mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 10:19:08 +00:00
Stool and Chair Models Completed
This commit is contained in:
1 parent
26f4158c17
commit
c95341b60b
31 files changed
+190
-120
No files matched your search
@@ -2,12 +2,16 @@ package noppes.npcs.client.renderer.blocks;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import noppes.npcs.CustomItems;
|
||||
import noppes.npcs.blocks.BlockChair;
|
||||
import noppes.npcs.blocks.tiles.TileColorable;
|
||||
import noppes.npcs.client.model.blocks.ModelChair;
|
||||
import noppes.npcs.client.model.blocks.chair.ModelChair;
|
||||
import noppes.npcs.client.model.blocks.chair.ModelChairSpoof;
|
||||
import noppes.npcs.client.model.blocks.legacy.ModelLegacyChair;
|
||||
import noppes.npcs.config.ConfigClient;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -16,7 +20,16 @@ import org.lwjgl.opengl.GL12;
|
||||
public class BlockChairRenderer extends BlockRendererInterface{
|
||||
|
||||
private final ModelLegacyChair legacyModel = new ModelLegacyChair();
|
||||
private final ModelChair model = new ModelChair();
|
||||
|
||||
private final ModelChairSpoof chairSpoof = new ModelChairSpoof();
|
||||
private final ModelChair chair = new ModelChair();
|
||||
|
||||
private static final ResourceLocation oak = new ResourceLocation("customnpcs","textures/models/chair/oak.png");
|
||||
private static final ResourceLocation spruce = new ResourceLocation("customnpcs","textures/models/chair/spruce.png");
|
||||
private static final ResourceLocation birch = new ResourceLocation("customnpcs","textures/models/chair/birch.png");
|
||||
private static final ResourceLocation jungle = new ResourceLocation("customnpcs","textures/models/chair/jungle.png");
|
||||
private static final ResourceLocation dark_oak = new ResourceLocation("customnpcs","textures/models/chair/dark_oak.png");
|
||||
private static final ResourceLocation acacia = new ResourceLocation("customnpcs","textures/models/chair/acacia.png");
|
||||
|
||||
public BlockChairRenderer(){
|
||||
((BlockChair)CustomItems.chair).renderId = RenderingRegistry.getNextAvailableRenderId();
|
||||
@@ -28,7 +41,7 @@ public class BlockChairRenderer extends BlockRendererInterface{
|
||||
TileColorable tile = (TileColorable) var1;
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)var2 + 0.5f, (float)var4 + 1.68f, (float)var6 + 0.5f);
|
||||
GL11.glTranslatef((float)var2 + 0.5f, (float)var4 + 1.65f, (float)var6 + 0.5f);
|
||||
GL11.glScalef(1.2f, 1.1f, 1.2f);
|
||||
GL11.glRotatef(180, 0, 0, 1);
|
||||
GL11.glRotatef(90 * tile.rotation, 0, 1, 0);
|
||||
@@ -38,8 +51,14 @@ public class BlockChairRenderer extends BlockRendererInterface{
|
||||
setWoodTexture(var1.getBlockMetadata());
|
||||
if(ConfigClient.LegacyChair)
|
||||
legacyModel.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
else
|
||||
model.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
else {
|
||||
if(ConfigClient.WoodTextures)
|
||||
chairSpoof.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
else {
|
||||
setChairTexture(var1.getBlockMetadata());
|
||||
chair.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
}
|
||||
}
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
@@ -58,11 +77,32 @@ public class BlockChairRenderer extends BlockRendererInterface{
|
||||
GL11.glColor3f(1, 1, 1);
|
||||
if(ConfigClient.LegacyChair)
|
||||
legacyModel.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
else
|
||||
model.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
else {
|
||||
if(ConfigClient.WoodTextures)
|
||||
chairSpoof.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
else {
|
||||
setChairTexture(metadata);
|
||||
chair.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
}
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public void setChairTexture(int meta){
|
||||
TextureManager manager = Minecraft.getMinecraft().getTextureManager();
|
||||
if(meta == 1)
|
||||
manager.bindTexture(spruce);
|
||||
else if(meta == 2)
|
||||
manager.bindTexture(birch);
|
||||
else if(meta == 3)
|
||||
manager.bindTexture(jungle);
|
||||
else if(meta == 4)
|
||||
manager.bindTexture(acacia);
|
||||
else if(meta == 5)
|
||||
manager.bindTexture(dark_oak);
|
||||
else
|
||||
manager.bindTexture(oak);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user