TheGreyGhost
Members-
Posts
3280 -
Joined
-
Last visited
-
Days Won
8
Everything posted by TheGreyGhost
-
GameRegistry.getFuelValue always returns 0 1.6.2
TheGreyGhost replied to TrenTech's topic in Modder Support
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 -
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
-
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
-
Refining my development process with Forge
TheGreyGhost replied to chrixian's topic in Modder Support
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 -
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
-
[SOLVED] Change block properties in an if statement.
TheGreyGhost replied to Flayr's topic in Modder Support
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 -
RENDERING DISTANCE PROBLEM in Custom modeled block
TheGreyGhost replied to Alesimula's topic in Modder Support
Hi This might help http://greyminecraftcoder.blogspot.com.au/2013/08/the-tessellator.html -TGG -
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
-
How do you remove a vanilla item from its Creative tab?
TheGreyGhost replied to caveman's topic in Modder Support
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 -
[SOLVED] Change block properties in an if statement.
TheGreyGhost replied to Flayr's topic in Modder Support
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 -
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
-
RENDERING DISTANCE PROBLEM in Custom modeled block
TheGreyGhost replied to Alesimula's topic in Modder Support
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 -
[SOLVED] Change block properties in an if statement.
TheGreyGhost replied to Flayr's topic in Modder Support
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 -
[SOLVED] Change block properties in an if statement.
TheGreyGhost replied to Flayr's topic in Modder Support
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 -
Does this quirk still exist when developing mods with IntelliJ?
TheGreyGhost replied to ianc1215's topic in Modder Support
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 -
How to make a block with more than 16 metadatas?
TheGreyGhost replied to TheTrollingTrollguy's topic in Modder Support
Hi These are pretty helpful http://www.minecraftforge.net/wiki/Tile_Entities Cheers TGG -
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
-
[SOLVED] Buttons, PacketHandlers and Container Inventorys
TheGreyGhost replied to dvd604's topic in Modder Support
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 -
[SOLVED (Maybe)] Tile entity field not setting
TheGreyGhost replied to Sag73's topic in Modder Support
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 -
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
-
[SOLVED] Buttons, PacketHandlers and Container Inventorys
TheGreyGhost replied to dvd604's topic in Modder Support
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 -
No worries, glad it helped :-) -TGG
-
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