From 9bd5c2db0bba718ba83a9c6e4bc86a41c42891ac Mon Sep 17 00:00:00 2001 From: Axionize <154778082+Axionize@users.noreply.github.com> Date: Sun, 24 Nov 2024 02:38:55 -0500 Subject: [PATCH] Fix CCB constructor for DynamicHitboxFence --- .../collisions/blocks/connecting/DynamicHitboxFence.java | 1 - .../utils/collisions/datatypes/ComplexCollisionBox.java | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/ac/grim/grimac/utils/collisions/blocks/connecting/DynamicHitboxFence.java b/src/main/java/ac/grim/grimac/utils/collisions/blocks/connecting/DynamicHitboxFence.java index 0a543ae06b..255e789b9d 100644 --- a/src/main/java/ac/grim/grimac/utils/collisions/blocks/connecting/DynamicHitboxFence.java +++ b/src/main/java/ac/grim/grimac/utils/collisions/blocks/connecting/DynamicHitboxFence.java @@ -16,7 +16,6 @@ import com.github.retrooper.packetevents.protocol.world.states.type.StateType; import com.github.retrooper.packetevents.protocol.world.states.type.StateTypes; - public class DynamicHitboxFence extends DynamicConnecting implements HitBoxFactory { private static final CollisionBox[] MODERN_HITBOXES = makeShapes(2.0F, 2.0F, 24.0F, 0.0F, 24.0F, true, 1); diff --git a/src/main/java/ac/grim/grimac/utils/collisions/datatypes/ComplexCollisionBox.java b/src/main/java/ac/grim/grimac/utils/collisions/datatypes/ComplexCollisionBox.java index c87d76b82e..74619c75d8 100644 --- a/src/main/java/ac/grim/grimac/utils/collisions/datatypes/ComplexCollisionBox.java +++ b/src/main/java/ac/grim/grimac/utils/collisions/datatypes/ComplexCollisionBox.java @@ -20,8 +20,8 @@ public ComplexCollisionBox(int maxIndex) { public ComplexCollisionBox(int maxIndex, SimpleCollisionBox... boxes) { this.boxes = new SimpleCollisionBox[maxIndex]; - System.arraycopy(boxes, 0, this.boxes, 0, Math.min(maxIndex, boxes.length)); - currentLength = boxes.length; + currentLength = Math.min(maxIndex, boxes.length); + System.arraycopy(boxes, 0, this.boxes, 0, this.currentLength); } public boolean add(SimpleCollisionBox collisionBox) {