Everything posted by DragonFerocity
-
1.12 Custom Gui Not Showing
Yes, it doesn't crash now if that's what you mean. However right clicking the block still doesn't show a gui.
-
1.12 Custom Gui Not Showing
Changed it to this: Still doesn't open any gui: package com.DragonFerocity.expanded; import com.DragonFerocity.expanded.handlers.BlockHandler; import com.DragonFerocity.expanded.handlers.GuiHandler; import com.DragonFerocity.expanded.proxy.IProxy; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.network.NetworkRegistry; @Mod(modid = Ref.MODID, name=Ref.NAME, version = Ref.VERSION) public class ExpandedAesthetics { @Instance(Ref.MODID) public static ExpandedAesthetics instance; @SidedProxy(clientSide=Ref.CLIENT_PROXY, serverSide=Ref.SERVER_PROXY) public static IProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent event) { proxy.preInit(); NetworkRegistry.INSTANCE.registerGuiHandler(ExpandedAesthetics.instance, new GuiHandler()); } @EventHandler public void init(FMLInitializationEvent event) { proxy.init(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { proxy.postInit(); } }
-
1.12 Custom Gui Not Showing
ExpandedAesthetics.java package com.DragonFerocity.expanded; import com.DragonFerocity.expanded.handlers.BlockHandler; import com.DragonFerocity.expanded.handlers.GuiHandler; import com.DragonFerocity.expanded.proxy.IProxy; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.network.NetworkRegistry; @Mod(modid = Ref.MODID, name=Ref.NAME, version = Ref.VERSION) public class ExpandedAesthetics { public static final String MODID = "expanded"; public static final String VERSION = "1.2.0"; @Instance("expandedaesthetics") public static ExpandedAesthetics instance; @SidedProxy(clientSide=Ref.CLIENT_PROXY, serverSide=Ref.SERVER_PROXY) public static IProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent event) { proxy.preInit(); NetworkRegistry.INSTANCE.registerGuiHandler(ExpandedAesthetics.instance, new GuiHandler()); } @EventHandler public void init(FMLInitializationEvent event) { proxy.init(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { proxy.postInit(); } }
-
1.12 Custom Gui Not Showing
Even with lowercase letters it still is null. I've debugged it so I know that it is null when it reaches the preInit function. So something must be wrong here, but I don't know what it is.
-
1.12 Custom Gui Not Showing
Sorry for not knowing everything, but when the does the instance variable get set?
-
1.12 Custom Gui Not Showing
If I keep the line of code: NetworkRegistry.INSTANCE.registerGuiHandler(ExpandedAesthetics.instance, new GuiHandler()); in the ExpandedAesthetics::preInit function, it crashes. If I replace ExpandedAesthetics.instance with "expandedaesthetics" it still crashes. Here's my instance variable: @Instance("ExpandedAesthetics") public static ExpandedAesthetics instance;
-
1.12 Custom Gui Not Showing
ExpandedAesthetics.java @EventHandler public void preInit(FMLPreInitializationEvent event) { NetworkRegistry.INSTANCE.registerGuiHandler(BlockHandler.class, new GuiHandler()); proxy.preInit(); } CommonProxy.java public void init() { }
-
1.12 Custom Gui Not Showing
So, it crashes in both the preInit and the Init functions giving this error Invalid attempt to create a GUI during mod construction. Use an EventHandler instead Sorry, but I'm not sure what it means by Use an EventHandler instead.
-
1.12 Custom Gui Not Showing
So then where would you suggest that I register my GuiHandler?
-
1.12 Custom Gui Not Showing
I got the use from a Minecraft 1.11.2 Forge Modding Intro Tutorial.
-
1.12 Custom Gui Not Showing
I put a breakpoint in the GuiHandler and it never gets hit. I have this in the init in my CommonProxy: public void init() { NetworkRegistry.INSTANCE.registerGuiHandler(BlockHandler.class, new GuiHandler()); }
-
1.12 Custom Gui Not Showing
I tried playerIn.openGui((Object)ExpandedAesthetics.instance, BlockHandler.GUI_ENUM.ALLOY_FURNACE.ordinal(), worldIn, pos.getX(), pos.getY(), pos.getZ()); and playerIn.openGui("ExpandedAesthetics", BlockHandler.GUI_ENUM.ALLOY_FURNACE.ordinal(), worldIn, pos.getX(), pos.getY(), pos.getZ()); Neither worked, and now the gui doesn't even show up on a right click.
-
1.12 Custom Gui Not Showing
Still doesn't work then. I did this before as well, just forgot to mention it. public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { if (worldIn.isRemote) { return true; } else { TileEntity tileentity = worldIn.getTileEntity(pos); if (tileentity instanceof ModTileEntityAlloyFurnace) { playerIn.openGui((Object)ExpandedAesthetics.class, BlockHandler.GUI_ENUM.ALLOY_FURNACE.ordinal(), worldIn, pos.getX(), pos.getY(), pos.getZ()); playerIn.addStat(StatList.FURNACE_INTERACTION); } return true; } }
-
1.12 Custom Gui Not Showing
Do I call open gui there? or in the blocks/ModAlloyFurnace.java::onBlockActivated function?
-
1.12 Custom Gui Not Showing
I did that, and the gui still doesn't open properly. Here's my updated GuiHandler code: @SideOnly(Side.CLIENT) public class GuiHandler implements IGuiHandler { @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { TileEntity tileEntity = world.getTileEntity(new BlockPos(x, y, z)); System.out.println("Server GUI ----------------------------------------------------------------------------"); if (tileEntity != null) { if (ID == BlockHandler.GUI_ENUM.ALLOY_FURNACE.ordinal()) { return new ModContainerAlloyFurnace(player.inventory, (ModTileEntityAlloyFurnace)tileEntity); } } return null; } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { TileEntity tileEntity = world.getTileEntity(new BlockPos(x, y, z)); System.out.println("Client GUI ----------------------------------------------------------------------------"); if (tileEntity != null) { if (ID == BlockHandler.GUI_ENUM.ALLOY_FURNACE.ordinal()) { return new ModGuiAlloyFurnace(player.inventory, (ModTileEntityAlloyFurnace)tileEntity); } } return null; } }
-
1.12 Custom Gui Not Showing
So, I don't understand how answers my question, but thanks for the insight /s. Also, how do I get the ID of a gui (As an integer) since the EntityPlayer::openGui method requires and int ID?
-
1.12 Custom Gui Not Showing
Hey guys, I'm having trouble getting a custom gui to show up. I'm trying to create a new furnace that is a direct upgrade to the regular furnace. Internally, I have called it the Alloy Furnace. My issue is that the custom gui I've created doesn't show up when I right click the new furnace. It shows my players inventory and that's it. And then on subsequent right clicks, the gui doesn't show up anymore. Here's my code on GitHub. And relevant files for the furnace are at: src\main\java\com\DragonFerocity\expanded\handlers\GuiHandler.java src\main\java\com\DragonFerocity\expanded\inventory\ModContainerAlloyFurnace.java src\main\java\com\DragonFerocity\expanded\entities\ModTileEntityAlloyFurnace.java src\main\java\com\DragonFerocity\expanded\gui\ModGuiAlloyFurnace.java src\main\java\com\DragonFerocity\expanded\blocks\ModAlloyFurnace.java
-
Forge Blockstate With Sub Variant?
Is it possible to define a variant for a block inside of another variant using the Forge Blockstate JSON? As an example, I'm adding custom stairs to Minecraft, but in order to allow inner stairs and outer stairs the y needs to change based on which direction the stair block is facing AND which type of stairs it is (inner, outer, or straight). Is it possible to define this using the Forge Blockstate JSON? (Here's the JSON i'm currently using which doesn't rotate the block correctly for inner stairs:
-
1.12 Forge Blockstate Format > Item Models?
I seem to have possibly found the solution? You can specify the textures in the models/item file... Is this the correct or suggested way to do things?
-
1.12 Forge Blockstate Format > Item Models?
Hello, So, if I use the custom forge blockstate format, what do I do for the models? (Specifically for ItemBlocks). If you don't use the forge blockstate format, you have to create JSON file under the blockstates folder, and a a JSON file under models/block, and then for an ItemBlock, you also have to create a JSON file under models/item that effectively points at the JSON under models/block. However, the custom forge blockstate format negates the need for a file under models/block, so how do I make the ItemBlock file point at the right thing? Here's a sample of the JSON i'm using:
-
1.12 Override did not have an associated owner object
Yes it appears I forgot to change the given registry name of another one of my mod items so it was giving an error. Thanks for leading me in the right direction.
-
1.12 Override did not have an associated owner object
Well, as far as I know I'm not overriding any vanilla registry entries unless a dark oak bed exists now. Here's the total log: Here's the register code:
-
1.12 Override did not have an associated owner object
Hey guys, So I'm trying to upgrade my mod from 1.11.2 to 1.12 and I'm having a few difficulties namely with the new registration system. I'm getting the above error on one of my items: the bed items that I've created. Basically my ModItemBed class is a copy-paste of the ItemBed class with a few changes necessary to make it not have any errors. I have doors that are registered early in my code that don't appear to have any problems so I've tried comparing the code a little to see if I can see what is different and I wasn't able to find anything. Do any of you guys have any ideas? I can post code if you would like but I'm not sure how much use it will be.
-
1.12 Adding Recipes
Thanks, I just figured that out too. Now I'm getting a strange error on another piece of code but I'll make a new topic since it doesn't relate to this.
-
1.12 Adding Recipes
Can a recipe be a part of multiple groups? It appears not, but thought I'd ask just in case I'm wrong. Does anyone know where this error is coming from: Unknown recipe type: expanded:crafting_shaped Here's the JSON file it's having a problem with: { "type": "crafting_shaped", "group": "cactus", "pattern": [ " #", " ##", "###" ], "key": { "#": { "item": "expanded:cut_cactus_block_block" } }, "result": { "item": "expanded:cut_cactus_stairs_block", "count": 3 } }
IPS spam blocked by CleanTalk.