[Forge 1492] TileEntitySpecialRenderer (Texture)
-
Supprime ton ```java
@SideOnly(Side.CLIENT) -
ça ne change absolument rien
-
Ta classe TileEntityLanternSpecialRender doit être bonne maintenant , si tu veut vérifier il n’y a aucun SideOnly dans le tutoriel ^^
http://www.minecraftforgefrance.fr/showthread.php?tid=1509
Sinon ca doit être dans une autre classe , envoie celle du bloc et du ClientProxy.
-
Class Block :
package com.SpyMan.TinkerCraft.Blocks.Lantern; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import org.lwjgl.opengl.GL11; import com.SpyMan.TinkerCraft.MainClass; import com.SpyMan.TinkerCraft.proxy.ClientProxy; public class Lantern extends Block { public Lantern(Material lantern) { super(lantern); setResistance(1.0F); setLightLevel(1.0F); setHardness(0.0F); } public boolean isOpaqueCube() { return false; } public boolean setTranslucent() { return true; } public boolean renderAsNormalBlock() { return false; } public int getRenderType() { return ClientProxy.tesrRenderId; } public TileEntity createTileEntity(World world, int metadata) { return new TileLantern(); } public boolean hasTileEntity(int metadata) { return true; } public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { if (block == MainClass.lantern && metadata == 0) { GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); GL11.glTranslatef(0.0F, -1.0F, 0.0F); Minecraft.getMinecraft().getTextureManager().bindTexture(TileEntityLanternSpecialRenderer.lanternTexture); TileEntityLanternSpecialRenderer.modelLantern.renderAll(); GL11.glPopMatrix(); } } public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) { this.setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.625F, 0.75F); } }Class ClientProxy :
package com.SpyMan.TinkerCraft.proxy; import com.SpyMan.TinkerCraft.Blocks.Lantern.TESRInventoryRenderer; import com.SpyMan.TinkerCraft.Blocks.Lantern.TileEntityLanternSpecialRenderer; import com.SpyMan.TinkerCraft.Blocks.Lantern.TileLantern; import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.client.registry.RenderingRegistry; public class ClientProxy extends CommonProxy { public static int tesrRenderId; @Override public void registerRender() { ClientRegistry.bindTileEntitySpecialRenderer(TileLantern.class, new TileEntityLanternSpecialRenderer()); tesrRenderId = RenderingRegistry.getNextAvailableRenderId(); RenderingRegistry.registerBlockHandler(new TESRInventoryRenderer()); } } -
Déjà , ```java
public void renderInventoryBlock(Block block, int metadata, int modelId,
RenderBlocks renderer)
{
if (block == MainClass.lantern && metadata == 0)
{
GL11.glPushMatrix();
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
GL11.glTranslatef(0.0F, -1.0F, 0.0F);
Minecraft.getMinecraft().getTextureManager().bindTexture(TileEntityLanternSpecialRenderer.lanternTexture);
TileEntityLanternSpecialRenderer.modelLantern.renderAll();
GL11.glPopMatrix();
}
}Ne dois pas se trouver dans la classe du bloc mais dans le TESRInventoryRenderer.. -
oui, mais ça ne résoud pas mon problème.
-
Recommence le tutoriel et lit de A à Z , car il semble y avoir plusieurs erreurs dans ton codes déjà , re-vérifie et corrige et si ça ne marche toujours pas reviens posté un message

-
Rajoute des logs pour savoir si ta méthode est appelée
-
laquelles methode… ???
-
renderTileEntityTileLanternAt
-
J’ai fait un System.out.println(“Test”) mais je n’est pas le message dans les logs
[22:19:39] [main/INFO] [GradleStart]: Extra: []
[22:19:39] [main/INFO] [GradleStart]: Running with arguments: [–userProperties, {}, --assetsDir, C:/Users/Family/.gradle/caches/minecraft/assets, --assetIndex, 1.7.10, --accessToken, {REDACTED}, --version, 1.7.10, --tweakClass, cpw.mods.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
[22:19:39] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker
[22:19:39] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker
[22:19:39] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
[22:19:39] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker
[22:19:40] [main/INFO] [FML]: Forge Mod Loader version 7.99.30.1492 for Minecraft 1.7.10 loading
[22:19:40] [main/INFO] [FML]: Java is Java HotSpot
64-Bit Server VM, version 1.8.0_60, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jre1.8.0_60
[22:19:40] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[22:19:40] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker
[22:19:40] [main/INFO] [GradleStart]: Injecting location in coremod cpw.mods.fml.relauncher.FMLCorePlugin
[22:19:40] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
[22:19:40] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[22:19:40] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker
[22:19:40] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[22:19:40] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[22:19:40] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[22:19:40] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper
[22:19:40] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!
[22:19:47] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
[22:19:47] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper
[22:19:47] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker
[22:19:49] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[22:19:49] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.TerminalTweaker
[22:19:49] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.TerminalTweaker
[22:19:49] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
[22:19:52] [main/INFO]: Setting user: Player161
[22:20:00] [Client thread/INFO]: LWJGL Version: 2.9.1
[22:20:03] [Client thread/INFO] [STDOUT]: [cpw.mods.fml.client.SplashProgress:start:188]: –-- Minecraft Crash Report ----
// On the bright side, I bought you a teddy bear!Time: 25/10/15 22:20
Description: Loading screen debug infoThis 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.7.10
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.8.0_60, Oracle Corporation
Java VM Version: Java HotSpot
64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 946333384 bytes (902 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML:
GL info: ’ Vendor: ‘Intel’ Version: ‘2.1.0 - Build 8.15.10.2302’ Renderer: ‘Mobile Intel
4 Series Express Chipset Family’
[22:20:05] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization
[22:20:05] [Client thread/INFO] [FML]: MinecraftForge v10.13.4.1492 Initialized
[22:20:05] [Client thread/INFO] [FML]: Replaced 183 ore recipies
[22:20:06] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization
[22:20:07] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer
[22:20:07] [Client thread/INFO] [FML]: Searching C:\Users\Family\Desktop\Java Modding\mods TinkerCraft\eclipse\mods for mods
[22:20:30] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load
[22:20:31] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, TinkerCraft] at CLIENT
[22:20:31] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, TinkerCraft] at SERVER
[22:20:32] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:TinkerCraft
[22:20:32] [Client thread/INFO] [FML]: Processing ObjectHolder annotations
[22:20:32] [Client thread/INFO] [FML]: Found 341 ObjectHolder annotations
[22:20:32] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations
[22:20:32] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations
[22:20:32] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0
[22:20:33] [Client thread/INFO] [FML]: Applying holder lookups
[22:20:33] [Client thread/INFO] [FML]: Holder lookups applied
[22:20:33] [Client thread/INFO] [FML]: Injecting itemstacks
[22:20:33] [Client thread/INFO] [FML]: Itemstack injection complete
[22:20:33] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:
[22:20:33] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Starting up SoundSystem…
[22:20:34] [Thread-8/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Initializing LWJGL OpenAL
[22:20:34] [Thread-8/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org)
[22:20:36] [Thread-8/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: OpenAL initialized.
[22:20:36] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:
[22:20:36] [Sound Library Loader/INFO]: Sound engine started
[22:20:42] [Client thread/INFO]: Created: 16x16 textures/blocks-atlas
[22:20:42] [Client thread/INFO]: Created: 16x16 textures/items-atlas
[22:20:43] [Client thread/INFO] [FML]: Injecting itemstacks
[22:20:43] [Client thread/INFO] [FML]: Itemstack injection complete
[22:20:43] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods
[22:20:43] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:TinkerCraft
[22:20:44] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas
[22:20:44] [Client thread/INFO]: Created: 256x256 textures/items-atlas
[22:20:44] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:
[22:20:44] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: SoundSystem shutting down…
[22:20:45] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:importantMessage:90]: Author: Paul Lamb, www.paulscode.com
[22:20:45] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:
[22:20:45] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:
[22:20:45] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Starting up SoundSystem…
[22:20:46] [Thread-10/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Initializing LWJGL OpenAL
[22:20:46] [Thread-10/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org)
[22:20:47] [Thread-10/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: OpenAL initialized.
[22:20:47] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:
[22:20:47] [Sound Library Loader/INFO]: Sound engine started
[22:21:54] [Client thread/INFO]: Stopping!
[22:21:54] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:
[22:21:54] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: SoundSystem shutting down…
[22:21:55] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:importantMessage:90]: Author: Paul Lamb, www.paulscode.com
[22:21:55] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:
Java HotSpot
64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release -
Regarde donc si ton TESR est enregistré (toujours en mettant des logs), si la méthode renderTileEntityAt est appelée etc et remonte jusqu’au problème
-
je comprend pas car mon model 3D fonctionne, il est rendu en jeux sauf la texture
-
Ton model n’est pas rendu si ta méthode n’est pas appelée
-
ba en jeux il est rendu apres peut etre que le System.out.println ne sais pas affiché.
Il y a que la texture qui n’est pas rendu en jeux c’est ca mon gros problèmeholala j’y comprend plus rien

-
Le code pour le rendu dans l’inventaire n’est pas au bon endroit. Vérifies aussi que ton tile entity est bien enregistré.
-
oui mon TileEntity est bien enregistrer dans ma class principale
-
J’ai suivi de nouveau le tuto du forum entier, ca ne foncionne toujours pas.
J’ai que mon model tesr qui est rendu et pas la texture.Cella peut-il est du a la version de forge que j’utilise ?(Forge 1492)
-
Envoi :
- classe principale
- client proxy
- TESR
- block
-
Class Princ. :
package com.SpyMan.TinkerCraft; import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; import net.minecraft.util.ResourceLocation; import net.minecraftforge.oredict.OreDictionary; import com.SpyMan.TinkerCraft.Blocks.Lantern.Lantern; import com.SpyMan.TinkerCraft.Blocks.Lantern.TileLantern; import com.SpyMan.TinkerCraft.Items.DiamAxeHead; import com.SpyMan.TinkerCraft.Items.DiamPickHead; import com.SpyMan.TinkerCraft.Items.DiamShovelHead; import com.SpyMan.TinkerCraft.Items.GoldAxeHead; import com.SpyMan.TinkerCraft.Items.GoldPickHead; import com.SpyMan.TinkerCraft.Items.GoldShovelHead; import com.SpyMan.TinkerCraft.Items.IronAxeHead; import com.SpyMan.TinkerCraft.Items.IronPickHead; import com.SpyMan.TinkerCraft.Items.IronShovelHead; import com.SpyMan.TinkerCraft.Items.StoneAxeHead; import com.SpyMan.TinkerCraft.Items.StonePickHead; import com.SpyMan.TinkerCraft.Items.StoneShovelHead; import com.SpyMan.TinkerCraft.Items.WoodAxeHead; import com.SpyMan.TinkerCraft.Items.WoodPickHead; import com.SpyMan.TinkerCraft.Items.WoodShovelHead; import com.SpyMan.TinkerCraft.ItemsTools.DiamChisel; import com.SpyMan.TinkerCraft.ItemsTools.DiamHammer; import com.SpyMan.TinkerCraft.ItemsTools.DiamSaw; import com.SpyMan.TinkerCraft.ItemsTools.IronChisel; import com.SpyMan.TinkerCraft.ItemsTools.IronHammer; import com.SpyMan.TinkerCraft.ItemsTools.IronSaw; import com.SpyMan.TinkerCraft.ItemsTools.StoneChisel; import com.SpyMan.TinkerCraft.ItemsTools.StoneHammer; import com.SpyMan.TinkerCraft.ItemsTools.StoneSaw; import com.SpyMan.TinkerCraft.ItemsTools.WoodSaw; import com.SpyMan.TinkerCraft.ItemsTools.Wrench; import com.SpyMan.TinkerCraft.proxy.CommonProxy; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = "TinkerCraft", name = "TinkerCraft", version = "1.0.0") public class MainClass { @Instance("TinkerCraft") public static MainClass instance; @SidedProxy(clientSide = "com.SpyMan.TinkerCraft.proxy.ClientProxy", serverSide = "com.SpyMan.TinkerCraft.proxy.CommonProxy") public static CommonProxy proxy; public static final String MODID = "TinkerCraft"; public static final String VERSION = "1.0"; /* CreativeTabs */ public static CreativeTabs modTab = new mTab("mTab"); /* Blocks */ public static Block lantern; /* Items */ public static Item not_available; /* Items Tools */ public static Item ironHammer, diamHammer, stoneSaw, stoneHammer, wrench, woodSaw, ironSaw, diamSaw; public static Item stoneChisel, ironChisel, diamChisel; /* Tools Parts */ public static Item woodPickHead, stonePickHead, goldPickHead, ironPickHead, diamPickHead; public static Item woodShovelHead, stoneShovelHead, goldShovelHead, ironShovelHead, diamShovelHead; public static Item woodAxeHead, stoneAxeHead, goldAxeHead, ironAxeHead, diamAxeHead; /* Remove Recipes */ public static void removeRecipe(ItemStack stack) { List <irecipe>recipeList = CraftingManager.getInstance().getRecipeList(); for(int i = 0; i < recipeList.size(); i++) { ItemStack output = recipeList.get(i).getRecipeOutput(); if(output != null && stack.getItem() == output.getItem() && stack.getItemDamage() == output.getItemDamage()) { recipeList.remove(i); } } } @EventHandler public void preInit(FMLPreInitializationEvent event) { /* -=[ Block Lantern ]=- */ lantern = new Lantern().setBlockName("lantern").setCreativeTab(modTab).setBlockTextureName(MODID+":lantern"); /* -=[ Items ]=- */ ironHammer = new IronHammer().setUnlocalizedName("ironHammer").setTextureName(MODID+":ironHammer").setCreativeTab(modTab); diamHammer = new DiamHammer().setUnlocalizedName("diamHammer").setTextureName(MODID+":diamHammer").setCreativeTab(modTab); stoneHammer = new StoneHammer().setUnlocalizedName("stoneHammer").setTextureName(MODID+":stoneHammer").setCreativeTab(modTab); wrench = new Wrench().setUnlocalizedName("Wrench").setTextureName(MODID+":wrench").setCreativeTab(modTab); woodSaw = new WoodSaw().setUnlocalizedName("woodSaw").setTextureName(MODID+":woodSaw").setCreativeTab(modTab); ironSaw = new IronSaw().setUnlocalizedName("ironSaw").setTextureName(MODID+":ironSaw").setCreativeTab(modTab); diamSaw = new DiamSaw().setUnlocalizedName("diamSaw").setTextureName(MODID+":diamSaw").setCreativeTab(modTab); stoneSaw = new StoneSaw().setUnlocalizedName("stoneSaw").setTextureName(MODID+":stoneSaw").setCreativeTab(modTab); stoneChisel = new StoneChisel().setUnlocalizedName("stoneChisel").setTextureName(MODID+":stoneChisel").setCreativeTab(modTab); diamChisel = new DiamChisel().setUnlocalizedName("diamChisel").setTextureName(MODID+":diamChisel").setCreativeTab(modTab); ironChisel = new IronChisel().setUnlocalizedName("ironChisel").setTextureName(MODID+":ironChisel").setCreativeTab(modTab); woodPickHead = new WoodPickHead().setUnlocalizedName("woodPickHead").setTextureName(MODID+":woodPickHead").setCreativeTab(modTab); stonePickHead = new StonePickHead().setUnlocalizedName("stonePickHead").setTextureName(MODID+":stonePickHead").setCreativeTab(modTab); goldPickHead = new GoldPickHead().setUnlocalizedName("goldPickHead").setTextureName(MODID+":goldPickHead").setCreativeTab(modTab); ironPickHead = new IronPickHead().setUnlocalizedName("ironPickHead").setTextureName(MODID+":ironPickHead").setCreativeTab(modTab); diamPickHead = new DiamPickHead().setUnlocalizedName("diamPickHead").setTextureName(MODID+":diamPickHead").setCreativeTab(modTab); woodShovelHead = new WoodShovelHead().setUnlocalizedName("woodShovelHead").setTextureName(MODID+":woodShovelHead").setCreativeTab(modTab); stoneShovelHead = new StoneShovelHead().setUnlocalizedName("stoneShovelHead").setTextureName(MODID+":stoneShovelHead").setCreativeTab(modTab); goldShovelHead = new GoldShovelHead().setUnlocalizedName("goldShovelHead").setTextureName(MODID+":goldShovelHead").setCreativeTab(modTab); ironShovelHead = new IronShovelHead().setUnlocalizedName("ironShovelHead").setTextureName(MODID+":ironShovelHead").setCreativeTab(modTab); diamShovelHead = new DiamShovelHead().setUnlocalizedName("diamShovelHead").setTextureName(MODID+":diamShovelHead").setCreativeTab(modTab); woodAxeHead = new WoodAxeHead().setUnlocalizedName("woodAxeHead").setTextureName(MODID+":woodAxeHead").setCreativeTab(modTab); stoneAxeHead = new StoneAxeHead().setUnlocalizedName("stoneAxeHead").setTextureName(MODID+":stoneAxeHead").setCreativeTab(modTab); goldAxeHead = new GoldAxeHead().setUnlocalizedName("goldAxeHead").setTextureName(MODID+":goldAxeHead").setCreativeTab(modTab); ironAxeHead = new IronAxeHead().setUnlocalizedName("ironAxeHead").setTextureName(MODID+":ironAxeHead").setCreativeTab(modTab); diamAxeHead = new DiamAxeHead().setUnlocalizedName("diamAxeHead").setTextureName(MODID+":diamAxeHead").setCreativeTab(modTab); /* Item Register */ GameRegistry.registerItem(diamAxeHead, "diamAxeHead"); GameRegistry.registerItem(goldAxeHead, "goldAxeHead"); GameRegistry.registerItem(ironAxeHead, "ironAxeHead"); GameRegistry.registerItem(woodAxeHead, "woodAxeHead"); GameRegistry.registerItem(stoneAxeHead, "stoneAxeHead"); GameRegistry.registerItem(diamPickHead, "diamPickHead"); GameRegistry.registerItem(goldPickHead, "goldPickHead"); GameRegistry.registerItem(stonePickHead, "stonePickHead"); GameRegistry.registerItem(woodPickHead, "woodPickHead"); GameRegistry.registerItem(ironPickHead, "ironPickHead"); GameRegistry.registerItem(diamShovelHead, "diamShovelHead"); GameRegistry.registerItem(goldShovelHead, "goldShovelHead"); GameRegistry.registerItem(stoneShovelHead, "stoneShovelHead"); GameRegistry.registerItem(woodShovelHead, "woodShovelHead"); GameRegistry.registerItem(ironShovelHead, "ironShovelHead"); GameRegistry.registerItem(ironSaw, "ironSaw"); GameRegistry.registerItem(woodSaw, "woodSaw"); GameRegistry.registerItem(diamSaw, "diamSaw"); GameRegistry.registerItem(stoneSaw, "stoneSaw"); GameRegistry.registerItem(ironHammer, "ironHammer"); GameRegistry.registerItem(diamHammer, "diamHammer"); GameRegistry.registerItem(stoneHammer, "stoneHammer"); GameRegistry.registerItem(ironChisel, "ironChisel"); GameRegistry.registerItem(diamChisel, "diamChisel"); GameRegistry.registerItem(stoneChisel, "stoneChisel"); GameRegistry.registerItem(wrench, "wrench"); GameRegistry.registerBlock(lantern, "lantern"); GameRegistry.registerTileEntity(TileLantern.class, "TileLantern"); /* Remove Recipes */ removeRecipe(new ItemStack(Items.diamond_pickaxe)); removeRecipe(new ItemStack(Items.diamond_axe)); removeRecipe(new ItemStack(Items.diamond_shovel)); removeRecipe(new ItemStack(Items.iron_pickaxe)); removeRecipe(new ItemStack(Items.iron_axe)); removeRecipe(new ItemStack(Items.iron_shovel)); removeRecipe(new ItemStack(Items.golden_pickaxe)); removeRecipe(new ItemStack(Items.golden_axe)); removeRecipe(new ItemStack(Items.golden_shovel)); removeRecipe(new ItemStack(Items.stone_pickaxe)); removeRecipe(new ItemStack(Items.stone_axe)); removeRecipe(new ItemStack(Items.stone_shovel)); removeRecipe(new ItemStack(Items.wooden_pickaxe)); removeRecipe(new ItemStack(Items.wooden_axe)); removeRecipe(new ItemStack(Items.wooden_shovel)); /* -=[ Recipes ]=- */ /* Recipe Lantern */ // GameRegistry.addRecipe(new ItemStack(lantern, 1, 0), new Object[] // { // "ISI", // "GTG", // "ISI", // 'T', new ItemStack(Blocks.torch, 1, 0), // 'I', new ItemStack(Items.iron_ingot, 1, 0), // 'S', new ItemStack(Blocks.stone, 1, 0), // 'G', new ItemStack(Blocks.glass_pane, 1, 0) // }); /* -=[ Recipes Saws ]=- */ GameRegistry.addRecipe(new ItemStack(woodSaw, 1, 0), new Object[] { "#00", "0#0", "00#", '#', new ItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE) }); GameRegistry.addRecipe(new ItemStack(stoneSaw, 1, 0), new Object[] { "I00", "0I0", "00#", '#', new ItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE), 'I', Blocks.cobblestone }); GameRegistry.addRecipe(new ItemStack(ironSaw, 1, 0), new Object[] { "I00", "0I0", "00#", '#', new ItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE), 'I', Items.iron_ingot }); GameRegistry.addRecipe(new ItemStack(diamSaw, 1, 0), new Object[] { "I00", "0I0", "00#", '#', new ItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE), 'I', Items.diamond }); /* -=[ Recipes Hammers ]=- */ GameRegistry.addRecipe(new ItemStack(stoneHammer, 1, 0), new Object[] { "III", "III", " # ", '#', Items.stick, 'I', Blocks.cobblestone }); GameRegistry.addRecipe(new ItemStack(ironHammer, 1, 0), new Object[] { "III", "III", "0#0", '#', Items.stick, 'I', Items.iron_ingot }); GameRegistry.addRecipe(new ItemStack(diamHammer, 1, 0), new Object[] { "III", "III", "0#0", '#', Items.stick, 'I', Items.diamond }); /* -=[ Recipes Chisels ]=- */ GameRegistry.addRecipe(new ItemStack(ironChisel, 1, 0), new Object[] { "I00", "0I0", "00#", '#', Items.stick, 'I', Items.iron_ingot }); GameRegistry.addRecipe(new ItemStack(diamChisel, 1, 0), new Object[] { "I00", "0I0", "00#", '#', Items.stick, 'I', Items.diamond }); GameRegistry.addRecipe(new ItemStack(stoneChisel, 1, 0), new Object[] { "I00", "0I0", "00#", '#', Items.stick, 'I', Blocks.cobblestone }); /* -=[ Recipes Pickaxes Heads ]=- *//*–------------------------------------*/ GameRegistry.addRecipe(new ItemStack(diamPickHead, 1, 0), new Object[] { "###", "HC0", "000", 'H', new ItemStack(diamHammer, 1, OreDictionary.WILDCARD_VALUE), '#', Items.diamond, 'C', new ItemStack(diamChisel, 1, OreDictionary.WILDCARD_VALUE) }); GameRegistry.addRecipe(new ItemStack(goldPickHead, 1, 0), new Object[] { "###", "HC0", "000", 'H', new ItemStack(ironHammer, 1, OreDictionary.WILDCARD_VALUE), '#', Items.gold_ingot, 'C', new ItemStack(ironChisel, 1, OreDictionary.WILDCARD_VALUE) }); GameRegistry.addRecipe(new ItemStack(ironPickHead, 1, 0), new Object[] { "###", "HC0", "000", 'H', new ItemStack(ironHammer, 1, OreDictionary.WILDCARD_VALUE), '#', Items.iron_ingot, 'C', new ItemStack(ironChisel, 1, OreDictionary.WILDCARD_VALUE) }); GameRegistry.addRecipe(new ItemStack(stonePickHead, 1, 0), new Object[] { "###", "HC0", "000", 'H', new ItemStack(stoneHammer, 1, OreDictionary.WILDCARD_VALUE), '#', Blocks.cobblestone, 'C', new ItemStack(stoneChisel, 1, OreDictionary.WILDCARD_VALUE) }); GameRegistry.addRecipe(new ItemStack(woodPickHead, 1, 0), new Object[] { "###", "S00", "000", 'S', new ItemStack(woodSaw, 1, OreDictionary.WILDCARD_VALUE), '#', new ItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE) }); /* -=[ Recipes Axe Heads ]=- *//*–-----------------------------------------*/ GameRegistry.addRecipe(new ItemStack(diamAxeHead, 1, 0), new Object[] { "0##", "HC#", "000", 'H', new ItemStack(diamHammer, 1, OreDictionary.WILDCARD_VALUE), '#', Items.diamond, 'C', new ItemStack(diamChisel, 1, OreDictionary.WILDCARD_VALUE) }); GameRegistry.addRecipe(new ItemStack(goldAxeHead, 1, 0), new Object[] { "0##", "HC#", "000", 'H', new ItemStack(ironHammer, 1, OreDictionary.WILDCARD_VALUE), '#', Items.gold_ingot, 'C', new ItemStack(ironChisel, 1, OreDictionary.WILDCARD_VALUE) }); GameRegistry.addRecipe(new ItemStack(ironAxeHead, 1, 0), new Object[] { "0##", "HC#", "000", 'H', new ItemStack(ironHammer, 1, OreDictionary.WILDCARD_VALUE), '#', Items.iron_ingot, 'C', new ItemStack(ironChisel, 1, OreDictionary.WILDCARD_VALUE) }); GameRegistry.addRecipe(new ItemStack(stoneAxeHead, 1, 0), new Object[] { "0##", "HC#", "000", 'H', new ItemStack(stoneHammer, 1, OreDictionary.WILDCARD_VALUE), '#', Blocks.cobblestone, 'C', new ItemStack(stoneChisel, 1, OreDictionary.WILDCARD_VALUE) }); GameRegistry.addRecipe(new ItemStack(woodAxeHead, 1, 0), new Object[] { "0##", "S0#", "000", 'S', new ItemStack(woodSaw, 1, OreDictionary.WILDCARD_VALUE), '#', new ItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE) }); /* -=[ Recipes Shovel Heads ]=- *//*–--------------------------------------*/ GameRegistry.addRecipe(new ItemStack(diamShovelHead, 1, 0), new Object[] { "0#0", "HC0", "000", 'H', new ItemStack(diamHammer, 1, OreDictionary.WILDCARD_VALUE), '#', Items.diamond, 'C', new ItemStack(diamChisel, 1, OreDictionary.WILDCARD_VALUE) }); GameRegistry.addRecipe(new ItemStack(goldShovelHead, 1, 0), new Object[] { "0#0", "HC0", "000", 'H', new ItemStack(ironHammer, 1, OreDictionary.WILDCARD_VALUE), '#', Items.gold_ingot, 'C', new ItemStack(ironChisel, 1, OreDictionary.WILDCARD_VALUE) }); GameRegistry.addRecipe(new ItemStack(ironShovelHead, 1, 0), new Object[] { "0#0", "HC0", "000", 'H', new ItemStack(ironHammer, 1, OreDictionary.WILDCARD_VALUE), '#', Items.iron_ingot, 'C', new ItemStack(ironChisel, 1, OreDictionary.WILDCARD_VALUE) }); GameRegistry.addRecipe(new ItemStack(stoneShovelHead, 1, 0), new Object[] { "0#0", "HC0", "000", 'H', new ItemStack(stoneHammer, 1, OreDictionary.WILDCARD_VALUE), '#', Blocks.cobblestone, 'C', new ItemStack(stoneChisel, 1, OreDictionary.WILDCARD_VALUE) }); GameRegistry.addRecipe(new ItemStack(woodShovelHead, 1, 0), new Object[] { "0#0", "S00", "000", 'S', new ItemStack(woodSaw, 1, OreDictionary.WILDCARD_VALUE), '#', new ItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE) }); } public void init(FMLInitializationEvent event) { proxy.registerRender(); } public void postInit(FMLPostInitializationEvent event) { } }TESR :
package com.SpyMan.TinkerCraft.Blocks.Lantern; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import com.SpyMan.TinkerCraft.*; public class TileEntityLanternSpecialRenderer extends TileEntitySpecialRenderer { @SideOnly(Side.CLIENT) public static ModelLantern modelLantern = new ModelLantern(); public static ResourceLocation lanternTexture = new ResourceLocation("TinkerCraft:textures/models/blocks/lantern_model.png"); public TileEntityLanternSpecialRenderer() { this.func_147497_a(TileEntityRendererDispatcher.instance); } private void renderTileEntityTileLanternAt(TileLantern tile, double x, double y, double z, float partialRenderTick) { GL11.glPushMatrix(); GL11.glTranslated(x + 0.5D, y + 1.5D, z + 0.5D); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); this.bindTexture(lanternTexture); modelLantern.renderAll(); GL11.glPopMatrix(); } public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partialRenderTick) { this.renderTileEntityTileLanternAt((TileLantern) tile, x, y, z, partialRenderTick); } }Bloc :
package com.SpyMan.TinkerCraft.Blocks.Lantern; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import org.lwjgl.opengl.GL11; import com.SpyMan.TinkerCraft.proxy.ClientProxy; import com.SpyMan.TinkerCraft.MainClass; public class Lantern extends Block { public Lantern() { super (Material.glass); setResistance(1.0F); setLightLevel(1.0F); setHardness(0.0F); } public boolean isOpaqueCube() { return false; } public boolean setTranslucent() { return true; } public boolean renderAsNormalBlock() { return false; } public int getRenderType() { return ClientProxy.tesrRenderId; } public TileEntity createTileEntity(World world, int metadata) { return new TileLantern(); } public boolean hasTileEntity(int metadata) { return true; } // public void renderInventoryBlock(Block block, int metadata, int modelId, // RenderBlocks renderer) { // if (block == MainClass.lantern && metadata == 0) { // GL11.glPushMatrix(); // GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); // GL11.glTranslatef(0.0F, -1.0F, 0.0F); // Minecraft.getMinecraft().getTextureManager() // .bindTexture(TileEntityLanternSpecialRenderer.texture); // TileEntityLanternSpecialRenderer.modelLantern.renderAll(); // GL11.glPopMatrix(); // } // } public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) { this.setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.625F, 0.75F); } }Client Proxy :
package com.SpyMan.TinkerCraft.proxy; import com.SpyMan.TinkerCraft.Blocks.Lantern.TESRInventoryRenderer; import com.SpyMan.TinkerCraft.Blocks.Lantern.TileEntityLanternSpecialRenderer; import com.SpyMan.TinkerCraft.Blocks.Lantern.TileLantern; import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.client.registry.RenderingRegistry; public class ClientProxy extends CommonProxy { public static int tesrRenderId; @Override public void registerRender() { ClientRegistry.bindTileEntitySpecialRenderer(TileLantern.class, new TileEntityLanternSpecialRenderer()); tesrRenderId = RenderingRegistry.getNextAvailableRenderId(); RenderingRegistry.registerBlockHandler(new TESRInventoryRenderer()); } }TESR inventory :
package com.SpyMan.TinkerCraft.Blocks.Lantern; import org.lwjgl.opengl.GL11; import com.SpyMan.TinkerCraft.MainClass; import com.SpyMan.TinkerCraft.proxy.ClientProxy; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.world.IBlockAccess; public class TESRInventoryRenderer implements ISimpleBlockRenderingHandler { @Override public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { if(block == MainClass.lantern && metadata == 0) { GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); GL11.glTranslatef(0.0F, -1.0F, 0.0F); Minecraft.getMinecraft().getTextureManager().bindTexture(TileEntityLanternSpecialRenderer.lanternTexture); TileEntityLanternSpecialRenderer.modelLantern.renderAll(); GL11.glPopMatrix(); } } @Override public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { return false; } @Override public boolean shouldRender3DInInventory(int modelId) { return true; } @Override public int getRenderId() { return ClientProxy.tesrRenderId; } } ```</irecipe>
