Everything posted by Jay Avery
-
[1.10.2]Block render glitch
Do you know what overriding a method means in Java? The class Block contains two methods, named isFullCube and isOpaqueCube . In your subclass, you need to override those methods. Both return a boolean and take an IBlockState as a parameter. All you need the methods to do is return false.
-
[1.10.2] {Solved!!!} Right-Click Item for Chest-like GUI
Does that console error happen when you use your item, or regardless of the item?
-
[1.10.2]Block render glitch
You need to override isFullCube and isOpaqueCube and make both return false.
-
[1.10.2] {Solved!!!} Right-Click Item for Chest-like GUI
No, I said call getHeldItem on the player from the inventory - you are now calling getCurrentItem on the inventory itself.
-
[1.10.2] {Solved!!!} Right-Click Item for Chest-like GUI
You need to call getHeldItem on the player. You could pass the player to the constructor of your container, or get the player from the InventoryPlayer which is already in the constructor - inventory.player .
-
[1.10.2] {Solved!!!} Right-Click Item for Chest-like GUI
I am doing this already! (I think) No, you're not. You're trying to call TestBagCapabilities.getCapability , as if it is a static method (which it isn't).
-
[1.10.2] {Solved!!!} Right-Click Item for Chest-like GUI
getCapability is a non-static method. A non-static method can only be called on an instance of the class, not the class itself.
-
[1.10.2] {Solved!!!} Right-Click Item for Chest-like GUI
You really need to learn some more basic Java, because you are asking questions that you should know the answer to. Do you understand the difference between a static and non-static method?
-
[1.10.2] {Solved!!!} Right-Click Item for Chest-like GUI
Does your GUI open when you right click the item?
-
[1.10.2] {Solved!!!} Right-Click Item for Chest-like GUI
Just put this line: playerIn.openGui(Main.instance, GuiHandler.TEST_BAG, worldIn, pos.getX(), pos.getY(), pos.getZ()); inside the method. Edit: You'll need to get the pos from the player because it's not one of the method parameters.
-
[1.10.2] {Solved!!!} Right-Click Item for Chest-like GUI
I don't understand your question - "the things that [method] goes in to"? What do you mean?
-
[1.10.2] {Solved!!!} Right-Click Item for Chest-like GUI
You were perfectly on the right track before, the only problem was your method signature was wrong. To open the GUI, you need to call your GUI method: playerIn.openGui(Main.instance, GuiHandler.TEST_BAG, worldIn, pos.getX(), pos.getY(), pos.getZ());
-
[1.10.2] {Solved!!!} Right-Click Item for Chest-like GUI
The parameters are given to you right there in the method. Regardless, you shouldn't be calling super at all, because you are overriding the method to do your own thing. Put your code to bring up the GUI back in the method now that it's overriding correctly.
-
[1.10.2] {Solved!!!} Right-Click Item for Chest-like GUI
You are calling super.onItemRightClick with completely wrong parameters, for some reason.
-
[1.10.2] {Solved!!!} Right-Click Item for Chest-like GUI
To override a method, the method signature (the name and required parameters) must be exactly the same. Look at the superclass you are overriding from and copy the signature so that you can be sure.
-
[1.10.2] {Solved!!!} Right-Click Item for Chest-like GUI
Start by putting a println in your onItemRightClick to find out whether it is being called when you expect. Then track through the other steps that you want to happen, using printlns (or the debugger) to see whether they are happening as they should.
-
[1.11] Overlay returning null.
So, presumably voidEnergy is null when the method is getting called. Use printlns or the debugger to check whether it is being initialised as it should be. What exactly does CapabilityVoidEnergy.getVoidEnergyFromChunk(world, chunkPos) do - is it returning null?
-
[1.11] Overlay returning null.
Are you getting an error? Exactly where is null being returned, and how do you know?
-
[1.11.2] Difficulty Adding an item with a Texture
What exactly does your item look like in the game? Is it a cube or a flat square? Presumably you mean that it is showing the purple/black squares texture?
-
[1.8]Make booleans stay after quitting Minecraft
It's a NullPointerException , so use your debugger (or printlns) to find out which variable is null at the affected line.
-
[1.11] Registering slabs
Right, I've figured it out. I was confused because I was thinking that the single and double blocks also needed to have an ItemBlock each (because usually EVERY BLOCK EVER has to have an ItemBlock).
-
[1.8]Make booleans stay after quitting Minecraft
This line gets the property from the config: Property PMs = config1.get("Booleans", "PMs", false); The property contains the boolean value you want. So you 'get' the boolean from the property like this: PMs.getBoolean() And assign that value to your stored field. You can do it all in one line like this: PMs = config1.get("Booleans", "PMs", false).getBoolean();
-
[1.11] Rendering Progress Bar
Use printlns or the debugger to check: - Is getCookProgressScaled returning the expected values? - Is your TE's getField returning the expected values? - Is your TE fully synced between client and server?
-
[1.11] Registering slabs
I understand the basics of registering a single block with a single associated ItemBlock. But a functioning slab requires a single slab block, a double slab block, and an ItemSlab item - and I don't understand how to make them all relate to each other correctly in registration and construction.
-
[1.11] Registering slabs
How do you register BlockSlab s and ItemSlab s in 1.11? Older tutorials use GameRegistry.registerBlock which doesn't exist anymore (and seems to be able to take a combination of Item and Block parameters to combine them somehow). Looking through the vanilla code doesn't help because the registration is done completely differently. And I can't find any tutorials for 1.11. Can anyone talk me through it, or direct me to a tutorial or example code?
IPS spam blocked by CleanTalk.