Jump to content

TheGreyGhost

Members
  • Posts

    3280
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by TheGreyGhost

  1. Hi I suspect that GameRegistry.getFuelValue might be for custom fuels only? You might try calling TileEntityFurnace.getItemBurnTime(Itemstack) instead, I think it will do what you want. -TGG
  2. Hi Your second problem appears to be because you have put private Icon field_94393_a and private Icon field_94392_b into your BlockChainTNT class. But the rendering code for TNT will use those fields in the BlockTNT class, it will never see the ones in your BlockChainTNT class. The first problem appears to be because it's looking for a file called MISSING_ICON_TILE_503_textureTestBlock.png instead of textureTestBlock.png -? I'm not sure offhand why (perhaps you have forgotten to register something?), but with a bit of breakpoint (at your registerIcon method) and code tracing you should be able to find out. -TGG
  3. Hi Although I don't know the answer, I think this might be the directory you are looking for, if you trace the code through from that point then you should hopefully be able to find a place that your code can access it. http://www.minecraftforge.net/forum/index.php?topic=11963.0 -TGG
  4. Hi Unfortunately I don't have any suggestions on how to improve your workflow. I am wrestling with a similar problem myself and haven't managed to solve it. But if you're not a fan of Eclipse, is there a particular reason you're not using IDEA? That's what I use and it works great, even in my inexpert hands. Just followed the tutorial on http://www.minecraftforge.net/wiki/Forge_Development_in_IntelliJ_IDEA, hooked up to GitHub, and away I went. Actually - if you're an IntelliJ expert - do you know of an easy way to clone a project (i.e. its settings)? I spent two hours trying to figure it out with no luck, and surely it should be very simple? Wound up having to copy the files and then manually add all the libraries and settings back again. -TGG
  5. Hi Scanning through your logs I think nearly all the errors seem to stem from two problems (1) GuiContainer can't be found - have you deleted or moved the class file perhaps, or renamed the class by accident? (2) package codechicken.nei.api does not exist or has been moved (that's one you've added I presume?) -TGG
  6. Hi Ruski No worries, glad I could help :-) - TGG
  7. Hi Draco & Flayr I guess I phrased my reply a bit confusingly. What I meant was that the code responsible for placing the Block and associated TileEntity must know its location in the World. You are right that this isn't directly accessible from inside createNewTileEntity. Fortunately there are at least two other ways, for example * if you only have a few different TileEntity types, you could set the Block metadata and use that in overridden Block.createTileEntity to decide what to create. Or * after creating the block, you can manually place (or replace) the TileEntity at your target [x,y,z] with the correct type - see the vanilla code in setBlockIDWithMetadata. this.worldObj.setBlockTileEntity(j2, par2, k2, tileentity); Personally I've never needed to do either of them, I used a single TileEntity and modified its data to make it act in different ways. I have seen the first method used before. Rumour has it that the second way works, have never tried it myself. -TGG
  8. Hi This might help http://greyminecraftcoder.blogspot.com.au/2013/08/the-tessellator.html -TGG
  9. Hi I'm not sure I understand your question but these links might help http://greyminecraftcoder.blogspot.com.au/2013/07/blocks.html http://greyminecraftcoder.blogspot.com/2013/10/the-most-important-minecraft-classes_9.html http://greyminecraftcoder.blogspot.com/2013/10/the-most-important-minecraft-classes.html -TGG
  10. Hi I think you could probably overwrite Item.pumpkinPie with your own item information, so long as you derive it from ItemFood. It's probably not "best practice" but I imagine it would work ok. -TGG
  11. Hi Not sure but I suspect: PlayerCapabilities.disableDamage see EntityAITarget.isSuitableTarget else if (par1EntityLivingBase instanceof EntityPlayer && !par2 && ((EntityPlayer)par1EntityLivingBase).capabilities.disableDamage) -TGG
  12. Hi I would suggest repeating your "are any players nearby" code in the place you spawn the TileEntity. You must have access to the [x,y,z] somehow because otherwise how can you spawn the TileEntity in the right place? You could put the code in the TileEntity renderer instead but it would have a different effect - i.e. do you want the appearance to change when the special item moves in or out of the vicinity? Or do you want it to stay fixed after the initial placement, depending on whether the item was in the vicinity at the time it was place? -TGG
  13. Hi I haven't looked at your code, but perhaps this might help. http://greyminecraftcoder.blogspot.com.au/2013/07/rendering-transparent-blocks.html isOpaqueCube and shouldSideBeRendered might be worth looking at more closely, the symptoms look a bit similar. -TGG
  14. Hi You only need to use a TileEntity if you're trying to store more information that you can fit into the Block metadata (16 values). There's no need to use TileEntity if you're just wanting to make a block which looks different. Even if you need to use TileEntity for storing extra data, you can usually still render using the Block rendering code only (for example see BlockFurnace.) The only trick is if your custom block has an animation (eg opening the lid like a chest) - then Block Rendering won't help because the Block rendering code only gets called when the block or its metadata are updated. These pages go into a fair bit more detail which might help: http://greyminecraftcoder.blogspot.com.au/2013/07/block-rendering.html http://greyminecraftcoder.blogspot.com.au/2013/09/sample-code-for-rendering-items.html (has example of ISimpleBlockRenderingHandler). http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html -TGG
  15. Hi I'm not sure but I think the PotionEffect.onUpdate might be run on both the client and the server. If your custom code runs on the client it will cause problems. Try putting this as the first line of your method if (this.worldObj.isRemote) { // Don't run entity search on client side return super.onUpdate(par1EntityLivingBase); } -TGG
  16. Hi are you accessing server-side objects from client-side code by any chance? The client and the server run in different threads, and if they try to access the same object at the same time, you will get this error. Cheers TGG
  17. Hi To be honest I think the cure is worse than the disease. I just ignore those errors, doesn't make any difference to whether my mods work properly or not. -TGG
  18. Hi These are pretty helpful http://www.minecraftforge.net/wiki/Tile_Entities Cheers TGG
  19. Now there's an idea for a mod All I can suggest is that you try it with benchmarking and see if there really is a noticeable speed hit. I'm fresh out of any other ideas. -TGG
  20. Hi What I meant by a client/server mixup is that I suspect your code is writing to an object on the wrong side compared to what you expect. Perhaps you are accessing World or similar object from a location which is different when the client and server are on the same machine. Have you tried playing single player then opening to LAN and connecting with a second client, to see if the problem disappears when you open to LAN, and whether it is always the same for all clients or whether it depends on where the client code is running. You're right, even in single player the game still runs Client and Server (IntegratedServer). The symptoms you describe sound very much like a Client <--> Server synchronisation problem. Although it's normally the other way round (works in single player, not in multiplayer). The difference is that local Clients can access all sorts of objects that remote clients can't (or if they do, it has no effect because the objects are unused), which is what makes me think your client code or server code is writing data or calling methods somewhere it shouldn't. -TGG
  21. Hi It sounds to me like your TileEntityMachine keeps getting destroyed and a new one created every time. I can't tell why. Might also be some client<-->server problem. Perhaps you could try adding a couple of diagnostics to check this - for example add a counter, every time a new TileEntityMachine is created you give it a new ID number, then from your logging statements include the ID. eg static int nextID; int myID; in your constructor write myID = nextID++; and in your getControlState log the myID. That might help narrow the cause down. -TGG
  22. Hi Some concepts that might be relevant: You need to send enough information to uniquely identify your object, so that the receiver can recreate it. That can be done in many different ways depending on exactly what you want to do. The general name for what you're trying to do is called "serialisation" and there is inbuilt support for it in Java but I suspect it's probably more complicated that what you really want. Anything that is saved to disk already implements serialisation (eg readFromNBT typically) which can be sent via Packets, again it might be overkill. I would suggest that you find the code for a vanilla object which does roughly what you want, and adapt that. -TGG
  23. Hi I'm not sure I'm fully understanding what you are trying to do, but I suspect that you can probably accomplish it by deriving from Container and looking at (eg) ContainerChest for guidance. There are a number of vanilla methods used to automatically synchronise the client and server Containers when the player has it open and is manipulating it, for example EntityPlayerMP.sendContainerAndContentsToPlayer. I suspect your problem might be caused by some sort of mixup between your client and server responsibilities i.e. who creates what. It might help to plan that out more explicitly and add asserts to your code to make sure you're on the side that you think you are. Otherwise I'm out of ideas... TGG
  24. No worries, glad it helped :-) -TGG
  25. Hi. Just a suggestion - if it's too expensive to check the inventory every tick, why not check (say) every 20 ticks. A delay of 1 second will probably be unnoticeable to the player I imagine, depending on what "effect" you are applying. Even if it is noticeable, perhaps you can turn it into a feature (eg - "the unholy aura effect lasts for 10 seconds after you throw away the skull of putrescence", or similar). And to be honest I doubt it really takes that much extra time to check a player's inventory slots for a particular item ID. You could try it with a profiler and see if it is a significant slowdown or not. All the other solutions sound a bit fragile to me. Cheers TGG
×
×
  • Create New...

Important Information

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