Texture dans TileEntityRender
-
Ok y a plus d’erreur par contre sa me met un NPE Rendering Item quand je vais dans l’inventaire et que sa devrait afficher le bloc
Edit : j’ai désactivé le rendu en main c’est sa qui faisait crash
Time: 29/10/14 20:52 Description: Rendering item java.lang.NullPointerException: Rendering item at com.bowser.robotic.proxy.TileEntityBlockPipeTestSpecialRender.renderTileEntityBlockPipeTestAt(TileEntityBlockPipeTestSpecialRender.java:50) at com.bowser.robotic.proxy.TileEntityBlockPipeTestSpecialRender.renderInventory(TileEntityBlockPipeTestSpecialRender.java:31) at com.bowser.robotic.proxy.TESRInventoryRenderer.renderInventoryBlock(TESRInventoryRenderer.java:54) at cpw.mods.fml.client.registry.RenderingRegistry.renderInventoryBlock(RenderingRegistry.java:125) at net.minecraft.src.FMLRenderAccessLibrary.renderInventoryBlock(FMLRenderAccessLibrary.java:59) at net.minecraft.client.renderer.RenderBlocks.renderBlockAsItem(RenderBlocks.java:8361) at net.minecraft.client.renderer.entity.RenderItem.renderItemIntoGUI(RenderItem.java:463) at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:585) at net.minecraft.client.gui.inventory.GuiContainer.func_146977_a(GuiContainer.java:287) at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:114) at net.minecraft.client.renderer.InventoryEffectRenderer.drawScreen(InventoryEffectRenderer.java:44) at net.minecraft.client.gui.inventory.GuiContainerCreative.drawScreen(GuiContainerCreative.java:673) at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1137) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1056) at net.minecraft.client.Minecraft.run(Minecraft.java:951) at net.minecraft.client.main.Main.main(Main.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at GradleStart.bounce(GradleStart.java:107) at GradleStart.startClient(GradleStart.java:100) at GradleStart.main(GradleStart.java:65) A detailed walkthrough of the error, its code path and all known details is as follows: –------------------------------------------------------------------------------------- -- Head -- Stacktrace: at com.bowser.robotic.proxy.TileEntityBlockPipeTestSpecialRender.renderTileEntityBlockPipeTestAt(TileEntityBlockPipeTestSpecialRender.java:50) at com.bowser.robotic.proxy.TileEntityBlockPipeTestSpecialRender.renderInventory(TileEntityBlockPipeTestSpecialRender.java:31) at com.bowser.robotic.proxy.TESRInventoryRenderer.renderInventoryBlock(TESRInventoryRenderer.java:54) at cpw.mods.fml.client.registry.RenderingRegistry.renderInventoryBlock(RenderingRegistry.java:125) at net.minecraft.src.FMLRenderAccessLibrary.renderInventoryBlock(FMLRenderAccessLibrary.java:59) at net.minecraft.client.renderer.RenderBlocks.renderBlockAsItem(RenderBlocks.java:8361) at net.minecraft.client.renderer.entity.RenderItem.renderItemIntoGUI(RenderItem.java:463) -- Item being rendered -- Details: Item Type: net.minecraft.item.ItemBlock@73bfc16e Item Aux: 0 Item NBT: null Item Foil: false Stacktrace: at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:585) at net.minecraft.client.gui.inventory.GuiContainer.func_146977_a(GuiContainer.java:287) at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:114) at net.minecraft.client.renderer.InventoryEffectRenderer.drawScreen(InventoryEffectRenderer.java:44) at net.minecraft.client.gui.inventory.GuiContainerCreative.drawScreen(GuiContainerCreative.java:673) -- Screen render details -- Details: Screen name: net.minecraft.client.gui.inventory.GuiContainerCreative Mouse location: Scaled: (262, 66). Absolute: (525, 347) Screen size: Scaled: (427, 240). Absolute: (854, 480). Scale factor of 2 -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityClientPlayerMP['Bowser338'/427, l='MpServer', x=-40,07, y=71,62, z=246,79]] Chunk stats: MultiplayerChunkCache: 546, 546 Level seed: 0 Level generator: ID 00 - default, ver 1\. Features enabled: false Level generator options: Level spawn location: World: (-48,64,244), Chunk: (at 0,4,4 in -3,15; contains blocks -48,0,240 to -33,255,255), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511) Level time: 473 game time, 473 day time Level dimension: 0 Level storage version: 0x00000 - Unknown? Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false) Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false Forced entities: 106 total; [EntitySheep['Sheep'/258, l='MpServer', x=16,97, y=68,00, z=248,03], EntitySheep['Sheep'/259, l='MpServer', x=20,66, y=67,00, z=249,63], EntitySheep['Sheep'/257, l='MpServer', x=24,78, y=67,00, z=255,25], EntityCreeper['Creeper'/262, l='MpServer', x=23,00, y=36,00, z=284,50], EntityBat['Bat'/263, l='MpServer', x=27,35, y=35,20, z=281,67], EntitySheep['Sheep'/260, l='MpServer', x=23,16, y=67,00, z=249,19], EntityZombie['Zombie'/261, l='MpServer', x=22,50, y=35,00, z=286,50], EntitySquid['Squid'/266, l='MpServer', x=17,50, y=56,75, z=278,50], EntitySquid['Squid'/264, l='MpServer', x=18,50, y=57,00, z=285,13], EntitySquid['Squid'/265, l='MpServer', x=20,69, y=56,00, z=284,06], EntitySquid['Squid'/268, l='MpServer', x=19,50, y=56,22, z=289,88], EntityZombie['Zombie'/294, l='MpServer', x=38,31, y=27,00, z=288,41], EntitySkeleton['Skeleton'/620, l='MpServer', x=-95,50, y=52,00, z=208,50], EntitySkeleton['Skeleton'/85, l='MpServer', x=-119,28, y=15,17, z=221,09], EntitySkeleton['Skeleton'/84, l='MpServer', x=-116,59, y=14,00, z=211,91], EntityZombie['Zombie'/87, l='MpServer', x=-119,22, y=15,00, z=219,91], EntitySpider['Spider'/86, l='MpServer', x=-119,28, y=15,00, z=221,09], EntitySkeleton['Skeleton'/83, l='MpServer', x=-121,10, y=15,00, z=223,40], EntitySkeleton['Skeleton'/82, l='MpServer', x=-118,44, y=14,00, z=212,44], EntityZombie['Zombie'/92, l='MpServer', x=-117,34, y=45,00, z=295,99], EntityZombie['Zombie'/91, l='MpServer', x=-117,47, y=14,00, z=296,66], EntityZombie['Zombie'/90, l='MpServer', x=-117,50, y=15,00, z=299,50], EntitySquid['Squid'/102, l='MpServer', x=-97,06, y=59,00, z=203,22], EntitySquid['Squid'/103, l='MpServer', x=-95,50, y=59,00, z=205,50], EntitySquid['Squid'/100, l='MpServer', x=-100,50, y=60,34, z=202,50], EntitySquid['Squid'/101, l='MpServer', x=-98,25, y=61,38, z=198,91], EntitySkeleton['Skeleton'/98, l='MpServer', x=-102,44, y=29,00, z=192,96], EntityCreeper['Creeper'/99, l='MpServer', x=-103,00, y=28,00, z=199,41], EntityCreeper['Creeper'/97, l='MpServer', x=-96,38, y=26,00, z=175,03], EntityPig['Pig'/110, l='MpServer', x=-106,53, y=116,00, z=250,56], EntityPig['Pig'/111, l='MpServer', x=-111,47, y=112,00, z=248,53], EntityPig['Pig'/108, l='MpServer', x=-105,59, y=116,00, z=252,03], EntityPig['Pig'/109, l='MpServer', x=-105,50, y=117,00, z=254,50], EntitySquid['Squid'/106, l='MpServer', x=-97,69, y=59,00, z=204,84], EntitySquid['Squid'/107, l='MpServer', x=-97,81, y=60,31, z=208,50], EntitySquid['Squid'/104, l='MpServer', x=-105,50, y=60,38, z=211,13], EntitySquid['Squid'/105, l='MpServer', x=-95,50, y=62,34, z=209,50], EntityBat['Bat'/115, l='MpServer', x=-95,75, y=24,61, z=293,50], EntityBat['Bat'/114, l='MpServer', x=-106,92, y=25,00, z=288,35], EntityBat['Bat'/113, l='MpServer', x=-100,32, y=24,31, z=290,58], EntityCreeper['Creeper'/112, l='MpServer', x=-111,56, y=13,00, z=301,16], EntitySkeleton['Skeleton'/127, l='MpServer', x=-95,50, y=14,00, z=198,50], EntityCreeper['Creeper'/126, l='MpServer', x=-89,94, y=14,00, z=203,34], EntityEnderman['Enderman'/125, l='MpServer', x=-84,47, y=35,00, z=191,66], EntitySkeleton['Skeleton'/124, l='MpServer', x=-95,13, y=30,00, z=188,47], EntitySheep['Sheep'/136, l='MpServer', x=-82,66, y=66,10, z=171,56], EntityBat['Bat'/139, l='MpServer', x=-63,49, y=35,49, z=182,42], EntityBat['Bat'/138, l='MpServer', x=-66,25, y=33,40, z=179,63], EntityBat['Bat'/141, l='MpServer', x=-68,89, y=23,73, z=186,68], EntityWitch['Witch'/140, l='MpServer', x=-70,50, y=24,00, z=202,91], EntitySkeleton['Skeleton'/143, l='MpServer', x=-79,50, y=17,00, z=220,50], EntityBat['Bat'/142, l='MpServer', x=-65,42, y=19,40, z=193,55], EntityCreeper['Creeper'/128, l='MpServer', x=-89,50, y=37,00, z=260,50], EntityCreeper['Creeper'/134, l='MpServer', x=-69,44, y=23,00, z=174,06], EntitySheep['Sheep'/158, l='MpServer', x=-49,13, y=67,00, z=170,56], EntityZombie['Zombie'/159, l='MpServer', x=-51,47, y=34,00, z=178,94], EntityCreeper['Creeper'/144, l='MpServer', x=-65,53, y=27,00, z=212,72], EntityZombie['Zombie'/145, l='MpServer', x=-70,66, y=25,00, z=210,75], EntityCreeper['Creeper'/146, l='MpServer', x=-69,38, y=25,00, z=210,56], EntitySheep['Sheep'/171, l='MpServer', x=-32,50, y=68,00, z=190,84], EntitySheep['Sheep'/170, l='MpServer', x=-34,19, y=68,00, z=191,50], EntitySheep['Sheep'/169, l='MpServer', x=-38,50, y=67,00, z=181,09], EntitySheep['Sheep'/168, l='MpServer', x=-41,50, y=67,00, z=172,50], EntitySheep['Sheep'/175, l='MpServer', x=-33,03, y=65,00, z=278,09], EntityZombie['Zombie'/174, l='MpServer', x=-38,85, y=20,00, z=199,46], EntityZombie['Zombie'/173, l='MpServer', x=-40,69, y=19,00, z=201,47], EntityZombie['Zombie'/172, l='MpServer', x=-36,09, y=19,00, z=199,00], EntitySpider['Spider'/163, l='MpServer', x=-61,57, y=31,00, z=196,93], EntityCreeper['Creeper'/162, l='MpServer', x=-54,97, y=25,00, z=204,53], EntityBat['Bat'/161, l='MpServer', x=-63,41, y=35,83, z=182,08], EntityBat['Bat'/160, l='MpServer', x=-49,43, y=41,14, z=186,39], EntitySheep['Sheep'/167, l='MpServer', x=-41,22, y=67,00, z=168,22], EntityZombie['Zombie'/166, l='MpServer', x=-57,50, y=28,00, z=306,50], EntitySkeleton['Skeleton'/165, l='MpServer', x=-55,50, y=27,00, z=305,50], EntitySkeleton['Skeleton'/164, l='MpServer', x=-59,50, y=32,00, z=192,50], EntityCreeper['Creeper'/184, l='MpServer', x=-41,09, y=24,00, z=321,50], EntitySheep['Sheep'/190, l='MpServer', x=-24,22, y=69,00, z=220,47], EntitySheep['Sheep'/191, l='MpServer', x=-25,81, y=69,00, z=219,22], EntityClientPlayerMP['Bowser338'/427, l='MpServer', x=-40,07, y=71,62, z=246,79], EntitySheep['Sheep'/189, l='MpServer', x=-31,25, y=68,00, z=190,38], EntitySkeleton['Skeleton'/178, l='MpServer', x=-37,88, y=24,00, z=311,50], EntityItem['item.tile.doublePlant.syringa'/179, l='MpServer', x=-42,97, y=67,13, z=310,91], EntityCreeper['Creeper'/176, l='MpServer', x=-39,50, y=24,00, z=317,50], EntitySkeleton['Skeleton'/177, l='MpServer', x=-38,50, y=23,00, z=316,06], EntityCreeper['Creeper'/182, l='MpServer', x=-43,63, y=25,00, z=324,28], EntityCreeper['Creeper'/180, l='MpServer', x=-40,30, y=25,69, z=323,47], EntityCreeper['Creeper'/181, l='MpServer', x=-40,31, y=24,00, z=322,03], EntitySheep['Sheep'/207, l='MpServer', x=-8,22, y=69,00, z=258,50], EntitySheep['Sheep'/206, l='MpServer', x=-9,72, y=70,00, z=252,22], EntityHorse['Horse'/197, l='MpServer', x=-29,50, y=63,00, z=288,19], EntityHorse['Horse'/196, l='MpServer', x=-30,87, y=64,00, z=285,13], EntitySkeleton['Skeleton'/193, l='MpServer', x=-20,44, y=22,00, z=223,94], EntitySheep['Sheep'/192, l='MpServer', x=-26,69, y=69,00, z=217,25], EntitySheep['Sheep'/195, l='MpServer', x=-26,19, y=70,00, z=224,84], EntityCreeper['Creeper'/194, l='MpServer', x=-18,69, y=22,00, z=227,97], EntitySheep['Sheep'/208, l='MpServer', x=-9,47, y=69,00, z=258,47], EntitySheep['Sheep'/209, l='MpServer', x=-10,50, y=69,00, z=259,53], EntitySheep['Sheep'/210, l='MpServer', x=-0,78, y=66,00, z=298,28], EntitySheep['Sheep'/211, l='MpServer', x=-0,09, y=64,00, z=295,03], EntityCreeper['Creeper'/248, l='MpServer', x=17,28, y=13,00, z=308,91], EntitySheep['Sheep'/249, l='MpServer', x=3,84, y=67,00, z=307,44], EntitySheep['Sheep'/246, l='MpServer', x=7,88, y=64,00, z=300,53], EntitySheep['Sheep'/244, l='MpServer', x=12,45, y=73,75, z=235,47], EntitySheep['Sheep'/245, l='MpServer', x=10,53, y=70,00, z=245,53], EntitySheep['Sheep'/242, l='MpServer', x=7,47, y=70,00, z=244,84], EntitySheep['Sheep'/243, l='MpServer', x=9,47, y=70,00, z=245,53]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:415) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2555) at net.minecraft.client.Minecraft.run(Minecraft.java:973) at net.minecraft.client.main.Main.main(Main.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at GradleStart.bounce(GradleStart.java:107) at GradleStart.startClient(GradleStart.java:100) at GradleStart.main(GradleStart.java:65) – System Details -- Details: Minecraft Version: 1.7.10 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.7.0_51, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 637041888 bytes (607 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 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: 12, tallocated: 94 FML: MCP v9.05 FML v7.10.85.1231 Minecraft Forge 10.13.2.1231 4 mods loaded, 4 mods active mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available FML{7.10.85.1231} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.2.1231.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Forge{10.13.2.1231} [Minecraft Forge] (forgeSrc-1.7.10-10.13.2.1231.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available roboticmod{1.0.0} [Robotic Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Launched Version: 1.7.10 LWJGL: 2.9.1 OpenGL: GeForce GTX 770/PCIe/SSE2 GL version 4.4.0, NVIDIA Corporation GL Caps: Using GL 1.3 multitexturing. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Anisotropic filtering is supported and maximum anisotropy is 16. Shaders are available because OpenGL 2.1 is supported. Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Resource Packs: [] Current Language: English (US) Profiler Position: N/A (disabled) Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Anisotropic Filtering: Off (1) [20:52:54] [Server thread/INFO] [FML]: Holder lookups applied [20:52:54] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:398]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\Alexandre\Desktop\Ressources\Robotic Mod\forge-1.7.10\eclipse\.\crash-reports\crash-2014-10-29_20.52.54-client.txt [20:52:54] [Client thread/INFO] [FML]: Waiting for the server to terminate/save. [20:52:54] [Client thread/INFO] [FML]: Server terminated.En tout cas merci de votre patience
-
tile est null dans le cas du rendu dans l’inventaire, il faudrait que tu sépare la partie inventaire et monde.
-
Ok mais je pense me contenter d’une texture de tuyau par contre j’ai l’impression qu’il s’en fou completement de ma condition
ou plutot qu’il ne detecte jamais le bloc meme si il y en a un car il rends toujours le shape central -
Ok merci mais je pense que je vais me contenter d’une simple texture pour le tuyaux en main
Par contre sa n’a pas l’air de marcher l’affichage des differentes shapes il m’affiche toujours le shape central peut importe les bloc qu’il y a autour je viens de penser il ne faudrait pas actualiser le rendu pour qu’il prenne en compte l’ajout d’un autre bloc a coté ?
-
Non, le rendu TESR sont mit à jour à chaque tick, c’est écrit dans le tutoriel.
C’est sûrement tes conditions qui ne sont pas bonne. -
j’ai mis sa pour tester
public void render(float f, World world, int x, int y, int z) { if(world.getBlock(x,y-1,z) == Robotic.pipetest) { Shape1.render(f); } else { Shape4.render(f); } -
shape4 c’est le centre ?
Perso j’aurai plutôt mit les conditions dans le rendu plutôt que dans le modèle. -
Oui Shape4 c’est le centre
sa change quelque chose si c’est dans le rendu plutot que dans le modèle ? a par de la lisibilité
-
Non, je ne crois pas que ça change autre chose que la lisibilité.
Et donc ton problème c’est qu’il rend toujours le shape4 et jamais le Shape1 ?
-
Oui comme si que la condition n’etait jamais remplie
-
Tu as bien placé le bloc en dessous ?
-
Oui j’ai placer un block de pipe en dessous et sa change rien
-
Étrange tout ça, tu peux m’envoyer tout ton code ? je vais regarder quand j’aurai le temps.
-
TileEntitySpecialRender :
package com.bowser.robotic.proxy; 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 net.minecraft.world.World; import org.lwjgl.opengl.GL11; import com.bowser.robotic.client.IInventoryRenderer; import com.bowser.robotic.common.Robotic; import com.bowser.robotic.common.TileEntityBlockPipeTest; import com.bowser.robotic.common.TileEntityFourArc; import com.bowser.robotic.common.techne.FourArc; import com.bowser.robotic.common.techne.Pipe; public class TileEntityBlockPipeTestSpecialRender extends TileEntitySpecialRenderer implements IInventoryRenderer { private final Pipe model = new Pipe(); public static final ResourceLocation textureLocation = new ResourceLocation(Robotic.modid, "textures/blocks/pipetest.png"); public TileEntityBlockPipeTestSpecialRender() { this.func_147497_a(TileEntityRendererDispatcher.instance); } @Override public void renderInventory(double x, double y, double z) { this.renderTileEntityBlockPipeTestAt(null, x, y, z, 0.0F); } @Override public void renderTileEntityAt(TileEntity te, double x, double y, double z, float f) { this.renderTileEntityBlockPipeTestAt((TileEntityBlockPipeTest)te, x, y, z, f); } public void renderTileEntityBlockPipeTestAt(TileEntityBlockPipeTest te, double x, double y, double z, float f) { GL11.glPushMatrix(); GL11.glTranslated(x + 0.5F, y + 1.5F, z + 0.5F); this.bindTexture(textureLocation); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); if(te!= null) { this.model.core(0.0625F, te.getWorldObj(), (int)x, (int)y, (int)z); } GL11.glPopMatrix(); } }la classe du bloc :
package com.bowser.robotic.common; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; public class BlockPipeTest extends Block { protected BlockPipeTest(Material material) { super(material); } public TileEntity createTileEntity(World world, int metadata) { return new TileEntityBlockPipeTest(); } public boolean hasTileEntity(int metadata) { return true; } public boolean renderAsNormalBlock() { return false; } public int getRenderType() { return -1; } public boolean isOpaqueCube() { return false; } }et le model techne :
// Date: 28/10/2014 12:09:37 // Template version 1.1 // Java generated by Techne // Keep in mind that you still need to fill in some blanks // - ZeuX package com.bowser.robotic.common.techne; import com.bowser.robotic.common.Robotic; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; import net.minecraft.world.World; public class Pipe extends ModelBase { //fields public static ModelRenderer Shape1; public static ModelRenderer Shape2; public static ModelRenderer Shape3; public static ModelRenderer Shape4; public static ModelRenderer Shape5; public static ModelRenderer Shape6; public static ModelRenderer Shape7; public Pipe() { textureWidth = 64; textureHeight = 32; Shape1 = new ModelRenderer(this, 0, 0); Shape1.addBox(0F, 0F, 0F, 6, 4, 4); Shape1.setRotationPoint(2F, 14F, -2F); Shape1.setTextureSize(64, 32); Shape1.mirror = true; setRotation(Shape1, 0F, 0F, 0F); Shape2 = new ModelRenderer(this, 0, 10); Shape2.addBox(0F, 0F, 0F, 4, 4, 6); Shape2.setRotationPoint(-2F, 14F, 2F); Shape2.setTextureSize(64, 32); Shape2.mirror = true; setRotation(Shape2, 0F, 0F, 0F); Shape3 = new ModelRenderer(this, 0, 21); Shape3.addBox(0F, 0F, 0F, 6, 4, 4); Shape3.setRotationPoint(-8F, 14F, -2F); Shape3.setTextureSize(64, 32); Shape3.mirror = true; setRotation(Shape3, 0F, 0F, 0F); Shape4 = new ModelRenderer(this, 21, 0); Shape4.addBox(0F, 0F, 0F, 4, 4, 4); Shape4.setRotationPoint(-2F, 14F, -2F); Shape4.setTextureSize(64, 32); Shape4.mirror = true; setRotation(Shape4, 0F, 0F, 0F); Shape5 = new ModelRenderer(this, 21, 9); Shape5.addBox(0F, 0F, 0F, 4, 4, 6); Shape5.setRotationPoint(-2F, 14F, -8F); Shape5.setTextureSize(64, 32); Shape5.mirror = true; setRotation(Shape5, 0F, 0F, 0F); Shape6 = new ModelRenderer(this, 21, 20); Shape6.addBox(0F, 0F, 0F, 4, 6, 4); Shape6.setRotationPoint(-2F, 8F, -2F); Shape6.setTextureSize(64, 32); Shape6.mirror = true; setRotation(Shape6, 0F, 0F, 0F); Shape7 = new ModelRenderer(this, 44, 3); Shape7.addBox(0F, 0F, 0F, 4, 6, 4); Shape7.setRotationPoint(-2F, 18F, -2F); Shape7.setTextureSize(64, 32); Shape7.mirror = true; setRotation(Shape7, 0F, 0F, 0F); } /** public void render(float f, World world, int x, int y, int z) { if(world.getBlock(x,y-1,z+1) == Robotic.fourArc) { Shape1.render(f); } else { Shape4.render(f); } //Shape1.render(f); //Shape2.render(f); //Shape3.render(f); //Shape4.render(f); Core //Shape5.render(f); //Shape6.render(f); //Shape7.render(f); } * @param z * @param y * @param x * @param world */ public void core(float f, World world, int x, int y, int z){ //CENTER Shape4.render(f); } public void top(float f, World world, int x, int y, int z){ Shape3.render(f); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } public void render(float f) { // TODO Auto-generated method stub } }Sa marche mais il ne me manque plus qu’a ajouter la fonction pour que le rendu change en fonction des blocs autour