Everything posted by TheGreyGhost
-
HarvestDropsEvent bug
Hi :-) look at this line very carefully to spot the unwanted guest at the end if(block.blockID == Block.oreIron.blockID); -TGG
-
HarvestDropsEvent bug
Hi Have you checked? eg using a breakpoint or System.out.println("player is null:" + (player == null)); -TGG
-
HarvestDropsEvent bug
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
-
Saving persistent global data
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
-
[SOLVED]1.6.4 different setContainerItem problem
Hi What exactly do you mean by this? what are the symptoms? -TGG
-
Entity Spawning twice?
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
-
Item Interaction not responding
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
-
[solved]Block Setting Hardness depending on metadata?
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
-
[Solved]Why does my TileEntity lose its Data on World reload??
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
-
Forge Invalid initial
Hi try it with lower case m? 1024m not 1024M ? -TGG
-
[Solved]Why does my TileEntity lose its Data on World reload??
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
-
Gui Overlay issues (working from tutorial) [Solved]
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
-
Documentation for modders?
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
-
Saving Icons with tileentity
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
-
Item Rendering
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
-
[SOLVED]Texture dependent on TileEntity?
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
-
[Solved] My New Mob Does Not Work
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
-
Item Recipes not working in multiplayer?
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
-
[SOLVED]Texture dependent on TileEntity?
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
-
Can Certain Players have different textures than others?
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
-
Redstone Powered Furnace Textures Not Updating [SOLVED]
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
-
Item Rendering
Hi The links on this might help - the various sections on Item Rendering including IItemRenderer and some sample code. -TGG
-
Inventory unique ID for same item?
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
-
Problems Installing Forge Source
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
-
Custom Fluid Help
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
IPS spam blocked by CleanTalk.