Skip to content

Commit b99da53

Browse files
committed
and now it works out of build height
1 parent d901c0f commit b99da53

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/main/java/com/simibubi/create/content/contraptions/Contraption.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1163,7 +1163,8 @@ public void addBlocksToWorld(Level world, StructureTransform transform) {
11631163
targetPos.relative(face));
11641164

11651165
BlockState blockState = world.getBlockState(targetPos);
1166-
if (blockState.getDestroySpeed(world, targetPos) == -1 ||
1166+
if (world.isOutsideBuildHeight(targetPos) ||
1167+
blockState.getDestroySpeed(world, targetPos) == -1 ||
11671168
(state.getCollisionShape(world, targetPos).isEmpty() &&
11681169
!blockState.getCollisionShape(world, targetPos).isEmpty())) {
11691170
if (targetPos.getY() == world.getMinBuildHeight())

src/main/java/com/simibubi/create/content/contraptions/GhostPlacementServerLevel.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ public BlockEntity getBlockEntity(BlockPos pos) {
4444
BlockEntity blockEntity = blockEntities.getOrDefault(pos, null);
4545
if (blockState.hasBlockEntity() && blockEntity == null) {
4646
blockEntity = ((EntityBlock) blockState.getBlock()).newBlockEntity(pos, blockState);
47+
if(blockEntity != null)
48+
blockEntity.setLevel(this);
4749
pos = pos.immutable();
4850
blockEntities.put(pos, blockEntity);
4951
}
@@ -52,7 +54,7 @@ public BlockEntity getBlockEntity(BlockPos pos) {
5254

5355
@Override
5456
public void removeBlockEntity(BlockPos pos) {
55-
blockEntities.remove(pos);
57+
blockEntities.remove(pos);
5658
}
5759

5860
@Override

0 commit comments

Comments
 (0)