Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package fr.shyfe.dcedo.proxy;
- import org.lwjgl.opengl.GL11;
- import BlocksPers.ModelFlagSpawn;
- import BlocksPers.ModelGrassB;
- import BlocksPers.TileEntityFlagSpawn;
- import BlocksPers.TileEntityGrassB;
- import BlocksPers.flagSpawn;
- import fr.shyfe.dcedo.common.Main;
- 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 TileEntityFlagSpawnSpecialRenderer extends TileEntitySpecialRenderer {
- public static ModelFlagSpawn model = new ModelFlagSpawn();
- public static ResourceLocation texture = new ResourceLocation(Main.MODID, "textures/models/blocks/FlagSpawn.png");
- @Override
- public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partialRenderTick) // la fonction qui était la de base
- {
- this.renderTileEntityFlagSpawnAt((TileEntityFlagSpawn)tile, x, y, z, partialRenderTick); // j'appelle ma fonction renderTileEntityTutorielAt en castant TileEntityTutoriel à l'argument tile
- }
- private void renderTileEntityFlagSpawnAt(TileEntityFlagSpawn tile, double x, double y, double z, float partialRenderTick)
- {
- GL11.glPushMatrix(); // ouvre une matrix
- GL11.glTranslated(x + 0.5D, y + 1.5D, z + 0.5D); // déplace le bloc sur les coordonnés et le centre
- GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); // met droit le bloc (par défaut il est à l'envers)
- GL11.glRotatef(90F * tile.getDirection(), 0.0F, 1.0F, 0.0F);
- this.bindTexture(texture); // affiche la texture
- model.renderAll(); // rend le modèle
- GL11.glPopMatrix(); // ferme la matrix
- }
- public TileEntityFlagSpawnSpecialRenderer() // TileEntityTutorielSpecialRenderer dans mon cas, c'est la classe que nous avons fait dans la partie précédente
- {
- this.func_147497_a(TileEntityRendererDispatcher.instance);
- }
- }
Add Comment
Please, Sign In to add comment