Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Commit

Permalink
fix(hack): disable scaffolding from bounding box checks in player pos…
Browse files Browse the repository at this point in the history
…e updates
  • Loading branch information
mworzala committed Dec 8, 2023
1 parent 1554487 commit 2f3eeb5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/java/net/minestom/server/entity/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -802,8 +802,13 @@ private boolean canFitWithBoundingBox(@NotNull Pose pose) {
var iter = bb.getBlocks(getPosition());
while (iter.hasNext()) {
var pos = iter.next();
var hit = instance.getBlock(pos, Block.Getter.Condition.TYPE)
.registry().collisionShape()
var block = instance.getBlock(pos, Block.Getter.Condition.TYPE);

// For now just ignore scaffolding. It seems to have a dynamic bounding box, or is just parsed
// incorrectly in MinestomDataGenerator.
if (block.id() == Block.SCAFFOLDING.id()) continue;

var hit = block.registry().collisionShape()
.intersectBox(position.sub(pos.blockX(), pos.blockY(), pos.blockZ()), bb);
if (hit) return false;
}
Expand Down

0 comments on commit 2f3eeb5

Please sign in to comment.