mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-30 04:19:27 +00:00
Fix Head Rotate and Move to NetworkReflections
This commit is contained in:
@@ -133,7 +133,7 @@ public class CrawlSeat extends AbstractSeat {
|
||||
super.dismount(player);
|
||||
((org.bukkit.entity.Player) player.platformPlayer()).setPose(Pose.STANDING, false);
|
||||
try {
|
||||
Object packet = CoreReflections.constructor$ClientboundRemoveEntitiesPacket.newInstance((Object) new int[]{visualId});
|
||||
Object packet = NetworkReflections.constructor$ClientboundRemoveEntitiesPacket.newInstance((Object) new int[]{visualId});
|
||||
player.sendPacket(packet, false);
|
||||
} catch (Exception e) {
|
||||
BukkitCraftEngine.instance().logger().warn("Failed to remove crawl entity", e);
|
||||
|
||||
@@ -101,17 +101,17 @@ public class LaySeat extends AbstractSeat {
|
||||
MEntityTypes.instance$EntityType$PLAYER, 0, CoreReflections.instance$Vec3$Zero, 0);
|
||||
|
||||
// Info
|
||||
EnumSet enumSet = EnumSet.noneOf((Class<? extends Enum>) CoreReflections.clazz$ClientboundPlayerInfoUpdatePacket$Action);
|
||||
enumSet.add(CoreReflections.instance$ClientboundPlayerInfoUpdatePacket$Action$ADD_PLAYER);
|
||||
EnumSet enumSet = EnumSet.noneOf((Class<? extends Enum>) NetworkReflections.clazz$ClientboundPlayerInfoUpdatePacket$Action);
|
||||
enumSet.add(NetworkReflections.instance$ClientboundPlayerInfoUpdatePacket$Action$ADD_PLAYER);
|
||||
Object entry;
|
||||
if (VersionHelper.isOrAbove1_21_4()) {
|
||||
entry = CoreReflections.constructor$ClientBoundPlayerInfoUpdatePacket$Entry.newInstance(
|
||||
entry = NetworkReflections.constructor$ClientBoundPlayerInfoUpdatePacket$Entry.newInstance(
|
||||
uuid, npcProfile, false, 0, CoreReflections.instance$GameType$SURVIVAL, null, true, 0, null);
|
||||
} else if (VersionHelper.isOrAbove1_21_3()) {
|
||||
entry = CoreReflections.constructor$ClientBoundPlayerInfoUpdatePacket$Entry.newInstance(
|
||||
entry = NetworkReflections.constructor$ClientBoundPlayerInfoUpdatePacket$Entry.newInstance(
|
||||
uuid, npcProfile, false, 0, CoreReflections.instance$GameType$SURVIVAL, null, 0, null);
|
||||
} else {
|
||||
entry = CoreReflections.constructor$ClientBoundPlayerInfoUpdatePacket$Entry.newInstance(
|
||||
entry = NetworkReflections.constructor$ClientBoundPlayerInfoUpdatePacket$Entry.newInstance(
|
||||
uuid, npcProfile, false, 0, CoreReflections.instance$GameType$SURVIVAL, null, null);
|
||||
}
|
||||
Object npcInfoPacket = FastNMS.INSTANCE.constructor$ClientboundPlayerInfoUpdatePacket(enumSet, Collections.singletonList(entry));
|
||||
@@ -124,7 +124,7 @@ public class LaySeat extends AbstractSeat {
|
||||
bedLoc.setY(bedLoc.getWorld().getMinHeight());
|
||||
Object bedPos = LocationUtils.toBlockPos(new BlockPos(bedLoc.getBlockX(), bedLoc.getBlockY(), bedLoc.getBlockZ()));
|
||||
Object blockState = BlockStateUtils.blockDataToBlockState(bedData);
|
||||
Object bedPacket = CoreReflections.constructor$ClientboundBlockUpdatePacket.newInstance(bedPos, blockState);
|
||||
Object bedPacket = NetworkReflections.constructor$ClientboundBlockUpdatePacket.newInstance(bedPos, blockState);
|
||||
|
||||
// Data
|
||||
Object npcData = CoreReflections.method$Entity$getEntityData.invoke(npc);
|
||||
@@ -146,15 +146,15 @@ public class LaySeat extends AbstractSeat {
|
||||
);
|
||||
|
||||
// Remove
|
||||
Object npcRemovePacket = CoreReflections.constructor$ClientboundRemoveEntitiesPacket.newInstance((Object) new int[]{npcId});
|
||||
Object npcRemovePacket = NetworkReflections.constructor$ClientboundRemoveEntitiesPacket.newInstance((Object) new int[]{npcId});
|
||||
|
||||
// TP
|
||||
Object npcTeleportPacket;
|
||||
if (VersionHelper.isOrAbove1_21_3()) {
|
||||
Object positionMoveRotation = CoreReflections.method$PositionMoveRotation$of.invoke(null, npc);
|
||||
npcTeleportPacket = CoreReflections.constructor$ClientboundTeleportEntityPacket.newInstance(npcId, positionMoveRotation, Set.of(), false);
|
||||
npcTeleportPacket = NetworkReflections.constructor$ClientboundTeleportEntityPacket.newInstance(npcId, positionMoveRotation, Set.of(), false);
|
||||
} else {
|
||||
npcTeleportPacket = CoreReflections.constructor$ClientboundTeleportEntityPacket.newInstance(npc);
|
||||
npcTeleportPacket = NetworkReflections.constructor$ClientboundTeleportEntityPacket.newInstance(npc);
|
||||
}
|
||||
|
||||
|
||||
@@ -217,8 +217,11 @@ public class LaySeat extends AbstractSeat {
|
||||
float npcYawOffset = 0.0f;
|
||||
if (player.getY() > 0.0874218749) {
|
||||
if (VersionHelper.isOrAbove1_21_2()) {
|
||||
if (npcDir == Direction.SOUTH) npcYawOffset = 27;
|
||||
if (npcDir == Direction.NORTH) npcYawOffset = -26;
|
||||
double offset = loc.x() - Math.floor(loc.x()) - 0.5;
|
||||
|
||||
if (Math.abs(offset) > 0.05005) {
|
||||
npcYawOffset = offset > 0 ? +27f : -26f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -345,7 +348,7 @@ public class LaySeat extends AbstractSeat {
|
||||
Object blockPos = LocationUtils.toBlockPos(bedLoc.getBlockX(), bedLoc.getBlockY(), bedLoc.getBlockZ());
|
||||
Object blockState = BlockStateUtils.blockDataToBlockState(bedLoc.getBlock().getBlockData());
|
||||
try {
|
||||
Object blockUpdatePacket = CoreReflections.constructor$ClientboundBlockUpdatePacket.newInstance(blockPos, blockState);
|
||||
Object blockUpdatePacket = NetworkReflections.constructor$ClientboundBlockUpdatePacket.newInstance(blockPos, blockState);
|
||||
if (player.getPotionEffect(PotionEffectType.INVISIBILITY) == null) CoreReflections.method$Entity$setInvisible.invoke(serverPlayer.serverPlayer(), false);
|
||||
from.sendPacket(this.npcRemovePacket, true);
|
||||
from.sendPacket(blockUpdatePacket, true);
|
||||
@@ -362,7 +365,7 @@ public class LaySeat extends AbstractSeat {
|
||||
player.setSleepingIgnored(false);
|
||||
}
|
||||
|
||||
Object fullSlots = CoreReflections.method$ClientboundSetEquipmentPacket$getSlots.invoke(this.fullEquipPacket);
|
||||
Object fullSlots = NetworkReflections.method$ClientboundSetEquipmentPacket$getSlots.invoke(this.fullEquipPacket);
|
||||
Object recoverEquip = NetworkReflections.constructor$ClientboundSetEquipmentPacket.newInstance(player.getEntityId(), fullSlots);
|
||||
|
||||
for (org.bukkit.entity.Player p : PlayerUtils.getTrackedBy(player)) {
|
||||
@@ -418,7 +421,7 @@ public class LaySeat extends AbstractSeat {
|
||||
@Override
|
||||
public void handleContainerSetSlot(NetWorkUser user, NMSPacketEvent event, Object packet) {
|
||||
try {
|
||||
int slot = (int) CoreReflections.method$ClientboundContainerSetSlotPacket$getSlot.invoke(packet);
|
||||
int slot = (int) NetworkReflections.method$ClientboundContainerSetSlotPacket$getSlot.invoke(packet);
|
||||
org.bukkit.entity.Player player = (org.bukkit.entity.Player) user.platformPlayer();
|
||||
|
||||
int convertSlot;
|
||||
@@ -441,9 +444,9 @@ public class LaySeat extends AbstractSeat {
|
||||
}
|
||||
|
||||
if (!(convertSlot == player.getInventory().getHeldItemSlot() || (isPlayerInv && (slot == 45 || (slot >= 5 && slot <= 8))))) return;
|
||||
int containerId = (int) CoreReflections.method$ClientboundContainerSetSlotPacket$getContainerId.invoke(packet);
|
||||
int stateId = (int) CoreReflections.method$ClientboundContainerSetSlotPacket$getStateId.invoke(packet);
|
||||
Object replacePacket = CoreReflections.constructor$ClientboundContainerSetSlotPacket.newInstance(containerId, stateId, slot, MItems.Air$ItemStack);
|
||||
int containerId = (int) NetworkReflections.method$ClientboundContainerSetSlotPacket$getContainerId.invoke(packet);
|
||||
int stateId = (int) NetworkReflections.method$ClientboundContainerSetSlotPacket$getStateId.invoke(packet);
|
||||
Object replacePacket = NetworkReflections.constructor$ClientboundContainerSetSlotPacket.newInstance(containerId, stateId, slot, MItems.Air$ItemStack);
|
||||
event.replacePacket(replacePacket);
|
||||
} catch (Exception e) {
|
||||
CraftEngine.instance().logger().warn("Failed to handleContainerSetSlotPacket", e);
|
||||
@@ -456,9 +459,9 @@ public class LaySeat extends AbstractSeat {
|
||||
try {
|
||||
Object animatePacket;
|
||||
if (e.getAnimationType() == PlayerAnimationType.ARM_SWING) {
|
||||
animatePacket = CoreReflections.constructor$ClientboundAnimatePacket.newInstance(npc, 0);
|
||||
animatePacket = NetworkReflections.constructor$ClientboundAnimatePacket.newInstance(npc, 0);
|
||||
} else {
|
||||
animatePacket = CoreReflections.constructor$ClientboundAnimatePacket.newInstance(npc, 3);
|
||||
animatePacket = NetworkReflections.constructor$ClientboundAnimatePacket.newInstance(npc, 3);
|
||||
}
|
||||
serverPlayer.sendPacket(animatePacket, true);
|
||||
for (org.bukkit.entity.Player other : PlayerUtils.getTrackedBy(serverPlayer.platformPlayer())) {
|
||||
@@ -549,7 +552,7 @@ public class LaySeat extends AbstractSeat {
|
||||
private void updateNpcYaw(float playerYaw) {
|
||||
byte packYaw = getRot(playerYaw);
|
||||
try {
|
||||
this.npcRotHeadPacket = CoreReflections.constructor$ClientboundRotateHeadPacket.newInstance(npc, packYaw);
|
||||
this.npcRotHeadPacket = NetworkReflections.constructor$ClientboundRotateHeadPacket.newInstance(npc, packYaw);
|
||||
} catch (Exception exception) {
|
||||
CraftEngine.instance().logger().warn("Failed to sync NPC yaw", exception);
|
||||
}
|
||||
|
||||
@@ -2431,7 +2431,7 @@ public class PacketConsumers {
|
||||
};
|
||||
public static final TriConsumer<NetWorkUser, NMSPacketEvent, Object> SET_EQUIPMENT_NMS = (user, event, packet) -> {
|
||||
try {
|
||||
int entityId = (int) CoreReflections.method$ClientboundSetEquipmentPacket$getEntity.invoke(packet);
|
||||
int entityId = (int) NetworkReflections.method$ClientboundSetEquipmentPacket$getEntity.invoke(packet);
|
||||
EntityPacketHandler handler = user.entityPacketHandlers().get(entityId);
|
||||
if (handler != null) {
|
||||
handler.handleSetEquipment(user, event, packet);
|
||||
|
||||
@@ -3447,23 +3447,6 @@ public final class CoreReflections {
|
||||
)
|
||||
);
|
||||
|
||||
public static final Class<?> clazz$ClientBoundPlayerInfoRemovePacket = requireNonNull(
|
||||
ReflectionUtils.getClazz(
|
||||
BukkitReflectionUtils.assembleMCClass("network.protocol.game.ClientboundPlayerInfoRemovePacket")
|
||||
)
|
||||
);
|
||||
|
||||
public static final Constructor<?> constructor$ClientBoundPlayerInfoRemovePacket = requireNonNull(
|
||||
ReflectionUtils.getConstructor(clazz$ClientBoundPlayerInfoRemovePacket, List.class)
|
||||
);
|
||||
|
||||
public static final Class<?> clazz$ClientBoundPlayerInfoUpdatePacket$Entry = requireNonNull(
|
||||
BukkitReflectionUtils.findReobfOrMojmapClass(
|
||||
"network.protocol.game.ClientboundPlayerInfoUpdatePacket$b",
|
||||
"network.protocol.game.ClientboundPlayerInfoUpdatePacket$Entry"
|
||||
)
|
||||
);
|
||||
|
||||
public static final Class<?> clazz$RemoteChatSession$Data = requireNonNull(
|
||||
BukkitReflectionUtils.findReobfOrMojmapClass(
|
||||
"network.chat.RemoteChatSession$a",
|
||||
@@ -3471,14 +3454,6 @@ public final class CoreReflections {
|
||||
)
|
||||
);
|
||||
|
||||
public static final Constructor<?> constructor$ClientBoundPlayerInfoUpdatePacket$Entry = requireNonNull(
|
||||
VersionHelper.isOrAbove1_21_3()
|
||||
? VersionHelper.isOrAbove1_21_4()
|
||||
? ReflectionUtils.getConstructor(clazz$ClientBoundPlayerInfoUpdatePacket$Entry, UUID.class, clazz$GameProfile, boolean.class, int.class, clazz$GameType, clazz$Component, boolean.class, int.class, clazz$RemoteChatSession$Data)
|
||||
: ReflectionUtils.getConstructor(clazz$ClientBoundPlayerInfoUpdatePacket$Entry, UUID.class, clazz$GameProfile, boolean.class, int.class, clazz$GameType, clazz$Component, int.class, clazz$RemoteChatSession$Data)
|
||||
: ReflectionUtils.getConstructor(clazz$ClientBoundPlayerInfoUpdatePacket$Entry, UUID.class, clazz$GameProfile, boolean.class, int.class, clazz$GameType, clazz$Component, clazz$RemoteChatSession$Data)
|
||||
);
|
||||
|
||||
public static final Method method$GameType$values = requireNonNull(
|
||||
ReflectionUtils.getStaticMethod(
|
||||
clazz$GameType, clazz$GameType.arrayType()
|
||||
@@ -3515,165 +3490,9 @@ public final class CoreReflections {
|
||||
)
|
||||
);
|
||||
|
||||
public static final Class<?> clazz$ClientboundTeleportEntityPacket = requireNonNull(
|
||||
BukkitReflectionUtils.findReobfOrMojmapClass(
|
||||
"network.protocol.game.PacketPlayOutEntityTeleport",
|
||||
"network.protocol.game.ClientboundTeleportEntityPacket"
|
||||
)
|
||||
);
|
||||
|
||||
public static final Constructor<?> constructor$ClientboundTeleportEntityPacket = requireNonNull(
|
||||
VersionHelper.isOrAbove1_21_3()
|
||||
? ReflectionUtils.getConstructor(clazz$ClientboundTeleportEntityPacket, int.class, clazz$PositionMoveRotation, Set.class, boolean.class)
|
||||
: ReflectionUtils.getConstructor(clazz$ClientboundTeleportEntityPacket, clazz$Entity)
|
||||
);
|
||||
|
||||
public static final Method method$Entity$setSharedFlag = requireNonNull(
|
||||
ReflectionUtils.getDeclaredMethod(
|
||||
clazz$Entity, void.class, int.class, boolean.class
|
||||
)
|
||||
);
|
||||
|
||||
public static final Method method$ClientboundSetEquipmentPacket$getEntity = requireNonNull(
|
||||
ReflectionUtils.getMethod(
|
||||
NetworkReflections.clazz$ClientboundSetEquipmentPacket, int.class
|
||||
)
|
||||
);
|
||||
|
||||
public static final Method method$ClientboundSetEquipmentPacket$getSlots = requireNonNull(
|
||||
ReflectionUtils.getMethod(
|
||||
NetworkReflections.clazz$ClientboundSetEquipmentPacket, List.class
|
||||
)
|
||||
);
|
||||
|
||||
public static final Class<?> clazz$ClientboundContainerSetSlotPacket = requireNonNull(
|
||||
BukkitReflectionUtils.findReobfOrMojmapClass(
|
||||
"network.protocol.game.PacketPlayOutSetSlot",
|
||||
"network.protocol.game.ClientboundContainerSetSlotPacket"
|
||||
)
|
||||
);
|
||||
|
||||
public static final Constructor<?> constructor$ClientboundContainerSetSlotPacket = requireNonNull(
|
||||
ReflectionUtils.getConstructor(
|
||||
clazz$ClientboundContainerSetSlotPacket, int.class, int.class, int.class, clazz$ItemStack
|
||||
)
|
||||
);
|
||||
|
||||
public static final Method method$ClientboundContainerSetSlotPacket$getContainerId = requireNonNull(
|
||||
ReflectionUtils.getMethod(
|
||||
clazz$ClientboundContainerSetSlotPacket, int.class, new String[]{"a", "getContainerId"}
|
||||
)
|
||||
);
|
||||
|
||||
public static final Method method$ClientboundContainerSetSlotPacket$getSlot = requireNonNull(
|
||||
ReflectionUtils.getMethod(
|
||||
clazz$ClientboundContainerSetSlotPacket, int.class, new String[]{"c", "d", "getSlot"}
|
||||
)
|
||||
);
|
||||
|
||||
public static final Method method$ClientboundContainerSetSlotPacket$getStateId = requireNonNull(
|
||||
ReflectionUtils.getMethod(
|
||||
clazz$ClientboundContainerSetSlotPacket, int.class, new String[]{"e", "f", "getStateId"}
|
||||
)
|
||||
);
|
||||
|
||||
public static final Class<?> clazz$ClientboundAnimatePacket = requireNonNull(
|
||||
BukkitReflectionUtils.findReobfOrMojmapClass(
|
||||
"network.protocol.game.PacketPlayOutAnimation",
|
||||
"network.protocol.game.ClientboundAnimatePacket")
|
||||
);
|
||||
|
||||
public static final Constructor<?> constructor$ClientboundAnimatePacket = requireNonNull(
|
||||
ReflectionUtils.getConstructor(clazz$ClientboundAnimatePacket, clazz$Entity, int.class)
|
||||
);
|
||||
|
||||
public static final Class<?> clazz$ClientboundRotateHeadPacket = requireNonNull(
|
||||
BukkitReflectionUtils.findReobfOrMojmapClass(
|
||||
"network.protocol.game.PacketPlayOutEntityHeadRotation",
|
||||
"network.protocol.game.ClientboundRotateHeadPacket"
|
||||
)
|
||||
);
|
||||
|
||||
public static final Constructor<?> constructor$ClientboundRotateHeadPacket = requireNonNull(
|
||||
ReflectionUtils.getDeclaredConstructor(
|
||||
clazz$ClientboundRotateHeadPacket, clazz$Entity, byte.class
|
||||
)
|
||||
);
|
||||
|
||||
public static final Class<?> clazz$ClientboundBlockUpdatePacket = requireNonNull(
|
||||
BukkitReflectionUtils.findReobfOrMojmapClass(
|
||||
"network.protocol.game.PacketPlayOutBlockChange",
|
||||
"network.protocol.game.ClientboundBlockUpdatePacket"
|
||||
)
|
||||
);
|
||||
|
||||
public static final Constructor<?> constructor$ClientboundBlockUpdatePacket = requireNonNull(
|
||||
ReflectionUtils.getConstructor(
|
||||
clazz$ClientboundBlockUpdatePacket, clazz$BlockPos, clazz$BlockState
|
||||
)
|
||||
);
|
||||
|
||||
public static final Class<?> clazz$ClientboundRemoveEntitiesPacket = requireNonNull(
|
||||
BukkitReflectionUtils.findReobfOrMojmapClass(
|
||||
"network.protocol.game.PacketPlayOutEntityDestroy",
|
||||
"network.protocol.game.ClientboundRemoveEntitiesPacket"
|
||||
)
|
||||
);
|
||||
|
||||
public static final Constructor<?> constructor$ClientboundRemoveEntitiesPacket = requireNonNull(
|
||||
ReflectionUtils.getConstructor(clazz$ClientboundRemoveEntitiesPacket, int[].class)
|
||||
);
|
||||
|
||||
public static final Class<?> clazz$ClientboundPlayerInfoUpdatePacket = requireNonNull(
|
||||
ReflectionUtils.getClazz(
|
||||
BukkitReflectionUtils.assembleMCClass("network.protocol.game.ClientboundPlayerInfoUpdatePacket")
|
||||
)
|
||||
);
|
||||
|
||||
public static final Field field$ClientboundPlayerInfoUpdatePacket$entries = requireNonNull(
|
||||
ReflectionUtils.getDeclaredField(
|
||||
clazz$ClientboundPlayerInfoUpdatePacket, List.class, 0
|
||||
)
|
||||
);
|
||||
|
||||
public static final Class<?> clazz$ClientboundPlayerInfoUpdatePacket$Action = requireNonNull(
|
||||
BukkitReflectionUtils.findReobfOrMojmapClass(
|
||||
"network.protocol.game.ClientboundPlayerInfoUpdatePacket$a",
|
||||
"network.protocol.game.ClientboundPlayerInfoUpdatePacket$Action"
|
||||
)
|
||||
);
|
||||
|
||||
public static final Method method$ClientboundPlayerInfoUpdatePacket$Action$values = requireNonNull(
|
||||
ReflectionUtils.getStaticMethod(
|
||||
clazz$ClientboundPlayerInfoUpdatePacket$Action, clazz$ClientboundPlayerInfoUpdatePacket$Action.arrayType()
|
||||
)
|
||||
);
|
||||
|
||||
public static final Object instance$ClientboundPlayerInfoUpdatePacket$Action$ADD_PLAYER;
|
||||
public static final Object instance$ClientboundPlayerInfoUpdatePacket$Action$INITIALIZE_CHAT;
|
||||
public static final Object instance$ClientboundPlayerInfoUpdatePacket$Action$UPDATE_GAME_MODE;
|
||||
public static final Object instance$ClientboundPlayerInfoUpdatePacket$Action$UPDATE_LISTED;
|
||||
public static final Object instance$ClientboundPlayerInfoUpdatePacket$Action$UPDATE_LATENCY;
|
||||
public static final Object instance$ClientboundPlayerInfoUpdatePacket$Action$UPDATE_DISPLAY_NAME;
|
||||
//public static final Object instance$ClientboundPlayerInfoUpdatePacket$Action$UPDATE_LIST_ORDER;
|
||||
//public static final Object instance$ClientboundPlayerInfoUpdatePacket$Action$UPDATE_HAT;
|
||||
|
||||
|
||||
static {
|
||||
try {
|
||||
Object[] values = (Object[]) method$ClientboundPlayerInfoUpdatePacket$Action$values.invoke(null);
|
||||
instance$ClientboundPlayerInfoUpdatePacket$Action$ADD_PLAYER = values[0];
|
||||
instance$ClientboundPlayerInfoUpdatePacket$Action$INITIALIZE_CHAT = values[1];
|
||||
instance$ClientboundPlayerInfoUpdatePacket$Action$UPDATE_GAME_MODE = values[2];
|
||||
instance$ClientboundPlayerInfoUpdatePacket$Action$UPDATE_LISTED = values[3];
|
||||
instance$ClientboundPlayerInfoUpdatePacket$Action$UPDATE_LATENCY = values[4];
|
||||
instance$ClientboundPlayerInfoUpdatePacket$Action$UPDATE_DISPLAY_NAME = values[5];
|
||||
//1.21.3
|
||||
//instance$ClientboundPlayerInfoUpdatePacket$Action$UPDATE_LIST_ORDER = values[6];
|
||||
//1.21.4
|
||||
//instance$ClientboundPlayerInfoUpdatePacket$Action$UPDATE_HAT = values[7];
|
||||
} catch (ReflectiveOperationException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -382,12 +382,30 @@ public final class NetworkReflections {
|
||||
ReflectionUtils.getStaticMethod(clazz$ClientboundPlayerInfoUpdatePacket$Action, clazz$ClientboundPlayerInfoUpdatePacket$Action.arrayType())
|
||||
);
|
||||
|
||||
|
||||
public static final Object instance$ClientboundPlayerInfoUpdatePacket$Action$ADD_PLAYER;
|
||||
public static final Object instance$ClientboundPlayerInfoUpdatePacket$Action$INITIALIZE_CHAT;
|
||||
public static final Object instance$ClientboundPlayerInfoUpdatePacket$Action$UPDATE_GAME_MODE;
|
||||
public static final Object instance$ClientboundPlayerInfoUpdatePacket$Action$UPDATE_LISTED;
|
||||
public static final Object instance$ClientboundPlayerInfoUpdatePacket$Action$UPDATE_LATENCY;
|
||||
public static final Object instance$ClientboundPlayerInfoUpdatePacket$Action$UPDATE_DISPLAY_NAME;
|
||||
//public static final Object instance$ClientboundPlayerInfoUpdatePacket$Action$UPDATE_LIST_ORDER;
|
||||
//public static final Object instance$ClientboundPlayerInfoUpdatePacket$Action$UPDATE_HAT;
|
||||
|
||||
|
||||
static {
|
||||
try {
|
||||
Object[] values = (Object[]) method$ClientboundPlayerInfoUpdatePacket$Action$values.invoke(null);
|
||||
instance$ClientboundPlayerInfoUpdatePacket$Action$ADD_PLAYER = values[0];
|
||||
instance$ClientboundPlayerInfoUpdatePacket$Action$INITIALIZE_CHAT = values[1];
|
||||
instance$ClientboundPlayerInfoUpdatePacket$Action$UPDATE_GAME_MODE = values[2];
|
||||
instance$ClientboundPlayerInfoUpdatePacket$Action$UPDATE_LISTED = values[3];
|
||||
instance$ClientboundPlayerInfoUpdatePacket$Action$UPDATE_LATENCY = values[4];
|
||||
instance$ClientboundPlayerInfoUpdatePacket$Action$UPDATE_DISPLAY_NAME = values[5];
|
||||
//1.21.3
|
||||
//instance$ClientboundPlayerInfoUpdatePacket$Action$UPDATE_LIST_ORDER = values[6];
|
||||
//1.21.4
|
||||
//instance$ClientboundPlayerInfoUpdatePacket$Action$UPDATE_HAT = values[7];
|
||||
} catch (ReflectiveOperationException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
@@ -1484,4 +1502,78 @@ public final class NetworkReflections {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static final Class<?> clazz$ClientBoundPlayerInfoUpdatePacket$Entry = requireNonNull(
|
||||
BukkitReflectionUtils.findReobfOrMojmapClass(
|
||||
"network.protocol.game.ClientboundPlayerInfoUpdatePacket$b",
|
||||
"network.protocol.game.ClientboundPlayerInfoUpdatePacket$Entry"
|
||||
)
|
||||
);
|
||||
|
||||
public static final Constructor<?> constructor$ClientBoundPlayerInfoUpdatePacket$Entry = requireNonNull(
|
||||
VersionHelper.isOrAbove1_21_3()
|
||||
? VersionHelper.isOrAbove1_21_4()
|
||||
? ReflectionUtils.getConstructor(clazz$ClientBoundPlayerInfoUpdatePacket$Entry, UUID.class, CoreReflections.clazz$GameProfile, boolean.class, int.class, CoreReflections.clazz$GameType, CoreReflections.clazz$Component, boolean.class, int.class, CoreReflections.clazz$RemoteChatSession$Data)
|
||||
: ReflectionUtils.getConstructor(clazz$ClientBoundPlayerInfoUpdatePacket$Entry, UUID.class, CoreReflections.clazz$GameProfile, boolean.class, int.class, CoreReflections.clazz$GameType, CoreReflections.clazz$Component, int.class, CoreReflections.clazz$RemoteChatSession$Data)
|
||||
: ReflectionUtils.getConstructor(clazz$ClientBoundPlayerInfoUpdatePacket$Entry, UUID.class, CoreReflections.clazz$GameProfile, boolean.class, int.class, CoreReflections.clazz$GameType, CoreReflections.clazz$Component, CoreReflections.clazz$RemoteChatSession$Data)
|
||||
);
|
||||
|
||||
public static final Class<?> clazz$ClientboundTeleportEntityPacket = requireNonNull(
|
||||
BukkitReflectionUtils.findReobfOrMojmapClass(
|
||||
"network.protocol.game.PacketPlayOutEntityTeleport",
|
||||
"network.protocol.game.ClientboundTeleportEntityPacket"
|
||||
)
|
||||
);
|
||||
|
||||
public static final Constructor<?> constructor$ClientboundTeleportEntityPacket = requireNonNull(
|
||||
VersionHelper.isOrAbove1_21_3()
|
||||
? ReflectionUtils.getConstructor(clazz$ClientboundTeleportEntityPacket, int.class, CoreReflections.clazz$PositionMoveRotation, Set.class, boolean.class)
|
||||
: ReflectionUtils.getConstructor(clazz$ClientboundTeleportEntityPacket, CoreReflections.clazz$Entity)
|
||||
);
|
||||
|
||||
public static final Method method$ClientboundSetEquipmentPacket$getEntity = requireNonNull(
|
||||
ReflectionUtils.getMethod(
|
||||
NetworkReflections.clazz$ClientboundSetEquipmentPacket, int.class
|
||||
)
|
||||
);
|
||||
|
||||
public static final Method method$ClientboundSetEquipmentPacket$getSlots = requireNonNull(
|
||||
ReflectionUtils.getMethod(
|
||||
NetworkReflections.clazz$ClientboundSetEquipmentPacket, List.class
|
||||
)
|
||||
);
|
||||
|
||||
public static final Method method$ClientboundContainerSetSlotPacket$getContainerId = requireNonNull(
|
||||
ReflectionUtils.getMethod(
|
||||
clazz$ClientboundContainerSetSlotPacket, int.class, new String[]{"a", "getContainerId"}
|
||||
)
|
||||
);
|
||||
|
||||
public static final Method method$ClientboundContainerSetSlotPacket$getSlot = requireNonNull(
|
||||
ReflectionUtils.getMethod(
|
||||
clazz$ClientboundContainerSetSlotPacket, int.class, new String[]{"c", "d", "getSlot"}
|
||||
)
|
||||
);
|
||||
|
||||
public static final Method method$ClientboundContainerSetSlotPacket$getStateId = requireNonNull(
|
||||
ReflectionUtils.getMethod(
|
||||
clazz$ClientboundContainerSetSlotPacket, int.class, new String[]{"e", "f", "getStateId"}
|
||||
)
|
||||
);
|
||||
|
||||
public static final Class<?> clazz$ClientboundAnimatePacket = requireNonNull(
|
||||
BukkitReflectionUtils.findReobfOrMojmapClass(
|
||||
"network.protocol.game.PacketPlayOutAnimation",
|
||||
"network.protocol.game.ClientboundAnimatePacket")
|
||||
);
|
||||
|
||||
public static final Constructor<?> constructor$ClientboundAnimatePacket = requireNonNull(
|
||||
ReflectionUtils.getConstructor(clazz$ClientboundAnimatePacket, CoreReflections.clazz$Entity, int.class)
|
||||
);
|
||||
|
||||
public static final Constructor<?> constructor$ClientboundRotateHeadPacket = requireNonNull(
|
||||
ReflectionUtils.getDeclaredConstructor(
|
||||
clazz$ClientboundRotateHeadPacket, CoreReflections.clazz$Entity, byte.class
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user