Résolu Changer la texture d'un bloc TESR
-
Bonjour,
je me présente je m’appelle Kyrioo j’ai 15 ans et je découvre et j’apprends le modding depuis peu.Enfin bref…,En ce moment je travaille sur un mod rajoutant une friteuse et j’aimerais que lorsque la friteuse fonctionne la texture du bloc change,malgré mes nombreuses tentatives qui se résume de crash je m’en remets à la communauté de MFF suite à mon échec.
Je tiens à préciser que la friteuse Utilise un rendu TESR fait avec le tutoriel de Robin4002 : https://www.minecraftforgefrance.fr/showthread.php?tid=1509 .
La friteuse fonctionne à l’aide du tutoriel de BrokenSwing: https://www.minecraftforgefrance.fr/showthread.php?tid=2017&highlight=four .
Ci-joint le rendu final que j’aimerais avoir avec deux textures différentes.
Je vous remercie d’avance pour votre futur aide.
Cordialement Kyrioo.
-
Il faudrait le crash + la classe de ton rendu TESR
-
@‘BrokenSwing’:
Il faudrait le crash + la classe de ton rendu TESR
Enfaite voyant que mon code marche j’ai tout effacer,j’ai surtout besoin de la méthode pour pouvoir changer la texture,désoler ci je me suis mal exprimer.
-
Tu as normalement un bindTexture dans la fonction render de ton tesr. Tu peux donc faire varier le ResourceLocation de ce bindTexture en fonction de si oui ou non ta machine marche…
-
J’avais déjà essayer mais je n’avait pas réussi,j’ai retenter mais sans succès si vous voyez où se trouve l’erreur.
TileEntiySpecialRenderer
package fr.kyri.test.proxy; import org.lwjgl.opengl.GL11; import fr.kyri.test.client.RenderBlockFriteuse; import fr.kyri.test.common.ModTest; import fr.kyri.test.common.TileEntityMachineFriteuse; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; public class TileEntityFriteuseSpecialRenderer extends TileEntitySpecialRenderer { private TileEntityMachineFriteuse tileMachineFriteuse; public static RenderBlockFriteuse model = new RenderBlockFriteuse(); public static ResourceLocation texture = new ResourceLocation(ModTest.MODID, "textures/models/blocks/model_block_friteuse.png"); public static ResourceLocation texturem = new ResourceLocation(ModTest.MODID, "textures/models/blocks/model_block_friteuse_marche.png"); public TileEntityFriteuseSpecialRenderer() { this.func_147497_a(TileEntityRendererDispatcher.instance); } @Override public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partialRenderTick) { this.renderTileEntityFriteuseAt((TileEntityMachineFriteuse)tile, x, y, z, partialRenderTick); // tile } private void renderTileEntityFriteuseAt(TileEntityMachineFriteuse 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(texture); model.renderAll(); GL11.glPopMatrix(); if(this.tileMachineFriteuse.marche == 1) { this.bindTexture(texturem); } } }
TileEntity***
package fr.kyri.test.common; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; public class TileEntityMachineFriteuse extends TileEntity implements IInventory { private ItemStack[] contents = new ItemStack[4]; private int workingTime = 0; private int workingTimeNeeded = 200; public int marche = (this.isBurning()) ? 1 : 0; //conversion de ma variable boolean en int @Override public void writeToNBT(NBTTagCompound compound) { super.writeToNBT(compound); NBTTagList nbttaglist = new NBTTagList(); for (int i = 0; i < this.contents.length; ++i) { if (this.contents* != null) { NBTTagCompound nbttagcompound1 = new NBTTagCompound(); nbttagcompound1.setByte("Slot", (byte)i); this.contents*.writeToNBT(nbttagcompound1); nbttaglist.appendTag(nbttagcompound1); } } compound.setTag("Items", nbttaglist); compound.setShort("workingTime",(short)this.workingTime); compound.setShort("workingTimeNeeded", (short)this.workingTimeNeeded); } @Override public void readFromNBT(NBTTagCompound compound) { super.readFromNBT(compound); NBTTagList nbttaglist = compound.getTagList("Items", 10); this.contents = new ItemStack[this.getSizeInventory()]; for (int i = 0; i < nbttaglist.tagCount(); ++i) { NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); int j = nbttagcompound1.getByte("Slot") & 255; if (j >= 0 && j < this.contents.length) { this.contents[j] = ItemStack.loadItemStackFromNBT(nbttagcompound1); } } this.workingTime = compound.getShort("workingTime"); this.workingTimeNeeded = compound.getShort("workingTimeNeeded"); } @Override public int getSizeInventory() { return this.contents.length; } @Override public ItemStack getStackInSlot(int slotIndex) { return this.contents[slotIndex]; } @Override public ItemStack decrStackSize(int slotIndex, int amount) { if (this.contents[slotIndex] != null) { ItemStack itemstack; if (this.contents[slotIndex].stackSize <= amount) { itemstack = this.contents[slotIndex]; this.contents[slotIndex] = null; this.markDirty(); return itemstack; } else { itemstack = this.contents[slotIndex].splitStack(amount); if (this.contents[slotIndex].stackSize == 0) { this.contents[slotIndex] = null; } this.markDirty(); return itemstack; } } else { return null; } } @Override public ItemStack getStackInSlotOnClosing(int slotIndex) { if (this.contents[slotIndex] != null) { ItemStack itemstack = this.contents[slotIndex]; this.contents[slotIndex] = null; return itemstack; } else { return null; } } @Override public void setInventorySlotContents(int slotIndex, ItemStack stack) { this.contents[slotIndex] = stack; if (stack != null && stack.stackSize > this.getInventoryStackLimit()) { stack.stackSize = this.getInventoryStackLimit(); } this.markDirty(); } @Override public String getInventoryName() { return "tile.machineTuto"; } @Override public boolean hasCustomInventoryName() { return false; } @Override public int getInventoryStackLimit() { return 64; } @Override public boolean isUseableByPlayer(EntityPlayer player) { return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : player.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D; } @Override public void openInventory() { } @Override public void closeInventory() { } @Override public boolean isItemValidForSlot(int slot, ItemStack stack) { return slot == 3 ? false : true; } public boolean isBurning() { return this.workingTime > 0; } private boolean canSmelt() { if (this.contents[0] == null || this.contents[1] == null || this.contents[2] == null) { return false; } else { ItemStack itemstack = MachineFriteuseRecipes.smelting().getSmeltingResult(new ItemStack[]{this.contents[0], this.contents[1], this.contents[2]}); //Il y a une erreur ici, c'est normal, on y vient après (c'est pour les recettes) if (itemstack == null) return false; if (this.contents[3] == null) return true; if (!this.contents[3].isItemEqual(itemstack)) return false; int result = contents[3].stackSize + itemstack.stackSize; return result <= getInventoryStackLimit() && result <= this.contents[3].getMaxStackSize(); } } public void updateEntity() { if(this.isBurning() && this.canSmelt()) { ++this.workingTime; } if(this.canSmelt() && !this.isBurning()) { this.workingTime = 1; } if(this.canSmelt() && this.workingTime == this.workingTimeNeeded) { this.smeltItem(); this.workingTime = 0; } if(!this.canSmelt()) { this.workingTime= 0; } } public void smeltItem() { if (this.canSmelt()) { ItemStack itemstack = MachineFriteuseRecipes.smelting().getSmeltingResult(new ItemStack[]{this.contents[0], this.contents[1], this.contents[2]}); //On récupère l'output de la recette if (this.contents[3] == null) { this.contents[3] = itemstack.copy(); } else if (this.contents[3].getItem() == itemstack.getItem()) { this.contents[3].stackSize += itemstack.stackSize; } –this.contents[0].stackSize; –this.contents[1].stackSize; –this.contents[2].stackSize; if (this.contents[0].stackSize <= 0) { this.contents[0] = null; } if (this.contents[1].stackSize <= 0) { this.contents[1] = null; } if (this.contents[2].stackSize <= 0) { this.contents[2] = null; } } } @SideOnly(Side.CLIENT) public int getCookProgress() { return this.workingTime * 41 / this.workingTimeNeeded; } }
Class Du Bloc
**```java
package fr.kyri.test.common;
**import fr.kyri.test.proxy.ClientProxy;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;public class MachineFriteuse extends BlockContainer
{
public MachineFriteuse()
{
super(Material.rock);
this.setResistance(8.0F);
this.setHarvestLevel(“pickaxe”, 2);
this.setBlockTextureName(ModTest.MODID + “:friteuse”);
this.setCreativeTab(ModTest.samaCreativeTabs);}
@Override
public TileEntity createNewTileEntity(World world, int metadata)
{
return new TileEntityMachineFriteuse();
}@Override
public boolean hasTileEntity(int metadata)
{
return true;
}public void breakBlock(World world, int x, int y, int z, Block block, int metadata)
{
TileEntity tileentity = world.getTileEntity(x, y, z);if (tileentity instanceof IInventory)
{
IInventory inv = (IInventory)tileentity;
for (int i1 = 0; i1 < inv.getSizeInventory(); ++i1)
{
ItemStack itemstack = inv.getStackInSlot(i1);if (itemstack != null)
{
float f = world.rand.nextFloat() * 0.8F + 0.1F;
float f1 = world.rand.nextFloat() * 0.8F + 0.1F;
EntityItem entityitem;for (float f2 = world.rand.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; world.spawnEntityInWorld(entityitem))
{
int j1 = world.rand.nextInt(21) + 10;if (j1 > itemstack.stackSize)
{
j1 = itemstack.stackSize;
}itemstack.stackSize -= j1;
entityitem = new EntityItem(world, (double)((float)x + f), (double)((float)y + f1), (double)((float)z + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
float f3 = 0.05F;
entityitem.motionX = (double)((float)world.rand.nextGaussian() * f3);
entityitem.motionY = (double)((float)world.rand.nextGaussian() * f3 + 0.2F);
entityitem.motionZ = (double)((float)world.rand.nextGaussian() * f3);if (itemstack.hasTagCompound())
{
entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
}
}
}
}world.func_147453_f(x, y, z, block);
}super.breakBlock(world, x, y, z, block, metadata);
}
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitx, float hity, float hitz)
{
if (world.isRemote)
{
return true;
}
else
{
player.openGui(ModTest.instance, 0, world, x, y, z);
return true;
}
}public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z)
{
this.setBlockBounds(0.2F, 0.0F, 0.13F, 0.8F, 0.62F, 0.94F);
}public boolean isOpaqueCube()
{
return false;
}public boolean renderAsNormalBlock()
{
return false;
}public int getRenderType()
{
return ClientProxy.tesrRenderId;
}}
**Crash Report***
–-- Minecraft Crash Report ----
// Would you like a cupcake?Time: 22/02/17 11:47
Description: Rendering Block Entityjava.lang.NullPointerException: Rendering Block Entity
at fr.kyri.test.proxy.TileEntityFriteuseSpecialRenderer.renderTileEntityFriteuseAt(TileEntityFriteuseSpecialRenderer.java:44)
at fr.kyri.test.proxy.TileEntityFriteuseSpecialRenderer.renderTileEntityAt(TileEntityFriteuseSpecialRenderer.java:31)
at net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.renderTileEntityAt(TileEntityRendererDispatcher.java:141)
at net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.renderTileEntity(TileEntityRendererDispatcher.java:126)
at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:539)
at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1300)
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1087)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1067)
at net.minecraft.client.Minecraft.run(Minecraft.java:962)
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 net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
at GradleStart.main(Unknown Source)A detailed walkthrough of the error, its code path and all known details is as follows:
– Head –
Stacktrace:
at fr.kyri.test.proxy.TileEntityFriteuseSpecialRenderer.renderTileEntityFriteuseAt(TileEntityFriteuseSpecialRenderer.java:44)
at fr.kyri.test.proxy.TileEntityFriteuseSpecialRenderer.renderTileEntityAt(TileEntityFriteuseSpecialRenderer.java:31)– Block Entity Details –
Details:
Name: ModTest:MachineFriteuseTileEntity // fr.kyri.test.common.TileEntityMachineFriteuse
Block type: ID #165 (tile.friteuse2000 // fr.kyri.test.common.MachineFriteuse)
Block data value: 0 / 0x0 / 0b0000
Block location: World: (207,73,290), Chunk: (at 15,4,2 in 12,18; contains blocks 192,0,288 to 207,255,303), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
Actual block type: ID #165 (tile.friteuse2000 // fr.kyri.test.common.MachineFriteuse)
Actual block data value: 0 / 0x0 / 0b0000
Stacktrace:
at net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.renderTileEntityAt(TileEntityRendererDispatcher.java:141)
at net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.renderTileEntity(TileEntityRendererDispatcher.java:126)
at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:539)
at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1300)– Affected level –
Details:
Level name: MpServer
All players: 1 total; [EntityClientPlayerMP[‘Player296’/243, l=‘MpServer’, x=206,46, y=74,62, z=290,46]]
Chunk stats: MultiplayerChunkCache: 80, 80
Level seed: 0
Level generator: ID 00 - default, ver 1. Features enabled: false
Level generator options:
Level spawn location: World: (252,64,236), Chunk: (at 12,4,12 in 15,14; contains blocks 240,0,224 to 255,255,239), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
Level time: 1548 game time, 1548 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: 93 total; [EntityZombie[‘Zombie’/128, l=‘MpServer’, x=177,94, y=52,00, z=313,50], EntitySkeleton[‘Skeleton’/129, l=‘MpServer’, x=184,13, y=56,00, z=307,00], EntitySpider[‘Spider’/130, l=‘MpServer’, x=184,42, y=56,00, z=305,98], EntityBat[‘Bat’/140, l=‘MpServer’, x=198,64, y=47,95, z=231,53], EntityBat[‘Bat’/141, l=‘MpServer’, x=200,50, y=48,49, z=236,62], EntityBat[‘Bat’/142, l=‘MpServer’, x=203,25, y=53,10, z=246,75], EntityBat[‘Bat’/143, l=‘MpServer’, x=199,24, y=53,01, z=242,67], EntityBat[‘Bat’/144, l=‘MpServer’, x=201,43, y=51,62, z=251,50], EntityBat[‘Bat’/145, l=‘MpServer’, x=207,29, y=50,68, z=246,94], EntitySheep[‘Sheep’/164, l=‘MpServer’, x=218,06, y=76,00, z=227,94], EntitySheep[‘Sheep’/165, l=‘MpServer’, x=220,50, y=76,00, z=228,50], EntitySpider[‘Spider’/166, l=‘MpServer’, x=222,47, y=32,00, z=253,34], EntityCow[‘Cow’/167, l=‘MpServer’, x=212,69, y=66,00, z=255,28], EntityCow[‘Cow’/168, l=‘MpServer’, x=212,53, y=67,00, z=269,44], EntityCow[‘Cow’/169, l=‘MpServer’, x=222,63, y=68,00, z=261,50], EntityCreeper[‘Creeper’/170, l=‘MpServer’, x=213,50, y=27,00, z=287,50], EntityCreeper[‘Creeper’/171, l=‘MpServer’, x=213,50, y=27,00, z=285,50], EntitySheep[‘Sheep’/175, l=‘MpServer’, x=224,53, y=76,00, z=226,38], EntitySheep[‘Sheep’/176, l=‘MpServer’, x=232,53, y=75,00, z=234,88], EntityItem[‘item.tile.mushroom’/177, l=‘MpServer’, x=239,28, y=13,13, z=247,78], EntitySheep[‘Sheep’/178, l=‘MpServer’, x=233,53, y=66,00, z=249,78], EntitySheep[‘Sheep’/179, l=‘MpServer’, x=235,50, y=71,00, z=248,50], EntitySheep[‘Sheep’/180, l=‘MpServer’, x=232,25, y=65,00, z=246,94], EntitySheep[‘Sheep’/181, l=‘MpServer’, x=231,91, y=65,00, z=248,13], EntitySkeleton[‘Skeleton’/182, l=‘MpServer’, x=230,47, y=19,00, z=274,69], EntitySkeleton[‘Skeleton’/183, l=‘MpServer’, x=239,91, y=42,00, z=278,50], EntitySkeleton[‘Skeleton’/184, l=‘MpServer’, x=232,50, y=18,00, z=292,50], EntityZombie[‘Zombie’/185, l=‘MpServer’, x=231,63, y=20,00, z=300,06], EntityBat[‘Bat’/190, l=‘MpServer’, x=247,75, y=14,10, z=230,66], EntityItem[‘item.tile.mushroom’/191, l=‘MpServer’, x=245,88, y=12,13, z=247,88], EntityItem[‘item.tile.mushroom’/192, l=‘MpServer’, x=243,88, y=12,13, z=248,88], EntityBat[‘Bat’/193, l=‘MpServer’, x=243,09, y=14,10, z=250,44], EntityCreeper[‘Creeper’/65, l=‘MpServer’, x=134,28, y=25,00, z=271,88], EntitySkeleton[‘Skeleton’/194, l=‘MpServer’, x=245,50, y=28,00, z=248,50], EntityZombie[‘Zombie’/66, l=‘MpServer’, x=134,50, y=15,00, z=277,50], EntityCreeper[‘Creeper’/195, l=‘MpServer’, x=253,50, y=29,00, z=271,50], EntityCreeper[‘Creeper’/67, l=‘MpServer’, x=142,50, y=28,00, z=281,50], EntitySkeleton[‘Skeleton’/196, l=‘MpServer’, x=255,72, y=31,00, z=264,47], EntityCreeper[‘Creeper’/68, l=‘MpServer’, x=142,50, y=24,00, z=281,50], EntitySpider[‘Spider’/197, l=‘MpServer’, x=250,72, y=29,00, z=273,16], EntityZombie[‘Zombie’/69, l=‘MpServer’, x=137,91, y=20,00, z=287,44], EntitySkeleton[‘Skeleton’/198, l=‘MpServer’, x=253,91, y=29,00, z=273,41], EntitySkeleton[‘Skeleton’/70, l=‘MpServer’, x=135,69, y=17,00, z=298,31], EntityZombie[‘Zombie’/199, l=‘MpServer’, x=246,63, y=42,00, z=276,47], EntitySkeleton[‘Skeleton’/71, l=‘MpServer’, x=142,53, y=21,00, z=297,72], EntityBat[‘Bat’/200, l=‘MpServer’, x=251,30, y=36,00, z=323,68], EntityZombie[‘Zombie’/72, l=‘MpServer’, x=142,50, y=20,00, z=294,50], EntitySheep[‘Sheep’/73, l=‘MpServer’, x=142,38, y=67,00, z=290,53], EntityBat[‘Bat’/202, l=‘MpServer’, x=267,54, y=31,96, z=244,72], EntitySheep[‘Sheep’/74, l=‘MpServer’, x=140,94, y=67,00, z=289,50], EntitySkeleton[‘Skeleton’/203, l=‘MpServer’, x=262,50, y=38,00, z=247,50], EntityZombie[‘Zombie’/75, l=‘MpServer’, x=140,50, y=31,00, z=361,50], EntityCreeper[‘Creeper’/204, l=‘MpServer’, x=257,09, y=29,00, z=271,34], EntityZombie[‘Zombie’/76, l=‘MpServer’, x=138,50, y=31,00, z=360,50], EntityZombie[‘Zombie’/205, l=‘MpServer’, x=262,50, y=32,00, z=270,50], EntityZombie[‘Zombie’/77, l=‘MpServer’, x=137,50, y=31,00, z=360,50], EntityZombie[‘Zombie’/206, l=‘MpServer’, x=262,41, y=33,00, z=266,41], EntitySheep[‘Sheep’/78, l=‘MpServer’, x=140,63, y=71,00, z=354,68], EntityCreeper[‘Creeper’/207, l=‘MpServer’, x=269,34, y=27,00, z=274,91], EntitySkeleton[‘Skeleton’/208, l=‘MpServer’, x=260,50, y=43,00, z=280,09], EntityCreeper[‘Creeper’/209, l=‘MpServer’, x=263,50, y=35,00, z=288,50], EntityCreeper[‘Creeper’/210, l=‘MpServer’, x=264,50, y=49,00, z=303,50], EntityZombie[‘Zombie’/211, l=‘MpServer’, x=262,50, y=27,00, z=348,50], EntitySkeleton[‘Skeleton’/84, l=‘MpServer’, x=158,09, y=48,00, z=246,50], EntityCreeper[‘Creeper’/85, l=‘MpServer’, x=157,50, y=30,00, z=268,50], EntityBat[‘Bat’/86, l=‘MpServer’, x=151,25, y=28,10, z=268,25], EntityCreeper[‘Creeper’/87, l=‘MpServer’, x=145,50, y=50,00, z=260,50], EntitySkeleton[‘Skeleton’/88, l=‘MpServer’, x=154,56, y=13,00, z=281,94], EntitySheep[‘Sheep’/89, l=‘MpServer’, x=145,34, y=70,00, z=282,56], EntitySheep[‘Sheep’/90, l=‘MpServer’, x=144,63, y=67,00, z=287,53], EntityBat[‘Bat’/91, l=‘MpServer’, x=160,22, y=14,61, z=292,22], EntityCreeper[‘Creeper’/92, l=‘MpServer’, x=149,84, y=37,00, z=288,34], EntitySheep[‘Sheep’/93, l=‘MpServer’, x=152,13, y=68,00, z=350,09], EntitySheep[‘Sheep’/94, l=‘MpServer’, x=159,19, y=69,00, z=338,50], EntitySheep[‘Sheep’/95, l=‘MpServer’, x=151,91, y=70,00, z=361,97], EntityCreeper[‘Creeper’/108, l=‘MpServer’, x=168,69, y=50,75, z=225,03], EntitySpider[‘Spider’/109, l=‘MpServer’, x=164,88, y=51,00, z=228,78], EntitySkeleton[‘Skeleton’/110, l=‘MpServer’, x=170,50, y=42,00, z=255,13], EntitySpider[‘Spider’/111, l=‘MpServer’, x=166,81, y=19,00, z=263,28], EntitySkeleton[‘Skeleton’/112, l=‘MpServer’, x=166,31, y=55,00, z=261,47], EntityBat[‘Bat’/113, l=‘MpServer’, x=160,03, y=14,93, z=281,44], EntitySkeleton[‘Skeleton’/114, l=‘MpServer’, x=166,09, y=12,00, z=294,41], EntitySkeleton[‘Skeleton’/115, l=‘MpServer’, x=161,34, y=13,00, z=293,69], EntityClientPlayerMP[‘Player296’/243, l=‘MpServer’, x=206,46, y=74,62, z=290,46], EntityCreeper[‘Creeper’/116, l=‘MpServer’, x=160,50, y=26,00, z=300,50], EntityCreeper[‘Creeper’/117, l=‘MpServer’, x=173,97, y=57,00, z=299,47], EntitySkeleton[‘Skeleton’/121, l=‘MpServer’, x=183,50, y=44,00, z=235,50], EntityCreeper[‘Creeper’/122, l=‘MpServer’, x=190,50, y=51,00, z=232,50], EntitySkeleton[‘Skeleton’/123, l=‘MpServer’, x=186,38, y=42,00, z=243,55], EntityCow[‘Cow’/124, l=‘MpServer’, x=189,38, y=67,00, z=275,59], EntityCreeper[‘Creeper’/125, l=‘MpServer’, x=177,25, y=56,00, z=298,94], EntityZombie[‘Zombie’/126, l=‘MpServer’, x=179,94, y=53,00, z=311,41], EntityZombie[‘Zombie’/127, l=‘MpServer’, x=183,50, y=57,00, z=304,94]]
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:2566)
at net.minecraft.client.Minecraft.run(Minecraft.java:984)
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 net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
at GradleStart.main(Unknown Source)– System Details –
Details:
Minecraft Version: 1.7.10
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.8.0_121, Oracle Corporation
Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 870684664 bytes (830 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 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.99.99 Minecraft Forge 10.13.4.1558 4 mods loaded, 4 mods active
States: ‘U’ = Unloaded ‘L’ = Loaded ‘C’ = Constructed ‘H’ = Pre-initialized ‘I’ = Initialized ‘J’ = Post-initialized ‘A’ = Available ‘D’ = Disabled ‘E’ = Errored
UCHIJAAAA mcp{9.05} [Minecraft Coder Pack] (minecraft.jar)
UCHIJAAAA FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar)
UCHIJAAAA Forge{10.13.4.1558} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1558-1.7.10.jar)
UCHIJAAAA samafrypoopmod{1.0.0} [SamaFryPoopMod] (bin)
GL info: ’ Vendor: ‘NVIDIA Corporation’ Version: ‘4.5.0 NVIDIA 378.66’ Renderer: ‘GeForce GTX 750/PCIe/SSE2’
Launched Version: 1.7.10
LWJGL: 2.9.1
OpenGL: GeForce GTX 750/PCIe/SSE2 GL version 4.5.0 NVIDIA 378.66, 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) -
J’aurai plutôt fait une condition ternaire du genre :
ResourceLocation chosenTexture : this.tileMachineFriteuse.marche == 1 ? texturem : texture;
this.bindTexture(chosenTexture);Et vérifie que tu as bien enregistré tile entity…
-
@‘Plaigon’:
J’aurai plutôt fait une condition ternaire du genre :
ResourceLocation chosenTexture : this.tileMachineFriteuse.marche == 1 ? texturem : texture;
this.bindTexture(chosenTexture);Et vérifie que tu as bien enregistré tile entity…
J’ai toujours eu mal avec les conditions ternaire j’ai jamais compris comment ça marche,si tu peux me montrer comment je peut faire ça serai génial.
-
Le bind de la texture doit être avant la fonction model.render
this.tileMachineFriteuse.marche devrait être juste tile.marche et la variable ligne 15 ne devrait pas exister.
-
@‘robin4002’:
Le bind de la texture doit être avant la fonction model.render
this.tileMachineFriteuse.marche devrait être juste tile.marche et la variable ligne 15 ne devrait pas exister.
Merci ça fonctionne et merci d’avoir pris le temps de m’aider.