GuiServer overrides ContainerRepair#canInteractWith to always return false, so Minecraft closes the GUI during the next tick of the player.
You need to override it to do what the super method does: check if the block at the specified position is your anvil and that the player is within range of it.
BlockGoldenAnvil#onBlockActivated incorrectly passes the hitX/Y/Z arguments to EntityPlayer#openGUI, these represent the position on the block that the player clicked; not the position of the block in the world. The BlockPos argument is the block's position in the world.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Now the problem is that my inventory isn't displayed into the anvil interface. Since I call super() for ContainerRepair, shouln't be the inventory be displayed?
Now the problem is that my inventory isn't displayed into the anvil interface. Since I call super() for ContainerRepair, shouln't be the inventory be displayed?
You're creating a new empty InventoryPlayer instead of using the player's actual inventory (EntityPlayer#inventory).
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Oh, I'm dumb
There's no way to change the level limit instead of rewriting the entire ContainerRepair#updateRepairOutput?
I don't think there is.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I've tried overriding it but on right click the gui opens for a frame and then closes.
EDIT: Managed to create a GuiRepair for the anvil and calling it with
But the problem stands still. The gui opens for a frame only.
Here's the full code of the block: https://github.com/Insane-96/GoldenAnvilMod/blob/master/common/net/insane96mcp/goldenAnvil/block/BlockGoldenAnvil.java
GuiServer overrides ContainerRepair#canInteractWith to always return false, so Minecraft closes the GUI during the next tick of the player.
You need to override it to do what the super method does: check if the block at the specified position is your anvil and that the player is within range of it.
BlockGoldenAnvil#onBlockActivated incorrectly passes the hitX/Y/Z arguments to EntityPlayer#openGUI, these represent the position on the block that the player clicked; not the position of the block in the world. The BlockPos argument is the block's position in the world.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Awesome, thank you
Now the problem is that my inventory isn't displayed into the anvil interface. Since I call super() for ContainerRepair, shouln't be the inventory be displayed?
You're creating a new empty InventoryPlayer instead of using the player's actual inventory (EntityPlayer#inventory).
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Oh, I'm dumb
There's no way to change the level limit instead of rewriting the entire ContainerRepair#updateRepairOutput?
I don't think there is.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.