This commit is contained in:
HbmMods 2026-07-14 19:18:10 +02:00
parent 5336b7cfb4
commit 7d635bfc0d
5 changed files with 20 additions and 12 deletions

View File

@ -33,19 +33,19 @@ public class BlockPile extends BlockContainer implements IBlockCT, IToolable {
/** The core, gets its own TE and runs the simulation, only one per pile */ /** The core, gets its own TE and runs the simulation, only one per pile */
public static final int META_CORE = 1; public static final int META_CORE = 1;
/** Channel mid segment for channel intersect checks */ /** Channel mid segment for channel intersect checks */
public static final int META_CHANNEL = 3; public static final int META_CHANNEL = 2;
/** Startpoint of the channel */ /** Startpoint of the channel */
public static final int META_FUEL_IN = 4; public static final int META_FUEL_IN = 3;
/** Endpoint of the fuel channel */ /** Endpoint of the fuel channel */
public static final int META_FUEL_OUT = 5; public static final int META_FUEL_OUT = 4;
/** Startpoint of the ventilation channel */ /** Startpoint of the ventilation channel */
public static final int META_AIR_IN = 6; public static final int META_AIR_IN = 5;
/** Endpoint of the ventilation channel */ /** Endpoint of the ventilation channel */
public static final int META_AIR_OUT = 7; public static final int META_AIR_OUT = 6;
/** Control rod channel */ /** Control rod channel */
public static final int META_CONTROL = 8; public static final int META_CONTROL = 7;
/** Edge of our pile "cube" to prevent channels from being drilled there */ /** Edge of our pile "cube" to prevent channels from being drilled there */
public static final int META_EDGE = 9; public static final int META_EDGE = 8;
@SideOnly(Side.CLIENT) protected IIcon iconTop; @SideOnly(Side.CLIENT) protected IIcon iconTop;
@ -85,10 +85,10 @@ public class BlockPile extends BlockContainer implements IBlockCT, IToolable {
if(tile instanceof TileEntityPileBaseMK2) { if(tile instanceof TileEntityPileBaseMK2) {
TileEntityPileBaseMK2 pile = (TileEntityPileBaseMK2) tile; TileEntityPileBaseMK2 pile = (TileEntityPileBaseMK2) tile;
world.removeTileEntity(x, y, z); world.removeTileEntity(x, y, z);
world.setBlock(x, y, z, ModBlocks.pile_brick); if(pile.coreY >= 0) world.setBlock(x, y, z, ModBlocks.pile_brick);
TileEntityPileCore core = pile.getCore(); TileEntityPileCore core = pile.getCore();
if(core != null) core.destroy(); if(core != null && !core.isInvalid()) core.destroy();
} else { } else {
world.removeTileEntity(x, y, z); world.removeTileEntity(x, y, z);

View File

@ -3,6 +3,7 @@ package com.hbm.blocks.machine.pile;
import com.hbm.blocks.ModBlocks; import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.machine.MachinePWRController; import com.hbm.blocks.machine.MachinePWRController;
import com.hbm.lib.RefStrings; import com.hbm.lib.RefStrings;
import com.hbm.tileentity.machine.pile.TileEntityPileBaseMK2;
import com.hbm.tileentity.machine.pile.TileEntityPileCore; import com.hbm.tileentity.machine.pile.TileEntityPileCore;
import com.hbm.tileentity.machine.pile.TileEntityPileCore.PileOrientation; import com.hbm.tileentity.machine.pile.TileEntityPileCore.PileOrientation;
@ -128,6 +129,10 @@ public class BlockPileBrick extends Block implements IToolable {
core.orientation = PileOrientation.getOrientation(dir); core.orientation = PileOrientation.getOrientation(dir);
} else { } else {
world.setBlock(iX, iY, iZ, ModBlocks.pile_block, BlockPile.META_DUMMY, 3); world.setBlock(iX, iY, iZ, ModBlocks.pile_block, BlockPile.META_DUMMY, 3);
TileEntityPileBaseMK2 pile = (TileEntityPileBaseMK2) world.getTileEntity(iX, iY, iZ);
pile.coreX = x;
pile.coreY = y;
pile.coreZ = z;
} }
} }
} }

View File

@ -388,6 +388,9 @@ public class TileMappings {
put(TileEntityPileSource.class, "tileentity_pile_source"); put(TileEntityPileSource.class, "tileentity_pile_source");
put(TileEntityPileBreedingFuel.class, "tileentity_pile_breedingfuel"); put(TileEntityPileBreedingFuel.class, "tileentity_pile_breedingfuel");
put(TileEntityPileNeutronDetector.class, "tileentity_pile_neutrondetector"); put(TileEntityPileNeutronDetector.class, "tileentity_pile_neutrondetector");
put(TileEntityPileCore.class, "tileentity_pile_core");
put(TileEntityPileBaseMK2.class, "tileentity_pile_block");
} }
private static void putRBMK() { private static void putRBMK() {

View File

@ -11,14 +11,14 @@ public class TileEntityPileBaseMK2 extends TileEntityTickingBase {
public TileEntityPileCore cachedCore; public TileEntityPileCore cachedCore;
public int coreX; public int coreX;
public int coreY; public int coreY = -999;
public int coreZ; public int coreZ;
@Override @Override
public void updateEntity() { public void updateEntity() {
if(!worldObj.isRemote) { if(!worldObj.isRemote) {
if(worldObj.getTotalWorldTime() % 20 == 0) { if(coreY >= 0) {
TileEntityPileCore controller = getCore(); TileEntityPileCore controller = getCore();

View File

@ -97,7 +97,7 @@ public class TileEntityPileCore extends TileEntityTickingBase {
} }
public void destroy() { public void destroy() {
worldObj.setBlock(xCoord, yCoord, zCoord, ModBlocks.pile_brick);
} }
public static enum PileOrientation { public static enum PileOrientation {