finished up render bounding box

This commit is contained in:
Ell 2024-03-07 19:05:21 +01:00
parent c8fee33ca5
commit 9be1e0ce2d
2 changed files with 7 additions and 9 deletions

View file

@ -399,14 +399,6 @@ public class PipeBlockEntity extends BlockEntity implements MenuProvider, IPipeC
return new MainPipeContainer(Registry.pipeContainer, window, player, PipeBlockEntity.this.worldPosition);
}
// TODO render bounding box?
/* @Override
@OnlyIn(Dist.CLIENT)
public AABB getRenderBoundingBox() {
// our render bounding box should always be the full block in case we're covered
return new AABB(this.worldPosition);
}*/
@Override
public ConnectionType getConnectionType(BlockPos pipePos, Direction direction) {
var state = this.level.getBlockState(pipePos.relative(direction));

View file

@ -6,6 +6,7 @@ import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.blockentity.BlockEntityRenderer;
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
import net.minecraft.util.RandomSource;
import net.minecraft.world.phys.AABB;
import net.neoforged.neoforge.client.model.data.ModelData;
import java.util.Random;
@ -41,5 +42,10 @@ public class PipeRenderer implements BlockEntityRenderer<PipeBlockEntity> {
}
}
}
@Override
public AABB getRenderBoundingBox(PipeBlockEntity blockEntity) {
// our render bounding box should always be the full block in case we're covered
return new AABB(blockEntity.getBlockPos());
}
}