mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-19 15:09:15 +00:00
添加invisible选项控制潜影贝碰撞箱是否可见
This commit is contained in:
@@ -50,6 +50,7 @@ public class ShulkerFurnitureHitboxConfig extends AbstractFurnitureHitBoxConfig<
|
|||||||
byte peek,
|
byte peek,
|
||||||
boolean interactive,
|
boolean interactive,
|
||||||
boolean interactionEntity,
|
boolean interactionEntity,
|
||||||
|
boolean invisible,
|
||||||
Direction direction) {
|
Direction direction) {
|
||||||
super(seats, position, canUseItemOn, blocksBuilding, canBeHitByProjectile);
|
super(seats, position, canUseItemOn, blocksBuilding, canBeHitByProjectile);
|
||||||
this.scale = scale;
|
this.scale = scale;
|
||||||
@@ -66,7 +67,9 @@ public class ShulkerFurnitureHitboxConfig extends AbstractFurnitureHitBoxConfig<
|
|||||||
ShulkerData.SharedFlags.addEntityDataIfNotDefaultValue((byte) 0x20, this.cachedShulkerValues); // Invisible
|
ShulkerData.SharedFlags.addEntityDataIfNotDefaultValue((byte) 0x20, this.cachedShulkerValues); // Invisible
|
||||||
|
|
||||||
List<Object> cachedInteractionValues = new ArrayList<>();
|
List<Object> cachedInteractionValues = new ArrayList<>();
|
||||||
InteractionEntityData.SharedFlags.addEntityDataIfNotDefaultValue((byte) 0x20, cachedInteractionValues);
|
if (invisible) {
|
||||||
|
InteractionEntityData.SharedFlags.addEntityDataIfNotDefaultValue((byte) 0x20, cachedInteractionValues);
|
||||||
|
}
|
||||||
float shulkerHeight = (getPhysicalPeek(peek * 0.01F) + 1) * scale;
|
float shulkerHeight = (getPhysicalPeek(peek * 0.01F) + 1) * scale;
|
||||||
if (direction == Direction.UP) {
|
if (direction == Direction.UP) {
|
||||||
InteractionEntityData.Height.addEntityDataIfNotDefaultValue(shulkerHeight + 0.01f, cachedInteractionValues);
|
InteractionEntityData.Height.addEntityDataIfNotDefaultValue(shulkerHeight + 0.01f, cachedInteractionValues);
|
||||||
@@ -309,11 +312,12 @@ public class ShulkerFurnitureHitboxConfig extends AbstractFurnitureHitBoxConfig<
|
|||||||
boolean canUseItemOn = ResourceConfigUtils.getAsBoolean(arguments.getOrDefault("can-use-item-on", true), "can-use-item-on");
|
boolean canUseItemOn = ResourceConfigUtils.getAsBoolean(arguments.getOrDefault("can-use-item-on", true), "can-use-item-on");
|
||||||
boolean canBeHitByProjectile = ResourceConfigUtils.getAsBoolean(arguments.getOrDefault("can-be-hit-by-projectile", true), "can-be-hit-by-projectile");
|
boolean canBeHitByProjectile = ResourceConfigUtils.getAsBoolean(arguments.getOrDefault("can-be-hit-by-projectile", true), "can-be-hit-by-projectile");
|
||||||
boolean blocksBuilding = ResourceConfigUtils.getAsBoolean(arguments.getOrDefault("blocks-building", true), "blocks-building");
|
boolean blocksBuilding = ResourceConfigUtils.getAsBoolean(arguments.getOrDefault("blocks-building", true), "blocks-building");
|
||||||
|
boolean invisible = ResourceConfigUtils.getAsBoolean(arguments.getOrDefault("invisible", false), "invisible");
|
||||||
return new ShulkerFurnitureHitboxConfig(
|
return new ShulkerFurnitureHitboxConfig(
|
||||||
SeatConfig.fromObj(arguments.get("seats")),
|
SeatConfig.fromObj(arguments.get("seats")),
|
||||||
position,
|
position,
|
||||||
canUseItemOn, blocksBuilding, canBeHitByProjectile,
|
canUseItemOn, blocksBuilding, canBeHitByProjectile,
|
||||||
scale, peek, interactive, interactionEntity, directionEnum
|
scale, peek, interactive, interactionEntity, invisible, directionEnum
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user