mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-25 09:59:20 +00:00
test
This commit is contained in:
@@ -357,12 +357,8 @@ public class BukkitFurnitureManager implements FurnitureManager {
|
||||
this.furnitureByEntityId.put(entityId, loadedFurniture);
|
||||
}
|
||||
for (CollisionEntity collisionEntity : loadedFurniture.collisionEntities()) {
|
||||
try {
|
||||
int collisionEntityId = (int) Reflections.method$Entity$getId.invoke(collisionEntity);
|
||||
this.furnitureByCollisionEntitiesId.put(collisionEntityId, loadedFurniture);
|
||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
int collisionEntityId = FastNMS.INSTANCE.method$Entity$getId(collisionEntity);
|
||||
this.furnitureByCollisionEntitiesId.put(collisionEntityId, loadedFurniture);
|
||||
}
|
||||
return loadedFurniture;
|
||||
}
|
||||
|
||||
@@ -102,14 +102,14 @@ public class LoadedFurniture {
|
||||
for (int entityId : ids) {
|
||||
fakeEntityIds.add(entityId);
|
||||
mainEntityIds.add(entityId);
|
||||
hitBox.addSpawnPackets(ids, x, y, z, yaw, conjugated, (packet, canBeMinimized) -> {
|
||||
packets.add(packet);
|
||||
if (this.minimized && !canBeMinimized) {
|
||||
minimizedPackets.add(packet);
|
||||
}
|
||||
});
|
||||
this.hitBoxes.put(entityId, hitBox);
|
||||
}
|
||||
hitBox.addSpawnPackets(ids, x, y, z, yaw, conjugated, (packet, canBeMinimized) -> {
|
||||
packets.add(packet);
|
||||
if (this.minimized && !canBeMinimized) {
|
||||
minimizedPackets.add(packet);
|
||||
}
|
||||
});
|
||||
}
|
||||
try {
|
||||
this.cachedSpawnPacket = Reflections.constructor$ClientboundBundlePacket.newInstance(packets);
|
||||
|
||||
@@ -45,8 +45,9 @@ public class ShulkerHitBox extends AbstractHitBox {
|
||||
ShulkerData.SharedFlags.addEntityDataIfNotDefaultValue((byte) 0x20, this.cachedShulkerValues); // 不可见
|
||||
|
||||
if (this.interactionEntity) {
|
||||
InteractionEntityData.Height.addEntityDataIfNotDefaultValue(getPeekHeight(peek, scale) + 0.001f, cachedInteractionValues);
|
||||
InteractionEntityData.Width.addEntityDataIfNotDefaultValue((float) scale + 0.001f, cachedInteractionValues);
|
||||
// make it a litter bigger
|
||||
InteractionEntityData.Height.addEntityDataIfNotDefaultValue(getPeekHeight(peek, scale) + 0.01f, cachedInteractionValues);
|
||||
InteractionEntityData.Width.addEntityDataIfNotDefaultValue((float) scale + 0.01f, cachedInteractionValues);
|
||||
InteractionEntityData.Responsive.addEntityDataIfNotDefaultValue(interactive, cachedInteractionValues);
|
||||
}
|
||||
}
|
||||
@@ -115,8 +116,9 @@ public class ShulkerHitBox extends AbstractHitBox {
|
||||
packets.accept(Reflections.constructor$ClientboundUpdateAttributesPacket0.newInstance(entityIds[1], Collections.singletonList(attributeInstance)), false);
|
||||
}
|
||||
if (this.interactionEntity) {
|
||||
// make it a litter lower
|
||||
packets.accept(Reflections.constructor$ClientboundAddEntityPacket.newInstance(
|
||||
entityIds[2], UUID.randomUUID(), x + offset.x, y + offset.y - 0.0005f, z - offset.z, 0, yaw,
|
||||
entityIds[2], UUID.randomUUID(), x + offset.x, y + offset.y - 0.005f, z - offset.z, 0, yaw,
|
||||
Reflections.instance$EntityType$INTERACTION, 0, Reflections.instance$Vec3$Zero, 0
|
||||
), true);
|
||||
packets.accept(Reflections.constructor$ClientboundSetEntityDataPacket.newInstance(entityIds[2], List.copyOf(this.cachedInteractionValues)), true);
|
||||
|
||||
@@ -626,7 +626,7 @@ public class PacketConsumers {
|
||||
}
|
||||
}
|
||||
} else if (entityType == Reflections.instance$EntityType$INTERACTION) {
|
||||
// 取消服务端碰撞实体
|
||||
// Cancel collider entity packet
|
||||
int entityId = (int) Reflections.field$ClientboundAddEntityPacket$entityId.get(packet);
|
||||
LoadedFurniture furniture = BukkitFurnitureManager.instance().getLoadedFurnitureByCollisionEntityId(entityId);
|
||||
if (furniture != null) {
|
||||
@@ -911,6 +911,7 @@ public class PacketConsumers {
|
||||
callback.accept(new String(newCodepoints, 0, newCodepoints.length));
|
||||
}
|
||||
}
|
||||
|
||||
public static final TriConsumer<NetWorkUser, NMSPacketEvent, Object> CUSTOM_PAYLOAD = (user, event, packet) -> {
|
||||
try {
|
||||
if (!VersionHelper.isVersionNewerThan1_20_5()) return;
|
||||
|
||||
@@ -49,7 +49,7 @@ mojang_brigadier_version=1.0.18
|
||||
byte_buddy_version=1.15.11
|
||||
snake_yaml_version=2.3
|
||||
anti_grief_version=0.13
|
||||
nms_helper_version=0.26
|
||||
nms_helper_version=0.27
|
||||
# Ignite Dependencies
|
||||
mixinextras_version=0.4.1
|
||||
mixin_version=0.15.2+mixin.0.8.7
|
||||
|
||||
Reference in New Issue
Block a user