Salut !
Cela fait quelque heurs que j’essaye de reglé se problème maintenant mais je n’est aucun resultat correct.
J’utilise un Tile entity mais j ai toujours un résultat random. 
Voic le code de mon bloc: ```java
package modCrafttech.common;
import modCrafttech.proxy.CraftechClientProxy;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.Icon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class lamp1 extends Block {
int test2 =0;
public lamp1(int id)
{
super(id, Material.rock);
this.setCreativeTab(ModCraftech.Craftech);
}
public boolean renderAsNormalBlock()
{
return false;
}
public boolean isOpaqueCube()
{
return false;
}
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockAccess blockAccess, int x, int y, int z, int side)
{
return true;
}
public TileEntity createTileEntity(World world, int metadata)
{
if(metadata == 0)
return new TileEntitylamp();
else
return null;
}
public boolean hasTileEntity(int metadata)
{
if(metadata == 0 || metadata == 2)
return true;
else
return false;
}
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase living, ItemStack stack)
{
int direction1 = MathHelper.floor_double((double)(living.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3;
TileEntity te = world.getBlockTileEntity(x, y, z);
if(te instanceof TileEntitylamp)
{
((TileEntitylamp)te).setDirection((byte)direction1);
world.markBlockForUpdate(x, y, z);
}
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z)
{
TileEntity te = world.getBlockTileEntity(x, y, z);
if(te instanceof TileEntitylamp)
{
int direction1 = ((TileEntitylamp)te).getDirection();
test2 = direction1;
if(direction1 == 0)
{
// direction 0
return AxisAlignedBB.getAABBPool().getAABB((double)x +this.minX, (double)y + this.minY, (double)z + this.minZ, (double)x + this.maxX, (double)y + this.maxY, (double)z + (1.0F-(0.0625F*14)));
}
else if(direction1 == 1)
{
return AxisAlignedBB.getAABBPool().getAABB((double)x +(1.0F-(0.0625F2)), (double)y + this.minY, (double)z + this.minZ, (double)x + this.maxX, (double)y + this.maxY, (double)z + this.maxZ);
//direction 1 Correct
//etc … jusqu’à 3
}
else if(direction1 == 2)
{
return AxisAlignedBB.getAABBPool().getAABB((double)x +this.minX, (double)y + this.minY, (double)z + (1.0F-(0.0625F2)), (double)x + this.maxX, (double)y + this.maxY, (double)z + this.maxZ);
//direction 1
//etc … jusqu’à 3
}
else if(direction1 == 3)
{
return AxisAlignedBB.getAABBPool().getAABB((double)x +this.minX, (double)y + this.minY, (double)z + this.minZ, (double)x + (1.0F-(0.0625F*14)), (double)y + this.maxY, (double)z + this.maxZ);
//direction 1
//etc … jusqu’à 3
}
}
return AxisAlignedBB.getAABBPool().getAABB((double)x + this.minX, (double)y + this.minY, (double)z + this.minZ, (double)x + this.maxX, (double)y + this.maxY, (double)z + this.maxZ);
// tile entity invalide, pas de direction, donc valeur par défaut (ne devrait pas arriver en temps normal)
}
@SideOnly(Side.CLIENT)
public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z)
{
TileEntity te = world.getBlockTileEntity(x, y, z);
if(te instanceof TileEntitylamp)
{
int direction1 = ((TileEntitylamp)te).getDirection();
if(direction1 == 0)
{
// direction 0
return AxisAlignedBB.getAABBPool().getAABB((double)x +this.minX, (double)y + this.minY, (double)z + this.minZ, (double)x + this.maxX, (double)y + this.maxY, (double)z + (1.0F-(0.0625F*14)));
}
else if(direction1 == 1)
{
return AxisAlignedBB.getAABBPool().getAABB((double)x +(1.0F-(0.0625F*2)), (double)y + this.minY, (double)z + this.minZ, (double)x + this.maxX, (double)y + this.maxY, (double)z + this.maxZ);
//direction 1 Correct
//etc … jusqu’à 3
}
else if(direction1 == 2)
{
return AxisAlignedBB.getAABBPool().getAABB((double)x +this.minX, (double)y + this.minY, (double)z + (1.0F-(0.0625F2)), (double)x + this.maxX, (double)y + this.maxY, (double)z + this.maxZ);
//direction 1
//etc … jusqu’à 3
}
else if(direction1 == 3)
{
return AxisAlignedBB.getAABBPool().getAABB((double)x +this.minX, (double)y + this.minY, (double)z + this.minZ, (double)x + (1.0F-(0.0625F14)), (double)y + this.maxY, (double)z + this.maxZ);
//direction 1
//etc … jusqu’à 3
}
}
return AxisAlignedBB.getAABBPool().getAABB((double)x + this.minX, (double)y + this.minY, (double)z + this.minZ, (double)x + this.maxX, (double)y + this.maxY, (double)z + this.maxZ);
}
@SideOnly(Side.CLIENT)
public int getRenderType()
{
if(test2 == 0)
{
return CraftechClientProxy.lamp2;
}
else if(test2 == 1)
{
return CraftechClientProxy.lamp2;
}
else if(test2 == 2)
{
return CraftechClientProxy.lamp;
}
else if(test2 == 3)
{
return CraftechClientProxy.lamp;
}
return test2;
}
}
Cordialement Sidney