Jump to content

TheGreyGhost

Members
  • Posts

    3280
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by TheGreyGhost

  1. Hi :-) look at this line very carefully to spot the unwanted guest at the end if(block.blockID == Block.oreIron.blockID); -TGG
  2. Hi Have you checked? eg using a breakpoint or System.out.println("player is null:" + (player == null)); -TGG
  3. Hi Well it seems pretty clear that either player is null or inventory is null. Perhaps event.harvester is sometimes null? Checking the Javadocs: /** * Fired when a block is about to drop it's harvested items. The {@link #drops} array can be amended, as can the {@link #dropChance}. * <strong>Note well:</strong> the {@link #harvester} player field is null in a variety of scenarios. Code expecting null. and public final EntityPlayer harvester; // May be null for non-player harvesting such as explosions or machines -TGG
  4. Hi To save your data into the storage you need world.setItemData, not .loadData. The data will be automatically saved and loaded from disk for you but you will still need to read it back out when the world loads and do something with it. There is probably a suitable forge event you can subscribe to for this, perhaps WorldEvent.Load ? (Never used it myself). -TGG
  5. Hi What exactly do you mean by this? what are the symptoms? -TGG
  6. Hi onUpdate is called both on server and client side. Spawning an entity on the server side automatically spawns a "copy" on the client side, and onUpdate are called for both of them. If you want your message on one side only, then use isRemote, like you did when spawning the bullet. -TGG
  7. Hi the itemInteractionForEntity appears to be for right click. Attacking is done by left click. You might actually want .onLeftClickEntity. The left click interaction code is in EntityPlayer.attackTargetEntityWithCurrentItem, in case that helps. -TGG
  8. Hi I'd suggest perhaps Block.getBlockHardness(World world, int x, int y, int z) and use world.getBlockMetadata(par2, par3, par4)); to get the metadata and return the appropriate hardness. -TGG
  9. Hi Does your Block implement ITileEntityProvider? Once Chunk.setChunkBlockTileEntity is used this.chunkTileEntityMap.put(chunkposition, par4TileEntity); your TileEntity should be in there for good. Can you breakpoint that and inspect it? A breakpoint in TileEntity.invalidate() might also highlight a problem with your freshly minted TileEntity being thrown away? -TGG
  10. Hi try it with lower case m? 1024m not 1024M ? -TGG
  11. Hi Curious. I don't know what the problem is. But I suspect you can get some clues by putting a breakpoint in TileEntity.createAndLoadEntity and finding out why it doesn't call your readFromNBT. Or if it does - why it doesn't work. -TGG
  12. Hi Looks to me like there's something wrong with your proxy or @SidedProxy Some background info http://greyminecraftcoder.blogspot.com/2013/11/how-forge-starts-up-your-code.html -TGG
  13. Hi You might find the information on this site interesting. It's more or less a summary of all the stuff I figured out the hard way by looking at the code. Hopefully it might help you get the big picture faster. http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html -TGG
  14. Hi This post is a bit similar to what you want. http://www.minecraftforge.net/forum/index.php/topic,14726.0.html An icon is really just a string giving the name of the texture .png. Check the icon's methods to figure out how to get it and save it to the TileEntity's NBT as a string. Cheers TGG
  15. Hi Ah, forgot the link! Brain fade. http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html In particular http://greyminecraftcoder.blogspot.com.au/2013/08/rendering-items.html http://greyminecraftcoder.blogspot.com.au/2013/08/rendering-third-person-view-items.html -TGG
  16. Hi MyBlock:: @Override public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int x, int y, int z, int side) { TileEntity tileEntity = par1IBlockAccess.getBlockTileEntity(x, y, z); if (! (tileEntityChest instanceof MyTileEntity) ) return someerroricon; MyTileEntity myTileEntity = (MyTileEntity)tileEntity; int myHugeMetadata = myTileEntity.getMyHugeMetadata(); return myArrayOfIcons[myHugeMetadata]; } -TGG
  17. Hi Look for lines in your ModelGoblin constructor where a variable is used before it is initialised, eg armLeft.mirror = true; armLeft = new ModelRenderer(this, 16, 13); Apparently this is a common bug in the code generated by Techne. -TGG
  18. Hi Looks to me like your mod is running on the client not the server. Try changing this line @NetworkMod(clientSideRequired= true, serverSideRequired= false) to be true on both sides. Not sure if that's the problem but it's worth a try. BTW a link on Proxy stuff you might find interesting http://greyminecraftcoder.blogspot.com/2013/11/how-forge-starts-up-your-code.html -TGG
  19. Hi Yes it is possible. TileEntityChest tileentitychest = (TileEntityChest)par1World.getBlockTileEntity(par2, par3, par4); Alternatively you can make a TileEntitySpecialRenderer to render the TileEntity instead of using the Block Renderer. -TGG
  20. Hi Yes I'm sure it's possible. My first suggestion would be to try the RenderPlayerEvent.SetArmorModel event. See RenderPlayer.setArmorModel It looks to me like that gets called for all players (EntityClientPlayerMP and EntityOtherPlayerMP), you could use it to change the rendering model based on stored information about each player. -TGG
  21. Hi The vanilla furnace uses two different blocks and switches itself between the two. Because of the way minecraft draws blocks, it won't notice when you change the texture until you refresh the block. (It draws each block into a display list once, and then just keeps using the display list to render the screen instead of generating it from scratch every single frame). Anyway you need to trigger a refresh of the block. You can do it like the vanilla furnace with par1World.setBlock(par2, par3, par4, Block.furnaceIdle.blockID); or you can do RenderGlobal.markBlockForRenderUpdate(x,y,z); Might be other ways too, but those two should work. -TGG PS get to RenderGlobal using Minecraft.getMinecraft().renderGlobal http://greyminecraftcoder.blogspot.com.au/2013/10/client-side-class-linkage-map.html
  22. Hi The links on this might help - the various sections on Item Rendering including IItemRenderer and some sample code. -TGG
  23. Hi Yes there is, you have two choices that spring to mind (1) use the "damage value" to store the amount of ammo, or (2) use the NBT data to store the amount of ammo - setTagCompound, getTagCompound -TGG
  24. Hi Were you connected to the internet when running the script? Looks to me like it was trying to download a number of files but couldn't. -TGG
  25. Hi No worries, you're welcome :-) Unfortunately I think you're right about how deeply embedded a lot of these effects are. Some of them you can cover by giving your fluid Material.water, if you're happy with the vanilla water effects, otherwise I reckon many of them would need base class edits. Of course, if you ask nicely over at the suggestions forum http://www.minecraftforge.net/forum/index.php/board,4.0.html, they might add the hooks for you at the next release... -TGG
×
×
  • Create New...

Important Information

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