Skip to content

Commit

Permalink
Add offset of TileEntityPlaceable to RenderBoundingBox
Browse files Browse the repository at this point in the history
  • Loading branch information
Kai-Z-JP committed Jun 11, 2021
1 parent d1f12b1 commit 822adad
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@ public MachineType getMachineType() {
public AxisAlignedBB getRenderBoundingBox() {
float[] box = this.getResourceState().getResourceSet().getConfig().renderAABB;
return AxisAlignedBB.getBoundingBox(
this.xCoord + box[0], this.yCoord + box[1], this.zCoord + box[2], this.xCoord + box[3], this.yCoord + box[4], this.zCoord + box[5]);
this.xCoord + box[0] + this.getOffsetX(),
this.yCoord + box[1] + this.getOffsetY(),
this.zCoord + box[2] + this.getOffsetZ(),
this.xCoord + box[3] + this.getOffsetX(),
this.yCoord + box[4] + this.getOffsetY(),
this.zCoord + box[5] + this.getOffsetZ());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,13 @@ public double getMaxRenderDistanceSquared() {
@Override
@SideOnly(Side.CLIENT)
public AxisAlignedBB getRenderBoundingBox() {
return AxisAlignedBB.getBoundingBox(this.xCoord, this.yCoord, this.zCoord, this.xCoord + 1, this.yCoord + 1, this.zCoord + 1);
return AxisAlignedBB.getBoundingBox(
this.xCoord + this.getOffsetX(),
this.yCoord + this.getOffsetY(),
this.zCoord + this.getOffsetZ(),
this.xCoord + 1 + this.getOffsetX(),
this.yCoord + 1 + this.getOffsetY(),
this.zCoord + 1 + this.getOffsetZ());
}

public ModelSetMachine getModelSet() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ public MachineType getMachineType() {
@Override
@SideOnly(Side.CLIENT)
public AxisAlignedBB getRenderBoundingBox() {
return AxisAlignedBB.getBoundingBox(this.xCoord - 1, this.yCoord, this.zCoord - 1, this.xCoord + 2, this.yCoord + 1, this.zCoord + 2);
return AxisAlignedBB.getBoundingBox(
this.xCoord - 1 + this.getOffsetX(),
this.yCoord + this.getOffsetY(),
this.zCoord - 1 + this.getOffsetZ(),
this.xCoord + 2 + this.getOffsetX(),
this.yCoord + 1 + this.getOffsetY(),
this.zCoord + 2 + this.getOffsetZ());
}

@Override
Expand Down

0 comments on commit 822adad

Please sign in to comment.