mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-17 11:05:15 +00:00
Adjust all renderers to support break overlay
This commit is contained in:
1 parent
471f665351
commit
2c19fe16b7
30 files changed
+231
-144
No files matched your search
@@ -1,6 +1,5 @@
|
||||
package crazypants.enderio.conduit;
|
||||
|
||||
import static crazypants.enderio.ModObject.*;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -20,6 +19,8 @@ import crazypants.enderio.material.BlockFusedQuartz;
|
||||
import crazypants.enderio.material.FrankenSkull;
|
||||
import crazypants.enderio.material.Material;
|
||||
|
||||
import static crazypants.enderio.ModObject.*;
|
||||
|
||||
public class ConduitRecipes {
|
||||
|
||||
public static void addRecipes() {
|
||||
|
||||
@@ -24,7 +24,6 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.GuiHandler;
|
||||
import crazypants.enderio.Log;
|
||||
import crazypants.enderio.api.tool.ITool;
|
||||
import crazypants.enderio.conduit.IConduitBundle.FacadeRenderState;
|
||||
import crazypants.enderio.conduit.gas.GasConduitNetwork;
|
||||
import crazypants.enderio.conduit.gas.IGasConduit;
|
||||
|
||||
@@ -5,6 +5,7 @@ import static crazypants.render.CubeRenderer.addVecWithUV;
|
||||
import java.util.List;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@@ -31,8 +32,8 @@ public class GasConduitRenderer extends DefaultConduitRenderer {
|
||||
|
||||
@Override
|
||||
public void renderEntity(ConduitBundleRenderer conduitBundleRenderer, IConduitBundle te, IConduit conduit, double x, double y, double z, float partialTick,
|
||||
float worldLight) {
|
||||
super.renderEntity(conduitBundleRenderer, te, conduit, x, y, z, partialTick, worldLight);
|
||||
float worldLight, RenderBlocks rb) {
|
||||
super.renderEntity(conduitBundleRenderer, te, conduit, x, y, z, partialTick, worldLight, rb);
|
||||
|
||||
if(!conduit.hasConnectionMode(ConnectionMode.INPUT) && !conduit.hasConnectionMode(ConnectionMode.OUTPUT)) {
|
||||
return;
|
||||
|
||||
@@ -23,4 +23,12 @@ public class CollidableComponent {
|
||||
return "CollidableComponent [conduitType=" + conduitType + ", bound=" + bound + ", id=" + dir + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if(obj instanceof CollidableComponent) {
|
||||
CollidableComponent other = (CollidableComponent) obj;
|
||||
return conduitType == other.conduitType && bound.equals(((CollidableComponent) obj).bound) && dir == other.dir;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package crazypants.enderio.conduit.item;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@@ -24,8 +25,8 @@ public class ItemConduitRenderer extends DefaultConduitRenderer {
|
||||
|
||||
@Override
|
||||
public void renderEntity(ConduitBundleRenderer conduitBundleRenderer, IConduitBundle te, IConduit conduit, double x, double y, double z, float partialTick,
|
||||
float worldLight) {
|
||||
super.renderEntity(conduitBundleRenderer, te, conduit, x, y, z, partialTick, worldLight);
|
||||
float worldLight, RenderBlocks rb) {
|
||||
super.renderEntity(conduitBundleRenderer, te, conduit, x, y, z, partialTick, worldLight, rb);
|
||||
|
||||
IItemConduit pc = (IItemConduit) conduit;
|
||||
for (ForgeDirection dir : conduit.getExternalConnections()) {
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
package crazypants.enderio.conduit.liquid;
|
||||
|
||||
import static crazypants.render.CubeRenderer.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@@ -22,6 +21,8 @@ import crazypants.render.RenderUtil;
|
||||
import crazypants.vecmath.Vector3d;
|
||||
import crazypants.vecmath.Vertex;
|
||||
|
||||
import static crazypants.render.CubeRenderer.*;
|
||||
|
||||
public class AdvancedLiquidConduitRenderer extends DefaultConduitRenderer {
|
||||
|
||||
@Override
|
||||
@@ -31,8 +32,8 @@ public class AdvancedLiquidConduitRenderer extends DefaultConduitRenderer {
|
||||
|
||||
@Override
|
||||
public void renderEntity(ConduitBundleRenderer conduitBundleRenderer, IConduitBundle te, IConduit conduit, double x, double y, double z, float partialTick,
|
||||
float worldLight) {
|
||||
super.renderEntity(conduitBundleRenderer, te, conduit, x, y, z, partialTick, worldLight);
|
||||
float worldLight, RenderBlocks rb) {
|
||||
super.renderEntity(conduitBundleRenderer, te, conduit, x, y, z, partialTick, worldLight, rb);
|
||||
|
||||
if(!conduit.hasConnectionMode(ConnectionMode.INPUT) && !conduit.hasConnectionMode(ConnectionMode.OUTPUT)) {
|
||||
return;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package crazypants.enderio.conduit.liquid;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
@@ -23,8 +24,8 @@ public class EnderLiquidConduitRenderer extends DefaultConduitRenderer {
|
||||
|
||||
@Override
|
||||
public void renderEntity(ConduitBundleRenderer conduitBundleRenderer, IConduitBundle te, IConduit conduit, double x, double y, double z, float partialTick,
|
||||
float worldLight) {
|
||||
super.renderEntity(conduitBundleRenderer, te, conduit, x, y, z, partialTick, worldLight);
|
||||
float worldLight, RenderBlocks rb) {
|
||||
super.renderEntity(conduitBundleRenderer, te, conduit, x, y, z, partialTick, worldLight, rb);
|
||||
EnderLiquidConduit pc = (EnderLiquidConduit) conduit;
|
||||
for (ForgeDirection dir : conduit.getExternalConnections()) {
|
||||
IIcon tex = null;
|
||||
|
||||
@@ -5,6 +5,7 @@ import static crazypants.render.CubeRenderer.*;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@@ -42,9 +43,9 @@ public class LiquidConduitRenderer extends DefaultConduitRenderer {
|
||||
|
||||
@Override
|
||||
public void renderEntity(ConduitBundleRenderer conduitBundleRenderer, IConduitBundle te, IConduit conduit, double x, double y, double z, float partialTick,
|
||||
float worldLight) {
|
||||
float worldLight, RenderBlocks rb) {
|
||||
calculateRatios((LiquidConduit) conduit);
|
||||
super.renderEntity(conduitBundleRenderer, te, conduit, x, y, z, partialTick, worldLight);
|
||||
super.renderEntity(conduitBundleRenderer, te, conduit, x, y, z, partialTick, worldLight, rb);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package crazypants.enderio.conduit.power;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@@ -26,8 +27,8 @@ public class PowerConduitRenderer extends DefaultConduitRenderer {
|
||||
|
||||
@Override
|
||||
public void renderEntity(ConduitBundleRenderer conduitBundleRenderer, IConduitBundle te, IConduit conduit, double x, double y, double z, float partialTick,
|
||||
float worldLight) {
|
||||
super.renderEntity(conduitBundleRenderer, te, conduit, x, y, z, partialTick, worldLight);
|
||||
float worldLight, RenderBlocks rb) {
|
||||
super.renderEntity(conduitBundleRenderer, te, conduit, x, y, z, partialTick, worldLight, rb);
|
||||
|
||||
if(!conduit.hasConnectionMode(ConnectionMode.INPUT) && !conduit.hasConnectionMode(ConnectionMode.OUTPUT)) {
|
||||
return;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package crazypants.enderio.conduit.redstone;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@@ -41,9 +42,9 @@ public class RedstoneSwitchRenderer extends DefaultConduitRenderer {
|
||||
@Override
|
||||
public void renderEntity(ConduitBundleRenderer conduitBundleRenderer, IConduitBundle bundle, IConduit conduit, double x, double y, double z,
|
||||
float partialTick,
|
||||
float worldLight) {
|
||||
float worldLight, RenderBlocks rb) {
|
||||
|
||||
super.renderEntity(conduitBundleRenderer, bundle, conduit, x, y, z, partialTick, worldLight);
|
||||
super.renderEntity(conduitBundleRenderer, bundle, conduit, x, y, z, partialTick, worldLight, rb);
|
||||
|
||||
RedstoneSwitch sw = (RedstoneSwitch) conduit;
|
||||
|
||||
|
||||
@@ -15,12 +15,15 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -31,6 +34,7 @@ import crazypants.enderio.conduit.ConduitUtil;
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.conduit.RaytraceResult;
|
||||
import crazypants.enderio.conduit.IConduitBundle.FacadeRenderState;
|
||||
import crazypants.enderio.conduit.TileConduitBundle;
|
||||
import crazypants.enderio.conduit.facade.BlockConduitFacade;
|
||||
@@ -116,7 +120,7 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
|
||||
boolean renderedFacade = !renderFacade(x, y, z, rb, bundle, player);
|
||||
boolean renderConduit = !renderedFacade && BlockConduitBundle.theRenderPass == 0;
|
||||
boolean renderConduit = !renderedFacade && (BlockConduitBundle.theRenderPass == 0 || rb.hasOverrideBlockTexture());
|
||||
|
||||
if(renderConduit) {
|
||||
BlockCoord loc = bundle.getLocation();
|
||||
@@ -126,7 +130,7 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
|
||||
} else {
|
||||
brightness = bundle.getEntity().getWorldObj().getLightBrightnessForSkyBlocks(loc.x, loc.y, loc.z, 0);
|
||||
}
|
||||
renderConduits(bundle, x, y, z, 0, brightness);
|
||||
renderConduits(bundle, x, y, z, 0, brightness, rb);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -181,12 +185,12 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
|
||||
return res;
|
||||
}
|
||||
|
||||
public void renderConduits(IConduitBundle bundle, double x, double y, double z, float partialTick, float brightness) {
|
||||
public void renderConduits(IConduitBundle bundle, double x, double y, double z, float partialTick, float brightness, RenderBlocks rb) {
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.setColorOpaque_F(1, 1, 1);
|
||||
tessellator.addTranslation((float) x, (float) y, (float) z);
|
||||
|
||||
|
||||
// Conduits
|
||||
Set<ForgeDirection> externals = new HashSet<ForgeDirection>();
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
@@ -197,7 +201,7 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
|
||||
|
||||
if(ConduitUtil.renderConduit(player, con)) {
|
||||
ConduitRenderer renderer = EnderIO.proxy.getRendererForConduit(con);
|
||||
renderer.renderEntity(this, bundle, con, x, y, z, partialTick, brightness);
|
||||
renderer.renderEntity(this, bundle, con, x, y, z, partialTick, brightness, rb);
|
||||
Set<ForgeDirection> extCons = con.getExternalConnections();
|
||||
for (ForgeDirection dir : extCons) {
|
||||
if(con.getConnectionMode(dir) != ConnectionMode.DISABLED && con.getConnectionMode(dir) != ConnectionMode.NOT_SET) {
|
||||
@@ -210,41 +214,54 @@ public class ConduitBundleRenderer extends TileEntitySpecialRenderer implements
|
||||
wireBounds.add(component.bound);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Internal conectors between conduits
|
||||
List<CollidableComponent> connectors = bundle.getConnectors();
|
||||
List<CollidableComponent> rendered = Lists.newArrayList();
|
||||
for (CollidableComponent component : connectors) {
|
||||
if(component.conduitType != null) {
|
||||
IConduit conduit = bundle.getConduit(component.conduitType);
|
||||
if(conduit != null) {
|
||||
if(ConduitUtil.renderConduit(player, component.conduitType)) {
|
||||
tessellator.setBrightness((int) (brightness));
|
||||
CubeRenderer.render(component.bound, conduit.getTextureForState(component), true);
|
||||
if(rb.hasOverrideBlockTexture()) {
|
||||
List<RaytraceResult> results = EnderIO.blockConduitBundle.doRayTraceAll(bundle.getWorld(), MathHelper.floor_double(x),
|
||||
MathHelper.floor_double(y), MathHelper.floor_double(z), EnderIO.proxy.getClientPlayer());
|
||||
for (RaytraceResult r : results) {
|
||||
// the connectors can be rendered multiple times and this makes the break texture look funky
|
||||
if(r.component.conduitType == component.conduitType && !rendered.contains(r.component)) {
|
||||
rendered.add(r.component);
|
||||
CubeRenderer.render(component.bound, rb.overrideBlockTexture, true);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
tessellator.setBrightness((int) (brightness));
|
||||
CubeRenderer.render(component.bound, conduit.getTextureForState(component), true);
|
||||
}
|
||||
} else {
|
||||
wireBounds.add(component.bound);
|
||||
}
|
||||
}
|
||||
|
||||
} else if(ConduitUtil.getDisplayMode(player) == ConduitDisplayMode.ALL) {
|
||||
} else if(ConduitUtil.getDisplayMode(player) == ConduitDisplayMode.ALL && !rb.hasOverrideBlockTexture()) {
|
||||
IIcon tex = EnderIO.blockConduitBundle.getConnectorIcon();
|
||||
CubeRenderer.render(component.bound, tex);
|
||||
}
|
||||
}
|
||||
|
||||
//render these after the 'normal' conduits so help with proper blending
|
||||
for (BoundingBox wireBound : wireBounds) {
|
||||
Tessellator.instance.setColorRGBA_F(1, 1, 1, 0.25f);
|
||||
CubeRenderer.render(wireBound, EnderIO.blockConduitFacade.getIcon(0, 0));
|
||||
}
|
||||
if(!rb.hasOverrideBlockTexture()) {
|
||||
//render these after the 'normal' conduits so help with proper blending
|
||||
for (BoundingBox wireBound : wireBounds) {
|
||||
Tessellator.instance.setColorRGBA_F(1, 1, 1, 0.25f);
|
||||
CubeRenderer.render(wireBound, EnderIO.blockConduitFacade.getIcon(0, 0));
|
||||
}
|
||||
|
||||
Tessellator.instance.setColorRGBA_F(1, 1, 1, 1f);
|
||||
// External connection terminations
|
||||
for (ForgeDirection dir : externals) {
|
||||
renderExternalConnection(dir);
|
||||
Tessellator.instance.setColorRGBA_F(1, 1, 1, 1f);
|
||||
// External connection terminations
|
||||
for (ForgeDirection dir : externals) {
|
||||
renderExternalConnection(dir);
|
||||
}
|
||||
}
|
||||
|
||||
tessellator.addTranslation(-(float) x, -(float) y, -(float) z);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package crazypants.enderio.conduit.render;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
|
||||
@@ -8,7 +9,7 @@ public interface ConduitRenderer {
|
||||
boolean isRendererForConduit(IConduit conduit);
|
||||
|
||||
void renderEntity(ConduitBundleRenderer conduitBundleRenderer, IConduitBundle te, IConduit con, double x, double y, double z, float partialTick,
|
||||
float worldLight);
|
||||
float worldLight, RenderBlocks rb);
|
||||
|
||||
boolean isDynamic();
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
package crazypants.enderio.conduit.render;
|
||||
|
||||
import static crazypants.render.CubeRenderer.*;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@@ -18,6 +16,9 @@ import crazypants.render.BoundingBox;
|
||||
import crazypants.render.RenderUtil;
|
||||
import crazypants.vecmath.Vertex;
|
||||
|
||||
import static crazypants.render.CubeRenderer.*;
|
||||
import static net.minecraftforge.common.util.ForgeDirection.*;
|
||||
|
||||
public class DefaultConduitRenderer implements ConduitRenderer {
|
||||
|
||||
protected float transmissionScaleFactor;
|
||||
@@ -29,7 +30,7 @@ public class DefaultConduitRenderer implements ConduitRenderer {
|
||||
|
||||
@Override
|
||||
public void renderEntity(ConduitBundleRenderer conduitBundleRenderer, IConduitBundle te, IConduit conduit, double x, double y, double z, float partialTick,
|
||||
float worldLight) {
|
||||
float worldLight, RenderBlocks rb) {
|
||||
|
||||
Collection<CollidableComponent> components = conduit.getCollidableComponents();
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
@@ -37,25 +38,26 @@ public class DefaultConduitRenderer implements ConduitRenderer {
|
||||
transmissionScaleFactor = conduit.getTransmitionGeometryScale();
|
||||
|
||||
IIcon tex;
|
||||
for (CollidableComponent component : components) {
|
||||
if(renderComponent(component)) {
|
||||
float selfIllum = Math.max(worldLight, conduit.getSelfIlluminationForState(component));
|
||||
if(isNSEWUD(component.dir) &&
|
||||
conduit.getTransmitionTextureForState(component) != null) {
|
||||
tessellator.setBrightness((int) (worldLight));
|
||||
tex = conduit.getTransmitionTextureForState(component);
|
||||
renderTransmission(conduit, tex, component, selfIllum);
|
||||
}
|
||||
|
||||
tex = conduit.getTextureForState(component);
|
||||
if(tex != null) {
|
||||
tessellator.setBrightness((int) (worldLight));
|
||||
renderConduit(tex, conduit, component, selfIllum);
|
||||
if(!rb.hasOverrideBlockTexture()) {
|
||||
for (CollidableComponent component : components) {
|
||||
if(renderComponent(component)) {
|
||||
float selfIllum = Math.max(worldLight, conduit.getSelfIlluminationForState(component));
|
||||
if(isNSEWUD(component.dir) &&
|
||||
conduit.getTransmitionTextureForState(component) != null) {
|
||||
tessellator.setBrightness((int) (worldLight));
|
||||
tex = conduit.getTransmitionTextureForState(component);
|
||||
renderTransmission(conduit, tex, component, selfIllum);
|
||||
}
|
||||
|
||||
tex = conduit.getTextureForState(component);
|
||||
if(tex != null) {
|
||||
tessellator.setBrightness((int) (worldLight));
|
||||
renderConduit(tex, conduit, component, selfIllum);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,33 +1,18 @@
|
||||
package crazypants.enderio.item.skull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.BlockEio;
|
||||
import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.machine.AbstractMachineEntity;
|
||||
import net.minecraft.block.BlockSkull;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemSkull;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTUtil;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntitySkull;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.BlockEio;
|
||||
import crazypants.enderio.ModObject;
|
||||
|
||||
public class BlockEndermanSkull extends BlockEio {
|
||||
|
||||
|
||||
@@ -86,13 +86,16 @@ public class EndermanSkullRenderer implements ISimpleBlockRenderingHandler, IIte
|
||||
float size = 0.25f;
|
||||
float height = 0.5f;
|
||||
BoundingBox bb = new BoundingBox(size, 0, size, 1 - size, height, 1 - size);
|
||||
CubeRenderer.render(bb, icons, rot, true);
|
||||
|
||||
if(meta > 1) {
|
||||
renderBolts(rot, size);
|
||||
if (renderer.hasOverrideBlockTexture()) {
|
||||
CubeRenderer.render(bb, renderer.overrideBlockTexture, rot);
|
||||
} else {
|
||||
CubeRenderer.render(bb, icons, rot, true);
|
||||
|
||||
if(meta > 1) {
|
||||
renderBolts(rot, size);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
tes.addTranslation(-x, -y, -z);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -85,11 +85,13 @@ public class AbstractMachineRenderer implements ISimpleBlockRenderingHandler, II
|
||||
if (te instanceof IPaintableTileEntity && ((IPaintableTileEntity) te).getSourceBlock() != null) {
|
||||
ccr.setOverrideTexture(IconUtil.blankTexture);
|
||||
ccr.renderBlock(world, block, x, y, z, overlayRenderer);
|
||||
ccr.setOverrideTexture(null);
|
||||
ccr.setOverrideTexture(renderer.overrideBlockTexture);
|
||||
paintedRenderer.renderWorldBlock(world, x, y, z, block, modelId, renderer);
|
||||
} else {
|
||||
ccr.setOverrideTexture(renderer.overrideBlockTexture);
|
||||
ccr.renderBlock(world, block, x, y, z, overlayRenderer);
|
||||
}
|
||||
ccr.setOverrideTexture(null);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -147,10 +147,15 @@ public class ObeliskRenderer<T extends TileEntity> extends TileEntitySpecialRend
|
||||
BoundingBox bb = BoundingBox.UNIT_CUBE;
|
||||
|
||||
Tessellator.instance.addTranslation(x, y, z);
|
||||
|
||||
|
||||
IIcon icon = EnderIO.blockAttractor.getOnIcon();
|
||||
if(world != null) {
|
||||
icon = block.getIcon(world, x, y, z, 0);
|
||||
Tessellator.instance.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
|
||||
}
|
||||
|
||||
if(renderer.hasOverrideBlockTexture()) {
|
||||
icon = renderer.overrideBlockTexture;
|
||||
}
|
||||
|
||||
float height = 0.475f;
|
||||
|
||||
@@ -66,7 +66,13 @@ public class CapBankRenderer extends TileEntitySpecialRenderer implements ISimpl
|
||||
connectedTexRenderer.setForceAllEdges(false);
|
||||
}
|
||||
connectedTexRenderer.setEdgeTexture(EnderIO.blockCapBank.getBorderIcon(0, meta));
|
||||
CustomCubeRenderer.instance.renderBlock(world, block, x, y, z, connectedTexRenderer);
|
||||
CustomCubeRenderer.instance.setOverrideTexture(renderer.overrideBlockTexture);
|
||||
if (renderer.overrideBlockTexture == null) {
|
||||
CustomCubeRenderer.instance.renderBlock(world, block, x, y, z, connectedTexRenderer);
|
||||
} else {
|
||||
CustomCubeRenderer.instance.renderBlock(world, block, x, y, z);
|
||||
}
|
||||
CustomCubeRenderer.instance.setOverrideTexture(null);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,23 +6,13 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
|
||||
import net.minecraftforge.client.IItemRenderer.ItemRendererHelper;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import crazypants.enderio.machine.generator.zombie.ModelZombieJar;
|
||||
import crazypants.enderio.machine.generator.zombie.TileZombieGenerator;
|
||||
import crazypants.render.BoundingBox;
|
||||
import crazypants.render.CubeRenderer;
|
||||
import crazypants.render.RenderUtil;
|
||||
import crazypants.util.ForgeDirectionOffsets;
|
||||
import crazypants.vecmath.Vector3d;
|
||||
|
||||
public class EnchanterModelRenderer extends TileEntitySpecialRenderer implements IItemRenderer {
|
||||
|
||||
@@ -49,8 +39,6 @@ public class EnchanterModelRenderer extends TileEntitySpecialRenderer implements
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void renderModel(int facing) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package crazypants.enderio.machine.farm;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -35,25 +35,27 @@ public class FarmingStationRenderer implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
IIcon override = renderer.overrideBlockTexture;
|
||||
|
||||
BoundingBox bb = BoundingBox.UNIT_CUBE;
|
||||
TranslatedCubeRenderer.instance.renderBoundingBox(x, y, z, block, bb, xform, null, world != null);
|
||||
TranslatedCubeRenderer.instance.renderBoundingBox(x, y, z, block, bb, xform, override, world != null);
|
||||
|
||||
float scale = 0.7f;
|
||||
float width = 0.4f;
|
||||
float trans = (1 - scale) / 2;
|
||||
bb = BoundingBox.UNIT_CUBE.scale(1, scale, width);
|
||||
bb = bb.translate(0, -trans, 0);
|
||||
TranslatedCubeRenderer.instance.renderBoundingBox(x, y, z, block, bb, xform, null, world != null);
|
||||
TranslatedCubeRenderer.instance.renderBoundingBox(x, y, z, block, bb, xform, override, world != null);
|
||||
|
||||
bb = BoundingBox.UNIT_CUBE.scale(width, scale, 1);
|
||||
bb = bb.translate(0, -trans, 0);
|
||||
TranslatedCubeRenderer.instance.renderBoundingBox(x, y, z, block, bb, xform, null, world != null);
|
||||
TranslatedCubeRenderer.instance.renderBoundingBox(x, y, z, block, bb, xform, override, world != null);
|
||||
|
||||
float topWidth = 0.15f;
|
||||
bb = BoundingBox.UNIT_CUBE.scale(1, topWidth, 1);
|
||||
bb = bb.translate(0, 0.3f + topWidth / 2f, 0);
|
||||
TranslatedCubeRenderer.instance.renderBoundingBox(x, y, z, block, bb, xform, null, world != null);
|
||||
TranslatedCubeRenderer.instance.renderBoundingBox(x, y, z, block, bb, xform, override, world != null);
|
||||
TranslatedCubeRenderer.instance.getRenderer().setOverrideTexture(null);
|
||||
|
||||
if(world != null) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
@@ -62,13 +64,13 @@ public class FarmingStationRenderer implements ISimpleBlockRenderingHandler {
|
||||
bb = bb.translate(0, 0.1f, 0);
|
||||
bb = bb.translate(x, y, z);
|
||||
Tessellator.instance.setColorOpaque_F(1, 1, 1);
|
||||
CubeRenderer.render(bb, Blocks.portal.getBlockTextureFromSide(1));
|
||||
CubeRenderer.render(bb, override != null ? override : Blocks.portal.getBlockTextureFromSide(1));
|
||||
|
||||
bb = BoundingBox.UNIT_CUBE.scale(.4, 0.08, 1);
|
||||
bb = bb.translate(0, 0.1f, 0);
|
||||
bb = bb.translate(x, y, z);
|
||||
Tessellator.instance.setColorOpaque_F(1, 1, 1);
|
||||
CubeRenderer.render(bb, Blocks.portal.getBlockTextureFromSide(1));
|
||||
CubeRenderer.render(bb, override != null ? override : Blocks.portal.getBlockTextureFromSide(1));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+11
-4
@@ -60,12 +60,14 @@ public class CombustionGeneratorRenderer extends TileEntitySpecialRenderer imple
|
||||
boolean scaleX = facing != 4 && facing != 5;
|
||||
float scx;
|
||||
float scz;
|
||||
|
||||
IIcon override = renderer.overrideBlockTexture;
|
||||
|
||||
//middle chunk
|
||||
bb = BoundingBox.UNIT_CUBE;
|
||||
bb = bb.scale(1, 0.34, 1);
|
||||
vt.setFacing(facing);
|
||||
TranslatedCubeRenderer.instance.renderBoundingBox(x, y, z, block, bb, vt, null ,world != null);
|
||||
TranslatedCubeRenderer.instance.renderBoundingBox(x, y, z, block, bb, vt, override, world != null);
|
||||
|
||||
scaleX = facing != 4 && facing != 5;
|
||||
scx = scaleX ? 0.7f : 1;
|
||||
@@ -75,18 +77,18 @@ public class CombustionGeneratorRenderer extends TileEntitySpecialRenderer imple
|
||||
bb = BoundingBox.UNIT_CUBE;
|
||||
bb = bb.scale(scx, 0.21, scz);
|
||||
bb = bb.translate(0, 0.26f, 0);
|
||||
TranslatedCubeRenderer.instance.renderBoundingBox(x, y, z, block, bb, vt, null ,world != null);
|
||||
TranslatedCubeRenderer.instance.renderBoundingBox(x, y, z, block, bb, vt, override ,world != null);
|
||||
|
||||
|
||||
//lower 1/3
|
||||
bb = BoundingBox.UNIT_CUBE;
|
||||
bb = bb.scale(scx, 0.21, scz);
|
||||
bb = bb.translate(0, -0.26f, 0);
|
||||
TranslatedCubeRenderer.instance.renderBoundingBox(x, y, z, block, bb, vt, null ,world != null);
|
||||
TranslatedCubeRenderer.instance.renderBoundingBox(x, y, z, block, bb, vt, override ,world != null);
|
||||
|
||||
//top / bottom connectors
|
||||
bb = BoundingBox.UNIT_CUBE.scale(0.35, 1, 0.35);
|
||||
TranslatedCubeRenderer.instance.renderBoundingBox(x, y, z, block, bb, vt, null ,world != null);
|
||||
TranslatedCubeRenderer.instance.renderBoundingBox(x, y, z, block, bb, vt, override ,world != null);
|
||||
|
||||
//tanks
|
||||
float size = 0.64f;
|
||||
@@ -105,6 +107,11 @@ public class CombustionGeneratorRenderer extends TileEntitySpecialRenderer imple
|
||||
} else {
|
||||
tex = EnderIO.blockFusedQuartz.getDefaultFrameIcon(0);
|
||||
}
|
||||
|
||||
if (override != null) {
|
||||
tex = override;
|
||||
}
|
||||
|
||||
TranslatedCubeRenderer.instance.renderBoundingBox(x, y, z, block, bb, vt, tex, world != null);
|
||||
|
||||
bb = bb.translate(-tx * 2, 0, -tz * 2);
|
||||
|
||||
+4
-1
@@ -73,5 +73,8 @@ public class TranslatedCubeRenderer {
|
||||
Tessellator.instance.addTranslation(-(float)x,- (float)y, -(float)z);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public CustomCubeRenderer getRenderer() {
|
||||
return ccr;
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,11 @@ public class ElectricLightRenderer implements ISimpleBlockRenderingHandler {
|
||||
RenderUtil.setTesselatorBrightness(world, x, y, z);
|
||||
|
||||
IIcon[] textures = RenderUtil.getBlockTextures(world, x, y, z);
|
||||
CubeRenderer.render(bb, textures, null, null);
|
||||
if(renderer.hasOverrideBlockTexture()) {
|
||||
CubeRenderer.render(bb, renderer.overrideBlockTexture);
|
||||
} else {
|
||||
CubeRenderer.render(bb, textures, null, null);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -64,7 +64,11 @@ public class SolarPanelRenderer implements ISimpleBlockRenderingHandler {
|
||||
meta = MathHelper.clamp_int(meta, 0, 1);
|
||||
ctr.setEdgeTexture(EnderIO.blockSolarPanel.getBorderIcon(0, meta));
|
||||
CustomCubeRenderer.instance.setOverrideTexture(IconUtil.blankTexture);
|
||||
CustomCubeRenderer.instance.renderBlock(world, block, x, y, z, ctr);
|
||||
if(!renderer.hasOverrideBlockTexture()) {
|
||||
CustomCubeRenderer.instance.renderBlock(world, block, x, y, z, ctr);
|
||||
} else {
|
||||
CustomCubeRenderer.instance.renderBlock(world, block, x, y, z);
|
||||
}
|
||||
CustomCubeRenderer.instance.setOverrideTexture(null);
|
||||
Tessellator.instance.addTranslation(0, -0.0001f, 0);
|
||||
return true;
|
||||
|
||||
@@ -23,7 +23,8 @@ public class SoulBinderRenderer implements ISimpleBlockRenderingHandler {
|
||||
private float skullScale = 0.5f;
|
||||
private BoundingBox scaledBB = BoundingBox.UNIT_CUBE.scale(skullScale, skullScale, skullScale);
|
||||
private IIcon[] icons = new IIcon[6];
|
||||
|
||||
private IIcon override = null;
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
||||
|
||||
@@ -38,7 +39,8 @@ public class SoulBinderRenderer implements ISimpleBlockRenderingHandler {
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
|
||||
IIcon soulariumIcon = EnderIO.blockSoulFuser.getIcon(ForgeDirection.EAST.ordinal(), 0);
|
||||
|
||||
override = renderer.overrideBlockTexture;
|
||||
|
||||
//Horrible hack to get the MC lighting engine to set the correct values for me
|
||||
if(renderer != null && world != null) {
|
||||
renderer.setOverrideBlockTexture(IconUtil.blankTexture);
|
||||
@@ -99,7 +101,7 @@ public class SoulBinderRenderer implements ISimpleBlockRenderingHandler {
|
||||
|
||||
private void setIcons(IIcon defaultIcon, IIcon faceIcon, ForgeDirection faceSide) {
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
icons[dir.ordinal()] = dir == faceSide ? faceIcon : defaultIcon;
|
||||
icons[dir.ordinal()] = override != null ? override : dir == faceSide ? faceIcon : defaultIcon;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,23 +1,17 @@
|
||||
package crazypants.enderio.machine.vacuum;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
|
||||
import net.minecraftforge.client.IItemRenderer.ItemRendererHelper;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.render.BoundingBox;
|
||||
import crazypants.render.CubeRenderer;
|
||||
import crazypants.render.RenderUtil;
|
||||
|
||||
public class VacuumChestRenderer implements ISimpleBlockRenderingHandler, IItemRenderer {
|
||||
|
||||
@@ -31,8 +25,9 @@ public class VacuumChestRenderer implements ISimpleBlockRenderingHandler, IItemR
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
|
||||
double size = 0.4;
|
||||
IIcon override = renderer.overrideBlockTexture;
|
||||
|
||||
double size = 0.4;
|
||||
renderer.renderMinX = 0.5 - size;
|
||||
renderer.renderMaxX = 0.5 + size;
|
||||
renderer.renderMinY = 0.5 - size;
|
||||
@@ -40,24 +35,28 @@ public class VacuumChestRenderer implements ISimpleBlockRenderingHandler, IItemR
|
||||
renderer.renderMinZ = 0.5 - size;
|
||||
renderer.renderMaxZ = 0.5 + size;
|
||||
renderer.lockBlockBounds = true;
|
||||
|
||||
renderer.setOverrideBlockTexture(EnderIO.blockHyperCube.getIcon(0, 0));
|
||||
|
||||
if(!renderer.hasOverrideBlockTexture()) {
|
||||
renderer.setOverrideBlockTexture(EnderIO.blockHyperCube.getIcon(0, 0));
|
||||
}
|
||||
renderer.renderStandardBlock(Blocks.stone, x, y, z);
|
||||
renderer.setOverrideBlockTexture(null);
|
||||
|
||||
renderer.setOverrideBlockTexture(override);
|
||||
|
||||
renderer.lockBlockBounds = false;
|
||||
|
||||
|
||||
renderer.renderMinX = 0;
|
||||
renderer.renderMaxX = 1;
|
||||
renderer.renderMinY = 0;
|
||||
renderer.renderMaxY = 1;
|
||||
renderer.renderMinZ = 0;
|
||||
renderer.renderMaxZ = 1;
|
||||
|
||||
renderer.setOverrideBlockTexture(EnderIO.blockVacuumChest.getIcon(0, 0));
|
||||
|
||||
if(!renderer.hasOverrideBlockTexture()) {
|
||||
renderer.setOverrideBlockTexture(EnderIO.blockVacuumChest.getIcon(0, 0));
|
||||
}
|
||||
renderer.renderStandardBlock(Blocks.stone, x, y, z);
|
||||
renderer.setOverrideBlockTexture(null);
|
||||
|
||||
renderer.setOverrideBlockTexture(override);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -71,18 +71,20 @@ public class VatRenderer implements ISimpleBlockRenderingHandler, IItemRenderer
|
||||
}
|
||||
|
||||
float fudge = 1f;
|
||||
|
||||
IIcon override = renderer.overrideBlockTexture;
|
||||
|
||||
//-x side
|
||||
BoundingBox bb = BoundingBox.UNIT_CUBE.scale(0.334, fudge,fudge);
|
||||
bb = bb.translate(0.5f - (0.334f/2),0,0);
|
||||
TranslatedCubeRenderer.instance.renderBoundingBox(x, y, z, block, bb, xform, world != null);
|
||||
TranslatedCubeRenderer.instance.renderBoundingBox(x, y, z, block, bb, xform, override, world != null);
|
||||
|
||||
bb = BoundingBox.UNIT_CUBE.scale(0.334, fudge,fudge);
|
||||
TranslatedCubeRenderer.instance.renderBoundingBox(x, y, z, block, bb, xform, world != null);
|
||||
TranslatedCubeRenderer.instance.renderBoundingBox(x, y, z, block, bb, xform, override, world != null);
|
||||
|
||||
bb = BoundingBox.UNIT_CUBE.scale(0.334, fudge,fudge);
|
||||
bb = bb.translate(-0.5f + (0.334f/2),0,0);
|
||||
TranslatedCubeRenderer.instance.renderBoundingBox(x, y, z, block, bb, xform, world != null);
|
||||
TranslatedCubeRenderer.instance.renderBoundingBox(x, y, z, block, bb, xform, override, world != null);
|
||||
|
||||
if(vat != null) {
|
||||
ccr.renderBlock(world, block, x, y, z, overlayRenderer);
|
||||
@@ -104,7 +106,9 @@ public class VatRenderer implements ISimpleBlockRenderingHandler, IItemRenderer
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
Tessellator tes = Tessellator.instance;
|
||||
tes.startDrawingQuads();
|
||||
tes.addTranslation(0, -0.1f, 0);
|
||||
renderWorldBlock(null, 0, 0, 0, block, 0, renderer);
|
||||
tes.addTranslation(0, 0.1f, 0);
|
||||
tes.draw();
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
|
||||
@@ -67,12 +67,17 @@ public class FusedQuartzRenderer implements ISimpleBlockRenderingHandler {
|
||||
if(te instanceof TileEntityPaintedBlock) {
|
||||
tecb = (TileEntityPaintedBlock) te;
|
||||
}
|
||||
IBlockAccess origBa = renderer.blockAccess;
|
||||
renderer.blockAccess = new FacadeAccessWrapper(origBa);
|
||||
try {
|
||||
renderFrame(renderer.blockAccess, x, y, z, tecb, false, meta);
|
||||
} finally {
|
||||
renderer.blockAccess = origBa;
|
||||
|
||||
if(renderer.hasOverrideBlockTexture()) {
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
} else {
|
||||
IBlockAccess origBa = renderer.blockAccess;
|
||||
renderer.blockAccess = new FacadeAccessWrapper(origBa);
|
||||
try {
|
||||
renderFrame(renderer.blockAccess, x, y, z, tecb, false, meta);
|
||||
} finally {
|
||||
renderer.blockAccess = origBa;
|
||||
}
|
||||
}
|
||||
// }
|
||||
return true;
|
||||
|
||||
@@ -345,4 +345,40 @@ public final class BoundingBox {
|
||||
return AxisAlignedBB.getBoundingBox(minX, minY, minZ, maxX, maxY, maxZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + Float.floatToIntBits(maxX);
|
||||
result = prime * result + Float.floatToIntBits(maxY);
|
||||
result = prime * result + Float.floatToIntBits(maxZ);
|
||||
result = prime * result + Float.floatToIntBits(minX);
|
||||
result = prime * result + Float.floatToIntBits(minY);
|
||||
result = prime * result + Float.floatToIntBits(minZ);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if(this == obj)
|
||||
return true;
|
||||
if(obj == null)
|
||||
return false;
|
||||
if(getClass() != obj.getClass())
|
||||
return false;
|
||||
BoundingBox other = (BoundingBox) obj;
|
||||
if(Float.floatToIntBits(maxX) != Float.floatToIntBits(other.maxX))
|
||||
return false;
|
||||
if(Float.floatToIntBits(maxY) != Float.floatToIntBits(other.maxY))
|
||||
return false;
|
||||
if(Float.floatToIntBits(maxZ) != Float.floatToIntBits(other.maxZ))
|
||||
return false;
|
||||
if(Float.floatToIntBits(minX) != Float.floatToIntBits(other.minX))
|
||||
return false;
|
||||
if(Float.floatToIntBits(minY) != Float.floatToIntBits(other.minY))
|
||||
return false;
|
||||
if(Float.floatToIntBits(minZ) != Float.floatToIntBits(other.minZ))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,6 @@ public class CustomCubeRenderer {
|
||||
if(rb == null) {
|
||||
rb = new CustomRenderBlocks(ba);
|
||||
}
|
||||
|
||||
rb.blockAccess = ba;
|
||||
rb.setOverrideTexture(getOverrideTexture());
|
||||
rb.setFaceRenderers(null);
|
||||
@@ -31,7 +30,6 @@ public class CustomCubeRenderer {
|
||||
}
|
||||
rb.setRenderBoundsFromBlock(par1Block);
|
||||
rb.renderStandardBlock(par1Block, par2, par3, par4);
|
||||
|
||||
}
|
||||
|
||||
public void renderBlock(IBlockAccess ba, Block par1Block, int par2, int par3, int par4, Collection<IRenderFace> renderers) {
|
||||
@@ -43,7 +41,6 @@ public class CustomCubeRenderer {
|
||||
rb.setFaceRenderers(renderers);
|
||||
rb.setRenderBoundsFromBlock(par1Block);
|
||||
rb.renderStandardBlock(par1Block, par2, par3, par4);
|
||||
|
||||
}
|
||||
|
||||
public IIcon getOverrideTexture() {
|
||||
|
||||
Reference in new issue
Block a user