Skip to content

Commit

Permalink
fix some non-GT structures not completing
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyfts committed Dec 4, 2024
1 parent d442c6a commit 3d95c7c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public boolean setBlock(int x, int y, int z, Block block, int meta, int flags) {
long pos = CoordinatePacker.pack(x, y, z);
if (block == Blocks.air) {
blockMap.remove(pos);
blockMetaMap.remove(pos);
if (block.hasTileEntity(meta)) {
removeTileEntity(x, y, z);
}
Expand All @@ -46,6 +47,7 @@ public boolean setBlock(int x, int y, int z, Block block, int meta, int flags) {
setTileEntity(x, y, z, tile);
}
}
block.onBlockAdded(this, x, y, z);
}

minPos.x = Math.min(minPos.x, x);
Expand All @@ -69,6 +71,21 @@ public int getBlockMetadata(int x, int y, int z) {
return blockMetaMap.get(CoordinatePacker.pack(x, y, z));
}

@Override
public boolean setBlockMetadataWithNotify(int x, int y, int z, int meta, int flag) {
long pos = CoordinatePacker.pack(x, y, z);
if (!blockMap.containsKey(pos)) return false;
blockMetaMap.put(pos, meta);

TileEntity tile = tileMap.get(pos);
if (tile != null) {
tile.updateContainingBlockInfo();
tile.blockMetadata = meta;
}

return true;
}

@Override
public void setTileEntity(int x, int y, int z, TileEntity tile) {
tile.setWorldObj(this);
Expand All @@ -89,6 +106,15 @@ public TileEntity getTileEntity(int x, int y, int z) {
return tileMap.get(CoordinatePacker.pack(x, y, z));
}

@Override
public void updateEntitiesForNEI() {
for (TileEntity tile : tileMap.values()) {
if (tile.canUpdate()) {
tile.updateEntity();
}
}
}

/**
* Enable fullbright rendering
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ public abstract class GuiMultiblockHandler {
protected static Vector3f center = new Vector3f();
protected static float rotationYaw, rotationPitch;
protected static float zoom;
protected static IConstructable renderingController, lastRenderingController;

protected ItemStack tooltipBlockStack;

protected IConstructable renderingController, lastRenderingController;
protected ConstructableData constructableData;
protected ItemStack stackForm;

Expand Down

0 comments on commit 3d95c7c

Please sign in to comment.