Posted October 31, 201510 yr Hello everybody, first of all sorry for my bad english, im german . I created a BlockOre that has different states wich have different textures. Heres my Block class: package de.GetDeschmengd.MoreStuffMod.Blocks; import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.util.IStringSerializable; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; public class BlockOres extends Block implements IMetaBlockName{ public static final PropertyEnum TYPE = PropertyEnum.create("type", BlockOres.EnumType.class); protected BlockOres(Material materialIn, String unlocalizedName, String tool, int level, float hardness, float resistance) { super(materialIn); this.setUnlocalizedName(unlocalizedName); this.setHarvestLevel(tool, level); this.setHardness(hardness); this.setResistance(resistance); this.setCreativeTab(CreativeTabs.tabBlock); this.setDefaultState(this.blockState.getBaseState().withProperty(TYPE, EnumType.TIN)); } protected BlockOres(String unlocalizedName, float hardness, float resistance) { this(Material.rock, unlocalizedName, "pickaxe", 1, hardness, resistance); } protected BlockOres(String unlocalizedName) { this(unlocalizedName, 2.0F, 2.0F); } @Override protected BlockState createBlockState() { return new BlockState(this, new IProperty[] {TYPE}); } @Override public IBlockState getStateFromMeta(int meta) { switch(meta){ case 0: return getDefaultState().withProperty(TYPE, EnumType.TIN); case 1: return getDefaultState().withProperty(TYPE, EnumType.COPPER); default: return null; } } @Override public int getMetaFromState(IBlockState state) { EnumType type = (EnumType) state.getValue(TYPE); return type.getMeta(); } @Override public int damageDropped(IBlockState state) { return getMetaFromState(state); } @Override public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) { list.add(new ItemStack(itemIn, 1, EnumType.TIN.getMeta())); list.add(new ItemStack(itemIn, 1, EnumType.COPPER.getMeta())); } public enum EnumType implements IStringSerializable{ TIN(0, "tin"), COPPER(1, "copper"); private int meta; private String name; private EnumType(int meta, String name) { this.meta = meta; this.name = name; } @Override public String getName() { return name; } @Override public String toString() { return getName(); } public int getMeta() { return meta; } } @Override public String getSpecialName(ItemStack stack) { return stack.getItemDamage() == 0 ? "tin" : "copper"; } @Override public ItemStack getPickBlock(MovingObjectPosition target, World world, BlockPos pos) { return new ItemStack(Item.getItemFromBlock(this), 1, this.getMetaFromState(world.getBlockState(pos))); } } With the block class i created a interface that is for getting the unlocalizedname for the items. Interface: package de.GetDeschmengd.MoreStuffMod.Blocks; import net.minecraft.item.ItemStack; public interface IMetaBlockName { String getSpecialName(ItemStack stack); } ItemBlock class: package de.GetDeschmengd.MoreStuffMod.Blocks; import net.minecraft.block.Block; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; public class ItemBlockMeta extends ItemBlock{ public ItemBlockMeta(Block block) { super(block); if(!(block instanceof IMetaBlockName)){ throw new IllegalArgumentException(String.format("The given Block %s is not an instance of ISpecialBlockName!", block.getUnlocalizedName())); } this.setMaxDamage(0); this.setHasSubtypes(true); } @Override public int getMetadata(int damage) { return damage; } @Override public String getUnlocalizedName(ItemStack stack) { return super.getUnlocalizedName(stack) + "." + ((IMetaBlockName)this.block).getSpecialName(stack); } } I registered the block in my CommonProxy: CommonProxy: package de.GetDeschmengd.MoreStuffMod.proxies; import de.GetDeschmengd.MoreStuffMod.Blocks.ModBlocks; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; public class CommonProxy { public void preInit(FMLPreInitializationEvent e){ ModBlocks.init(); ModBlocks.registerBlocks(); } public void init(FMLInitializationEvent e){ } public void postInit(FMLPostInitializationEvent e){ } } ModBlocks class: package de.GetDeschmengd.MoreStuffMod.Blocks; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.item.ItemBlock; import net.minecraftforge.fml.common.registry.GameRegistry; public class ModBlocks { public static Block ores; public static void init(){ ores = new BlockOres("block_ores"); } public static void registerBlocks(){ reg(ores, "block_ores", ItemBlockMeta.class); } public static void reg(Block block, String name, Class<? extends ItemBlock> itemclass){ GameRegistry.registerBlock(block, itemclass, name); } public static void reg(Block block, String name){ GameRegistry.registerBlock(block, name); } } Here is my rendering registry: package de.GetDeschmengd.MoreStuffMod.render.blocks; import de.GetDeschmengd.MoreStuffMod.MoreStuffMod; import de.GetDeschmengd.MoreStuffMod.Blocks.ModBlocks; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.resources.model.ModelBakery; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.item.Item; public class BlockRenderRegister { public static String modid = MoreStuffMod.MODID; public static void preInit() { ModelBakery.addVariantName(Item.getItemFromBlock(ModBlocks.ores), "morestuffmod:block_ores_tin", "morestuffmod:block_ores_copper"); } public static void registerBlockRenderer(){ reg(ModBlocks.ores, 0, "block_ores_tin"); reg(ModBlocks.ores, 1, "block_ores_copper"); } public static void reg(Block block, int meta, String file){ Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block), meta, new ModelResourceLocation(modid + ":" + file)); } public static void reg(Block block, String file){ Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block), 0, new ModelResourceLocation(modid + ":" + file)); } } ClientProxy: package de.GetDeschmengd.MoreStuffMod.proxies; import de.GetDeschmengd.MoreStuffMod.Blocks.ModBlocks; import de.GetDeschmengd.MoreStuffMod.render.blocks.BlockRenderRegister; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; public class ClientProxy extends CommonProxy{ @Override public void preInit(FMLPreInitializationEvent e) { super.preInit(e); BlockRenderRegister.preInit(); } @Override public void init(FMLInitializationEvent e) { super.init(e); BlockRenderRegister.registerBlockRenderer(); } @Override public void postInit(FMLPostInitializationEvent e) { super.postInit(e); } } so here are my jsons: blockstates: { "variants": { "type=tin": { "model":"tutorial:block_ores_tin" }, "type=copper": { "model":"tutorial:block_ores_copper" } } } block (i put only one here because its the same) { "parent":"block/cube_all", "textures": { "all": "morestuffmod:blocks/block_ores_copper" } } item(i also put only one here) { "parent":"morestuffmod:block/block_ores_copper", "display": { "thirdperson": { "rotation": [ 10, -45, 170 ], "translation": [ 0, 1.5, -2.75 ], "scale": [ 0.375, 0.375, 0.375 ] } } } so when i start the game there is no texture not found error or anything but the texture doesnt renderes in item and in block model, when i do f3 it shows that the different states are working, and the unlocalizedname is changed too. heres my console log: [17:59:31] [main/INFO] [GradleStart]: Extra: [] [17:59:31] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --accessToken, {REDACTED}, --assetIndex, 1.8, --assetsDir, C:/Users/jan/.gradle/caches/minecraft/assets, --version, 1.8, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker] [17:59:31] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker [17:59:31] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker [17:59:31] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker [17:59:31] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker [17:59:31] [main/INFO] [FML]: Forge Mod Loader version 8.99.124.1450 for Minecraft 1.8 loading [17:59:31] [main/INFO] [FML]: Java is Java HotSpot 64-Bit Server VM, version 1.7.0_75, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jre7 [17:59:31] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation [17:59:31] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker [17:59:31] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin [17:59:31] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin [17:59:31] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [17:59:31] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker [17:59:31] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker [17:59:31] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [17:59:31] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [17:59:31] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [17:59:32] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work! [17:59:33] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing [17:59:33] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [17:59:33] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker [17:59:33] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker [17:59:33] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker [17:59:33] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker [17:59:33] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main} [17:59:34] [Client thread/INFO]: Setting user: Player164 [17:59:35] [Client thread/INFO]: LWJGL Version: 2.9.1 [17:59:36] [Client thread/INFO] [sTDOUT]: [net.minecraftforge.fml.client.SplashProgress:start:235]: ---- Minecraft Crash Report ---- // You should try our sister game, Minceraft! Time: 31.10.15 17:59 Description: Loading screen debug info This is just a prompt for computer specs to be printed. THIS IS NOT A ERROR A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.8 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.7.0_75, Oracle Corporation Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 750035000 bytes (715 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB) JVM Flags: 4 total; -Xincgc -Xmx1024M -Xms1024M -Xincgc-Xms2048m-Xmx8192m IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: Loaded coremods (and transformers): GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 347.25' Renderer: 'GeForce GTX 750 Ti/PCIe/SSE2' [17:59:36] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization [17:59:36] [Client thread/INFO] [FML]: MinecraftForge v11.14.3.1450 Initialized [17:59:36] [Client thread/INFO] [FML]: Replaced 204 ore recipies [17:59:36] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization [17:59:36] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer [17:59:36] [Client thread/INFO] [FML]: Searching C:\Users\jan\Desktop\MoreStuffMod\eclipse\mods for mods [17:59:37] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load [17:59:37] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, morestuffmod] at CLIENT [17:59:37] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, morestuffmod] at SERVER [17:59:38] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:More Stuff Mod [17:59:38] [Client thread/INFO] [FML]: Processing ObjectHolder annotations [17:59:38] [Client thread/INFO] [FML]: Found 384 ObjectHolder annotations [17:59:38] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations [17:59:38] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations [17:59:38] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0 [17:59:38] [Client thread/INFO] [FML]: Applying holder lookups [17:59:38] [Client thread/INFO] [FML]: Holder lookups applied [17:59:38] [Client thread/INFO] [FML]: Injecting itemstacks [17:59:38] [Client thread/INFO] [FML]: Itemstack injection complete [17:59:38] [sound Library Loader/INFO]: Starting up SoundSystem... [17:59:38] [Thread-9/INFO]: Initializing LWJGL OpenAL [17:59:38] [Thread-9/INFO]: (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) [17:59:38] [Thread-9/INFO]: OpenAL initialized. [17:59:39] [sound Library Loader/INFO]: Sound engine started [17:59:40] [Client thread/INFO]: Created: 512x512 textures-atlas [17:59:41] [Client thread/INFO] [FML]: Injecting itemstacks [17:59:41] [Client thread/INFO] [FML]: Itemstack injection complete [17:59:41] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods [17:59:41] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:More Stuff Mod [17:59:41] [Client thread/INFO]: SoundSystem shutting down... [17:59:41] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com [17:59:41] [sound Library Loader/INFO]: Starting up SoundSystem... [17:59:41] [Thread-11/INFO]: Initializing LWJGL OpenAL [17:59:41] [Thread-11/INFO]: (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) [17:59:41] [Thread-11/INFO]: OpenAL initialized. [17:59:41] [sound Library Loader/INFO]: Sound engine started [17:59:42] [Client thread/INFO]: Created: 512x512 textures-atlas [17:59:45] [server thread/INFO]: Starting integrated minecraft server version 1.8 [17:59:45] [server thread/INFO]: Generating keypair [17:59:45] [server thread/INFO] [FML]: Injecting existing block and item data into this server instance [17:59:45] [server thread/INFO] [FML]: Applying holder lookups [17:59:45] [server thread/INFO] [FML]: Holder lookups applied [17:59:45] [server thread/INFO] [FML]: Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@407d4f15) [17:59:45] [server thread/INFO] [FML]: Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@407d4f15) [17:59:45] [server thread/INFO] [FML]: Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@407d4f15) [17:59:45] [server thread/INFO]: Preparing start region for level 0 [17:59:46] [server thread/INFO]: Changing view distance to 12, from 10 [17:59:47] [Netty Local Client IO #0/INFO] [FML]: Server protocol version 2 [17:59:47] [Netty Server IO #1/INFO] [FML]: Client protocol version 2 [17:59:47] [Netty Server IO #1/INFO] [FML]: Client attempting to join with 4 mods : [email protected],[email protected],[email protected],[email protected] [17:59:47] [Netty Local Client IO #0/INFO] [FML]: [Netty Local Client IO #0] Client side modded connection established [17:59:47] [server thread/INFO] [FML]: [server thread] Server side modded connection established [17:59:48] [server thread/INFO]: Player164[local:E:fd959f3d] logged in with entity id 342 at (86.47497414097981, 64.0, 263.60661614473514) [17:59:48] [server thread/INFO]: Player164 joined the game [17:59:48] [pool-2-thread-1/WARN]: Couldn't look up profile properties for com.mojang.authlib.GameProfile@7bd5a763[id=efc72414-2867-3716-86bc-fef5a53d913b,name=Player164,properties={},legacy=false] com.mojang.authlib.exceptions.AuthenticationException: The client has sent too many requests within a certain amount of time at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:65) ~[YggdrasilAuthenticationService.class:?] at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillGameProfile(YggdrasilMinecraftSessionService.java:158) [YggdrasilMinecraftSessionService.class:?] at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:53) [YggdrasilMinecraftSessionService$1.class:?] at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:50) [YggdrasilMinecraftSessionService$1.class:?] at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524) [guava-17.0.jar:?] at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317) [guava-17.0.jar:?] at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280) [guava-17.0.jar:?] at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195) [guava-17.0.jar:?] at com.google.common.cache.LocalCache.get(LocalCache.java:3934) [guava-17.0.jar:?] at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938) [guava-17.0.jar:?] at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821) [guava-17.0.jar:?] at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4827) [guava-17.0.jar:?] at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillProfileProperties(YggdrasilMinecraftSessionService.java:148) [YggdrasilMinecraftSessionService.class:?] at net.minecraft.client.resources.SkinManager$3.run(SkinManager.java:138) [skinManager$3.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.7.0_75] at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.7.0_75] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.7.0_75] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.7.0_75] at java.lang.Thread.run(Unknown Source) [?:1.7.0_75] [21:33:45] [server thread/INFO]: Saving and pausing game... [21:33:45] [server thread/INFO]: Saving chunks for level 'New World'/Overworld [21:33:45] [server thread/INFO]: Saving chunks for level 'New World'/Nether [21:33:45] [server thread/INFO]: Saving chunks for level 'New World'/The End [21:33:46] [Client thread/INFO]: Stopping! [21:33:46] [Client thread/INFO]: SoundSystem shutting down... [21:33:46] [server thread/INFO]: Stopping server [21:33:46] [server thread/INFO]: Saving players [21:33:46] [server thread/INFO]: Saving worlds [21:33:46] [server thread/INFO]: Saving chunks for level 'New World'/Overworld [21:33:46] [server thread/INFO]: Saving chunks for level 'New World'/Nether [21:33:46] [server thread/INFO]: Saving chunks for level 'New World'/The End [21:33:46] [server thread/INFO] [FML]: Unloading dimension 0 [21:33:46] [server thread/INFO] [FML]: Unloading dimension -1 [21:33:46] [server thread/INFO] [FML]: Unloading dimension 1 [21:33:46] [server thread/INFO] [FML]: Applying holder lookups [21:33:46] [server thread/INFO] [FML]: Holder lookups applied [21:33:46] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com Picked up _JAVA_OPTIONS: -Xincgc-Xms2048m-Xmx8192m thanks for helping
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.