June 25, 20169 yr I'm trying to set up some blocks with differently textured variants. When I try to register a block with an ItemMultiTexture as its ItemBlock, the game crashes with the stacktrace: java.lang.NoSuchMethodException: net.minecraft.item.ItemMultiTexture.<init>(net.minecraft.block.Block, mod.block.PortalFrameBlock, mod.block.VariantBlock$1) at java.lang.Class.getConstructor0(Class.java:3082) ~[?:1.8.0_92] at java.lang.Class.getConstructor(Class.java:1825) ~[?:1.8.0_92] at net.minecraftforge.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:272) [GameRegistry.class:?] at net.minecraftforge.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:239) [GameRegistry.class:?] at mod.block.VariantBlock.<init>(VariantBlock.java:24) [VariantBlock.class:?] at mod.block.PortalFrameBlock.<init>(PortalFrameBlock.java:30) [PortalFrameBlock.class:?] at mod.block.ModBlocks.init(ModBlocks.java:18) [ModBlocks.class:?] at mod.proxy.CommonProxy.preInit(CommonProxy.java:16) [CommonProxy.class:?] at mod.proxy.ClientProxy.preInit(ClientProxy.java:14) [ClientProxy.class:?] at mod.TestMod.preInit(TestMod.java:34) [TestMod.class:?] Context from my code: protected VariantBlock(String name, Material material) { super(material); setUnlocalizedName(name); setRegistryName(name); Function<ItemStack, String> function = new Function<ItemStack, String>() { @Override public String apply(ItemStack input) { return getTypeForMeta(input.getMetadata()).getName(); } }; GameRegistry.registerBlock(this, ItemMultiTexture.class, this, function); } registerBlock() wants me to pass in the constructor arguments for ItemMultiTexture, not the types, but ItemMultiTexture has a (Block, Block, Function<>) constructor, which doesn't match the subtypes produced from the arguments. Is there any way to work around this, or should I just begin porting everything to 1.9.4?
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.