
vtsman
Members-
Posts
28 -
Joined
-
Last visited
Everything posted by vtsman
-
ah, I fixed my packet handling bug, another derp by me.
-
Ok, I fixed it by adding super.readFromNBT and super.writeToNBT Now my packet handler isn't working I am sending the packet according to some debug system.outs I added, but my packet handler isn't being called.
-
I have had a bu for quite some time now, and it's really bugging me. My tile entities won't save their nbt data. Before you ask, yes I did properly register my tile entities. Here's a link to my github http://github.com/vtsman/Runic-Transmutation Thank you in advance
-
I've tried using @EventHandler, and no luck. I've even put System.outs in my init method and it prints out 2 lines, 1 empty line, and one line with the text I entered in the System.out. I've even tried using a different version of forge. Nothing has worked D:
-
I guess you didn't see any of my code. In modBlocks.java, I register all my tileEntities with GameRegistry.registerTileEntity, so that's not the problem. I'm certain it's not my tile entity registering code.
-
I am having a strange bug in my mod, where it seems the init() function is only being called on the client side. I'm not refering to multiplayer, but in single player, My blocks and everything work just fine, but my tile entities are not saving NBT data, when I load up a world with any of my data saving tile entities, it says "Skipping TileEntity with id ", and I have a custom recipe manager that shows the crafting result, but gives you a ghost Item. I have concluded that something isn't working on the server side of my mod and I cannot find my mistake. My github repository is here: https://github.com/vtsman/Runic-Transmutation/ Thank you in advance
-
I'm just using the normal minecraft forge mcp environment. I seemed to work in 1.4.7, but it stopped working in 1.5.1 for me.
-
I've been having this problem for quite some time now where my mod works fine in eclipse, then I recompile and reobfuscate is with mcp and it crashes in normal minecraft. I don't know what I'm doing wrong but It gives me this error: Help would be much appreciated. Thanks!
-
It's just not saving or loading, no error.
-
I'm not very good with nbt tags, so can someone tell me what I'm doing wrong. I'm trying to make my tile entity to store some values a liquid stack and an ItemStack. For testing reasons, I've omitted the liquidstack and itemstack. Here's the nbt stuff
-
I'm now trying to use itemstack nbt data instead of metadata. Hopefully that will work
-
I have a block that usually has a metadata of over 10000000, and It doesn't seem to register a metadata that high. can anyone help. here's my block code: The block is also an itemBlock
-
I want to get the coords of it from within it's own class file. I can get the coords in my renderer for whatever reason, but not in the tile entity's class. TE Renderer
-
Update: I can't seem to get the inventory slots from within this tile entity. The debug code I use works in other TEs. My inv slots are stored in field_94124_b TE code
-
Update: I can't seem to get the inventory slots from within this tile entity. The debug code I use works in other TEs. My inv slots are stored in field_94124_b TE code
-
I want to render an item in the world through my block renderer, but every time I place my block, I get the same item rendering. Right now I'm in the process of debugging, so I have the item change based on the X location of the block. Can anyone help? Here is my render code: There was no rendering error, I just had some bad debug code.
-
Here's my TE code: And the error on startup (It works in eclipse but crashes in normal minecraft) :
-
I have made a post earlier entitled strange error in regards to an error that only would occur out of eclipse. I beleive I have narrowed it down to just tile entities that cause the error so I want to know, was there a change in declarations of tile entities. I have this in my pre-init code: GameRegistry.registerTileEntity(shelfTE.class, "shelfContainer");
-
line 79 - 81 is pretty standard code: public final Block emptyShelf = new emptyShelf(500, 0, Material.wood) .setHardness(1.5F).setStepSound(Block.soundWoodFootstep) .setCreativeTab(CreativeTabs.tabDecorations); And the bookshelf is pretty simple too: //todo: add inventory package mods.better_recipes_vtsman; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.src.*; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.Init; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.Mod.PreInit; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.IFuelHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.item.ItemStack; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Icon; import net.minecraft.world.World; import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.common.MinecraftForge; public class emptyShelf extends BlockContainer { public emptyShelf (int id, int texture, Material material) { super(id, material); setUnlocalizedName("Empty Shelf"); } @Override public void registerIcons(IconRegister par1IconRegister) { this.blockIcon = par1IconRegister.registerIcon("better_recipes_vtsman:emptyShelf"); } public Icon getBlockTextureFromSideAndMetadata(int par1, int par2) { return par1 != 1 && par1 != 0 ? super.getBlockTextureFromSideAndMetadata(par1, par2) : Block.planks.getBlockTextureFromSide(par1); } public int getBurnTime(ItemStack fuel) { return 300; } @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) { TileEntity tileEntity = world.getBlockTileEntity(x, y, z); if (tileEntity == null || player.isSneaking()) { return false; } //code to open gui explained later player.openGui(betterrecipes.instance, 0, world, x, y, z); return true; } @Override public void breakBlock(World world, int x, int y, int z, int par5, int par6) { dropItems(world, x, y, z); super.breakBlock(world, x, y, z, par5, par6); } private void dropItems(World world, int x, int y, int z){ Random rand = new Random(); TileEntity tileEntity = world.getBlockTileEntity(x, y, z); if (!(tileEntity instanceof IInventory)) { return; } IInventory inventory = (IInventory) tileEntity; for (int i = 0; i < inventory.getSizeInventory(); i++) { ItemStack item = inventory.getStackInSlot(i); if (item != null && item.stackSize > 0) { float rx = rand.nextFloat() * 0.8F + 0.1F; float ry = rand.nextFloat() * 0.8F + 0.1F; float rz = rand.nextFloat() * 0.8F + 0.1F; EntityItem entityItem = new EntityItem(world, x + rx, y + ry, z + rz, new ItemStack(item.itemID, item.stackSize, item.getItemDamage())); if (item.hasTagCompound()) { //entityItems.setTagCompound((NBTTagCompound) item.getTagCompound().copy()); } float factor = 0.05F; entityItem.motionX = rand.nextGaussian() * factor; entityItem.motionY = rand.nextGaussian() * factor + 0.2F; entityItem.motionZ = rand.nextGaussian() * factor; world.spawnEntityInWorld(entityItem); item.stackSize = 0; } } } @Override public TileEntity createNewTileEntity(World world) { return new shelfTE(); } }
-
The strange thing is my eclipse instance is running 1.5.1, It's only when I compile it that I get these errors
-
It's on 1.5.1 by the way, It was working in 1.4.7 and 1.5 but now 1.5.1, and it's all updated
-
I'm getting a strange error on my mod. It works in eclipse but when I reobfuscate it, it has this error: 2013-03-27 17:49:03 [iNFO] [sTDERR] Exception in thread "Minecraft main thread" java.lang.NoClassDefFoundError: mods/better_recipes_vtsman/shelfTE 2013-03-27 17:49:03 [iNFO] [sTDERR] at mods.better_recipes_vtsman.betterrecipes.<init>(betterrecipes.java:79) 2013-03-27 17:49:03 [iNFO] [sTDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 2013-03-27 17:49:03 [iNFO] [sTDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 2013-03-27 17:49:03 [iNFO] [sTDERR] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 2013-03-27 17:49:03 [iNFO] [sTDERR] at java.lang.reflect.Constructor.newInstance(Constructor.java:513) 2013-03-27 17:49:03 [iNFO] [sTDERR] at java.lang.Class.newInstance0(Class.java:357) 2013-03-27 17:49:03 [iNFO] [sTDERR] at java.lang.Class.newInstance(Class.java:310) 2013-03-27 17:49:03 [iNFO] [sTDERR] at cpw.mods.fml.common.FMLModContainer$JavaAdapter.getNewInstance(FMLModContainer.java:129) 2013-03-27 17:49:03 [iNFO] [sTDERR] at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:487) 2013-03-27 17:49:03 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2013-03-27 17:49:03 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 2013-03-27 17:49:03 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 2013-03-27 17:49:03 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Method.java:597) 2013-03-27 17:49:03 [iNFO] [sTDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) 2013-03-27 17:49:03 [iNFO] [sTDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) 2013-03-27 17:49:03 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) 2013-03-27 17:49:03 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) 2013-03-27 17:49:03 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:267) 2013-03-27 17:49:03 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165) 2013-03-27 17:49:03 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2013-03-27 17:49:03 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 2013-03-27 17:49:03 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 2013-03-27 17:49:03 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Method.java:597) 2013-03-27 17:49:03 [iNFO] [sTDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) 2013-03-27 17:49:03 [iNFO] [sTDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) 2013-03-27 17:49:03 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) 2013-03-27 17:49:03 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) 2013-03-27 17:49:03 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:267) 2013-03-27 17:49:03 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98) 2013-03-27 17:49:03 [iNFO] [sTDERR] at cpw.mods.fml.common.Loader.loadMods(Loader.java:502) 2013-03-27 17:49:03 [iNFO] [sTDERR] at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:160) 2013-03-27 17:49:03 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:407) 2013-03-27 17:49:03 [iNFO] [sTDERR] at net.minecraft.client.MinecraftAppletImpl.func_71384_a(SourceFile:56) 2013-03-27 17:49:03 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:729) 2013-03-27 17:49:03 [iNFO] [sTDERR] at java.lang.Thread.run(Thread.java:680) 2013-03-27 17:49:03 [iNFO] [sTDERR] Caused by: java.lang.ClassNotFoundException: mods.better_recipes_vtsman.shelfTE 2013-03-27 17:49:03 [iNFO] [sTDERR] at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:211) 2013-03-27 17:49:03 [iNFO] [sTDERR] at java.lang.ClassLoader.loadClass(ClassLoader.java:306) 2013-03-27 17:49:03 [iNFO] [sTDERR] at java.lang.ClassLoader.loadClass(ClassLoader.java:247) 2013-03-27 17:49:03 [iNFO] [sTDERR] ... 35 more 2013-03-27 17:49:03 [iNFO] [sTDERR] Caused by: java.lang.ClassFormatError: Duplicate method name&signature in class file mods/better_recipes_vtsman/shelfTE 2013-03-27 17:49:03 [iNFO] [sTDERR] at java.lang.ClassLoader.defineClass1(Native Method) 2013-03-27 17:49:03 [iNFO] [sTDERR] at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) 2013-03-27 17:49:03 [iNFO] [sTDERR] at java.lang.ClassLoader.defineClass(ClassLoader.java:615) 2013-03-27 17:49:03 [iNFO] [sTDERR] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) 2013-03-27 17:49:03 [iNFO] [sTDERR] at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:200) 2013-03-27 17:49:03 [iNFO] [sTDERR] ... 37 more
-
I would like to find a block's coordinates from within the block's own class. Is there a way to do this?
-
I believe the code that's causing that behavior is in your block class. Here's the code I use: private void dropItems(World world, int x, int y, int z){ Random rand = new Random(); TileEntity tileEntity = world.getBlockTileEntity(x, y, z); if (!(tileEntity instanceof IInventory)) { return; } IInventory inventory = (IInventory) tileEntity; for (int i = 0; i < inventory.getSizeInventory(); i++) { ItemStack item = inventory.getStackInSlot(i); if (item != null && item.stackSize > 0) { float rx = rand.nextFloat() * 0.8F + 0.1F; float ry = rand.nextFloat() * 0.8F + 0.1F; float rz = rand.nextFloat() * 0.8F + 0.1F; EntityItem entityItem = new EntityItem(world, x + rx, y + ry, z + rz, new ItemStack(item.itemID, item.stackSize, item.getItemDamage())); if (item.hasTagCompound()) { //entityItems.setTagCompound((NBTTagCompound) item.getTagCompound().copy()); } float factor = 0.05F; entityItem.motionX = rand.nextGaussian() * factor; entityItem.motionY = rand.nextGaussian() * factor + 0.2F; entityItem.motionZ = rand.nextGaussian() * factor; world.spawnEntityInWorld(entityItem); item.stackSize = 0; } } }
-
I am attempting to create an electricity system and the way I intend to implement it involves the cable tile entities to pass the amount of energy it's outputting to it's neighbor. Does anyone know how to do this? If so, can you please include some sample code