HassanS6000 Posted November 13, 2015 Share Posted November 13, 2015 Hi! Basically, I want to replace snow and ice so they do not melt, and use the substitution alias system to avoid using ASM. I have replaced the ItemBlock and Block here: https://gist.github.com/hsyyid/ae6e14b6128f5aee27d8 but to no avail. Instead of replacing the snow and the ice, it appears that the ItemBlock does nothing when right clicked, and the snow and ice items DO NOT have textures anymore. Any and all help would be greatly appreciated! Quote Link to comment Share on other sites More sharing options...
jabelar Posted November 13, 2015 Share Posted November 13, 2015 How come you don't have @Mod.EventHandler annotation before each of your event handling methods? I think your methods probably aren't being called at all because you don't have the annotation. Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/ Link to comment Share on other sites More sharing options...
HassanS6000 Posted November 13, 2015 Author Share Posted November 13, 2015 No, that's not why. I showed my proxy class whose methods are called by my main class. My main class is the one with the @EventHandler annotations. Quote Link to comment Share on other sites More sharing options...
jabelar Posted November 13, 2015 Share Posted November 13, 2015 Okay. Well anyway you have to resort to standard debugging. Are you sure the method is being called? Use a console statement to confirm it. After that, in the pre-init I think your registry of your blocks and items is wrong -- I don't think you can (or at least I think it is a bad idea) to set the unlocalized name to "minecraft:snow". The "minecraft:" is for vanilla items and it should really have your mod id. After that, are you sure that the instances you are passing have in fact already been constructed (not null). Again use console statement to confirm it. That's the only things I can think of, otherwise it looks pretty simple. Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/ Link to comment Share on other sites More sharing options...
Elix_x Posted November 13, 2015 Share Posted November 13, 2015 Are you sure that you are calling common proxy's init methods from client proxy? That's only thing i can think of for textures. Quote Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones Link to comment Share on other sites More sharing options...
HassanS6000 Posted November 13, 2015 Author Share Posted November 13, 2015 @jabelar @elix Thanks for the suggestions, but neither helped. Quote Link to comment Share on other sites More sharing options...
jabelar Posted November 13, 2015 Share Posted November 13, 2015 Did you trace the execution using debug mode in your IDE? I'd set breakpoints in the code that does the substitution to see if it is properly executing. Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/ Link to comment Share on other sites More sharing options...
ShetiPhian Posted November 23, 2015 Share Posted November 23, 2015 I just re-implemented, or at least attempted to, a block substitution into my mod. The substitution alias does appear to be currently broken. You can't place the block because ItemBlock.placeBlockAt eventually gets to ExtendedBlockStorage.get(int x, int y, int z) and it always returns air. It does that because Block.BLOCK_STATE_IDS.getByValue(#) always returns null. Up until that point it appears to be working. Here is a quick test mod if anyone wants to look into it. With the exception of function names and imports changing, this is the same code works in 1.7 package net.minecraftforge.debug; import net.minecraft.block.Block; import net.minecraft.block.BlockTallGrass; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemColored; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.registry.ExistingSubstitutionException; import net.minecraftforge.fml.common.registry.GameRegistry; @Mod(modid = "substitutionaliastest") public class SubstitutionAliasTest { private Block testBlock; @Mod.EventHandler public void onPreInit(FMLPreInitializationEvent event) { this.testBlock = new TestBlock(); ItemBlock testItemBlock = (new ItemColored(this.testBlock, true)).setSubtypeNames(new String[] { "shrub", "grass", "fern" }); try { GameRegistry.addSubstitutionAlias("minecraft:tallgrass", GameRegistry.Type.BLOCK, this.testBlock); GameRegistry.addSubstitutionAlias("minecraft:tallgrass", GameRegistry.Type.ITEM, testItemBlock); } catch (ExistingSubstitutionException e) { e.printStackTrace(); } } public static class TestBlock extends BlockTallGrass { public TestBlock() { super(); super.setUnlocalizedName("tallgrass"); setHardness(0.0F); setStepSound(soundTypeGrass); setUnlocalizedName("tallgrass"); } } } Quote Link to comment Share on other sites More sharing options...
jabelar Posted November 24, 2015 Share Posted November 24, 2015 You should probably file a bug report ("pull request) to Forge team. This is something that really should work as it is a powerful way to mod. Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/ Link to comment Share on other sites More sharing options...
LexManos Posted November 25, 2015 Share Posted November 25, 2015 it is working, cpws tested it fully. Not sure what the hell you're talking about when it comes to setting the block as you should be able to do that just fine. BLOCK_STATE_IDS will return proper values for the current world respecting aliases. Quote I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon Link to comment Share on other sites More sharing options...
ShetiPhian Posted November 25, 2015 Share Posted November 25, 2015 Well I've tried that test mod I posted again. I've tried registering the alias in PreInit, Init, and PostInit. Every time it the same result. The block is replaced, the F3 screen shows null type: tall_grass before replacement it shows: minefraft:tallgrass type: tall_grass The original item in the creative menu has no texture and can not be placed due to failing Block.BLOCK_STATE_IDS.getByValue(#) If you use pick block, you get an item with correct texture but placing it crashes the game. java.lang.ArrayIndexOutOfBoundsException: -1 at net.minecraft.item.ItemStack.onItemUse(ItemStack.java:151) at net.minecraft.client.multiplayer.PlayerControllerMP.func_178890_a(PlayerControllerMP.java:442) ItemStack.java:151 => playerIn.triggerAchievement(StatList.objectUseStats[item.getIdFromItem(this.item)]); Quote Link to comment Share on other sites More sharing options...
jabelar Posted December 2, 2015 Share Posted December 2, 2015 It looks like they may have made a fix for this in Build 1.8-11.14.3.1559. The changelog says "Fix substitutions for recipes and oredict recipes. Should mean that substitutions start working properly." Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/ Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.