mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-25 00:34:28 +00:00
Full Imports and Code Format Optimization
This commit is contained in:
1 parent
250edf099c
commit
6815f579a7
1192 files changed
+60344
-62167
No files matched your search
@@ -15,28 +15,29 @@ import noppes.npcs.client.model.blocks.legacy.ModelLegacyTable;
|
||||
import noppes.npcs.config.ConfigClient;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class BlockTableRenderer extends BlockRendererInterface{
|
||||
public class BlockTableRenderer extends BlockRendererInterface {
|
||||
|
||||
private final ModelLegacyTable legacyTable = new ModelLegacyTable();
|
||||
private final ModelLegacyTable legacyTable = new ModelLegacyTable();
|
||||
private final ModelTable table = new ModelTable();
|
||||
|
||||
private static final ResourceLocation oak = new ResourceLocation("customnpcs","textures/models/table/oak.png");
|
||||
private static final ResourceLocation spruce = new ResourceLocation("customnpcs","textures/models/table/spruce.png");
|
||||
private static final ResourceLocation birch = new ResourceLocation("customnpcs","textures/models/table/birch.png");
|
||||
private static final ResourceLocation jungle = new ResourceLocation("customnpcs","textures/models/table/jungle.png");
|
||||
private static final ResourceLocation acacia = new ResourceLocation("customnpcs","textures/models/table/acacia.png");
|
||||
private static final ResourceLocation dark_oak = new ResourceLocation("customnpcs","textures/models/table/dark_oak.png");
|
||||
private static final ResourceLocation oak = new ResourceLocation("customnpcs", "textures/models/table/oak.png");
|
||||
private static final ResourceLocation spruce = new ResourceLocation("customnpcs", "textures/models/table/spruce.png");
|
||||
private static final ResourceLocation birch = new ResourceLocation("customnpcs", "textures/models/table/birch.png");
|
||||
private static final ResourceLocation jungle = new ResourceLocation("customnpcs", "textures/models/table/jungle.png");
|
||||
private static final ResourceLocation acacia = new ResourceLocation("customnpcs", "textures/models/table/acacia.png");
|
||||
private static final ResourceLocation dark_oak = new ResourceLocation("customnpcs", "textures/models/table/dark_oak.png");
|
||||
|
||||
public BlockTableRenderer(){
|
||||
((BlockTable)CustomItems.table).renderId = RenderingRegistry.getNextAvailableRenderId();
|
||||
RenderingRegistry.registerBlockHandler(this);
|
||||
}
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity var1, double var2, double var4,
|
||||
double var6, float var8) {
|
||||
TileVariant tile = (TileVariant) var1;
|
||||
public BlockTableRenderer() {
|
||||
((BlockTable) CustomItems.table).renderId = RenderingRegistry.getNextAvailableRenderId();
|
||||
RenderingRegistry.registerBlockHandler(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity var1, double var2, double var4,
|
||||
double var6, float var8) {
|
||||
TileVariant tile = (TileVariant) var1;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)var2 + 0.5f, (float)var4 + 1.5f, (float)var6 + 0.5f);
|
||||
GL11.glTranslatef((float) var2 + 0.5f, (float) var4 + 1.5f, (float) var6 + 0.5f);
|
||||
GL11.glRotatef(180, 0, 0, 1);
|
||||
GL11.glColor3f(1, 1, 1);
|
||||
|
||||
@@ -52,7 +53,7 @@ public class BlockTableRenderer extends BlockRendererInterface{
|
||||
|
||||
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
if(ConfigClient.LegacyTable){
|
||||
if (ConfigClient.LegacyTable) {
|
||||
setWoodTexture(var1.getBlockMetadata());
|
||||
legacyTable.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
GL11.glRotatef(90 * tile.rotation, 0, 1, 0);
|
||||
@@ -66,18 +67,18 @@ public class BlockTableRenderer extends BlockRendererInterface{
|
||||
|
||||
}
|
||||
GL11.glPopAttrib();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId,
|
||||
RenderBlocks renderer) {
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId,
|
||||
RenderBlocks renderer) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(0, 0.9f, 0);
|
||||
GL11.glRotatef(180, 0, 0, 1);
|
||||
GL11.glRotatef(180, 0, 1, 0);
|
||||
|
||||
if(ConfigClient.LegacyTable){
|
||||
if (ConfigClient.LegacyTable) {
|
||||
setWoodTexture(metadata);
|
||||
GL11.glColor3f(1, 1, 1);
|
||||
legacyTable.Table.render(0.0625f);
|
||||
@@ -97,27 +98,27 @@ public class BlockTableRenderer extends BlockRendererInterface{
|
||||
table.render(null, 0, 0, 0, 0, 0.0F, 0.0625F);
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public void setTableTexture(int meta){
|
||||
public void setTableTexture(int meta) {
|
||||
TextureManager manager = Minecraft.getMinecraft().getTextureManager();
|
||||
if(meta == 1)
|
||||
if (meta == 1)
|
||||
manager.bindTexture(spruce);
|
||||
else if(meta == 2)
|
||||
else if (meta == 2)
|
||||
manager.bindTexture(birch);
|
||||
else if(meta == 3)
|
||||
else if (meta == 3)
|
||||
manager.bindTexture(jungle);
|
||||
else if(meta == 4)
|
||||
else if (meta == 4)
|
||||
manager.bindTexture(acacia);
|
||||
else if(meta == 5)
|
||||
else if (meta == 5)
|
||||
manager.bindTexture(dark_oak);
|
||||
else
|
||||
manager.bindTexture(oak);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return CustomItems.table.getRenderType();
|
||||
}
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return CustomItems.table.getRenderType();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user