Jump to content

BaconBombing

Members
  • Posts

    20
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • URL
    https://www.curseforge.com/members/baconbombingdeveloper/projects

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

BaconBombing's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. He means your actual code not just the errors
  2. This isn't quite global variables, but the way I cut down on code was writing a function with a switch case that uses a prefix to cut down on string length for every string that was applicable. The "modifyLoot" functions probably won't be useful to you in this case because you're not modifying original Loot Pools but you can modify it to your liking. So your prefix in this case would use "entities" instead, and you would just have to write every monster name once. https://github.com/EricHedengren/StandardMaterials/blob/master/com/baconbombing/standardmaterials/loot/ModLoot.java Hope this helps!
  3. I love it when easy fixes come along Thanks!
  4. So I already created an Armor class and Item Tier class for my new set of Mod tools and armor, but I can't figure out how to set the repair material as my Mod Item. The Item I would like to use is declared as a Registry Object because that's the new way forge does it, however "fromItems" takes IItemProvider and I'm not sure how to properly declare that. Can someone help me figure this out please? Enum Class for Armor public enum ModArmorMaterial implements IArmorMaterial { TUNGSTEN("tungsten", 33, new int[]{3, 6, 8, 3}, 10, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 2.0F, () -> { return Ingredient.fromItems(ModItems.TUNGSTEN_INGOT); // Error }); Mod Repair Item public static final RegistryObject<Item> TUNGSTEN_INGOT = ITEMS.register("tungsten_ingot", ItemBase::new); Thanks for any help!
  5. So this is my current update json file, and currently when an update appears the /n don't give a new line, and it's a block of messy change log. Can someone please tell me how to do a new line or give me an example of their's? { "homepage": "https://www.curseforge.com/minecraft/mc-mods/standardmaterials/files", "promos": { "1.15.2-latest" : "1.2.0", "1.15.2-recomended" : "1.1.3" }, "1.15.2": { "1.2.0" : "Added obsidian and emerald armor/nAdded pure obsidian block/nAdded emerald horse armor/nAdded custom game achievements/nAdded recipe advancements for obtaining obsidian gem and emerald/nAdded random spawn for mod items in chests in normal structures", "1.1.3" : "Changed obsidian class repair material to obsidian gem/nCreated json updater functionality", "1.1.2" : "Rebalanced obsidian and emerald tool stats/nObsidian(3, 2000, 5.0F, 2.0F, 15)/nEmerald(2, 500, 7.0F, 3.0F, 20)/nFixed tool visual models", "1.1.1" : "Added emerald tools, emerald stats(2, 500, 10.0F, 4.0F, 25)/nChanged obsidian tool stats(3, 3000, 6.0F, 2.0F, 15)/nAdded additional obsidian tools/nRecreated textures for previous obsidian tools", "1.0.0" : "Adds obsidian sword, pickaxe, and gem" } } Thanks for your help!
  6. Guys I promise I know some Java. This is my fix public static final RegistryObject<Item> EMERALD_HORSE_ARMOR = ITEMS.register("emerald_horse_armor", ()-> new HorseArmorItem(9, new ResourceLocation("standardmaterials", "textures/entity/horse/armor/horse_armor_emerald.png"), (new Item.Properties()).maxStackSize(1).group(ItemGroup.MISC)));
  7. Well regardless of what I have for my path right now, using ("string one", "string two") gives me a syntax error. Do you mean I have to add ResourceLocation("String","String") when calling HorseArmorItem? Or would it just be something like this? ("standardmaterials", "textures/entity/horse/armor/horse_armor_emerald.png")
  8. So I'm making horse armor, and in the HorseArmorItem class public static final RegistryObject<Item> EMERALD_HORSE_ARMOR = ITEMS.register("emerald_horse_armor", ()-> new HorseArmorItem(9, ("standardmaterials", "emerald"), (new Item.Properties()).maxStackSize(1).group(ItemGroup.MISC))); The second parameter is the minecraft ResourceLocation class, public HorseArmorItem(int p_i50042_1_, ResourceLocation texture, Item.Properties p_i50042_3_) public ResourceLocation(String namespaceIn, String pathIn) Which can take two parameters. What is the correct syntax to give two strings to call HorseArmorItem so it can find my textures? Thanks for any help!
  9. Thanks so much!! That makes sense I only called ModItems.init(); in my main class and not ModBlocks.init()! I definitely won't make the same mistake. So all these replies are just a simple error on my part. Sorry for the spam, but I hope it helps someone else learn. Thanks for everyone's help!
  10. This is in a separate class named ModBlocks: public class ModBlocks { public static final DeferredRegister<Block> BLOCKS = new DeferredRegister<>(ForgeRegistries.BLOCKS, StandardMaterials.MOD_ID); public static void init() { BLOCKS.register(FMLJavaModLoadingContext.get().getModEventBus()); } //Blocks public static final RegistryObject<Block> PURE_OBSIDIAN = BLOCKS.register("pure_obsidian", ()-> new Block(Block.Properties.create(Material.ROCK, MaterialColor.BLACK).hardnessAndResistance(50.0F, 1200.0F))); }
  11. I also found these that could give hints to what the problem is. I'm completely new to blocks, can someone please help me out? [Render thread/FATAL] [ne.mi.fm.ModLoader/LOADING]: Failed to complete lifecycle event LOAD_REGISTRIES, 1 errors found [Render thread/ERROR] [ne.mi.fm.ja.FMLModContainer/LOADING]: Caught exception during event RegistryEvent.Register<minecraft:item> dispatch for modid standardmaterials
  12. I posted it above. Does it have something to do with my block registry? I clicked on the log for at net.minecraftforge.fml.RegistryObject.get(RegistryObject.java:91) And it brought me to the method that throws the "Registry Object not present" public T get() { T ret = this.value; Objects.requireNonNull(ret, "Registry Object not present"); return ret; } So it does it not interpret ModBlocks.PURE_OBSIDIAN.get() properly? Or is it because I initialized the event bus for Items but not BlockItems? I tried to create one, but ForgeRegistries doesn't have a .BLOCKITEMS method. In their documentation they also say blockitems is a sub class to items so I shouldn't have to make another one for this to work. public static final DeferredRegister<Item> ITEMS = new DeferredRegister<>(ForgeRegistries.ITEMS, StandardMaterials.MOD_ID); public static void init() { ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus()); } Alright that's plenty of thinking for one post, can someone help me out please?
  13. Thanks so much! Yeah you're right I was using the wrong parameters. "BlockItem.Properties" also works but I think it's the same thing, because the class BlockItem extends Item. Code: public static final RegistryObject<BlockItem> PURE_OBSIDIAN = ITEMS.register("pure_obsidian", ()-> new BlockItem(ModBlocks.PURE_OBSIDIAN.get(), (new Item.Properties()).group(ItemGroup.BUILDING_BLOCKS))); But it still gives an error on startup the log puts directly to the line where I initialized the Block Item. Here's a few lines from the log: java.lang.NullPointerException: Registry Object not present at net.minecraftforge.fml.RegistryObject.get(RegistryObject.java:91) at com.baconbombing.standardmaterials.items.ModItems.lambda$19(ModItems.java:56) ~[main/:?] Here's the full log:
×
×
  • Create New...

Important Information

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