mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-21 12:42:57 +00:00
Fix JABBA-related issues with crafting station slots (#54)
* Fix shift-merging tools voiding items fixes <https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/11392> * Change 0-sized ItemStacks into null stacks in crafting station attached slots Fixes <https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/10425> * Update buildscript * spotlessApply
This commit is contained in:
1 parent
18bfeaff32
commit
39be06c23b
571 files changed
+25959
-28223
No files matched your search
@@ -6,119 +6,100 @@ import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import tconstruct.util.ItemHelper;
|
||||
|
||||
public class BarricadeRender implements ISimpleBlockRenderingHandler
|
||||
{
|
||||
public class BarricadeRender implements ISimpleBlockRenderingHandler {
|
||||
public static int model;
|
||||
|
||||
public BarricadeRender()
|
||||
{
|
||||
public BarricadeRender() {
|
||||
model = RenderingRegistry.getNextAvailableRenderId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block barricade, int modelId, RenderBlocks renderer)
|
||||
{
|
||||
if (modelId == model)
|
||||
{
|
||||
public boolean renderWorldBlock(
|
||||
IBlockAccess world, int x, int y, int z, Block barricade, int modelId, RenderBlocks renderer) {
|
||||
if (modelId == model) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
int type = meta % 4;
|
||||
|
||||
if (meta / 4 == 0)
|
||||
{
|
||||
if (meta / 4 == 0) {
|
||||
// if (type >= 0)
|
||||
// TODO setRenderBounds
|
||||
renderer.setRenderBounds(0.125, 0.0, 0.5, 0.375, 1.0, 0.75);
|
||||
renderer.renderStandardBlock(barricade, x, y, z);
|
||||
|
||||
if (type >= 1)
|
||||
{
|
||||
if (type >= 1) {
|
||||
renderer.setRenderBounds(0.625, 0.0, 0.5, 0.875, 1.0, 0.75);
|
||||
renderer.renderStandardBlock(barricade, x, y, z);
|
||||
}
|
||||
|
||||
if (type >= 2)
|
||||
{
|
||||
if (type >= 2) {
|
||||
renderer.setRenderBounds(0.0, 0.125, 0.25, 1.0, 0.375, 0.5);
|
||||
renderer.renderStandardBlock(barricade, x, y, z);
|
||||
}
|
||||
|
||||
if (type >= 3)
|
||||
{
|
||||
if (type >= 3) {
|
||||
renderer.setRenderBounds(0.0, 0.625, 0.25, 1.0, 0.875, 0.5);
|
||||
renderer.renderStandardBlock(barricade, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
if (meta / 4 == 1)
|
||||
{
|
||||
if (meta / 4 == 1) {
|
||||
// if (type >= 0)
|
||||
renderer.setRenderBounds(0.25, 0.0, 0.125, 0.5, 1.0, 0.375);
|
||||
renderer.renderStandardBlock(barricade, x, y, z);
|
||||
|
||||
if (type >= 1)
|
||||
{
|
||||
if (type >= 1) {
|
||||
renderer.setRenderBounds(0.25, 0.0, 0.625, 0.5, 1.0, 0.875);
|
||||
renderer.renderStandardBlock(barricade, x, y, z);
|
||||
}
|
||||
|
||||
if (type >= 2)
|
||||
{
|
||||
if (type >= 2) {
|
||||
renderer.setRenderBounds(0.5, 0.125, 0.0, 0.75, 0.375, 1.0);
|
||||
renderer.renderStandardBlock(barricade, x, y, z);
|
||||
}
|
||||
|
||||
if (type >= 3)
|
||||
{
|
||||
if (type >= 3) {
|
||||
renderer.setRenderBounds(0.5, 0.625, 0.0, 0.75, 0.875, 1.0);
|
||||
renderer.renderStandardBlock(barricade, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
if (meta / 4 == 2)
|
||||
{
|
||||
if (meta / 4 == 2) {
|
||||
// if (type >= 0)
|
||||
renderer.setRenderBounds(0.125, 0.0, 0.25, 0.375, 1.0, 0.5);
|
||||
renderer.renderStandardBlock(barricade, x, y, z);
|
||||
|
||||
if (type >= 1)
|
||||
{
|
||||
if (type >= 1) {
|
||||
renderer.setRenderBounds(0.625, 0.0, 0.25, 0.875, 1.0, 0.5);
|
||||
renderer.renderStandardBlock(barricade, x, y, z);
|
||||
}
|
||||
|
||||
if (type >= 2)
|
||||
{
|
||||
if (type >= 2) {
|
||||
renderer.setRenderBounds(0.0, 0.125, 0.5, 1.0, 0.375, 0.75);
|
||||
renderer.renderStandardBlock(barricade, x, y, z);
|
||||
}
|
||||
|
||||
if (type >= 3)
|
||||
{
|
||||
if (type >= 3) {
|
||||
renderer.setRenderBounds(0.0, 0.625, 0.5, 1.0, 0.875, 0.75);
|
||||
renderer.renderStandardBlock(barricade, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
if (meta / 4 == 3)
|
||||
{
|
||||
if (meta / 4 == 3) {
|
||||
// if (type >= 0)
|
||||
renderer.setRenderBounds(0.5, 0.0, 0.125, 0.75, 1.0, 0.375);
|
||||
renderer.renderStandardBlock(barricade, x, y, z);
|
||||
|
||||
if (type >= 1)
|
||||
{
|
||||
if (type >= 1) {
|
||||
renderer.setRenderBounds(0.5, 0.0, 0.625, 0.75, 1.0, 0.875);
|
||||
renderer.renderStandardBlock(barricade, x, y, z);
|
||||
}
|
||||
|
||||
if (type >= 2)
|
||||
{
|
||||
if (type >= 2) {
|
||||
renderer.setRenderBounds(0.25, 0.125, 0.0, 0.5, 0.375, 1.0);
|
||||
renderer.renderStandardBlock(barricade, x, y, z);
|
||||
}
|
||||
|
||||
if (type >= 3)
|
||||
{
|
||||
if (type >= 3) {
|
||||
renderer.setRenderBounds(0.25, 0.625, 0.0, 0.5, 0.875, 1.0);
|
||||
renderer.renderStandardBlock(barricade, x, y, z);
|
||||
}
|
||||
@@ -130,10 +111,8 @@ public class BarricadeRender implements ISimpleBlockRenderingHandler
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer)
|
||||
{
|
||||
if (modelID == model)
|
||||
{
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
|
||||
if (modelID == model) {
|
||||
renderer.setRenderBounds(0.375F, 0.0F, 0.375F, 0.625F, 1.0F, 0.625F);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.375F, 0.375F, 0.0F, 0.625F, 0.625F, 1.0F);
|
||||
@@ -142,15 +121,12 @@ public class BarricadeRender implements ISimpleBlockRenderingHandler
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory (int modelId)
|
||||
{
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId ()
|
||||
{
|
||||
public int getRenderId() {
|
||||
return model;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,13 +2,12 @@ package tconstruct.world.model;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
|
||||
public class CrystalModelSmall extends ModelBase
|
||||
{
|
||||
public class CrystalModelSmall extends ModelBase {
|
||||
/*
|
||||
* ModelRenderer body; ModelRendererTurbo top; ModelRendererTurbo bottom;
|
||||
*
|
||||
*
|
||||
* public CrystalModelSmall() { textureWidth = 32; textureHeight = 32;
|
||||
*
|
||||
*
|
||||
* body = new ModelRenderer(this, 0, 8); body.addBox(-2F, 0F, -2F, 4, 6, 4);
|
||||
* body.setRotationPoint(0F, 0F, 0F); setRotation(body, 0, 0.7853982F, 0);
|
||||
* top = new ModelRendererTurbo(this, 0, 0, 32, 32); top.addCone(0, 0, 0,
|
||||
@@ -17,16 +16,16 @@ public class CrystalModelSmall extends ModelBase
|
||||
* new ModelRendererTurbo(this, 0, 18, 32, 32); top.addCone(0, 10, 0, 2.8F,
|
||||
* 4, 4, 0, ModelRendererTurbo.MR_TOP, 4, 8); bottom.setRotationPoint(0F,
|
||||
* 6F, 0F); //setRotation(bottom, 0F, 0F, 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);
|
||||
* setRotationAngles(f, f1, f2, f3, f4, f5, entity); body.render(f5);
|
||||
* top.render(f5); bottom.render(f5); }
|
||||
*
|
||||
*
|
||||
* private void setRotation (ModelRenderer model, float x, float y, float z)
|
||||
* { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z;
|
||||
* }
|
||||
*
|
||||
*
|
||||
* public void setRotationAngles (float f, float f1, float f2, float f3,
|
||||
* float f4, float f5, Entity entity) { super.setRotationAngles(f, f1, f2,
|
||||
* f3, f4, f5, entity); }
|
||||
|
||||
@@ -8,27 +8,23 @@ import net.minecraft.util.ResourceLocation;
|
||||
import tconstruct.world.entity.Crystal;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class CrystalRender extends RenderLiving
|
||||
{
|
||||
public class CrystalRender extends RenderLiving {
|
||||
/** The creeper model. */
|
||||
private ModelBase creeperModel = new CrystalModelSmall();
|
||||
|
||||
public CrystalRender()
|
||||
{
|
||||
public CrystalRender() {
|
||||
super(new CrystalModelSmall(), 0.5F);
|
||||
}
|
||||
|
||||
/**
|
||||
* A method used to render a creeper's powered form as a pass model.
|
||||
*/
|
||||
protected int renderCreeperPassModel (Crystal par1EntityCreeper, int par2, float par3)
|
||||
{
|
||||
protected int renderCreeperPassModel(Crystal par1EntityCreeper, int par2, float par3) {
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
protected int func_77061_b (Crystal par1EntityCreeper, int par2, float par3)
|
||||
{
|
||||
protected int func_77061_b(Crystal par1EntityCreeper, int par2, float par3) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -45,27 +41,23 @@ public class CrystalRender extends RenderLiving
|
||||
* Returns an ARGB int color back. Args: entityLiving, lightBrightness,
|
||||
* partialTickTime
|
||||
*/
|
||||
protected int getColorMultiplier (EntityLiving par1EntityLiving, float par2, float par3)
|
||||
{
|
||||
protected int getColorMultiplier(EntityLiving par1EntityLiving, float par2, float par3) {
|
||||
return super.getColorMultiplier(par1EntityLiving, par2, par3);
|
||||
}
|
||||
|
||||
/**
|
||||
* Queries whether should render the specified pass or not.
|
||||
*/
|
||||
protected int shouldRenderPass (EntityLiving par1EntityLiving, int par2, float par3)
|
||||
{
|
||||
protected int shouldRenderPass(EntityLiving par1EntityLiving, int par2, float par3) {
|
||||
return this.renderCreeperPassModel((Crystal) par1EntityLiving, par2, par3);
|
||||
}
|
||||
|
||||
protected int inheritRenderPass (EntityLiving par1EntityLiving, int par2, float par3)
|
||||
{
|
||||
protected int inheritRenderPass(EntityLiving par1EntityLiving, int par2, float par3) {
|
||||
return this.func_77061_b((Crystal) par1EntityLiving, par2, par3);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture (Entity par1Entity)
|
||||
{
|
||||
protected ResourceLocation getEntityTexture(Entity par1Entity) {
|
||||
return texture;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,29 +6,22 @@ import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import tconstruct.util.ItemHelper;
|
||||
|
||||
public class OreberryRender implements ISimpleBlockRenderingHandler
|
||||
{
|
||||
public class OreberryRender implements ISimpleBlockRenderingHandler {
|
||||
public static int model = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
|
||||
{
|
||||
public boolean renderWorldBlock(
|
||||
IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
|
||||
if (modelId == model)
|
||||
{
|
||||
if (modelId == model) {
|
||||
int md = world.getBlockMetadata(x, y, z);
|
||||
if (md < 4)
|
||||
{
|
||||
if (md < 4) {
|
||||
renderer.setRenderBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.5F, 0.75F);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
else if (md < 8)
|
||||
{
|
||||
} else if (md < 8) {
|
||||
renderer.setRenderBounds(0.125F, 0.0F, 0.125F, 0.875F, 0.75F, 0.875F);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
@@ -38,24 +31,20 @@ public class OreberryRender implements ISimpleBlockRenderingHandler
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer)
|
||||
{
|
||||
if (modelID == model)
|
||||
{
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
|
||||
if (modelID == model) {
|
||||
renderer.setRenderBounds(0.125F, 0.0F, 0.125F, 0.875F, 0.75F, 0.875F);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory (int modelID)
|
||||
{
|
||||
public boolean shouldRender3DInInventory(int modelID) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId ()
|
||||
{
|
||||
public int getRenderId() {
|
||||
return model;
|
||||
}
|
||||
}
|
||||
@@ -6,45 +6,37 @@ import net.minecraft.client.renderer.*;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class PunjiRender implements ISimpleBlockRenderingHandler
|
||||
{
|
||||
public class PunjiRender implements ISimpleBlockRenderingHandler {
|
||||
public static int model = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer)
|
||||
{
|
||||
if (modelID == model)
|
||||
{
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
|
||||
if (modelID == model) {
|
||||
renderer.setRenderBounds(0.4375, 0.0, 0.4375, 0.5625, 1.0f, 0.5625);
|
||||
renderStandardInvBlock(renderer, block, metadata);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer)
|
||||
{
|
||||
if (modelID == model)
|
||||
{
|
||||
public boolean renderWorldBlock(
|
||||
IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer) {
|
||||
if (modelID == model) {
|
||||
int metadata = world.getBlockMetadata(x, y, z);
|
||||
renderer.setRenderBounds(0.4375, 0.0, 0.4375, 0.5625, 0.375f, 0.5625);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
if (metadata >= 1)
|
||||
{
|
||||
if (metadata >= 1) {
|
||||
renderer.setRenderBounds(0.125, 0.0, 0.125, 0.25, 0.375f, 0.25);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
if (metadata >= 2)
|
||||
{
|
||||
if (metadata >= 2) {
|
||||
renderer.setRenderBounds(0.75, 0.0, 0.75, 0.875, 0.375f, 0.875);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
if (metadata >= 3)
|
||||
{
|
||||
if (metadata >= 3) {
|
||||
renderer.setRenderBounds(0.125, 0.0, 0.75, 0.25, 0.375f, 0.875);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
if (metadata >= 4)
|
||||
{
|
||||
if (metadata >= 4) {
|
||||
renderer.setRenderBounds(0.75, 0.0, 0.125, 0.875, 0.375f, 0.25);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
@@ -68,19 +60,16 @@ public class PunjiRender implements ISimpleBlockRenderingHandler
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory (int modelID)
|
||||
{
|
||||
public boolean shouldRender3DInInventory(int modelID) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId ()
|
||||
{
|
||||
public int getRenderId() {
|
||||
return model;
|
||||
}
|
||||
|
||||
public static void renderStandardInvBlock (RenderBlocks renderblocks, Block block, int meta)
|
||||
{
|
||||
public static void renderStandardInvBlock(RenderBlocks renderblocks, Block block, int meta) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
tessellator.startDrawingQuads();
|
||||
|
||||
@@ -9,18 +9,16 @@ import org.lwjgl.opengl.GL11;
|
||||
import tconstruct.mechworks.landmine.Helper;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author fuj1n
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class RenderLandmine implements ISimpleBlockRenderingHandler
|
||||
{
|
||||
public class RenderLandmine implements ISimpleBlockRenderingHandler {
|
||||
|
||||
public static int model = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer)
|
||||
{
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(-0.5F, 0F, -0.5F);
|
||||
|
||||
@@ -31,22 +29,19 @@ public class RenderLandmine implements ISimpleBlockRenderingHandler
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
|
||||
{
|
||||
if (modelId == getRenderId())
|
||||
{
|
||||
public boolean renderWorldBlock(
|
||||
IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
if (modelId == getRenderId()) {
|
||||
renderBasedOnSide(world, x, y, z, block, modelId, renderer);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("incomplete-switch")
|
||||
public void renderBasedOnSide (IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
|
||||
{
|
||||
public void renderBasedOnSide(
|
||||
IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
int l = world.getBlockMetadata(x, y, z);
|
||||
int i1 = l & 7;
|
||||
boolean flag = (l & 8) > 0;
|
||||
@@ -55,41 +50,37 @@ public class RenderLandmine implements ISimpleBlockRenderingHandler
|
||||
|
||||
// TConstruct.logger.info(i1 + " for " + dir);
|
||||
|
||||
switch (dir)
|
||||
{
|
||||
case DOWN:
|
||||
renderer.setRenderBounds(0.0625F, 0.0F, 0.0625F, 1.0F - 0.0625F, 0.0625F, 1.0F - 0.0625F);
|
||||
break;
|
||||
case UP:
|
||||
renderer.setRenderBounds(0.0625F, 1.0F - 0.0625F, 0.0625F, 1.0F - 0.0625F, 1.0F, 1.0F - 0.0625F);
|
||||
break;
|
||||
case NORTH:
|
||||
renderer.setRenderBounds(0.0625F, 0.0625F, 0.0F, 1.0F - 0.0625F, 1.0F - 0.0625F, 0.0625F);
|
||||
break;
|
||||
case SOUTH:
|
||||
renderer.setRenderBounds(0.0625F, 0.0625F, 1.0F - 0.0625F, 1.0F - 0.0625F, 1.0F - 0.0625F, 1.0F);
|
||||
break;
|
||||
case EAST:
|
||||
renderer.setRenderBounds(1.0F - 0.0625F, 0.0625F, 0.0625F, 1.0F, 1.0F - 0.0625F, 1.0F - 0.0625F);
|
||||
break;
|
||||
case WEST:
|
||||
renderer.setRenderBounds(0.0F, 0.0625F, 0.0625F, 0.0625F, 1.0F - 0.0625F, 1.0F - 0.0625F);
|
||||
break;
|
||||
switch (dir) {
|
||||
case DOWN:
|
||||
renderer.setRenderBounds(0.0625F, 0.0F, 0.0625F, 1.0F - 0.0625F, 0.0625F, 1.0F - 0.0625F);
|
||||
break;
|
||||
case UP:
|
||||
renderer.setRenderBounds(0.0625F, 1.0F - 0.0625F, 0.0625F, 1.0F - 0.0625F, 1.0F, 1.0F - 0.0625F);
|
||||
break;
|
||||
case NORTH:
|
||||
renderer.setRenderBounds(0.0625F, 0.0625F, 0.0F, 1.0F - 0.0625F, 1.0F - 0.0625F, 0.0625F);
|
||||
break;
|
||||
case SOUTH:
|
||||
renderer.setRenderBounds(0.0625F, 0.0625F, 1.0F - 0.0625F, 1.0F - 0.0625F, 1.0F - 0.0625F, 1.0F);
|
||||
break;
|
||||
case EAST:
|
||||
renderer.setRenderBounds(1.0F - 0.0625F, 0.0625F, 0.0625F, 1.0F, 1.0F - 0.0625F, 1.0F - 0.0625F);
|
||||
break;
|
||||
case WEST:
|
||||
renderer.setRenderBounds(0.0F, 0.0625F, 0.0625F, 0.0625F, 1.0F - 0.0625F, 1.0F - 0.0625F);
|
||||
break;
|
||||
}
|
||||
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId ()
|
||||
{
|
||||
public int getRenderId() {
|
||||
return model;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory (int modelId)
|
||||
{
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,24 +7,20 @@ import net.minecraft.util.*;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import tconstruct.util.ItemHelper;
|
||||
|
||||
public class SlimeChannelRender implements ISimpleBlockRenderingHandler
|
||||
{
|
||||
public class SlimeChannelRender implements ISimpleBlockRenderingHandler {
|
||||
public static int model = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer)
|
||||
{
|
||||
if (modelID == model)
|
||||
{
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
|
||||
if (modelID == model) {
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer)
|
||||
{
|
||||
if (modelID == model)
|
||||
{
|
||||
public boolean renderWorldBlock(
|
||||
IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer) {
|
||||
if (modelID == model) {
|
||||
renderRotatedBlock(block, x, y, z, world, renderer);
|
||||
return true;
|
||||
}
|
||||
@@ -36,10 +32,8 @@ public class SlimeChannelRender implements ISimpleBlockRenderingHandler
|
||||
static final float LIGHT_XZ_NEG = 0.8F;
|
||||
static final float LIGHT_XZ_POS = 0.6F;
|
||||
|
||||
public boolean renderRotatedBlock (Block block, int x, int y, int z, IBlockAccess world, RenderBlocks renderer)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
public boolean renderRotatedBlock(Block block, int x, int y, int z, IBlockAccess world, RenderBlocks renderer) {
|
||||
if (true) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
int bMeta = world.getBlockMetadata(x, y, z);
|
||||
IIcon iconStill = block.getIcon(1, bMeta);
|
||||
@@ -47,8 +41,7 @@ public class SlimeChannelRender implements ISimpleBlockRenderingHandler
|
||||
|
||||
double u1, u2, u3, u4, v1, v2, v3, v4;
|
||||
|
||||
if (flowDir < -999.0F)
|
||||
{
|
||||
if (flowDir < -999.0F) {
|
||||
u2 = iconStill.getInterpolatedU(0.0D);
|
||||
v2 = iconStill.getInterpolatedV(0.0D);
|
||||
u1 = u2;
|
||||
@@ -57,9 +50,7 @@ public class SlimeChannelRender implements ISimpleBlockRenderingHandler
|
||||
v4 = v1;
|
||||
u3 = u4;
|
||||
v3 = v2;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
float xFlow = MathHelper.sin(flowDir) * 0.25F;
|
||||
float zFlow = MathHelper.cos(flowDir) * 0.25F;
|
||||
u2 = iconStill.getInterpolatedU(8.0F + (-zFlow - xFlow) * 16.0F);
|
||||
@@ -89,7 +80,7 @@ public class SlimeChannelRender implements ISimpleBlockRenderingHandler
|
||||
* 0) renderer.uvRotateTop = 2; if (direction == 1) renderer.uvRotateTop
|
||||
* = 1; if (direction == 2) renderer.uvRotateTop = 0; if (direction ==
|
||||
* 3) renderer.uvRotateTop = 3;
|
||||
*
|
||||
*
|
||||
* boolean flag = renderer.renderStandardBlock(block, x, y, z);
|
||||
* renderer.uvRotateTop = 0; return flag;
|
||||
*/
|
||||
@@ -97,14 +88,12 @@ public class SlimeChannelRender implements ISimpleBlockRenderingHandler
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory (int modelID)
|
||||
{
|
||||
public boolean shouldRender3DInInventory(int modelID) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId ()
|
||||
{
|
||||
public int getRenderId() {
|
||||
return model;
|
||||
}
|
||||
}
|
||||
@@ -5,8 +5,7 @@ import net.minecraft.client.model.*;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class SlimeModel extends ModelBase
|
||||
{
|
||||
public class SlimeModel extends ModelBase {
|
||||
/** The slime's bodies, both the inside box and the outside box */
|
||||
ModelRenderer slimeBodies;
|
||||
|
||||
@@ -19,13 +18,11 @@ public class SlimeModel extends ModelBase
|
||||
/** The slime's mouth */
|
||||
ModelRenderer slimeMouth;
|
||||
|
||||
public SlimeModel(int par1)
|
||||
{
|
||||
public SlimeModel(int par1) {
|
||||
this.slimeBodies = new ModelRenderer(this, 0, par1);
|
||||
this.slimeBodies.addBox(-4.0F, 16.0F, -4.0F, 8, 8, 8);
|
||||
|
||||
if (par1 > 0)
|
||||
{
|
||||
if (par1 > 0) {
|
||||
this.slimeBodies = new ModelRenderer(this, 0, par1);
|
||||
this.slimeBodies.addBox(-3.0F, 17.0F, -3.0F, 6, 6, 6);
|
||||
this.slimeRightEye = new ModelRenderer(this, 32, 0);
|
||||
@@ -41,13 +38,11 @@ public class SlimeModel extends ModelBase
|
||||
* Sets the models various rotation angles then renders the model.
|
||||
*/
|
||||
@Override
|
||||
public void render (Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7)
|
||||
{
|
||||
public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) {
|
||||
this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity);
|
||||
this.slimeBodies.render(par7);
|
||||
|
||||
if (this.slimeRightEye != null)
|
||||
{
|
||||
if (this.slimeRightEye != null) {
|
||||
this.slimeRightEye.render(par7);
|
||||
this.slimeLeftEye.render(par7);
|
||||
this.slimeMouth.render(par7);
|
||||
|
||||
@@ -9,15 +9,12 @@ import tconstruct.util.ItemHelper;
|
||||
import tconstruct.world.TinkerWorld;
|
||||
import tconstruct.world.blocks.SlimePad;
|
||||
|
||||
public class SlimePadRender implements ISimpleBlockRenderingHandler
|
||||
{
|
||||
public class SlimePadRender implements ISimpleBlockRenderingHandler {
|
||||
public static int model = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer)
|
||||
{
|
||||
if (modelID == model)
|
||||
{
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
|
||||
if (modelID == model) {
|
||||
ItemHelper.renderStandardInvBlock(renderer, TinkerWorld.slimeGel, metadata);
|
||||
renderer.setRenderBounds(0f, 0.0625f, 0f, 1f, 0.5f, 1f);
|
||||
ItemHelper.renderStandardInvBlock(renderer, TinkerWorld.slimeGel, 1);
|
||||
@@ -25,59 +22,68 @@ public class SlimePadRender implements ISimpleBlockRenderingHandler
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer)
|
||||
{
|
||||
if (modelID == model)
|
||||
{
|
||||
public boolean renderWorldBlock(
|
||||
IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer) {
|
||||
if (modelID == model) {
|
||||
renderer.setRenderBounds(0f, 0, 0f, 1f, 0.5f, 1f);
|
||||
int metadata = world.getBlockMetadata(x, y, z);
|
||||
BlockSkinRenderHelper.renderLiquidBlock(((SlimePad) block).getFluidIcon(metadata), ((SlimePad) block).getFluidIcon(metadata), x, y, z, renderer, world);
|
||||
BlockSkinRenderHelper.renderLiquidBlock(
|
||||
((SlimePad) block).getFluidIcon(metadata),
|
||||
((SlimePad) block).getFluidIcon(metadata),
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
renderer,
|
||||
world);
|
||||
|
||||
renderer.setRenderBounds(0.125f,0.0625f,0.125f, 0.875f,0.625f,0.875f);
|
||||
renderer.setRenderBounds(0.125f, 0.0625f, 0.125f, 0.875f, 0.625f, 0.875f);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
|
||||
float[] size = size(metadata % 8);
|
||||
renderer.setRenderBounds(size[0], 0.5f, size[1], size[2], 0.6875f, size[3]);
|
||||
BlockSkinRenderHelper.renderLiquidBlock(((SlimePad) block).getNubIcon(metadata), ((SlimePad) block).getNubIcon(metadata), x, y, z, renderer, world);
|
||||
BlockSkinRenderHelper.renderLiquidBlock(
|
||||
((SlimePad) block).getNubIcon(metadata),
|
||||
((SlimePad) block).getNubIcon(metadata),
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
renderer,
|
||||
world);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
float[] size (int meta)
|
||||
{
|
||||
float[] size(int meta) {
|
||||
// xMin, zMin, xMax, zMax
|
||||
switch (meta)
|
||||
{
|
||||
case 0:
|
||||
return new float[] { 0.375f, 0.6875f, 0.625f, 0.9375f };
|
||||
case 1:
|
||||
return new float[] { 0.0625f, 0.6875f, 0.3125f, 0.9375f };
|
||||
case 2:
|
||||
return new float[] { 0.0625f, 0.375f, 0.3125f, 0.625f };
|
||||
case 3:
|
||||
return new float[] { 0.0625f, 0.0625f, 0.3125f, 0.3125f };
|
||||
case 4:
|
||||
return new float[] { 0.375f, 0.0625f, 0.625f, 0.3125f };
|
||||
case 5:
|
||||
return new float[] { 0.6875f, 0.0625f, 0.9375f, 0.3125f };
|
||||
case 6:
|
||||
return new float[] { 0.6875f, 0.375f, 0.9375f, 0.625f };
|
||||
case 7:
|
||||
return new float[] { 0.6875f, 0.6875f, 0.9375f, 0.9375f };
|
||||
switch (meta) {
|
||||
case 0:
|
||||
return new float[] {0.375f, 0.6875f, 0.625f, 0.9375f};
|
||||
case 1:
|
||||
return new float[] {0.0625f, 0.6875f, 0.3125f, 0.9375f};
|
||||
case 2:
|
||||
return new float[] {0.0625f, 0.375f, 0.3125f, 0.625f};
|
||||
case 3:
|
||||
return new float[] {0.0625f, 0.0625f, 0.3125f, 0.3125f};
|
||||
case 4:
|
||||
return new float[] {0.375f, 0.0625f, 0.625f, 0.3125f};
|
||||
case 5:
|
||||
return new float[] {0.6875f, 0.0625f, 0.9375f, 0.3125f};
|
||||
case 6:
|
||||
return new float[] {0.6875f, 0.375f, 0.9375f, 0.625f};
|
||||
case 7:
|
||||
return new float[] {0.6875f, 0.6875f, 0.9375f, 0.9375f};
|
||||
}
|
||||
return new float[] { 0.375f, 0.375f, 0.625f, 0.625f };
|
||||
return new float[] {0.375f, 0.375f, 0.625f, 0.625f};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory (int modelID)
|
||||
{
|
||||
public boolean shouldRender3DInInventory(int modelID) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId ()
|
||||
{
|
||||
public int getRenderId() {
|
||||
return model;
|
||||
}
|
||||
}
|
||||
@@ -11,46 +11,35 @@ import tconstruct.world.entity.KingBlueSlime;
|
||||
import tconstruct.world.entity.SlimeBase;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class SlimeRender extends RenderLiving
|
||||
{
|
||||
public class SlimeRender extends RenderLiving {
|
||||
static final ResourceLocation texture = new ResourceLocation("tinker", "textures/mob/slimeedible.png");
|
||||
private ModelBase scaleAmount;
|
||||
|
||||
public SlimeRender(ModelBase par1ModelBase, ModelBase par2ModelBase, float par3)
|
||||
{
|
||||
public SlimeRender(ModelBase par1ModelBase, ModelBase par2ModelBase, float par3) {
|
||||
super(par1ModelBase, par3);
|
||||
this.scaleAmount = par2ModelBase;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRender (EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9)
|
||||
{
|
||||
public void doRender(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) {
|
||||
super.doRender(par1EntityLiving, par2, par4, par6, par8, par9);
|
||||
if(par1EntityLiving instanceof KingBlueSlime)
|
||||
BossStatus.setBossStatus((KingBlueSlime) par1EntityLiving, true);
|
||||
if (par1EntityLiving instanceof KingBlueSlime) BossStatus.setBossStatus((KingBlueSlime) par1EntityLiving, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether Slime Render should pass or not.
|
||||
*/
|
||||
protected int shouldSlimeRenderPass (SlimeBase slime, int par2, float par3)
|
||||
{
|
||||
if (slime.isInvisible())
|
||||
{
|
||||
protected int shouldSlimeRenderPass(SlimeBase slime, int par2, float par3) {
|
||||
if (slime.isInvisible()) {
|
||||
return 0;
|
||||
}
|
||||
else if (par2 == 0)
|
||||
{
|
||||
} else if (par2 == 0) {
|
||||
this.setRenderPassModel(this.scaleAmount);
|
||||
GL11.glEnable(GL11.GL_NORMALIZE);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (par2 == 1)
|
||||
{
|
||||
} else {
|
||||
if (par2 == 1) {
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
@@ -62,10 +51,10 @@ public class SlimeRender extends RenderLiving
|
||||
/**
|
||||
* sets the scale for the slime based on getSlimeSize in EdibleSlime
|
||||
*/
|
||||
protected void scaleSlime (SlimeBase par1EdibleSlime, float par2)
|
||||
{
|
||||
protected void scaleSlime(SlimeBase par1EdibleSlime, float par2) {
|
||||
float f1 = (float) par1EdibleSlime.getSlimeSize();
|
||||
float f2 = (par1EdibleSlime.sizeHeight + (par1EdibleSlime.sizeFactor - par1EdibleSlime.sizeHeight) * par2) / (f1 * 0.5F + 1.0F);
|
||||
float f2 = (par1EdibleSlime.sizeHeight + (par1EdibleSlime.sizeFactor - par1EdibleSlime.sizeHeight) * par2)
|
||||
/ (f1 * 0.5F + 1.0F);
|
||||
float f3 = 1.0F / (f2 + 1.0F);
|
||||
GL11.glScalef(f3 * f1, 1.0F / f3 * f1, f3 * f1);
|
||||
}
|
||||
@@ -75,8 +64,7 @@ public class SlimeRender extends RenderLiving
|
||||
* the model is rendered. Args: entityLiving, partialTickTime
|
||||
*/
|
||||
@Override
|
||||
protected void preRenderCallback (EntityLivingBase par1EntityLiving, float par2)
|
||||
{
|
||||
protected void preRenderCallback(EntityLivingBase par1EntityLiving, float par2) {
|
||||
this.scaleSlime((SlimeBase) par1EntityLiving, par2);
|
||||
}
|
||||
|
||||
@@ -84,14 +72,12 @@ public class SlimeRender extends RenderLiving
|
||||
* Queries whether should render the specified pass or not.
|
||||
*/
|
||||
@Override
|
||||
protected int shouldRenderPass (EntityLivingBase par1EntityLiving, int par2, float par3)
|
||||
{
|
||||
protected int shouldRenderPass(EntityLivingBase par1EntityLiving, int par2, float par3) {
|
||||
return this.shouldSlimeRenderPass((SlimeBase) par1EntityLiving, par2, par3);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture (Entity par1Entity)
|
||||
{
|
||||
protected ResourceLocation getEntityTexture(Entity par1Entity) {
|
||||
return texture;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user