Jump to content

RafaelVN

Members
  • Posts

    27
  • Joined

  • Last visited

Everything posted by RafaelVN

  1. already tried to draw FMLNetworkHandler.openGui in the actionPerformed ?
  2. one correction : the true name is getIconFromDamage(int meta)
  3. I think you must implement the method getIcon as you made with getUnlocalizedName type: @Override public String getIcon(int meta) { if (meta == 0){return texture0} if (meta == 1){return texture1} if (meta == 2){return texture2} if (meta == 3){return texture3} if (meta == 4){return texture4} if (meta == 5){return texture5} return texture0; }
  4. hi, I'm trying to create a custom Recipe class, I'm trying to base myself in FurnaceRecipes class, but watching me her code came across a lot of weird names like func_151394_a among others and tried to search the web for your references and unique that I could find has only these two: func_151393_a: addSmelting () to blocks func_151396_a: addSmelting () to item then I know that it's more like an request than for a more doubts I would like to know if someone knows this Class I could to give me his translation = b. ty for attention.
  5. like that ? http://www.minecraftforge.net/wiki/Creating_NBT_for_items
  6. I think the gui the constructor must pass the argument a container this way : public MyGuiContainer (InventoryPlayer ivPlayer, MyTileEntity tileEntity) { super (new MyContainer (ivPlayer, tileEntity)); // Other things }
  7. exact, before I was using TileEntity to implement iMessage, but he has a constructor with arguments, then i made following the example of the inner class and got = b. thanks for listening
  8. hello again, follow the tutorial that showed me and creates a code but I'm having trouble, he is returning me excpetion. below is the code and the result of the console: IMessage package teste; import io.netty.buffer.ByteBuf; import cpw.mods.fml.common.network.ByteBufUtils; import cpw.mods.fml.common.network.simpleimpl.IMessage; public class InductionFurnacePowerPacket implements IMessage { public static final String POWER_SWITCH_MSG = "0"; public String text; public InductionFurnacePowerPacket(String text) { this.text = text; } @Override public void fromBytes(ByteBuf buf) { text = ByteBufUtils.readUTF8String(buf); } @Override public void toBytes(ByteBuf buf) { ByteBufUtils.writeUTF8String(buf, text); } } IMessageHandler (its my TileEntity so i will show onMessage) : @Override public IMessage onMessage(InductionFurnacePowerPacket message, MessageContext ctx) { System.out.println(String.format("Received %s from %s", message.text, ctx.getServerHandler().playerEntity.getDisplayName())); if (message.text == InductionFurnacePowerPacket.POWER_SWITCH_MSG) { powerFlag = !powerFlag; } return null; } init() networkWrapper = NetworkRegistry.INSTANCE.newSimpleChannel("myChannel"); networkWrapper.registerMessage(InductionFurnaceTileEntity.class, InductionFurnacePowerPacket.class, 0, Side.SERVER); actionPerformed (send packet): @Override protected void actionPerformed(GuiButton button) { switch (button.id) { case 0: System.out.println("clique detect"); testemod.networkWrapper .sendToServer(new InductionFurnacePowerPacket( InductionFurnacePowerPacket.POWER_SWITCH_MSG)); } } the exception [02:25:29] [server thread/ERROR] [FML]: FMLIndexedMessageCodec exception caught io.netty.handler.codec.DecoderException: java.lang.InstantiationException: teste.InductionFurnacePowerPacket at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99) ~[MessageToMessageDecoder.class:?] at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:?] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:?] at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:?] at cpw.mods.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:86) [FMLProxyPacket.class:?] at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241) [NetworkManager.class:?] at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) [NetworkSystem.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) [MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) [integratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) [MinecraftServer$2.class:?] Caused by: java.lang.InstantiationException: teste.InductionFurnacePowerPacket at java.lang.Class.newInstance(Unknown Source) ~[?:1.7.0_45] at cpw.mods.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:75) ~[FMLIndexedMessageToMessageCodec.class:?] at cpw.mods.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:17) ~[FMLIndexedMessageToMessageCodec.class:?] at io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81) ~[MessageToMessageCodec$2.class:?] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89) ~[MessageToMessageDecoder.class:?] ... 13 more [02:25:29] [server thread/ERROR] [FML]: SimpleChannelHandlerWrapper exception io.netty.handler.codec.DecoderException: java.lang.InstantiationException: teste.InductionFurnacePowerPacket at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99) ~[MessageToMessageDecoder.class:?] at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:?] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:?] at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:?] at cpw.mods.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:86) [FMLProxyPacket.class:?] at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241) [NetworkManager.class:?] at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) [NetworkSystem.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) [MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) [integratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) [MinecraftServer$2.class:?] Caused by: java.lang.InstantiationException: teste.InductionFurnacePowerPacket at java.lang.Class.newInstance(Unknown Source) ~[?:1.7.0_45] at cpw.mods.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:75) ~[FMLIndexedMessageToMessageCodec.class:?] at cpw.mods.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:17) ~[FMLIndexedMessageToMessageCodec.class:?] at io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81) ~[MessageToMessageCodec$2.class:?] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89) ~[MessageToMessageDecoder.class:?] ... 13 more [02:25:29] [server thread/ERROR] [FML]: There was a critical exception handling a packet on channel myChannel io.netty.handler.codec.DecoderException: java.lang.InstantiationException: teste.InductionFurnacePowerPacket at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99) ~[MessageToMessageDecoder.class:?] at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:?] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) ~[DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) ~[DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) ~[DefaultChannelPipeline.class:?] at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) ~[EmbeddedChannel.class:?] at cpw.mods.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:86) [FMLProxyPacket.class:?] at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241) [NetworkManager.class:?] at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) [NetworkSystem.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) [MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) [integratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) [MinecraftServer$2.class:?] Caused by: java.lang.InstantiationException: teste.InductionFurnacePowerPacket at java.lang.Class.newInstance(Unknown Source) ~[?:1.7.0_45] at cpw.mods.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:75) ~[FMLIndexedMessageToMessageCodec.class:?] at cpw.mods.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:17) ~[FMLIndexedMessageToMessageCodec.class:?] at io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81) ~[MessageToMessageCodec$2.class:?] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89) ~[MessageToMessageDecoder.class:?] ... 13 more what am I doing wrong?
  9. hey, had no idea that there was this feature, I will try to develop something with it and say if able, thank you for help friend = b.
  10. hi, I'm adding a button to my furnace which has functionality to act as an activator (such as a button on and off), however as the gui is in the client side I have no way to get the server TileEntity to change it, I do not know how I can do this by client, already tried using Conteiner.detectAndSendChanges () to try to update the TileEntity on 2 sides did not have more success (it seems that only works the server to the client not the reverse). follows my code of gui and container: package teste; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.inventory.SlotFurnace; import net.minecraft.item.ItemStack; public class InductionFurnaceContainer extends Container { private InductionFurnaceTileEntity tileEntity; public int lastBurnTime; public int lastItemBurnTime; public int[] lastCookTime = new int[5]; // the flag of my button control public int lastPowerFlag; public InductionFurnaceContainer(InventoryPlayer ivPlayer, InductionFurnaceTileEntity tileEntity) { this.tileEntity = tileEntity; // cria os slots em relação do numero do slot com a sua posição na gui // 0-4 - stocks // 5-9 - place // 11-4 - result for (int i = 0; i < 5; i++) { addSlotToContainer(new Slot(tileEntity, InductionFurnaceTileEntity.INGREDIENT_STOCK[i], 42, 25 + (18 * i))); addSlotToContainer(new InductionFurnaceLockedSlot(tileEntity, InductionFurnaceTileEntity.INGREDIENT_PLACE[i], 120, 25 + (18 * i))); addSlotToContainer(new SlotFurnace(ivPlayer.player, tileEntity, InductionFurnaceTileEntity.RESULT[i], 198, 25 + (18 * i))); } // 15 - fuel addSlotToContainer(new Slot(tileEntity, InductionFurnaceTileEntity.FUEL_PLACE, 120, 135)); // 16-43 Player inventory back // 44-52 Player inventory hand int i; for (i = 0; i < 3; ++i) { for (int j = 0; j < 9; ++j) { this.addSlotToContainer(new Slot(ivPlayer, j + (i * 9) + 9, 48 + (18 * j), 175 + (18 * i))); } } for (i = 0; i < 9; ++i) { this.addSlotToContainer(new Slot(ivPlayer, i, 48 + (18 * i), 233)); } } // ids : // 0-4 cookTime[] // 5 burnTime; // 6 currentItemBurnTime @Override public void addCraftingToCrafters(ICrafting iCraftting) { System.out.println("add"); super.addCraftingToCrafters(iCraftting); for (int i = 0; i < 5; i++) { iCraftting.sendProgressBarUpdate(this, i, tileEntity.cookTime[i]); } iCraftting.sendProgressBarUpdate(this, 5, tileEntity.burnTime); iCraftting.sendProgressBarUpdate(this, 6, tileEntity.currentItemBurnTime); iCraftting.sendProgressBarUpdate(this, 7, tileEntity.powerFlag ? 1 : 0); } // public void addPowerFlagToCraftters(ICrafting iCraftting) { // super.addCraftingToCrafters(iCraftting); // iCraftting.sendProgressBarUpdate(this, 7, tileEntity.powerFlag ? 1 : 0); // } @Override // quanda a gui ativada, constantemente detecta mudança e caso haja alguma, // chama update no client public void detectAndSendChanges() { super.detectAndSendChanges(); System.out.println("detect :" + tileEntity.powerFlag); // eu acho que se refere a cada player que tem ativo o bloco for (int ic = 0; ic < crafters.size(); ic++) { ICrafting iCraftting = (ICrafting) crafters.get(ic); for (int i = 0; i < 5; i++) { if (lastCookTime[i] != tileEntity.cookTime[i]) { iCraftting.sendProgressBarUpdate(this, i, tileEntity.cookTime[i]); } } if (lastBurnTime != tileEntity.burnTime) { iCraftting.sendProgressBarUpdate(this, 5, tileEntity.burnTime); } if (lastItemBurnTime != tileEntity.currentItemBurnTime) { iCraftting.sendProgressBarUpdate(this, 6, tileEntity.currentItemBurnTime); } boolean b = lastPowerFlag == 1 ? true : false; if (b != tileEntity.powerFlag) { iCraftting.sendProgressBarUpdate(this, 7, tileEntity.powerFlag ? 1 : 0); } } lastCookTime = tileEntity.cookTime.clone(); lastBurnTime = tileEntity.burnTime; lastItemBurnTime = tileEntity.currentItemBurnTime; lastPowerFlag = tileEntity.powerFlag ? 1 : 0; } // no client e recebidos os valores atualizados do tileentity do server @Override public void updateProgressBar(int varId, int newValue) { System.out.println("update"); if (varId >= 0 && varId <= 4) { tileEntity.cookTime[varId] = newValue; } if (varId == 5) tileEntity.burnTime = newValue; if (varId == 6) tileEntity.currentItemBurnTime = newValue; if (varId == 7) tileEntity.powerFlag = newValue == 1 ? true : false; } @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot) { return null; } @Override public boolean canInteractWith(EntityPlayer player) { return tileEntity.isUseableByPlayer(player); } } package teste; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; public class InductionFurnaceGui extends GuiContainer { public static final ResourceLocation texture = new ResourceLocation( testemod.MODID, "textures/gui/InductionFurnaceGui.png"); public static final ResourceLocation addons = new ResourceLocation( testemod.MODID, "textures/gui/InductionFurnaceAddons.png"); public InductionFurnaceTileEntity tileEntity; // public InductionFurnaceContainer container; public InductionFurnaceGui(InventoryPlayer ivPlayer, InductionFurnaceTileEntity tileEntity) { super(new InductionFurnaceContainer(ivPlayer, tileEntity)); this.tileEntity = tileEntity; this.xSize = 256; this.ySize = 256; } @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { String name = tileEntity.isInvNameLocalized() ? tileEntity.getInvName() : I18n.format(tileEntity.getInvName(), new Object[0]); String inventoryName = I18n .format("container.inventory", new Object[0]); fontRendererObj.drawString(name, xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 13, 4210752); fontRendererObj.drawString(inventoryName, xSize / 2 - this.fontRendererObj.getStringWidth(inventoryName) / 2, 163 - 8, 4210752); } @Override protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { GL11.glColor4f(1F, 1F, 1F, 1F); Minecraft.getMinecraft().getTextureManager().bindTexture(texture); drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); Minecraft.getMinecraft().getTextureManager().bindTexture(addons); if (tileEntity.isBurning()) { drawTexturedModalRect(guiLeft + 120, guiTop + 25, 0, 0, 16, 88); int k = this.tileEntity.getBurnTimeRemainingScaled(29); drawTexturedModalRect(guiLeft + 114, guiTop + 119, 16, 0, k + 1, 10); } for (int i = 0; i < 5; i++) { int k = tileEntity.getCookProgressScaled(10, i); drawTexturedModalRect(guiLeft + 137, guiTop + 38 + (18 * i) - (k + 1), 16, 20 - (k + 1), 1, k + 1); } } public void initGui() { super.initGui(); this.buttonList.add(new customButton(0, guiLeft + 15, guiTop + 15, 16, 16, "no use")); } @Override protected void actionPerformed(GuiButton button) { switch (button.id) { case 0: System.out.println("clique detect"); tileEntity.powerFlag = !tileEntity.powerFlag; inventorySlots.detectAndSendChanges(); } } }
  11. hi diesieben07, is just that, besides the more thanks to your tip managed to find a flaw in my code a look: @Override public void updateEntity() { boolean flag1 = burnTime > 0; boolean flag2 = false; if (isBurning()) { burnTime--; } if (!worldObj.isRemote) { if (burnTime == 0 && canSmelt()) { currentItemBurnTime = burnTime = getItemBurnTime(slots[1]); if (isBurning()) { flag2 = true; if (slots[1] != null) { slots[1].stackSize--; if (slots[1].stackSize == 0) { slots[1] = slots[1].getItem().getContainerItem( slots[1]); } } } } if (isBurning() && canSmelt()) { cookTime++; if (cookTime == furnaceSpeed) { cookTime = 0; smeltItem(); // Exactly here !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! flag2 = true; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! } } else { cookTime = 0; } if (flag1 != isBurning()) { flag2 = true; InductionFurnaceBlock.updateFurnaceBlockState(burnTime > 0, worldObj, xCoord, yCoord, zCoord); } } if (flag2) { markDirty(); } } at the point where I scored in the code before I was using the first flag, so it was not detected when a particular item was cooked in the furnace, only when I changed something myself. very grateful for the help friend.
  12. Hi, I learned how to create a custom furnace following steps of a tutorial I saw recently developed a code that near the end, I'm just having some problems with respect to reading and writing of NBTTags (which is responsible in this case to allow the information of TileEntitys persist before the savegames), more specifically, my code so it works in a way, my question really is with respect to the criteria that the game system uses to make the call of the writeToNBT TileEntitys, in my case it only calls when I click on esc and then open the menu screen, the otherwise happens passively with auto saved. Only in the first case (when i click esc) the call only happens when some block changes its inventory (or retreat when I put any item in any slot), otherwise the call does not happen (to test so I put a System.out.println ("write ") in writeToNBT and looked in the console ) if the change happens without my intervene (as an item to be cooked and stored in slot 3) when I click the esc the call to writeToNBT not happen (as if the system does not could sees the change), then I thought it would be boring as eg for a player if he put 8 iron ingot and at a given time that 4 has been completed and then without even interact with the furnace he decides to leave the game. then when he returns he looks the furnace and observes the 8 iron ingot intact. It may seem little since it can count on the passive update (and thus ensure that a huge amount stay without being updated), but I'm a little detail and wanted to fix that little problem. What I really want to know if it is possible to force the system to call the call writeToNBT at a desired time (more precisely when the player click esc and open the menu) and thus ensure that the NBT be updated at the right time. if you want to look at learning the code follows the link from my repository in git hub (will not do that here not to make the topic get bigger than it already was , besides the more you forgive me if I could not express myself more briefly, I am foreign and do not speak english well). https://github.com/RafaelVN/Learning-Repository Thank you for your attention and for the help.
  13. ah. then i missed that, ty man you help me a lot .
  14. hi, I'm trying to create a block that when in the world he is facing the player who placed it (as well as furnaces etc ...). Follow my code: Block class: package teste; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.world.World; public class InductionFurnace extends Block implements ITileEntityProvider { public final static int BOTTOM_SIDE = 0; public final static int TOP_SIDE = 1; public final static int NORTH_SIDE = 2; public final static int SOUTH_SIDE = 3; public final static int WEST_SIDE = 4; public final static int EAST_SIDE = 5; private IIcon top; private IIcon bottom; private IIcon left; private IIcon right; private IIcon front; private IIcon back; private IIcon skinBase; public static boolean isBurning = true; protected InductionFurnace(Material mat) { super(mat); System.out.println("Block criado :" + toString()); } @Override public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { // Minecraft.getMinecraft().displayGuiScreen(new GuiBasic()); return super.onBlockActivated(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_, p_149727_5_, p_149727_6_, p_149727_7_, p_149727_8_, p_149727_9_); } @Override public TileEntity createNewTileEntity(World world, int meta) { System.out.println(meta); System.out.println("Tile Entity criado :" + toString()); Item.getItemFromBlock(this); return new MyFirstTileEntity(); // this.getDrops(world, x, y, z, metadata, fortune) } @Override public void registerBlockIcons(IIconRegister iconRegister) { top = iconRegister.registerIcon("testemod:MachinePlateBorded"); bottom = iconRegister.registerIcon("testemod:MachineLogisticEntrance"); left = iconRegister.registerIcon("testemod:MachinePlateFanLeft"); right = iconRegister.registerIcon("testemod:MachinePlateFanRight"); back = iconRegister.registerIcon("testemod:MachineBack"); front = iconRegister.registerIcon("testemod:" + (isBurning ? "InductionFurnaceFrontActive" : "InductionFurnaceFront")); skinBase = iconRegister.registerIcon("testemod:MachinePlateBorded"); } @Override public IIcon getIcon(int side, int meta) { switch (side) { case InductionFurnace.BOTTOM_SIDE: return bottom; case InductionFurnace.TOP_SIDE: return top; case InductionFurnace.NORTH_SIDE: return back; case InductionFurnace.SOUTH_SIDE: return front; case InductionFurnace.WEST_SIDE: return right; case InductionFurnace.EAST_SIDE: return left; } return skinBase; } @Override public Item getItemDropped(int par1, Random random, int par3) { return Item.getItemFromBlock(testemod.myFirstContainerBlock); } @Override public Item getItem(World world, int par2, int par3, int par4) { return Item.getItemFromBlock(testemod.myFirstContainerBlock); } @Override public void onBlockAdded(World world, int x, int y, int z) { super.onBlockAdded(world, x, y, z); direction(world, x, y, z); } @Override public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack p_149689_6_) { int l = MathHelper .floor_double((double) (player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; if (l == 0) { world.setBlockMetadataWithNotify(x, y, z, 2, 2); } if (l == 1) { world.setBlockMetadataWithNotify(x, y, z, 5, 2); } if (l == 2) { world.setBlockMetadataWithNotify(x, y, z, 3, 2); } if (l == 3) { world.setBlockMetadataWithNotify(x, y, z, 4, 2); } } public void direction(World world, int x, int y, int z) { if (!world.isRemote) { Block direction1 = world.getBlock(x, y, z - 1); Block direction2 = world.getBlock(x, y, z + 1); Block direction3 = world.getBlock(x - 1, y, z - 1); Block direction4 = world.getBlock(x + 1, y, z - 1); byte byte0 = 3; if (direction1.func_149730_j() && !direction2.func_149730_j()) { byte0 = 3; } if (direction2.func_149730_j() && !direction1.func_149730_j()) { byte0 = 2; } if (direction3.func_149730_j() && !direction4.func_149730_j()) { byte0 = 5; } if (direction4.func_149730_j() && !direction3.func_149730_j()) { byte0 = 4; } world.setBlockMetadataWithNotify(x, y, z, byte0, 2); } } public static void updateFurnaceBlockState(boolean p_149931_0_, World world, int x, int y, int z) { int direction = world.getBlockMetadata(x, y, z); // TileEntity tileentity = world.getTileEntity(p_149931_2_, p_149931_3_, // p_149931_4_); // field_149934_M = true; // if (p_149931_0_) { // world.setBlock(p_149931_2_, p_149931_3_, p_149931_4_, // Blocks.lit_furnace); // } else { // world.setBlock(p_149931_2_, p_149931_3_, p_149931_4_, // Blocks.furnace); // } // field_149934_M = false; world.setBlockMetadataWithNotify(x, y, z, direction, 2); // if (tileentity != null) // { // tileentity.validate(); // p_149931_1_.setTileEntity(p_149931_2_, p_149931_3_, p_149931_4_, // tileentity); // } } // @Override // public void breakBlock(World world, int x, int y, int z, Block block, // int meta) { // } @Override public void randomDisplayTick(World world, int x, int y, int z, Random random) { int direction = world.getBlockMetadata(x, y, z); float xx = (float) (x + 0.5F); float yy = (float) (y + random.nextFloat() * 6.0F / 16.0F); float zz = (float) (z + 0.5F); float zz2 = 0.52F; float xx2 = random.nextFloat() * 0.6F - 0.3F; switch (direction) { case 4: { world.spawnParticle("smoke", (double) (xx - zz2), (double) yy, (double) (zz + xx2), 0.0D, 0.0D, 0.0D); world.spawnParticle("flame", (double) (xx - zz2), (double) yy, (double) (zz + xx2), 0.0D, 0.0D, 0.0D); } case 5: { world.spawnParticle("smoke", (double) (xx + zz2), (double) yy, (double) (zz + xx2), 0.0D, 0.0D, 0.0D); world.spawnParticle("flame", (double) (xx + zz2), (double) yy, (double) (zz + xx2), 0.0D, 0.0D, 0.0D); } case 2: { world.spawnParticle("smoke", (double) (xx + xx2), (double) yy, (double) (zz - zz2), 0.0D, 0.0D, 0.0D); world.spawnParticle("flame", (double) (xx + xx2), (double) yy, (double) (zz - zz2), 0.0D, 0.0D, 0.0D); } case 3: { world.spawnParticle("smoke", (double) (xx + xx2), (double) yy, (double) (zz + zz2), 0.0D, 0.0D, 0.0D); world.spawnParticle("flame", (double) (xx + xx2), (double) yy, (double) (zz + zz2), 0.0D, 0.0D, 0.0D); } } } } main class: package teste; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = testemod.MODID, name = testemod.NAME, version = testemod.VERSION) public class testemod { public static final String MODID = "testemod"; public static final String NAME = "Testemod"; public static final String VERSION = "1.0"; public static Block myFirstContainerBlock; @Instance ( "testemod" ) public static testemod instance; @SidedProxy ( clientSide = "teste.ClientProxy", serverSide = "teste.CommonProxy" ) public static CommonProxy proxy; @EventHandler public void preinit(FMLPreInitializationEvent event) { myFirstContainerBlock = new InductionFurnace(Material.rock) .setHardness(0.5F).setStepSound(Block.soundTypeStone) .setBlockName("myFirstContainerBlock") .setCreativeTab(CreativeTabs.tabBlock); GameRegistry.registerBlock(myFirstContainerBlock, "myFirstContainerBlock"); NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy); } } Well, the problem is simple, do not block the orientation of the way I want, they just keep the default orientation. see the result: https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-xap1/t31.0-8/q83/p526x395/1801159_758967554192629_5029193513560918574_o.jpg[/img] https://scontent-a-mia.xx.fbcdn.net/hphotos-xfa1/t31.0-8/q83/p526x395/1655482_758967677525950_4610313450111996101_o.jpg[/img] I wonder what's wrong in my code does not work the way I want, and I'm grateful for the help.
  15. https://scontent-b-mia.xx.fbcdn.net/hphotos-xpf1/t31.0-8/10454347_758074337615284_8019490234765203264_o.jpg[/img] it seems that the minecraft works with a default resolution, before I was using a smaller image and in the end the minecraft stretched to reset the rest Thank you friend for the help = b
  16. Hi, I am testing a code that I did based on a sample that seen in a tuttorial, succeeded in part, the only problem I am having is that the image I'm trying to draw on the screen is not being fully drawn, as if the its resolution is changed when it is loaded by minecraft. look the code: testemod (Main class) package teste; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = testemod.MODID, name = testemod.NAME, version = testemod.VERSION) public class testemod { public static final String MODID = "testemod"; public static final String NAME = "Testemod"; public static final String VERSION = "1.0"; public static Block myFirstContainerBlock; @Instance ( "testemod" ) public static testemod instance; @SidedProxy ( clientSide = "teste.ClientProxy", serverSide = "teste.CommonProxy" ) public static CommonProxy proxy; @EventHandler public void preinit(FMLPreInitializationEvent event) { myFirstContainerBlock = new MyFirstContainerBlock(Material.rock) .setHardness(0.5F).setStepSound(Block.soundTypeStone) .setBlockName("myFirstContainerBlock") .setBlockTextureName("testemod:OsmiumOre") .setCreativeTab(CreativeTabs.tabBlock); GameRegistry.registerBlock(myFirstContainerBlock, "myFirstContainerBlock"); NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy); } } GuiBasic (GuiScreen class) package teste; import org.lwjgl.opengl.GL11; import net.minecraft.client.gui.GuiScreen; import net.minecraft.util.ResourceLocation; public class GuiBasic extends GuiScreen { public static final int GUI_ID = 20; int guiWidth = 140; int guiHeight = 80; @Override public void drawScreen(int x, int y, float ticks) { int guiX = (width - guiWidth) / 2; int guiY = (height - guiHeight) / 2; GL11.glColor4f(1, 1, 1, 1); drawDefaultBackground(); mc.renderEngine.bindTexture(new ResourceLocation(testemod.MODID, "textures/gui/Gui2.png")); drawTexturedModalRect(guiX, guiY, 0, 0, guiWidth, guiHeight); super.drawScreen(x, y, ticks); } } CommonProxy (implements IGuiHandler) package teste; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; import cpw.mods.fml.common.network.IGuiHandler; public class CommonProxy implements IGuiHandler { //public void registerKeyBindings() { //} @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { return null; } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if (ID == GuiBasic.GUI_ID) return new GuiBasic(); return null; } } MyFirstContainerBlock (the block start event) package teste; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; public class MyFirstContainerBlock extends Block { protected MyFirstContainerBlock(Material mat) { super(mat); } @Override public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { Minecraft.getMinecraft().displayGuiScreen(new GuiBasic()); return super.onBlockActivated(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_, p_149727_5_, p_149727_6_, p_149727_7_, p_149727_8_, p_149727_9_); } } my custom screen image (this have 140x80 resolution) https://scontent-a-mia.xx.fbcdn.net/hphotos-xap1/v/t1.0-9/10418987_758054787617239_8936067923206037565_n.jpg?oh=833c46c7a3a02b712def870bc859f452&oe=54DB4040[/img] the result screen displayed https://fbcdn-sphotos-d-a.akamaihd.net/hphotos-ak-xpa1/t31.0-8/p526x395/10835024_758054930950558_3083716366299205453_o.jpg[/img] tutorial link (what i'm based) then there are any solution?
  17. I tested again using mod OreDictionary Converter and got success in every item, I think I'll use this mod instead of the Factory Reload, however I'm still curious why not run over the previous mod now is a less important issue.
  18. Hi I am having difficulty making a custom item interact with other mods using OreDictionary. Aluminum test code: package tutorial.generic; import tutorial.generic.items.GenericItem; import tutorial.generic.items.GenericMetaItem; import tutorial.generic.items.TutResources; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = "generic", name = "Generic", version = "1.0") public class Generic { @Instance(value = "generic") public static Generic instance; @SidedProxy(clientSide = "tutorial.generic.client.ClientProxy", serverSide = "tutorial.generic.CommonProxy") public static CommonProxy proxy; public static Item aluminumIngot; @EventHandler public void preInit(FMLPreInitializationEvent event) { aluminumIngot = new GenericItem().setMaxStackSize(64) .setCreativeTab(CreativeTabs.tabMisc) .setUnlocalizedName("aluminumIngot") .setTextureName("generic:AluminumIngot"); GameRegistry.registerItem(aluminumIngot, "aluminumIngot"); OreDictionary.registerOre("ingotAluminum", aluminumIngot); OreDictionary.registerOre("ingotAluminium", aluminumIngot); } @EventHandler public void init(FMLInitializationEvent event) { //Check if there are registred a item name in OreDictionary //I'm doing it in init when all item are registred in OreDictionary System.out .println("////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////"); for (ItemStack ore : OreDictionary.getOres("ingotAluminum")) { if (ore.getItem().getHasSubtypes()) System.out .println("'ingotAluminum' registrado no OreDictionary : " + ore.getItem().getUnlocalizedName(ore)); else System.out .println("'ingotAluminum' registrado no OreDictionary : " + ore.getItem().getUnlocalizedName()); } System.out .println("////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////"); for (ItemStack ore : OreDictionary.getOres("ingotAluminium")) { if (ore.getItem().getHasSubtypes()) System.out .println("'ingotAluminium' registrado no OreDictionary : " + ore.getItem().getUnlocalizedName(ore)); else System.out .println("'ingotAluminium' registrado no OreDictionary : " + ore.getItem().getUnlocalizedName()); } System.out .println("////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////"); } } @EventHandler public void postInit(FMLPostInitializationEvent event) { } System.out : Client> [20:53:28] [Client thread/INFO] [sTDOUT]: [tutorial.generic.Generic:init:58]: //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Client> [20:53:28] [Client thread/INFO] [sTDOUT]: [tutorial.generic.Generic:init:66]: 'ingotAluminum' registrado no OreDictionary : item.aluminumIngot Client> [20:53:28] [Client thread/INFO] [sTDOUT]: [tutorial.generic.Generic:init:62]: 'ingotAluminum' registrado no OreDictionary : item.tconstruct.Materials.AluminumIngot Client> [20:53:28] [Client thread/INFO] [sTDOUT]: [tutorial.generic.Generic:init:70]: //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Client> [20:53:28] [Client thread/INFO] [sTDOUT]: [tutorial.generic.Generic:init:78]: 'ingotAluminium' registrado no OreDictionary : item.aluminumIngot Client> [20:53:28] [Client thread/INFO] [sTDOUT]: [tutorial.generic.Generic:init:74]: 'ingotAluminium' registrado no OreDictionary : item.tconstruct.Materials.AluminumIngot Client> [20:53:28] [Client thread/INFO] [sTDOUT]: [tutorial.generic.Generic:init:82]: //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// I researched the name the mod Tinker's Construct uses the item Aluminum Ingot, are 2 ('ingotAluminum' ingotAluminum '), so I registered my custom item to using these names (already tried using only one of the names and using Both) but in any of the cases got successful, I tested this using the mod MineFactory Reload (Unifier) to stack items that share the same name in OreDictionary, I've also realized tests using another type of item such as Stell Ingot mod Mekanism ('ingotSteel') and it worked correctly (even the Steel Ingot Tinker's Construct works), another thing is that when I put the Aluminium Ingot in Pulverizer of Themal Expasion mod (My custom and Tinker's mod) they all return the same to me Aluminium Dust (Proving that they have oreDict the same name). Steel test code: package tutorial.generic; import tutorial.generic.items.GenericItem; import tutorial.generic.items.GenericMetaItem; import tutorial.generic.items.TutResources; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = "generic", name = "Generic", version = "1.0") public class Generic { @Instance(value = "generic") public static Generic instance; @SidedProxy(clientSide = "tutorial.generic.client.ClientProxy", serverSide = "tutorial.generic.CommonProxy") public static CommonProxy proxy; public static Item steelIngot; @EventHandler public void preInit(FMLPreInitializationEvent event) { steelIngot = new GenericItem().setMaxStackSize(64) .setCreativeTab(CreativeTabs.tabMisc) .setUnlocalizedName("steelIngot") .setTextureName("generic:AluminumIngot");//I didnt change name in png file GameRegistry.registerItem(steelIngot, "SteelIngot"); OreDictionary.registerOre("ingotSteel", steelIngot); //OreDictionary.registerOre("ingotAluminium", aluminiumIngot); } @EventHandler public void init(FMLInitializationEvent event) { //Check if there are registred a item name in OreDictionary //I'm doing it in init when all item are registred in OreDictionary System.out .println("////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////"); for (ItemStack ore : OreDictionary.getOres("ingotAluminum")) { if (ore.getItem().getHasSubtypes()) System.out .println("'ingotAluminum' registrado no OreDictionary : " + ore.getItem().getUnlocalizedName(ore)); else System.out .println("'ingotAluminum' registrado no OreDictionary : " + ore.getItem().getUnlocalizedName()); } System.out .println("////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////"); for (ItemStack ore : OreDictionary.getOres("ingotAluminium")) { if (ore.getItem().getHasSubtypes()) System.out .println("'ingotAluminum' registrado no OreDictionary : " + ore.getItem().getUnlocalizedName(ore)); else System.out .println("'ingotAluminium' registrado no OreDictionary : " + ore.getItem().getUnlocalizedName()); } System.out .println("////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////"); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } } System.out: Client> [20:53:28] [Client thread/INFO] [sTDOUT]: [tutorial.generic.Generic:init:58]: //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Client> [18:07:39] [Client thread/INFO] [sTDOUT]: [tutorial.generic.Generic:init:59]: 'ingotAluminum' registrado no OreDictionary : item.tconstruct.Materials.AluminumIngot Client> [18:07:39] [Client thread/INFO] [sTDOUT]: [tutorial.generic.Generic:init:67]: //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Client> [18:07:39] [Client thread/INFO] [sTDOUT]: [tutorial.generic.Generic:init:71]: 'ingotAluminium' registrado no OreDictionary : item.tconstruct.Materials.AluminumIngot Client> [18:07:39] [Client thread/INFO] [sTDOUT]: [tutorial.generic.Generic:init:79]: //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// I would like to know if i miss something else I need to do or if any problem is beyond me (something in the operation of the Factory Reload: Unifier, I do not know much about this mod only installed it to be able to organize my items). Grateful if someone can help me.
  19. here : [02:53:57] [Client thread/ERROR]: Using missing texture, unable to load generic:textures/items/nickelCrystal.png hehe, my bad i did write "nickelCrystal" in setTextureName(), when its use uppercase ("NickelCrystal.png"), now its every ok ty for all =b
  20. compiled by gradlew and it worked, but now I have another problem, when I run the game the item customized it not renders (instead renders a box of pink and black), the directory where the texture is located assets / generic / textures / items / NickelCrystal.png. I call on item setTextureName ("generic: nickelCrystal"); This works fine when I do the eclipse, when I put the game simply does not render correctly. is there anything else I should do? Note: i check for the textures files in jar and its ok grateful again for the answers.
  21. I only found tutorials on how to use gradlew for installation, how can I use to build my mod? can you give me a hint? and thanks for the reply = b
  22. Well, I'm having trouble running an example of already compiled code in real minecraft package (no package eclipse), when I run in eclipse, runs without any problem, but when I move the compiled code into the mods folder in the directory the real minecraft (.minecraft) I get the message NoSuchMethodError. I'll post the example code and the error message. Class Generic (init class) package tutorial.generic; import tutorial.generic.items.GenericItem; import tutorial.generic.items.GenericMetaItem; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = "generic", name = "Generic", version = "0.0.0") public class Generic { @Instance(value = "generic") public static Generic instance; @SidedProxy(clientSide = "tutorial.generic.client.ClientProxy", serverSide = "tutorial.generic.CommonProxy") public static CommonProxy proxy; public static Item genericItem,genericMetaItem; @EventHandler public void preInit(FMLPreInitializationEvent event) { genericItem = new GenericItem().setMaxStackSize(64).setCreativeTab(CreativeTabs.tabMisc).setUnlocalizedName("genericItem").setTextureName("generic:nickelCrystal"); GameRegistry.registerItem(genericItem, "GenericItem"); } @EventHandler public void init(FMLInitializationEvent event) { } @EventHandler public void postInit(FMLPostInitializationEvent event) { } } Class GenericItem package tutorial.generic.items; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; public class GenericItem extends Item { public GenericItem() { super(); } } Class CommonProxy package tutorial.generic; public class CommonProxy { // Client stuff public void registerRenderers() { // Nothing here as the server doesn't render graphics or entities! } } Class ClientProxy package tutorial.generic.client; import tutorial.generic.CommonProxy; import net.minecraftforge.client.MinecraftForgeClient; public class ClientProxy extends CommonProxy { @Override public void registerRenderers() { // This is for rendering entities and so forth later on } } Error message --- Minecraft Crash Report ---- // Ouch. That hurt Time: 08/11/14 23:44 Description: There was a severe problem during mod loading that has caused the game to fail cpw.mods.fml.common.LoaderException: java.lang.NoSuchMethodError: tutorial.generic.items.GenericItem.setMaxStackSize(I)Lnet/minecraft/item/Item; at cpw.mods.fml.common.LoadController.transition(LoadController.java:162) at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:515) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:239) at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:480) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:867) at net.minecraft.client.main.Main.main(SourceFile:148) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) Caused by: java.lang.NoSuchMethodError: tutorial.generic.items.GenericItem.setMaxStackSize(I)Lnet/minecraft/item/Item; at tutorial.generic.Generic.preInit(Generic.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513) at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118) at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:513) ... 10 more my mod dir is : generic assets tutorial generic CommonProxy.class Generic.class client ClientProxy.class items GenericItem.class forge version: Minecraft forge-1.7.10-10.13.2.1230 Note. When I change the code setMaxStackSize(64) by maxStackSize = 64 in constructor, the exception changes to NoSuchFieldError. Well this is my problem, can someone help me?
  23. lol ? i use it, but why u say it ?
  24. trying run a sample code: package net.minecraft.src; public class mod_myMod extends BaseMod { public void load() {} public String getVersion() { return "Version 1.0"; } } but dont work, i did test it with a breakpoint in load() method. there some kind of code to register my mod?
  25. I was confusing a class that believed it was represented that the items in the game, such net.minecraft.entity.item.Entityitem, had not noticed that there is a class net.minecraft.item.Item. Noting she noticed the existence of the method Item.onItemUse (), I believe that is exactly what I was looking for, I will perform some tests to find out if I can use it for what I plan. ty for replys = b
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.