Probléme machine
-
Remplaces pos.getX() par x, pos.getY() par y et pos.getZ() par z
-
Sa ne fonctionner pas ducoups j’ai mis sa :
package com.adamitemod.mod.uncraft; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.util.Random; import com.adamitemod.mod.AdamiteMod; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; public class BlockUncraftingTable extends Block { public BlockUncraftingTable() { super(Material.wood); setResistance(8F); setHarvestLevel("pickaxe", 2); setCreativeTab(AdamiteMod.Ada); setHardness(8F); } public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) { if(FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) { int n1 = AdamiteMod.standardLevel; int n2 = AdamiteMod.maxUsedLevel; } player.openGui(AdamiteMod.instance, 0, world, pos.getX(), pos.getY(), pos.getZ()); checkForPorteManteau(player, world, pos.getX(), pos.getY(), pos.getZ()); return true; } public void onBlockAdded(World par1World, int par2, int par3, int par4) { if(!par1World.isRemote) { } } public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block par5) { if(!par1World.isRemote) { } } public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { } private void checkForPorteManteau(EntityPlayer player, World w, int x, int y, int z) { boolean furnace = false, chest = false, workbench = false; } }mais il y a un probléme a la ligne 34 à “BlockPos” et “IBlockState”
-
Il n’y a pas de BlockPos et IBlockState en 1.7.10.
Mets l’annotaion @Override au dessus de onBlockActivated pour t’en convaincre, Eclipse devrait râler.
-
je l’es mis mais sa change rien
-
Amigo127 Juste un conseille : Pour faire marcher ton serveur n’essaye pas de copier les autre (Le mien et Paladium) car ça ne va te servir a rien
-
D’ou je te copie je me suis j’amais co sur artha s2 ou 3
Edit j’ai régler mon probléme mais j’en ai 1 autre voilla dans une class j’ai des BlockPos mais je sait pas les remplacer par quoipackage com.adamitemod.mod.uncraft; import com.adamitemod.mod.AdamiteMod; import cpw.mods.fml.common.network.IGuiHandler; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; public class UnGuiHandler implements IGuiHandler { private ContainerUncraftingTable lastServerContainer; @Override public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { if(world.getBlockState(new BlockPos(x,y,z)).getBlock() == AdamiteMod.instance.uncraftingTable) { if(id == 0) { ContainerUncraftingTable c = new ContainerUncraftingTable(player.inventory, world, true, x, y, z, AdamiteMod.standardLevel, AdamiteMod.maxUsedLevel); lastServerContainer = c; return c; } else if(id == 1) { if(lastServerContainer != null) { lastServerContainer.onContainerClosed(player); lastServerContainer = null; } } } return null; } @Override public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { if(world.getBlockState(new BlockPos(x,y,z)).getBlock() == AdamiteMod.instance.uncraftingTable) { if(id == 0) { String name = I18n.format("tile.uncrafting_table.name"); return new GuiUncraftingTable(player.inventory, world, name, false, x, y, z, AdamiteMod.instance.minLvlServer, AdamiteMod.instance.maxLvlServer); } } return null; } }ligne 21 et 44
-
J’aimerai bien t’aider mais tu n’expliques mêmes pas tes erreurs…
-
j’ai une erreur la :
if(world.getBlockState(new BlockPos(x,y,z)).getBlock() == AdamiteMod.instance.uncraftingTableà BlockPos et je sait pas le remplacer par quoi
-
1.7.10 -> Pas de BlockPos -> coordonnées x, y, z
Tu peux retrouver les méthodes avec leurs paramètres directement dans les classes. Tu peux faire un CTRL + CLIC sur getBlockState, ça t’ouvrira la classe World avec la fonction et ses paramètres, ce n’est pas compliqué de chercher les bons paramètres d’une fonction
-
En 1.7 c’est pas getBlockState mais getBlock directement
Envoyé de mon RAINBOW LITE 4G en utilisant Tapatalk
-
j’ai une erreur la :
if(world.getBlockState(new BlockPos(x,y,z)).getBlock() == AdamiteMod.instance.uncraftingTableà BlockPos et je sait pas le remplacer par quoi
-
Aymeric a raison :
Ligne 379 de la classe Worldpublic Block getBlock(int x, int y, int z) -
Je suis un gros attarder aider moi
package com.adamitemod.mod.uncraft; import com.adamitemod.mod.AdamiteMod; import cpw.mods.fml.common.network.IGuiHandler; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; public class UnGuiHandler implements IGuiHandler { private ContainerUncraftingTable lastServerContainer; @Override public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { if(world.getBlock(new BlockPos(x,y,z)).getBlock() == AdamiteMod.instance.uncraftingTable) { if(id == 0) { ContainerUncraftingTable c = new ContainerUncraftingTable(player.inventory, world, true, x, y, z, AdamiteMod.standardLevel, AdamiteMod.maxUsedLevel); lastServerContainer = c; return c; } else if(id == 1) { if(lastServerContainer != null) { lastServerContainer.onContainerClosed(player); lastServerContainer = null; } } } return null; } @Override public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { if(world.getBlock(new BlockPos(x,y,z)).getBlock() == AdamiteMod.instance.uncraftingTable) { if(id == 0) { String name = I18n.format("tile.uncrafting_table.name"); return new GuiUncraftingTable(player.inventory, world, name, false, x, y, z, AdamiteMod.instance.minLvlServer, AdamiteMod.instance.maxLvlServer); } } return null; } } -
if(world.getBlock(new BlockPos(x,y,z)).getBlock() == AdamiteMod.instance.uncraftingTable)
=>
if(world.getBlock(x, y, z) == AdamiteMod.instance.uncraftingTable)À demain. Ça te laissera le temps de revoir la base de Java. Et nous ça nous laissera le temps de nous reposer.
La mauvaise fois n’est pas la bienvenue sur MFF. -
Les mecs ce sujet va-t-il s’arrêter un jour?
Envoyé de mon 6039Y en utilisant Tapatalk
-
Pour le moment il est en pause, l’auteur est banni
-
@‘BrokenSwing’:
Pour le moment il est en pause, l’auteur est banni
Pk??
Envoyé de mon 6039Y en utilisant Tapatalk
-
@‘robin4002’:
if(world.getBlock(new BlockPos(x,y,z)).getBlock() == AdamiteMod.instance.uncraftingTable)
=>
if(world.getBlock(x, y, z) == AdamiteMod.instance.uncraftingTable)À demain. %(#ff3333)[Ça te laissera le temps de revoir la base de Java. Et nous ça nous laissera le temps de nous reposer.
La mauvaise fois n’est pas la bienvenue sur MFF.] -
Durée du bannissement : 1 Jour (1h, 13m restant)
Bientôt de retour.
J’avais mit 3 jours au début, mais après réflexion je me suis dis que c’était moi qui était de mauvaise fois. Donc j’ai descendu à un jour.
