mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 01:27:27 +00:00
Updated Pedestal Model
This commit is contained in:
1 parent
f74984a014
commit
afa5bd81bd
10 files changed
+124
-47
No files matched your search
@@ -1,40 +1,31 @@
|
||||
package noppes.npcs.client.model.blocks;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelBox;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class ModelPedestal extends ModelBase {
|
||||
ModelRenderer Main_Block;
|
||||
ModelRenderer Front;
|
||||
private final ModelRenderer bb_main;
|
||||
|
||||
public ModelPedestal() {
|
||||
Main_Block = new ModelRenderer(this, 1, 0);
|
||||
Main_Block.addBox(-7F, 0F, -8F, 14, 3, 16);
|
||||
Main_Block.setRotationPoint(0, 16F, 0F);
|
||||
|
||||
Front = new ModelRenderer(this, 16, 8);
|
||||
Front.addBox(-8F, 0F, -8F, 16, 5, 16);
|
||||
Front.setRotationPoint(0F, 19F, 0F);
|
||||
textureWidth = 64;
|
||||
textureHeight = 64;
|
||||
|
||||
bb_main = new ModelRenderer(this);
|
||||
bb_main.setRotationPoint(0.0F, 24.0F, 0.0F);
|
||||
bb_main.cubeList.add(new ModelBox(bb_main, 0, 0, -6.0F, -4.0F, -6.0F, 12, 4, 12, 0.0F));
|
||||
bb_main.cubeList.add(new ModelBox(bb_main, 0, 16, -5.0F, -5.0F, -4.0F, 10, 1, 8, 0.0F));
|
||||
}
|
||||
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3,
|
||||
float f4, float f5) {
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(1, 1, 0.5f);
|
||||
Main_Block.render(f5);
|
||||
GL11.glScalef(1, 1, 1.25f);
|
||||
Front.render(f5);
|
||||
GL11.glPopMatrix();
|
||||
@Override
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
bb_main.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) {
|
||||
modelRenderer.rotateAngleX = x;
|
||||
modelRenderer.rotateAngleY = y;
|
||||
modelRenderer.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package noppes.npcs.client.model.blocks.legacy;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class ModelLegacyPedestal extends ModelBase {
|
||||
ModelRenderer Main_Block;
|
||||
ModelRenderer Front;
|
||||
|
||||
public ModelLegacyPedestal() {
|
||||
Main_Block = new ModelRenderer(this, 1, 0);
|
||||
Main_Block.addBox(-7F, 0F, -8F, 14, 3, 16);
|
||||
Main_Block.setRotationPoint(0, 16F, 0F);
|
||||
|
||||
Front = new ModelRenderer(this, 16, 8);
|
||||
Front.addBox(-8F, 0F, -8F, 16, 5, 16);
|
||||
Front.setRotationPoint(0F, 19F, 0F);
|
||||
}
|
||||
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3,
|
||||
float f4, float f5) {
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(1, 1, 0.5f);
|
||||
Main_Block.render(f5);
|
||||
GL11.glScalef(1, 1, 1.25f);
|
||||
Front.render(f5);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -14,14 +14,23 @@ import noppes.npcs.CustomItems;
|
||||
import noppes.npcs.blocks.BlockRotated;
|
||||
import noppes.npcs.blocks.tiles.TilePedestal;
|
||||
import noppes.npcs.client.model.blocks.ModelPedestal;
|
||||
import noppes.npcs.client.model.blocks.legacy.ModelLegacyPedestal;
|
||||
import noppes.npcs.config.ConfigClient;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
public class BlockPedestalRenderer extends BlockRendererInterface{
|
||||
|
||||
private final ModelPedestal model = new ModelPedestal();
|
||||
private final static ResourceLocation resource = new ResourceLocation("customnpcs:textures/models/npcPedestal.png");
|
||||
|
||||
private final ModelLegacyPedestal legacyModel = new ModelLegacyPedestal();
|
||||
private final static ResourceLocation resource = new ResourceLocation("customnpcs:textures/models/legacy/npcPedestal.png");
|
||||
|
||||
private final ModelPedestal model = new ModelPedestal();
|
||||
private final static ResourceLocation wood = new ResourceLocation("customnpcs:textures/models/pedestal/wood.png");
|
||||
private final static ResourceLocation stone = new ResourceLocation("customnpcs:textures/models/pedestal/stone.png");
|
||||
private final static ResourceLocation iron = new ResourceLocation("customnpcs:textures/models/pedestal/iron.png");
|
||||
private final static ResourceLocation gold = new ResourceLocation("customnpcs:textures/models/pedestal/gold.png");
|
||||
private final static ResourceLocation diamond = new ResourceLocation("customnpcs:textures/models/pedestal/diamond.png");
|
||||
|
||||
public BlockPedestalRenderer(){
|
||||
((BlockRotated)CustomItems.pedestal).renderId = RenderingRegistry.getNextAvailableRenderId();
|
||||
RenderingRegistry.registerBlockHandler(this);
|
||||
@@ -35,17 +44,26 @@ public class BlockPedestalRenderer extends BlockRendererInterface{
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)var2 + 0.5f, (float)var4 + 1.5f, (float)var6 + 0.5f);
|
||||
//GL11.glScalef(0.95f, 0.95f, 0.95f);
|
||||
GL11.glRotatef(180, 0, 0, 1);
|
||||
GL11.glRotatef(90 * tile.rotation, 0, 1, 0);
|
||||
GL11.glColor3f(1, 1, 1);
|
||||
|
||||
setMaterialTexture(var1.getBlockMetadata());
|
||||
model.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
GL11.glScalef(1f, 0.99f, 1f);
|
||||
TextureManager manager = Minecraft.getMinecraft().getTextureManager();
|
||||
manager.bindTexture(resource);
|
||||
model.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
|
||||
if(ConfigClient.LegacyPedestal){
|
||||
setMaterialTexture(var1.getBlockMetadata());
|
||||
legacyModel.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
GL11.glScalef(1f, 0.99f, 1f);
|
||||
TextureManager manager = Minecraft.getMinecraft().getTextureManager();
|
||||
manager.bindTexture(resource);
|
||||
legacyModel.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
} else {
|
||||
setPedestalTexture(var1.getBlockMetadata());
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(1f, 1.3f, 1f);
|
||||
GL11.glTranslatef(0f, -0.34f, 0f);
|
||||
model.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glScalef(1f, 0.99f, 1f);
|
||||
}
|
||||
if(!this.playerTooFar(tile))
|
||||
doRender(tile.getStackInSlot(0));
|
||||
GL11.glPopMatrix();
|
||||
@@ -55,7 +73,10 @@ public class BlockPedestalRenderer extends BlockRendererInterface{
|
||||
if(item == null || item.getItem() == null || item.getItem() instanceof ItemBlock)
|
||||
return;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(0.06f, 0.30f, 0.02f);
|
||||
if(ConfigClient.LegacyPedestal)
|
||||
GL11.glTranslatef(0.06f, 0.30f, 0.02f);
|
||||
else
|
||||
GL11.glTranslatef(0.06f, 0.490f, 0.02f);
|
||||
GL11.glRotatef(180, 0, 0, 1);
|
||||
GL11.glRotatef(90, 0, 1, 0);
|
||||
GL11.glScalef(0.6f, 0.6f, 0.6f);
|
||||
@@ -90,30 +111,53 @@ public class BlockPedestalRenderer extends BlockRendererInterface{
|
||||
RenderManager.instance.itemRenderer.renderItem(Minecraft.getMinecraft().thePlayer, item, 0);
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId,
|
||||
RenderBlocks renderer) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(0, 0.44f, 0);
|
||||
GL11.glScalef(0.76f, 0.66f, 0.76f);
|
||||
GL11.glRotatef(180, 0, 0, 1);
|
||||
GL11.glRotatef(180, 0, 1, 0);
|
||||
|
||||
setMaterialTexture(metadata);
|
||||
GL11.glColor3f(1, 1, 1);
|
||||
model.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
|
||||
if(ConfigClient.LegacyPedestal){
|
||||
GL11.glTranslatef(0, 0.44f, 0);
|
||||
GL11.glScalef(0.76f, 0.66f, 0.76f);
|
||||
GL11.glRotatef(180, 0, 0, 1);
|
||||
GL11.glRotatef(180, 0, 1, 0);
|
||||
setMaterialTexture(metadata);
|
||||
GL11.glColor3f(1, 1, 1);
|
||||
legacyModel.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
} else {
|
||||
GL11.glTranslatef(0, 1.9f, 0);
|
||||
GL11.glScalef(1f, 1.4f, 1f);
|
||||
GL11.glRotatef(180, 0, 0, 1);
|
||||
GL11.glRotatef(180, 0, 1, 0);
|
||||
setPedestalTexture(metadata);
|
||||
GL11.glColor3f(1, 1, 1);
|
||||
model.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public void setPedestalTexture(int meta){
|
||||
TextureManager manager = Minecraft.getMinecraft().getTextureManager();
|
||||
if(meta == 1)
|
||||
manager.bindTexture(stone);
|
||||
else if(meta == 2)
|
||||
manager.bindTexture(iron);
|
||||
else if(meta == 3)
|
||||
manager.bindTexture(gold);
|
||||
else if(meta == 4)
|
||||
manager.bindTexture(diamond);
|
||||
else
|
||||
manager.bindTexture(wood);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return CustomItems.pedestal.getRenderType();
|
||||
}
|
||||
|
||||
|
||||
public int specialRenderDistance(){
|
||||
return 40;
|
||||
}
|
||||
|
||||
@@ -94,6 +94,7 @@ public class ConfigClient
|
||||
public static boolean LegacyLantern = false;
|
||||
public static boolean LegacyCandle = false;
|
||||
public static boolean LegacyTallLamp = false;
|
||||
public static boolean LegacyPedestal = false;
|
||||
|
||||
public static void init(File configFile)
|
||||
{
|
||||
@@ -165,6 +166,7 @@ public class ConfigClient
|
||||
LegacyLantern = config.get(MODEL, "Legacy Lantern Model", false).getBoolean(false);
|
||||
LegacyCandle = config.get(MODEL, "Legacy Candle Model", false).getBoolean(false);
|
||||
LegacyTallLamp = config.get(MODEL, "Legacy Tall Lamp Model", false).getBoolean(false);
|
||||
LegacyPedestal = config.get(MODEL, "Legacy Pedestal Model", false).getBoolean(false);
|
||||
|
||||
// Convert to Legacy
|
||||
if(CustomNpcs.legacyExist){
|
||||
|
||||
Reference in new issue
Block a user