Merge pull request #3040 from WolfEclipses/MachineOverlay

Machine Placement Overlay
This commit is contained in:
HbmMods 2026-07-23 11:55:59 +02:00 committed by GitHub
commit 6cee1fb273
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
25 changed files with 392 additions and 22 deletions

View File

@ -5,6 +5,8 @@ import com.hbm.handler.ThreeInts;
import com.hbm.interfaces.ICopiable;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.IPersistentNBT;
import com.hbm.util.EntityDamageUtil;
import com.hbm.util.fauxpointtwelve.BlockPos;
import com.hbm.world.gen.nbt.INBTBlockTransformable;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
@ -13,6 +15,7 @@ import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderGlobal;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@ -32,10 +35,14 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.client.event.DrawBlockHighlightEvent;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraft.client.renderer.Tessellator;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.Set;
import org.lwjgl.opengl.GL11;
public abstract class BlockDummyable extends BlockContainer implements ICustomBlockHighlight, ICopiable, INBTBlockTransformable {
@ -595,4 +602,151 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
return meta;
}
public int[][] getAllDimensions() {
return new int[][] { getDimensions() };
}
@SideOnly(Side.CLIENT)
public void drawPlacementHighlight(EntityPlayer player, float interp) {
MovingObjectPosition mop = EntityDamageUtil.getMouseOver(player, 5.0D);
if(mop != null && mop.typeOfHit == mop.typeOfHit.BLOCK) {
double dX = player.lastTickPosX + (player.posX - player.lastTickPosX) * (double) interp;
double dY = player.lastTickPosY + (player.posY - player.lastTickPosY) * (double) interp;
double dZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double) interp;
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
int o = -getOffset();
int pY = mop.blockY + getHeightOffset();
//Orientation
ForgeDirection facing = ForgeDirection.NORTH;
if(i == 0) facing = ForgeDirection.getOrientation(2);
if(i == 1) facing = ForgeDirection.getOrientation(5);
if(i == 2) facing = ForgeDirection.getOrientation(3);
if(i == 3) facing = ForgeDirection.getOrientation(4);
facing = getDirModified(facing);
double originX = mop.blockX + facing.offsetX * o;
double originY = pY + (mop.sideHit == 1 ? 1 : 0);
double originZ = mop.blockZ + facing.offsetZ * o;
boolean canPlace = checkRequirement(player.worldObj, mop.blockX, pY + 1, mop.blockZ, facing, o);
Tessellator tess = Tessellator.instance;
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_TEXTURE_2D);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240F, 240F);
GL11.glLineWidth(2.0F);
GL11.glDepthMask(false);
tess.startDrawing(GL11.GL_LINES);
tess.setBrightness(240);
if (canPlace) {
tess.setColorRGBA(0, 255, 0, 255);
} else {
tess.setColorRGBA(255, 0, 0, 255);
}
//Gets the list of different dimensions that each XLmultiblock has, and generates the list of blocks that needs to be highlighted.
//Each XL multiblock has the getAllDimensions overridden in its own class. Each NEEDS it or it will show the incorect shape.
List<BlockPos> blocks = new java.util.ArrayList<>();
Set<BlockPos> set = new java.util.HashSet<>();
for(int[] dims : getAllDimensions()) {
//Some of the multiblocks have offsets for the placements, so this allows for the ones that dont need it to have a bunch of 0s at the end.
int offFwd = dims.length > 6 ? dims[6] : 0;
int offUp = dims.length > 7 ? dims[7] : 0;
int offLat = dims.length > 8 ? dims[8] : 0;
int worldOffX;
int worldOffY;
int worldOffZ;
worldOffY = offUp;
worldOffX = facing.offsetX * offFwd + facing.getRotation(ForgeDirection.UP).offsetX * offLat;
worldOffZ = facing.offsetZ * offFwd + facing.getRotation(ForgeDirection.UP).offsetZ * offLat;
int[] rot = MultiblockHandlerXR.rotate(dims, facing);
for(int bx = -rot[4] + worldOffX; bx <= rot[5] + worldOffX; bx++) {
for(int by = -rot[1] + worldOffY; by <= rot[0] + worldOffY; by++) {
for(int bz = -rot[2] + worldOffZ; bz <= rot[3] + worldOffZ; bz++) {
BlockPos bp = new BlockPos(
MathHelper.floor_double(originX) + bx,
MathHelper.floor_double(originY) + by,
MathHelper.floor_double(originZ) + bz
);
blocks.add(bp);
set.add(bp);
}
}
}
}
//This looks for the blocks nearby and draws lines between the vertexes to make different shaped boxes.
//Most of this was taken from Mellow (Thanks mellow) -Wolf
for(BlockPos pos : blocks) {
boolean px = set.contains(pos.add(1, 0, 0));
boolean nx = set.contains(pos.add(-1, 0, 0));
boolean ppy = set.contains(pos.add(0, 1, 0));
boolean ny = set.contains(pos.add(0, -1, 0));
boolean ppz = set.contains(pos.add(0, 0, 1));
boolean nz = set.contains(pos.add(0, 0, -1));
double minX = pos.getX() - dX;
double maxX = pos.getX() + 1 - dX;
double minY = pos.getY() - dY;
double maxY = pos.getY() + 1 - dY;
double minZ = pos.getZ() - dZ;
double maxZ = pos.getZ() + 1 - dZ;
if(!ppy) {
if(!nx) { tess.addVertex(minX, maxY, minZ); tess.addVertex(minX, maxY, maxZ); }
if(!ppz) { tess.addVertex(minX, maxY, maxZ); tess.addVertex(maxX, maxY, maxZ); }
if(!px) { tess.addVertex(maxX, maxY, maxZ); tess.addVertex(maxX, maxY, minZ); }
if(!nz) { tess.addVertex(maxX, maxY, minZ); tess.addVertex(minX, maxY, minZ); }
}
if(!ny) {
if(!nx) { tess.addVertex(minX, minY, minZ); tess.addVertex(minX, minY, maxZ); }
if(!ppz) { tess.addVertex(minX, minY, maxZ); tess.addVertex(maxX, minY, maxZ); }
if(!px) { tess.addVertex(maxX, minY, maxZ); tess.addVertex(maxX, minY, minZ); }
if(!nz) { tess.addVertex(maxX, minY, minZ); tess.addVertex(minX, minY, minZ); }
}
if(!nz) {
if(!nx) { tess.addVertex(minX, minY, minZ); tess.addVertex(minX, maxY, minZ); }
if(!ppy) { tess.addVertex(minX, maxY, minZ); tess.addVertex(maxX, maxY, minZ); }
if(!px) { tess.addVertex(maxX, maxY, minZ); tess.addVertex(maxX, minY, minZ); }
if(!ny) { tess.addVertex(maxX, minY, minZ); tess.addVertex(minX, minY, minZ); }
}
if(!ppz) {
if(!nx) { tess.addVertex(minX, minY, maxZ); tess.addVertex(minX, maxY, maxZ); }
if(!ppy) { tess.addVertex(minX, maxY, maxZ); tess.addVertex(maxX, maxY, maxZ); }
if(!px) { tess.addVertex(maxX, maxY, maxZ); tess.addVertex(maxX, minY, maxZ); }
if(!ny) { tess.addVertex(maxX, minY, maxZ); tess.addVertex(minX, minY, maxZ); }
}
if(!nx) {
if(!nz) { tess.addVertex(minX, minY, minZ); tess.addVertex(minX, maxY, minZ); }
if(!ppy) { tess.addVertex(minX, maxY, minZ); tess.addVertex(minX, maxY, maxZ); }
if(!ppz) { tess.addVertex(minX, maxY, maxZ); tess.addVertex(minX, minY, maxZ); }
if(!ny) { tess.addVertex(minX, minY, maxZ); tess.addVertex(minX, minY, minZ); }
}
if(!px) {
if(!nz) { tess.addVertex(maxX, minY, minZ); tess.addVertex(maxX, maxY, minZ); }
if(!ppy) { tess.addVertex(maxX, maxY, minZ); tess.addVertex(maxX, maxY, maxZ); }
if(!ppz) { tess.addVertex(maxX, maxY, maxZ); tess.addVertex(maxX, minY, maxZ); }
if(!ny) { tess.addVertex(maxX, minY, maxZ); tess.addVertex(maxX, minY, minZ); }
}
}
tess.draw();
tess.setTranslation(0, 0, 0);
GL11.glDepthMask(true);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, OpenGlHelper.lastBrightnessX, OpenGlHelper.lastBrightnessY);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
}
}

View File

@ -31,7 +31,13 @@ public class MachineAnnihilator extends BlockDummyable {
@Override public int[] getDimensions() { return new int[] {2, 0, 4, 4, 1, 1}; }
@Override public int getOffset() { return 4; }
@Override
public int[][] getAllDimensions() {
return new int[][] {
new int[] {2, 0, 4, 4, 1, 1},
new int[] {8, -2, 1, 1, 1, 1, -3, 0, 0}
};
}
@Override
protected boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {
return super.checkRequirement(world, x, y, z, dir, o) &&

View File

@ -43,7 +43,18 @@ public class MachineBigAssTank extends BlockDummyable implements IPersistentInfo
@Override public int[] getDimensions() { return new int[] {5, 0, 4, 4, 4, 4}; }
@Override public int getOffset() { return 6; }
@Override
public int[][] getAllDimensions() {
return new int[][] {
new int[] {5, 0, 4, 4, 4, 4},
new int[] {4, 0, 5, -4, 2, 2},
new int[] {4, 0, -4, 5, 2, 2},
new int[] {4, 0, 2, 2, 5, -4},
new int[] {4, 0, 2, 2, -4, 5},
new int[] {3, 0, 6, -5, 0, 0},
new int[] {3, 0, -5, 6, 0, 0}
};
}
@Override
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
super.fillSpace(world, x, y, z, dir, o);

View File

@ -49,7 +49,16 @@ public class MachineCatalyticCracker extends BlockDummyable implements ILookOver
public int getOffset() {
return 3;
}
@Override
public int[][] getAllDimensions() {
return new int[][] {
new int[] {0, 0, 3, 3, 2, 3},
new int[]{8, -1, 3, -1, 2, 0},
new int[]{13, 0, 0, 3, 2, 1},
new int[]{14, -13, -1, 2, 1, 0},
new int[]{3, -1, 2, 3, -1, 3}
};
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {

View File

@ -68,7 +68,14 @@ public class MachineCatalyticReformer extends BlockDummyable implements IPersist
public int getOffset() {
return 1;
}
@Override
public int[][] getAllDimensions() {
return new int[][] {
new int[] {2, 0, 1, 1, 2, 2},
new int[] {3, -3, 1, 0, -1, 2},
new int[] {6, -3, 1, 1, 2, 0},
};
}
@Override
public void addInformation(ItemStack stack, NBTTagCompound persistentTag, EntityPlayer player, List list, boolean ext) {

View File

@ -89,7 +89,15 @@ public class MachineChungus extends BlockDummyable implements ITooltipProvider,
public int getOffset() {
return 3;
}
@Override
public int[][] getAllDimensions() {
return new int[][] {
new int[] { 3, 0, 0, 3, 2, 2 },
new int[] { 4, -4, 0, 3, 1, 1 },
new int[] { 3, 0, 6, -1, 1, 1 },
new int[] { 2, 0, 10, -7, 1, 1 },
};
}
@Override
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
super.fillSpace(world, x, y, z, dir, o);

View File

@ -43,7 +43,17 @@ public class MachineCoker extends BlockDummyable implements ITooltipProvider {
public int getOffset() {
return 1;
}
@Override
public int[][] getAllDimensions() {
return new int[][] {
new int[] {22, 0, 1, 1, 1, 1},
new int[] {5, 0, 2, 2, 2, 2, 0, 1, 0},
new int[] {0, 1, 0, 0, 0, 0, 2, 1, 2},
new int[] {0, 1, 0, 0, 0, 0, 2, 1, -2},
new int[] {0, 1, 0, 0, 0, 0, -2, 1, 2},
new int[] {0, 1, 0, 0, 0, 0, -2, 1, -2},
};
}
@Override
protected boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {
if(super.checkRequirement(world, x, y, z, dir, o)) {

View File

@ -34,7 +34,14 @@ public class MachineCompressor extends BlockDummyable {
public int getOffset() {
return 2;
}
@Override
public int[][] getAllDimensions() {
return new int[][] {
new int[] {2, 0, 1, 2, 1, 1},
new int[] {3, -3, 1, 1, 1, 1},
new int[] {8, -4, 0, 0, 1, 1}
};
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
return this.standardOpenBehavior(world, x, y, z, player, 0);

View File

@ -32,7 +32,24 @@ public class MachineElectrolyser extends BlockDummyable {
public int getOffset() {
return 5;
}
@Override
public int[][] getAllDimensions() {
return new int[][] {
new int[] {0, 0, 5, 5, 1, 3},
new int[] {2, -1, 5, 5, 1, 1},
new int[] {3, -3, 5, 5, 0, 0},
new int[] {3, -1, 4, -4, -3, 3},
new int[] {3, -1, 2, -2, -3, 3},
new int[] {3, -1, 0, 0, -3, 3},
new int[] {3, -1, -2, 2, -3, 3},
new int[] {3, -1, -4, 4, -3, 3},
new int[] {0, 0, 0, 0, -1, 2, 4, 3, 0},
new int[] {0, 0, 0, 0, -1, 2, 2, 3, 0},
new int[] {0, 0, 0, 0, -1, 2, 0, 3, 0},
new int[] {0, 0, 0, 0, -1, 2, -2, 3, 0},
new int[] {0, 0, 0, 0, -1, 2, -4, 3, 0},
};
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
return this.standardOpenBehavior(world, x, y, z, player, -1);

View File

@ -44,7 +44,15 @@ public class MachineExcavator extends BlockDummyable {
public int getHeightOffset() {
return 3;
}
@Override
public int[][] getAllDimensions() {
return new int[][] {
new int[] {3, 0, 3, 3, 3, 3},
new int[] {-1, 3, 3, -2, 3, -2},
new int[] {-1, 3, 3, -2, -2, 3},
new int[] {-1, 3, -2, 3, 3, 3},
};
}
@Override
protected boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {
x += dir.offsetX * o;

View File

@ -32,7 +32,17 @@ public class MachineExposureChamber extends BlockDummyable {
public int getOffset() {
return 2;
}
@Override
public int[][] getAllDimensions() {
return new int[][] {
getDimensions(),
new int[] {3, 0, 0, 0, -3, 8},
new int[] {0, 0, 1, -1, -3, 6, 0, 2, 0},
new int[] {0, 0, -1, 1, -3, 6, 0, 2, 0},
new int[] {3, 0, 1, -1, 0, 1, 0, 0, -7},
new int[] {3, 0, -1, 1, 0, 1, 0, 0, -7},
};
}
@Override
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
super.fillSpace(world, x, y, z, dir, o);

View File

@ -46,7 +46,20 @@ public class MachineFrackingTower extends BlockDummyable implements IPersistentI
public int getOffset() {
return 0;
}
@Override
public int[][] getAllDimensions() {
return new int[][] {
new int[] {3, 0, 0, 0, 0, 0},
new int[] {1, 0, 3, 3, 3, 3, 0, 2, 0},
new int[] {-1, 2, 0, 1, 0, 1, -2, 2, -2},
new int[] {-1, 2, 0, 1, 0, 1, 3, 2, -2},
new int[] {-1, 2, 0, 1, 0, 1, -2, 2, 3},
new int[] {-1, 2, 0, 1, 0, 1, 3, 2, 3},
new int[] {10, -4, 2, 2, 2, 2},
new int[] {24, -9, 1, 1, 1, 1},
new int[] {1, 0, -2, 3, 1, 1, 0, 15, 0},
};
}
@Override
protected boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {

View File

@ -33,7 +33,14 @@ public class MachineICF extends BlockDummyable {
public int getOffset() {
return 1;
}
@Override
public int[][] getAllDimensions() {
return new int[][] {
new int[] {5, 0, 1, 1, 8, 8},
new int[] {1, 1, -1, 2, 8, 8, 0, 3, 0},
new int[] {1, 1, 2, -1, 8, 8, 0, 3, 0},
};
}
@Override
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
super.fillSpace(world, x, y, z, dir, o);

View File

@ -47,7 +47,16 @@ public class MachinePumpjack extends BlockDummyable implements IPersistentInfoPr
public int getOffset() {
return 0;
}
@Override
public int[][] getAllDimensions() {
return new int[][] {
new int[] {3, 0, 0, 0, 0, 6},
new int[] {0, 0, -1, 1, -2, 4},
new int[] {0, 0, 1, -1, -1, 5},
new int[] {0, 0, -1, 1, 1, 1, 0, 0, -3},
new int[] {0, 0, 1, -1, 2, 2, 0, 0, -3},
};
}
@Override
protected boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {
return super.checkRequirement(world, x, y, z, dir, o) &&

View File

@ -47,7 +47,13 @@ public class MachineStrandCaster extends BlockDummyable implements ICrucibleAcce
public int getOffset() {
return 0;
}
@Override
public int[][] getAllDimensions() {
return new int[][] {
new int[] { 0, 0, 6, 0, 1, 0 },
new int[] { 2, 0, 1, 0, 1, 0 }
};
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
if(meta >= 12) return new TileEntityMachineStrandCaster();

View File

@ -62,7 +62,15 @@ public class ReactorZirnox extends BlockDummyable {
public int getOffset() {
return 2;
}
@Override
public int[][] getAllDimensions() {
return new int[][] {
new int[] {1, 0, 2, 2, 2, 2,},
new int[] {4, -2, 1, 1, 1, 1},
new int[] {4, -2, 0, 0, 2, -2},
new int[] {4, -2, 0, 0, -2, 2}
};
}
@Override
protected boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {
return super.checkRequirement(world, x, y, z, dir, o) &&

View File

@ -168,7 +168,18 @@ public class SoyuzLauncher extends BlockDummyable {
public int getOffset() {
return 0;
}
@Override
public int[][] getAllDimensions() {
return new int[][] {
new int[] { 0, 1, 6, 6, 6, 6 },
new int[] { -2, 4, -3, 6, -3, 6 },
new int[] { -2, 4, 6, -3, -3, 6 },
new int[] { -2, 4, 6, -3, 6, -3 },
new int[] { -2, 4, -3, 6, 6, -3 },
new int[] { 0, 4, 1, 1, -6, 8 },
new int[] { 0, 4, 2, 2, 9, -5 },
};
}
private final Random field_149933_a = new Random();
private static boolean keepInventory;

View File

@ -53,7 +53,16 @@ public class Watz extends BlockDummyable {
public int getOffset() {
return 3;
}
@Override
public int[][] getAllDimensions() {
return new int[][] {
new int[] {2, 0, 3, 3, 1, 1},
new int[] {2, 0, 2, 2, 2, -2},
new int[] {2, 0, 2, 2, -2, 2},
new int[] {2, 0, 1, 1, 3, -3},
new int[] {2, 0, 1, 1, -3, 3},
};
}
@Override
protected boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {
return super.checkRequirement(world, x, y, z, dir, o) &&

View File

@ -35,7 +35,13 @@ public class MachineFusionKlystron extends BlockDummyable implements ITooltipPro
@Override public int[] getDimensions() { return new int[] { 3, 0, 4, 3, 2, 2 }; }
@Override public int getOffset() { return 3; }
@Override
public int[][] getAllDimensions() {
return new int[][] {
new int[] { 3, 0, 4, 3, 2, 2 },
new int[] { 4, -3, 4, 3, 1, 1 },
};
}
@Override
public boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {
return super.checkRequirement(world, x, y, z, dir, o) &&

View File

@ -28,7 +28,13 @@ public class MachineFusionKlystronCreative extends BlockDummyable implements ITo
@Override public int[] getDimensions() { return new int[] { 3, 0, 4, 3, 2, 2 }; }
@Override public int getOffset() { return 3; }
@Override
public int[][] getAllDimensions() {
return new int[][] {
new int[] { 3, 0, 4, 3, 2, 2 },
new int[] { 4, -3, 4, 3, 1, 1 },
};
}
@Override
public boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {
return super.checkRequirement(world, x, y, z, dir, o) &&

View File

@ -44,7 +44,17 @@ public class MachineFusionMHDT extends BlockDummyable implements ILookOverlay, I
public int getOffset() {
return 7;
}
@Override
public int[][] getAllDimensions() {
return new int[][] {
new int[] { 2, 0, 6, 7, 2, 2 },
new int[] { 3, -2, 6, 2, 1, 1 },
new int[] { 3, -2, -6, 7, 1, 1 },
new int[] { 3, -2, -3, 5, 2, 2 },
new int[] { 4, -3, -3, 5, 1, 1 },
new int[] { 1, 0, 0, 1, 3, 3, 3, 0, 0 },
};
}
@Override
public boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {
return super.checkRequirement(world, x, y, z, dir, o) &&

View File

@ -31,6 +31,21 @@ public class MachineFusionPlasmaForge extends BlockDummyable {
@Override public int[] getDimensions() { return new int[] { 2, 0, 2, 2, 5, 5 }; }
@Override public int getOffset() { return 5; }
@Override
public int[][] getAllDimensions() {
return new int[][] {
new int[] { 2, 0, 2, 2, 5, 5 },
new int[] { 4, -3, 0, 0, 4, 4 },
new int[] { 2, 0, 3, -2, 4, 4 },
new int[] { 2, 0, -2, 3, 4, 4 },
new int[] { 2, 0, 4, -3, 3, 3 },
new int[] { 2, 0, -3, 4, 3, 3 },
new int[] { 2, 0, 5, -4, 2, 2 },
new int[] { 2, 0, -4, 5, 2, 2 },
new int[] { 3, -2, 1, 1, 5, 5 }
};
}
@Override
public boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {

View File

@ -107,7 +107,13 @@ public class RBMKConsole extends BlockDummyable implements IToolable {
public int getOffset() {
return 1;
}
@Override
public int[][] getAllDimensions() {
return new int[][] {
new int[] {3, 0, 0, 0, 2, 2},
new int[] {0, 0, 0, 1, 2, 2},
};
}
@Override
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
super.fillSpace(world, x, y, z, dir, o);

View File

@ -38,7 +38,13 @@ public class RBMKCraneConsole extends BlockDummyable implements IToolable {
public int getOffset() {
return 1;
}
@Override
public int[][] getAllDimensions() {
return new int[][] {
new int[] {1, 0, 0, 0, 1, 1},
new int[] {0, 0, 0, 1, 1, 1},
};
}
@Override
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
super.fillSpace(world, x, y, z, dir, o);

View File

@ -1,5 +1,6 @@
package com.hbm.main;
import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ICustomBlockHighlight;
import com.hbm.config.ClientConfig;
import com.hbm.config.RadiationConfig;
@ -414,6 +415,16 @@ public class ModEventHandlerRenderer {
public void onDrawHighlight(DrawBlockHighlightEvent event) {
EntityPlayer player = MainRegistry.proxy.me();
if(player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemBlock) {
Block b = Block.getBlockFromItem(player.getHeldItem().getItem());
if(b instanceof BlockDummyable) {
((BlockDummyable) b).drawPlacementHighlight(player, event.partialTicks);
event.setCanceled(true);
return;
}
}
if(player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.gun_drill) {
XFactoryDrill.drawBlockHighlight(player, player.getHeldItem(), event.partialTicks);
event.setCanceled(true);