mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Fixes!
This commit is contained in:
parent
230ff00257
commit
2ea60eae13
@ -109,7 +109,8 @@ public class PistonInserter extends BlockContainerBase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) {
|
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) {
|
||||||
return world.getBlockMetadata(x, y, z) != side.ordinal();
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
|
return meta != side.ordinal() && meta != side.getOpposite().ordinal();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -274,6 +275,8 @@ public class PistonInserter extends BlockContainerBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO: render AABB that extends out in direction of piston so it will render
|
||||||
|
|
||||||
/* BS inventory stuff */
|
/* BS inventory stuff */
|
||||||
|
|
||||||
@Override public int getSizeInventory() { return 1; }
|
@Override public int getSizeInventory() { return 1; }
|
||||||
|
|||||||
@ -177,6 +177,9 @@ public abstract class BlockGraphiteDrilledBase extends BlockFlammable implements
|
|||||||
int oldMeta = pureMeta | baseBlock.meta; //metablocks are kinda inconvenient to work with so
|
int oldMeta = pureMeta | baseBlock.meta; //metablocks are kinda inconvenient to work with so
|
||||||
Block oldBlock = baseBlock.block;
|
Block oldBlock = baseBlock.block;
|
||||||
NBTTagCompound oldTag = new NBTTagCompound(); //In case of TEs
|
NBTTagCompound oldTag = new NBTTagCompound(); //In case of TEs
|
||||||
|
oldTag.setInteger("x", x); //giving tags prevents issues and resets any lingering tes.
|
||||||
|
oldTag.setInteger("y", y);
|
||||||
|
oldTag.setInteger("z", z);
|
||||||
|
|
||||||
//now actually make the change
|
//now actually make the change
|
||||||
for(int i = 0; i <= 3; i++) { //yeah yeah we know it's safe but let's be *extra cautious* of infinite loops
|
for(int i = 0; i <= 3; i++) { //yeah yeah we know it's safe but let's be *extra cautious* of infinite loops
|
||||||
@ -193,15 +196,13 @@ public abstract class BlockGraphiteDrilledBase extends BlockFlammable implements
|
|||||||
if(newBlock instanceof BlockGraphiteDrilledTE) {
|
if(newBlock instanceof BlockGraphiteDrilledTE) {
|
||||||
TileEntity te = world.getTileEntity(ix, iy, iz);
|
TileEntity te = world.getTileEntity(ix, iy, iz);
|
||||||
te.writeToNBT(newTag);
|
te.writeToNBT(newTag);
|
||||||
newTag.setInteger("x", newTag.getInteger("x") + dir.offsetX); //malformed positions is very very bad and prevents the pile TEs from ticking
|
newTag.setInteger("x", te.xCoord + dir.offsetX); //malformed positions is very very bad and prevents the pile TEs from ticking
|
||||||
newTag.setInteger("y", newTag.getInteger("y") + dir.offsetY);
|
newTag.setInteger("y", te.yCoord + dir.offsetY);
|
||||||
newTag.setInteger("z", newTag.getInteger("z") + dir.offsetZ);
|
newTag.setInteger("z", te.zCoord + dir.offsetZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
world.setBlock(ix, iy, iz, oldBlock, (oldMeta & ~0b100) | (newMeta & 0b100), 2);
|
world.setBlock(ix, iy, iz, oldBlock, (oldMeta & ~0b100) | (newMeta & 0b100), 2);
|
||||||
|
|
||||||
//TODO: fix buggy interaction when a pu239 rod is inserted into another pu239 rod. the te doesn't disappear in time (even when invalidated) so the progress is 'duplicated' in the new rod.
|
|
||||||
//the fix might be to make an additional part after the oldTag is initalized, where the id + x,y,z are set, meaning that all other values will be set back to 0 and fixed.
|
|
||||||
if(oldBlock instanceof BlockGraphiteDrilledTE && !oldTag.hasNoTags()) { //safety first
|
if(oldBlock instanceof BlockGraphiteDrilledTE && !oldTag.hasNoTags()) { //safety first
|
||||||
TileEntity te = world.getTileEntity(ix, iy, iz);
|
TileEntity te = world.getTileEntity(ix, iy, iz);
|
||||||
te.readFromNBT(oldTag);
|
te.readFromNBT(oldTag);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user