mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 10:49:07 +00:00
Complete Candle Texture + Lantern 2D Texture
This commit is contained in:
1 parent
0a04560243
commit
4905b9400a
15 files changed
+413
-86
No files matched your search
@@ -12,19 +12,30 @@ import net.minecraft.world.IBlockAccess;
|
||||
import noppes.npcs.CustomItems;
|
||||
import noppes.npcs.blocks.BlockCandle;
|
||||
import noppes.npcs.blocks.tiles.TileCandle;
|
||||
import noppes.npcs.client.model.blocks.ModelCandle;
|
||||
import noppes.npcs.client.model.blocks.ModelCandleCeiling;
|
||||
import noppes.npcs.client.model.blocks.ModelCandleWall;
|
||||
import noppes.npcs.client.model.blocks.candle.ModelCandle;
|
||||
import noppes.npcs.client.model.blocks.candle.ModelCandleCeiling;
|
||||
import noppes.npcs.client.model.blocks.candle.ModelCandleWall;
|
||||
import noppes.npcs.client.model.blocks.legacy.ModelLegacyCandle;
|
||||
import noppes.npcs.client.model.blocks.legacy.ModelLegacyCandleCeiling;
|
||||
import noppes.npcs.client.model.blocks.legacy.ModelLegacyCandleWall;
|
||||
import noppes.npcs.config.ConfigClient;
|
||||
import noppes.npcs.config.legacy.LegacyConfig;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
public class BlockCandleRenderer extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler{
|
||||
|
||||
private final ModelCandle model = new ModelCandle();
|
||||
private final ModelCandleWall modelWall = new ModelCandleWall();
|
||||
private final ModelCandleCeiling modelCeiling = new ModelCandleCeiling();
|
||||
private static final ResourceLocation resource1 = new ResourceLocation("customnpcs","textures/models/Candle.png");
|
||||
|
||||
private final ModelLegacyCandle legacyCandle = new ModelLegacyCandle();
|
||||
private final ModelLegacyCandleWall legacyCandleWall = new ModelLegacyCandleWall();
|
||||
private final ModelLegacyCandleCeiling legacyCandleCeiling = new ModelLegacyCandleCeiling();
|
||||
|
||||
private final ModelCandle candle = new ModelCandle();
|
||||
private final ModelCandleWall candleWall = new ModelCandleWall();
|
||||
private final ModelCandleCeiling candleCeiling = new ModelCandleCeiling();
|
||||
|
||||
private static final ResourceLocation legacy = new ResourceLocation("customnpcs","textures/models/legacy/Candle.png");
|
||||
private static final ResourceLocation texture = new ResourceLocation("customnpcs","textures/models/candle.png");
|
||||
|
||||
public BlockCandleRenderer(){
|
||||
((BlockCandle)CustomItems.candle).renderId = RenderingRegistry.getNextAvailableRenderId();
|
||||
((BlockCandle)CustomItems.candle_unlit).renderId = ((BlockCandle)CustomItems.candle).renderId;
|
||||
@@ -40,19 +51,43 @@ public class BlockCandleRenderer extends TileEntitySpecialRenderer implements IS
|
||||
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(45 * tile.rotation, 0, 1, 0);
|
||||
GL11.glColor3f(1, 1, 1);
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(resource1);
|
||||
if(tile.color == 0)
|
||||
model.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
else if(tile.color == 1)
|
||||
modelCeiling.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
else{
|
||||
GL11.glRotatef(180, 0, 1, 0);
|
||||
modelWall.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
}
|
||||
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
if(ConfigClient.LegacyCandle){
|
||||
GL11.glRotatef(45 * tile.rotation, 0, 1, 0);
|
||||
GL11.glColor3f(1, 1, 1);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(legacy);
|
||||
if(tile.color == 0)
|
||||
legacyCandle.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
else if(tile.color == 1)
|
||||
legacyCandleCeiling.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
else{
|
||||
GL11.glRotatef(180, 0, 1, 0);
|
||||
legacyCandleWall.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
}
|
||||
} else {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
if(tile.color == 0){
|
||||
GL11.glRotatef(45 * tile.rotation, 0, 1, 0);
|
||||
GL11.glColor3f(1, 1, 1);
|
||||
candle.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
}
|
||||
else if(tile.color == 1){
|
||||
GL11.glPushMatrix();
|
||||
GL11.glColor3f(1, 1, 1);
|
||||
GL11.glRotatef( 90, 0, 1, 0);
|
||||
candleCeiling.Chain.render(0.0625F);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glRotatef(45 * tile.rotation, 0, 1, 0);
|
||||
candleCeiling.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
}
|
||||
else{
|
||||
GL11.glRotatef(45 * tile.rotation, 0, 1, 0);
|
||||
GL11.glColor3f(1, 1, 1);
|
||||
candleWall.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
}
|
||||
}
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@@ -65,9 +100,15 @@ public class BlockCandleRenderer extends TileEntitySpecialRenderer implements IS
|
||||
GL11.glRotatef(180, 0, 0, 1);
|
||||
GL11.glRotatef(180, 0, 1, 0);
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(resource1);
|
||||
GL11.glColor3f(1, 1, 1);
|
||||
model.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
if(ConfigClient.LegacyCandle){
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(legacy);
|
||||
GL11.glColor3f(1, 1, 1);
|
||||
legacyCandle.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
} else {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
GL11.glColor3f(1, 1, 1);
|
||||
candle.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
@@ -82,7 +123,7 @@ public class BlockCandleRenderer extends TileEntitySpecialRenderer implements IS
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return true;
|
||||
return ConfigClient.LegacyCandle;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user