Jump to content

Winseven4lyf

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by Winseven4lyf

  1. I was pulling my hair out for a while, wondering why my textures wouldn't load. Then I looked at the logs and saw it was looking for the texture in the domain "minecraft". About 10 minutes later, I realised I didn't put a domain in the JSON file's texture. For example, take this JSON inside your mod: { "parent": "item/generated", "textures": { "layer0": "items/item_name" } } Because there is no domain at the beginning of "layer0", it defaults to the domain "minecraft". To fix this, prepend your mod id and a ":" to the tag: { "parent": "item/generated", "textures": { "layer0": "modid:items/item_name" } } I hope this helps someone else who is also pulling their hair out.
  2. After looking at https://bedrockminer.jimdo.com/modding-tutorials/advanced-modding/tile-entity-data, I realised that it is camelCase. I guess that this can be locked now? EDIT: I needed to refresh my page
  3. I am starting development on a Redstone Circuit mod, and I was wondering if camelCase or PascalCase is used for NBT tags.
  4. The error is: net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from More Tools (moretools) Caused by: java.lang.ExceptionInInitializerError at com.Winseven4lyf.MoreTools.proxy.CommonProxy.preInit(CommonProxy.java:9) at com.Winseven4lyf.MoreTools.proxy.ClientProxy.preInit(ClientProxy.java:9) at com.Winseven4lyf.MoreTools.MoreTools.preInit(MoreTools.java:21) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:643) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:246) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:224) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:147) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:647) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:275) at net.minecraft.client.Minecraft.init(Minecraft.java:478) at net.minecraft.client.Minecraft.run(Minecraft.java:387) at net.minecraft.client.main.Main.main(Main.java:118) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:26) And underneath that is: Caused by: java.lang.ArrayIndexOutOfBoundsException: 5 at net.minecraft.item.ItemAxe.<init>(ItemAxe.java:19) at com.Winseven4lyf.MoreTools.items.ModAxe.<init>(ModAxe.java:13) at com.Winseven4lyf.MoreTools.handlers.ItemHandler.<clinit>(ItemHandler.java:33) ... 46 more P.S: I should probably learn where the log is in a dev environment...
  5. I am developing a mod that adds flint and cactus tools, and my axes have weird attack speed and damage. Doing super(material, material.getDamageVsEntity(), material.getEfficiencyOnProperMaterial()); In the constructor leaves me with values that would make the axe attack really fast and do less damage than I want it to, super(material); Gives me a java.lang.ExceptionInInitializerError. So I have rigged up a system to fix this for the time being, but having to expand this system every time I add a new ToolMaterial will get annoying fast. Help? Code: ModAxe.java: package com.Winseven4lyf.MoreTools.items; import com.Winseven4lyf.MoreTools.handlers.MaterialHandler; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.ItemAxe; public class ModAxe extends ItemAxe { public ModAxe(String name, ToolMaterial material, CreativeTabs tab) { super(material, MaterialHandler.getAxeDamage(material) - 1, MaterialHandler.getAxeAttackSpeed(material) - 4); setUnlocalizedName(name); setRegistryName(name); setCreativeTab(tab); } } MaterialHandler.java: package com.Winseven4lyf.MoreTools.handlers; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.EnumHelper; public class MaterialHandler { private static float lerp(float a, float b, float t) { return (1 - t) * a + t * b; } private static ToolMaterial createLerpedMaterial(String name, ToolMaterial a, ToolMaterial b, float t, ItemStack repairItem) { return EnumHelper.addToolMaterial( name, a.getHarvestLevel(), (int) Math.floor(lerp(a.getMaxUses(), b.getMaxUses(), 0.5F)), lerp(a.getEfficiencyOnProperMaterial(), b.getEfficiencyOnProperMaterial(), 0.5F), lerp(a.getDamageVsEntity(), b.getDamageVsEntity(), 0.5F), (int) Math.floor(lerp(a.getEnchantability(), b.getEnchantability(), 0.5F)) ).setRepairItem(repairItem); } private static ToolMaterial createDuplicateMaterial(String name, ToolMaterial original, ItemStack repairItem) { return EnumHelper.addToolMaterial( name, original.getHarvestLevel(), original.getMaxUses(), original.getEfficiencyOnProperMaterial(), original.getDamageVsEntity(), original.getEnchantability() ).setRepairItem(repairItem); } public static float getAxeAttackSpeed(ToolMaterial material) { float output = 0F; if (material == FLINT) { output = 0.85F; } else if (material == CACTUS) { output = 0.8F; } return output; } public static float getAxeDamage(ToolMaterial material) { float output = 0F; if (material == FLINT) { output = 9F; } else if (material == CACTUS) { output = 7F; } return output; } public static final ToolMaterial FLINT = createLerpedMaterial("flint", ToolMaterial.STONE, ToolMaterial.IRON, 0.5F, new ItemStack(Items.FLINT)); public static final ToolMaterial CACTUS = createDuplicateMaterial("cactus", ToolMaterial.WOOD, new ItemStack(Blocks.CACTUS)); }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.