Salut !
Aujourd’hui j ai voulu m attaquer au rendu ISBRH heureusement le tuto est très bien expliqué, rien a redire mais pourant aprés avoir fais tous se qui et dit sur le tuto cela ne fonctionne pas.
J ai tout recommencé de multiple fois mais rien ne fonctionne pourant je pence que tout mon code est bon mais faut croire que non:
Class principale:
test = new
test(4010).setStepSound(Block.soundGrassFootstep).setUnlocalizedName("test").setTextureName("craftech:white_block");
GameRegistry.registerBlock(test, "test");
Class test:
package modCrafttech.common;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import modCrafttech.proxy.CraftechClientProxy;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.world.IBlockAccess;
public class test extends Block {
public test(int id)
{
super(id, Material.rock);
this.setCreativeTab(ModCraftech.Craftech);
}
public boolean renderAsNormalBlock()
{
return false;
}
public boolean isOpaqueCube()
{
return false;
}
@SideOnly(Side.CLIENT)
public int getRenderType()
{
return CraftechClientProxy.test;
}
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockAccess blockAccess, int x, int y, int z, int side)
{
return true;
}
}
ClientProxy:
package modCrafttech.proxy;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.client.MinecraftForgeClient;
public class CraftechClientProxy extends CraftechCommonProxy
{
public static int test;
@Override
public void registerRender()
{
test = RenderingRegistry.getNextAvailableRenderId();
RenderingRegistry.registerBlockHandler(test, new RenderTable());
//ici mes futur client registry
}
}
RenderTable:
package modCrafttech.proxy;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.world.IBlockAccess;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
public class RenderTable implements ISimpleBlockRenderingHandler {
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID,
RenderBlocks renderer) {
// TODO Auto-generated method stub
}
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
// TODO Auto-generated method stub
renderer.setRenderBounds(0.2F, 0.0F, 0.2F, 0.8F, 0.1F, 0.8F);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0.45F, 0.1F, 0.45F, 0.55F, 0.8F, 0.55F);
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBounds(0.0F, 0.8F, 0.0F, 1F, 0.9F, 1F);
renderer.renderStandardBlock(block, x, y, z);
return false;
}
@Override
public boolean shouldRender3DInInventory() {
// TODO Auto-generated method stub
return false;
}
@Override
public int getRenderId() {
// TODO Auto-generated method stub
return 0;
}
}
Voila j’espère que quelqu’un pourra m’aidé.
Merci d’avance pour vos réponces.
Cordialement Sidney