9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-29 03:49:15 +00:00

Merge remote-tracking branch 'origin/merge-dev' into dev

# Conflicts:
#	bukkit/src/main/java/net/momirealms/craftengine/bukkit/entity/furniture/hitbox/ShulkerHitBox.java
This commit is contained in:
jhqwqmc
2025-04-02 16:51:49 +08:00
4 changed files with 3 additions and 23 deletions

View File

@@ -126,6 +126,7 @@ public class LoadedFurniture {
if (colliderSize != 0) {
Object world = FastNMS.INSTANCE.field$CraftWorld$ServerLevel(this.location.getWorld());
for (int i = 0; i < colliderSize; i++) {
// TODO better shulker hitbox
Collider collider = placement.colliders()[i];
Vector3f offset = conjugated.transform(new Vector3f(collider.position()));
Vector3d offset1 = collider.point1();

View File

@@ -44,23 +44,11 @@ public class ShulkerHitBox extends AbstractHitBox {
if (this.interactionEntity) {
// make it a litter bigger
InteractionEntityData.Height.addEntityDataIfNotDefaultValue((float) (getHeight(peek, scale, direction) + 0.01f), cachedInteractionValues);
InteractionEntityData.Height.addEntityDataIfNotDefaultValue((getPhysicalPeek(peek * 0.01F) + 1) * scale + 0.01f, cachedInteractionValues);
InteractionEntityData.Width.addEntityDataIfNotDefaultValue(scale + 0.005f, cachedInteractionValues);
InteractionEntityData.Responsive.addEntityDataIfNotDefaultValue(interactive, cachedInteractionValues);
}
}
private static double getHeight(byte inPeek, float scale, Direction direction) {
float peek = getPhysicalPeek(inPeek * 0.01F);
double y1 = 0.0;
double y2 = scale;
double dy = (double) direction.stepY() * peek * (double) scale;
if (dy > 0) {
y2 += dy;
} else if (dy < 0) {
y1 += dy;
}
return y2 - y1;
}
@Override
public Optional<Collider> optionalCollider() {