-
Posts
796 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Kokkie
-
Do you mean as in you are making an expansion for Thermal Foundation which requires the user to have it installed, or do you mean having the same properties?
-
[1.10.2] [unsolved] How do i make a static line between 2 points?
Kokkie replied to YesImAHuman's topic in Modder Support
Where do you need this for? -
Also, you should use breakBlock(), which is called if the block is replaced by another block (could be air, but also another block) instead of onBlockDestroyedByExplosion() and onBlockDestroyedByPlayer().
-
Maybe this will help:
-
Okay, thanks! Actually, they aren't working D: For my code etc. go to my github. https://github.com/KokkieBeer/Auto-Miner/tree/master/src/main/resources/assets/am/recipes
-
Okay, so how about smelting recipes?
-
So, I don't need any registry events or anything?
-
I've found ShapedRecipes.deserialize(JsonObject), should I use this?
-
How can I use json files with the event?
-
How can I use json?
-
So I need to make classes that implement IRecipe to use the new system?
-
Just noticed that :D. Is the event in newer versions of Forge? (I have 14.21.0.2321) Also, the wrench recipe now works :D.
-
Removed it, didn't work.
-
Also, go here for code. https://github.com/KokkieBeer/Auto-Miner
-
When I remove the recipe for the wrench, it works, but I set the registry name for the wrench... Also, it seems like the items aren't registered properly yet. They don't show up in the tab and I can't give them to me using /give...
-
Where can I find which item it is?
-
How can I set that condition?
-
I fixed the problem there, but it seems like the lambda nullpointer didn't go away, but the code didn't get far enough to reach a lambda... So, please help. I can't find what causes it because the console doesn't give any information...
-
You also forgot a : here.
-
You added one : too much.
-
When the code reaches the while loop it freezes the game and opens the debug perspective telling me something about the while loop...
-
It seems to have gone away... But now it's stuck on the while loop in here... if (recipeComponents[i] instanceof String[]) { String[] astring = (String[]) ((String[]) recipeComponents[i++]); for (int s3 = 0; s3 < astring.length; s3++) { String s2 = astring[s3]; ++k; j = s2.length(); s = s + s2; } } else { while (recipeComponents[i] instanceof String) { String s1 = (String) recipeComponents[i++]; ++k; j = s1.length(); s = s + s1; } }
-
Everything registers fine (I think) but I, again, get the lambda nullpointer, why does this happen?
-
I no longer get any errors, but the items and blocks aren't registered. The events aren't fired... Main. @Mod(modid = Reference.ID, name = Reference.NAME, version = Reference.VERSION, acceptedMinecraftVersions = "[" + Reference.MC_VERSION + "]") public class AutoMiner { @Instance public static AutoMiner INSTANCE = new AutoMiner(); @SidedProxy(clientSide = Reference.CLIENT_PROXY, serverSide = Reference.COMMON_PROXY) public static IProxy PROXY; @EventHandler public static void preInit(FMLPreInitializationEvent event) { PROXY.registerEntities(); PROXY.registerRecipes(); PROXY.setTitle("Minecraft - " + Reference.MC_VERSION + " AutoMiner - " + Reference.VERSION); } @EventHandler public static void init(FMLInitializationEvent event) { } @EventHandler public static void postInit(FMLPostInitializationEvent event) { } } IProxy. public interface IProxy { void setTitle(String title); void registerEntities(); void registerRecipes(); } CommonProxy. public class CommonProxy implements IProxy { @Override public void setTitle(String title) { } @Override public void registerEntities() { GameRegistry.registerTileEntity(TileEntityAutoMiner.class, "AutoMiner"); } @Override public void registerRecipes() { AMUtils.addShapedRecipe("wrench", new ItemStack(AMItems.WRENCH), "S S", "SSS", " S ", 'S', AMItems.STEEL_INGOT); AMUtils.addShapedRecipe("auto_miner", new ItemStack(AMBlocks.AUTO_MINER), "SSS", "SPS", "SSS", 'S', AMItems.STEEL_INGOT, 'P', Items.IRON_PICKAXE); } } ClientProxy. public class ClientProxy implements IProxy { @Override public void setTitle(String title) { Display.setTitle(title); } @Override public void registerEntities() { } @Override public void registerRecipes() { } } Blocks. public class AMBlocks { public static final Block STEEL_BLOCK = new Block(Material.IRON).setCreativeTab(AMTabs.AM_TAB).setHardness(8.0F) .setResistance(15.0F).setRegistryName("steel_block").setUnlocalizedName("steel_block"); public static final Block AUTO_MINER = new BlockAutoMiner().setCreativeTab(AMTabs.AM_TAB).setHardness(7.0F) .setResistance(20.0F).setRegistryName("auto_miner").setUnlocalizedName("auto_miner"); public static final Block[] BLOCKS = new Block[] { STEEL_BLOCK, AUTO_MINER }; } Items. public class AMItems { public static final Item STEEL_INGOT = new Item().setCreativeTab(AMTabs.AM_TAB).setRegistryName("steel_ingot") .setUnlocalizedName("steel_ingot"); public static final Item WRENCH = new Item().setCreativeTab(AMTabs.AM_TAB).setMaxDamage(128).setMaxStackSize(1) .setRegistryName("wrench").setUnlocalizedName("wrench"); public static final Item[] ITEMS = new Item[] { STEEL_INGOT, WRENCH }; } Client Handler. @Mod.EventBusSubscriber(modid = Reference.ID, value = Side.CLIENT) public class AMClientHandler { @SubscribeEvent public void registerModels(ModelRegistryEvent event) { for (int i = 0; i < AMBlocks.BLOCKS.length; i++) { Block block = AMBlocks.BLOCKS[i]; ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(), "inventory")); } for (int i = 0; i < AMItems.ITEMS.length; i++) { Item item = AMItems.ITEMS[i]; ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory")); } } } Common Handler. @Mod.EventBusSubscriber(modid = Reference.ID, value = Side.SERVER) public class AMCommonHandler { @SubscribeEvent public void registerBlocks(RegistryEvent.Register<Block> event) { AMBlocks.STEEL_BLOCK.setHarvestLevel("pickaxe", 2); AMBlocks.AUTO_MINER.setHarvestLevel("pickaxe", 1); event.getRegistry().registerAll(AMBlocks.BLOCKS); } @SubscribeEvent public void registerItems(RegistryEvent.Register<Item> event) { event.getRegistry().registerAll(AMItems.ITEMS); for (int i = 0; i < AMBlocks.BLOCKS.length; i++) { Block block = AMBlocks.BLOCKS[i]; event.getRegistry().register(new ItemBlock(block).setRegistryName(block.getRegistryName()) .setUnlocalizedName(block.getUnlocalizedName())); } } }