The_Wabbit
Members-
Posts
36 -
Joined
-
Last visited
Everything posted by The_Wabbit
-
With 1.12.1 this class some with a big ol' "DO NOT USE!" super-duper deprecated warning. But I can't figure out where its functionality (I want *this* recipe checked before *that* one) has moved. Is this something that is now implicit in json file names or some other magic? Pointers would be greatly appreciated as I do have mod that needs the sorting within its own recipe set. The_Wabbit
-
Wow. That is bad. So the old ore dictionary wildcarding is no longer a thing for input ingredients? What about custom IRecipe implementations? (sorry I've not started 1.12 porting yet but I'm trying to keep track of all the gotchas others seem to be having...)
-
[1.12] Registering Blocks and ItemBlocks the new way?
The_Wabbit replied to desht's topic in Modder Support
Out of curiousity...what if you have a block that requires an ItemStack of one of your items in its construction? As item registration seems to always come after blocks if using events, is such a thing no longer possible? Background: ItemStacks[1.8.9] used to barf if the underlying item was not registered in some cases...have not checked recently in 1.11+. So I was always careful to ensure an item was not just created but also registered before creating an ItemStack of it...for use by block initialization. -
1.11+ There doesn't seem to be any event for the fishing activity, in particular a hook to allow tweaking to what's fished up (after looting table). The solution that many mod authors have used -- is to create their own custom fishing-rod and/or fish-traps or some such thing. Bleech (I have 6 different mod-specific fishing rods and trap thingies) Example-use: I just want a hook to implement: if there is FireAspect on a standard fishing rod, smelt all smeltable fish that gets caught. Example-use: I just want a hook to implement: if there is XXXEnchantment on fishing rod, don't catch anything by ItemFish (and/or other 'fish'). Example-use: I just want a hook to implement if player has crappy luck (say -2 or worse) they only fish up junk junk always. Example-use: I want to replace vanilla fish with some custom mod fish (eg replace vanilla cod/salmon with Aquaculture's versions or some such thing) Example-use: I want enforce fishing requires at least a 5x5x3 water area. Example-use: I want to do different things if its a player or an automated mechanism (like trap). For instance, no Xp if it's a contraption. Etc. LootFunctions don't apply to pools as a whole, and don't have access to player and/or biome or other selected loot items so it's hard to implement 'overarching' type behavior (like above examples). Mod loot tables are also not hooked into the current loot table load notification so any loot function would not affect such fished up items. The location for said hook maybe: EntityFishHook::handleHookRetraction(...) ?
-
[1.11+] [SOLVED] How to refer to mod enchantments in loot tables?
The_Wabbit replied to The_Wabbit's topic in Modder Support
This is just what I need as the Enchantment reference was the important bit; the level can be randomly selected. Thank you! For others looking at this thread, this minecraftforum thread describe the function: Custom Loot Tables - Enchant Randomly Thanks. -
Hello all-- I'd like to refer to some custom enchantments in a loot table file. I believe the enchantment ids are (or can be) regenerated between world saves and modders aren't supposed to use them but instead use the Enchantment object or a ResourceLocation for lookup. But, I haven't found a way refer to the enchantment using a resource location and the standard 'set_nbt' function and the 'ench{}' nbt compound tag. (A dump of an itemstack's enchantment list shows ids although w/ 's' appended... like [0:{lvl:3s,id:17s},1:{lvl:2s,id:19s}]) Is this something I'll have to write a custom loot function for, or is there some mechanism already in place to refer to say "mymod:super_freeze_enchant" or some such thing in a loot table entry from the json? (A similar question comes to mind for potions.) Note these are my custom loot tables that I've registered with LootTableList.register(new ResourceLocation(...)); not vanilla ones. Thanks for any info, The_Wabbit
-
Hello all-- While investigating another issue, I discovered that by putting a shulker box on a hopper pointing into another shulkerbox and breaking it -- the hopper happily puts the first shulkerbox into the second. From what I can see everything is just fine (I can pull out the now nested box and all of its contents are preserved.) I did not try nesting into nesting as the first level is already not possible in vanilla (the shulkerbox is trapped by the hopper and NOT put into the other one). Pictures attached: I broke the pink box and it was put into the white one with its contents preserved fine as you can see. So my question: is this supposed to occur as a feature of Forge-modded-ness and capabilities? Or is it unintended and should not be relied on? -The Wabbit
-
Just a follow-up (for anyone looking for this in future). I created a very simple 1.8 test-mod that defines a simple item and a simple multi-variant item. Saved a world with the items in frames. Rebuilt said mod for 1.8.9 and loaded 1.8 world. Also broken, but at least there is some code to go with the issue now. All code, asset files, and some screenshots located here: http://jwaresoftware.org/files/mcmods/bugs/1.8.9/TestMod_MC1.8_to_MC1.8.9/. Main code body (as above link may disappear someday): /** -------- TestMod.java (ClientOnly) -------- **/ /** COMMENTED LINES ARE THE 1.8 LINES replaced **/ package testmod; //import net.minecraft.client.Minecraft; //import net.minecraft.client.renderer.ItemModelMesher; //import net.minecraft.client.resources.model.ModelBakery; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.registry.GameRegistry; @Mod(modid = "testmod", name = "Test Mod", version="1.8") public class TestMod { @Mod.Instance(value="testmod") public static TestMod instance; public static ItemSimple itemSimple; public static ItemVariant itemVariant; @EventHandler public void preInit(FMLPreInitializationEvent event) // seed: -8913466909937400889 { itemSimple = (ItemSimple)(new ItemSimple().setUnlocalizedName("tm_simple_item")); GameRegistry.registerItem(itemSimple,"tm_simple_item"); itemVariant = (ItemVariant)(new ItemVariant().setUnlocalizedName("tm_variant_item")); GameRegistry.registerItem(itemVariant,"tm_variant_item"); } @EventHandler public void postInit(FMLPostInitializationEvent event) { ModelResourceLocation model; //ItemModelMesher mesher = Minecraft.getMinecraft().getRenderItem().getItemModelMesher(); model = new ModelResourceLocation("testmod:tm_simple_item","inventory"); //mesher.register(itemSimple,0,model); ModelLoader.setCustomModelResourceLocation(itemSimple,0,model); //String[] itemids = new String[]{"testmod:tm_variant_item_0","testmod:tm_variant_item_1"}; //ModelBakery.addVariantName(itemVariant, itemids); model = new ModelResourceLocation("testmod:tm_variant_item_0","inventory"); //mesher.register(itemVariant,0,model); ModelLoader.setCustomModelResourceLocation(itemVariant,0,model); model = new ModelResourceLocation("testmod:tm_variant_item_1","inventory"); //mesher.register(itemVariant,1,model); ModelLoader.setCustomModelResourceLocation(itemVariant,1,model); } } /** --------- ItemSimple.java ---------- **/ package testmod; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; public class ItemSimple extends Item { public ItemSimple() { setCreativeTab(CreativeTabs.tabDecorations); } } /** ----------- ItemVariant.java --------- **/ package testmod; import java.util.List; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class ItemVariant extends Item { public ItemVariant() { setMaxDamage(0); setHasSubtypes(true); setCreativeTab(CreativeTabs.tabDecorations); } public int getMetadata(int damage) { return damage; } @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs tab, List subItems) { ItemStack stack; stack = new ItemStack(item,1,0); subItems.add(stack); stack = new ItemStack(item,1,1); subItems.add(stack); } public String getUnlocalizedName(ItemStack stack) { int metadata = stack.getMetadata(); return super.getUnlocalizedName() + "_"+ metadata; } } Pictures of issues even for this simple mod (1.8 -- Baseline [yellow=simple, green/blue=variant]) http://jwaresoftware.org/files/mcmods/bugs/1.8.9/TestMod_MC1.8_to_MC1.8.9/screenshots/MC1.8%20-%20The%20Items.png[/img] (1.8.9 -- Same thing; not so good) http://jwaresoftware.org/files/mcmods/bugs/1.8.9/TestMod_MC1.8_to_MC1.8.9/screenshots/MC1.8.9%20-%20The%20Items.png[/img] I didn't bother adding a Simple Block as there seemed no point based on previous commenter's advice.
-
To expand -- it's complaining about various items blockstates but all those item models are present (there isn't a single black-n-purple box shown and all items look correct once the game comes up). The usual model file missing errors aren't the ones generated. This seems to be the only symptom of some bigger issue...Are blockstate files required for items now? Or is there a format change or something I've missed? What code would you like to see? There isn't a specific thing that seems to be a problem which is the problem. Forge seems quite silent but there is this weird issue. The library does not complain about missing blocks or bad tile entities or anything. Just loads of model files not found and all of those are present. Everything looks OK on creative tabs and new blocks when placed are also OK. It's just existing blocks in old saves (build 1.8 11.14.3.1450) that are being screwed up. I will post after turning on all of Forge's debugging outside of IDE environment.
-
Any pointers deeply appreciated; I have no clue and am truly stumped. Background: I just started migrating 1.8 mods to 1.8.9 (build 11.15.1.1722). Did a rebuild and fixed compiler issues. NO other changes. Opened an existing 1.8 world for a smoke test. Here are the issues I'm getting (I see no one else referring to these kinds of errors so I'm assuming it's something with my mods): Some blocks (simple blocks, no entities, renderers, etc.) are just GONE (no errors, warnings, etc.) The blocks just aren't where they were in the 1.8 version. Lots of errors from Forge looking for blockstates files for ITEMS (it's like the game as substituted items names(?) for existing blocks). Of course there are no blockstates for these things as they're not blocks. Again no big errors or warnings except for these. Some blocks have been swapped for other blocks, sometimes a vanilla block (eg ice blocks shown in pics below) is where a custom mod block was before! I see this behavior with development IDE saves (Eclipse) as well as standalone games. Old saves and brand new 1.8 saves (just created in 1.8 and re-opened in 1.8.9). Example (snip) FileNotFoundException for items being looked up with blockstates: java.lang.Exception: Could not load model definition for variant vanillafoodpantry:breads#inventory at net.minecraftforge.client.model.ModelLoader.func_177586_a(ModelLoader.java:215) ~[ModelLoader.class:?] at net.minecraftforge.client.model.ModelLoader.loadItems(ModelLoader.java:252) ~[ModelLoader.class:?] at net.minecraftforge.client.model.ModelLoader.func_177570_a(ModelLoader.java:116) ~[ModelLoader.class:?] at net.minecraft.client.resources.model.ModelManager.func_110549_a(ModelManager.java:28) [bou.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.func_110542_a(SimpleReloadableResourceManager.java:120) [bnn.class:?] at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:478) [ave.class:?] at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:329) [ave.class:?] at net.minecraft.client.main.Main.main(SourceFile:124) [Main.class:?] [sNIP...] Caused by: java.lang.RuntimeException: Encountered an exception when loading model definition of model vanillafoodpantry:blockstates/breads.json at net.minecraft.client.resources.model.ModelBakery.func_177586_a(ModelBakery.java:165) ~[bot.class:?] at net.minecraftforge.client.model.ModelLoader.func_177586_a(ModelLoader.java:211) ~[ModelLoader.class:?] ... 21 more Caused by: java.io.FileNotFoundException: vanillafoodpantry:blockstates/breads.json at net.minecraft.client.resources.FallbackResourceManager.func_135056_b(FallbackResourceManager.java:93) ~[bnb.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.func_135056_b(SimpleReloadableResourceManager.java:78) ~[bnn.class:?] at net.minecraft.client.resources.model.ModelBakery.func_177586_a(ModelBakery.java:143) ~[bot.class:?] at net.minecraftforge.client.model.ModelLoader.func_177586_a(ModelLoader.java:211) ~[ModelLoader.class:?] ... 21 more Example pics of weirdness Yeah...those ice blocks shouldn't be there... http://jwaresoftware.org/files/mcmods/bugs/1.8.9/Vanilla_Blocks_Switched_For_Mod_Blocks.png[/img] All kinds of confusion in this one... http://jwaresoftware.org/files/mcmods/bugs/1.8.9/MyFav_CustomHoppers_Switched_For_OtherMod_Blocks.png[/img]
-
[1.8] Trying to Create a Special Drop when Harvesting Leaves
The_Wabbit replied to Entevily's topic in Modder Support
I do something similar (not dropping sticks but a custom item). Here is outline of handler in code that works fine. @SubscribeEvent public void onHarvestDrops(HarvestDropsEvent event) { World world = event.world; if (!world.isRemote && world.getGameRules().getGameRuleBooleanValue("doTileDrops") && !event.isSilkTouching) { Block block = event.state.getBlock(); if (block instanceof BlockLeaves) { //** YOUR CUSTOM DROPS SELECTION CODE GOES HERE **\\ } } }