mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-18 11:29:30 +00:00
Selection box of formed telepad contains whole structure, fix render BB
This commit is contained in:
1 parent
ffbfb52a1a
commit
2d39c6b60c
6 files changed
+31
-5
No files matched your search
@@ -115,6 +115,7 @@ public class CapBankRenderer extends TileEntitySpecialRenderer implements ISimpl
|
||||
|
||||
tes.startDrawingQuads();
|
||||
tes.setColorRGBA_F(1, 1, 1, 1);
|
||||
tes.addTranslation(0, -0.1f, 0);
|
||||
renderBorder(null, 0, 0, 0, item.getItemDamage());
|
||||
tes.draw();
|
||||
|
||||
@@ -130,7 +131,7 @@ public class CapBankRenderer extends TileEntitySpecialRenderer implements ISimpl
|
||||
fillGaugeRenderer.doRender(nw, RenderUtil.BRIGHTNESS_MAX, gi, key);
|
||||
// key = new GaugeKey(ForgeDirection.EAST, FillGauge.Type.SINGLE);
|
||||
// fillGaugeRenderer.doRender(nw, RenderUtil.BRIGHTNESS_MAX, gi, key);
|
||||
|
||||
tes.addTranslation(0, 0.1f, 0);
|
||||
}
|
||||
|
||||
private void renderBorder(IBlockAccess blockAccess, int x, int y, int z, int meta) {
|
||||
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
@@ -78,7 +79,17 @@ public class BlockTelePad extends BlockTravelAnchor {
|
||||
public int getRenderType() {
|
||||
return renderId;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
AxisAlignedBB bb = super.getSelectedBoundingBoxFromPool(world, x, y, z);
|
||||
TileTelePad te = (TileTelePad) world.getTileEntity(x, y, z);
|
||||
if(!te.inNetwork()) {
|
||||
return bb;
|
||||
}
|
||||
return te.getBoundingBox();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block changedTo) {
|
||||
super.onNeighborBlockChange(world, x, y, z, changedTo);
|
||||
|
||||
@@ -3,7 +3,6 @@ package crazypants.enderio.teleport.telepad;
|
||||
import java.awt.Rectangle;
|
||||
import java.util.List;
|
||||
|
||||
import joptsimple.internal.Strings;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
@@ -21,7 +20,6 @@ import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.GuiHandler;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.gui.TextFieldEIO;
|
||||
import crazypants.enderio.gui.TextFieldEIO.ICharFilter;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.gui.GuiContainerBase;
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.Map;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.client.model.obj.GroupObject;
|
||||
@@ -54,6 +55,8 @@ public class TelePadRenderer extends TechneModelRenderer {
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
||||
Tessellator.instance.startDrawingQuads();
|
||||
CubeRenderer.render(block, metadata);
|
||||
Tessellator.instance.draw();
|
||||
}
|
||||
}
|
||||
@@ -332,6 +332,19 @@ public class TileTelePad extends TileTravelAnchor implements IInternalPowerRecei
|
||||
return toTeleport.peek();
|
||||
}
|
||||
|
||||
public AxisAlignedBB getBoundingBox() {
|
||||
if(!inNetwork()) {
|
||||
return AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1);
|
||||
}
|
||||
TileTelePad master = getMaster();
|
||||
return AxisAlignedBB.getBoundingBox(master.xCoord - 1, master.yCoord, master.zCoord - 1, master.xCoord + 2, master.yCoord + 1, master.zCoord + 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
return getBoundingBox();
|
||||
}
|
||||
|
||||
/* IProgressTile */
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,7 +24,7 @@ public final class CubeRenderer {
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
icons[dir.ordinal()] = block.getIcon(dir.ordinal(), meta);
|
||||
}
|
||||
render(BoundingBox.UNIT_CUBE, icons, xForm, true);
|
||||
render(BoundingBox.UNIT_CUBE.translate(0, -0.1f, 0), icons, xForm, true);
|
||||
}
|
||||
|
||||
public static void render(BoundingBox bb, IIcon tex) {
|
||||
|
||||
Reference in new issue
Block a user