mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2026-10-19 22:12:28 +00:00
Fix several BE render bounds
- Monitors were one block taller/wider than they should be. - Lecterns are higher than one block, so got cut off if just looking at the top.
This commit is contained in:
+8
@@ -4,6 +4,7 @@
|
||||
|
||||
package dan200.computercraft.shared.lectern;
|
||||
|
||||
import dan200.computercraft.annotations.ForgeOverride;
|
||||
import dan200.computercraft.api.peripheral.IPeripheral;
|
||||
import dan200.computercraft.core.computer.ComputerSide;
|
||||
import dan200.computercraft.shared.ModRegistry;
|
||||
@@ -35,6 +36,7 @@ import net.minecraft.world.level.block.LecternBlock;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.block.entity.LecternBlockEntity;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import java.util.AbstractList;
|
||||
@@ -181,6 +183,12 @@ public final class CustomLecternBlockEntity extends BlockEntity {
|
||||
}
|
||||
}
|
||||
|
||||
@ForgeOverride
|
||||
public AABB getRenderBoundingBox() {
|
||||
var pos = getBlockPos();
|
||||
return new AABB(pos.getX(), pos.getY(), pos.getZ(), pos.getX() + 1.0, pos.getY() + 1.5, pos.getZ() + 1.0);
|
||||
}
|
||||
|
||||
/**
|
||||
* A read-only container storing the lectern's contents.
|
||||
*/
|
||||
|
||||
+1
-1
@@ -524,7 +524,7 @@ public class MonitorBlockEntity extends BlockEntity {
|
||||
bbHeight = height;
|
||||
|
||||
var startPos = toWorldPos(0, 0);
|
||||
var endPos = toWorldPos(width, height);
|
||||
var endPos = toWorldPos(width - 1, height - 1);
|
||||
return boundingBox = new AABB(
|
||||
Math.min(startPos.getX(), endPos.getX()),
|
||||
Math.min(startPos.getY(), endPos.getY()),
|
||||
|
||||
Reference in New Issue
Block a user