Replace {nms} and {obc} tags

This commit is contained in:
Lixfel
2025-01-06 10:15:48 +01:00
parent ab34d86da4
commit da148c0e9f
60 changed files with 182 additions and 182 deletions
@@ -170,7 +170,7 @@ public class ObserverTracer {
}
}
private static final Class<?> craftPoweredRail = Reflection.getClass("{obc}.block.impl.CraftPoweredRail");
private static final Class<?> craftPoweredRail = Reflection.getClass("org.bukkit.craftbukkit.block.impl.CraftPoweredRail");
private boolean checkAllowed(Block block, BlockData blockData) {
if (checkMaterial(block)) return true;
if (block.getType() == Material.BELL) {
@@ -72,9 +72,9 @@ import java.util.stream.Collectors;
public class SimulatorCursor implements Listener {
private final World WORLD = Bukkit.getWorlds().get(0);
private Class<?> position = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInFlying$PacketPlayInPosition");
private Class<?> look = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInFlying$PacketPlayInLook");
private Class<?> positionLook = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInFlying$PacketPlayInPositionLook");
private Class<?> position = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInFlying$PacketPlayInPosition");
private Class<?> look = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInFlying$PacketPlayInLook");
private Class<?> positionLook = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInFlying$PacketPlayInPositionLook");
private Map<Player, CursorType> cursorType = Collections.synchronizedMap(new HashMap<>());
private Map<Player, REntityServer> cursors = Collections.synchronizedMap(new HashMap<>());
@@ -81,7 +81,7 @@ public class SmartPlaceListener implements Listener {
IGNORED.remove(Material.BARRIER);
}
private static final Class<?> useItem = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInUseItem");
private static final Class<?> useItem = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInUseItem");
private static final Set<Player> SMART_PLACING = new HashSet<>();
private static final Set<Player> WAS_EXECUTED = new HashSet<>();
@@ -45,17 +45,17 @@ class PacketCache {
private static Set<Entity> entities = new HashSet<>();
private static BukkitTask task = null;
private static Class<?> vec3dClass = Reflection.getClass("{nms.world.phys}.Vec3D");
private static Class<?> vec3dClass = Reflection.getClass("net.minecraft.world.phys.Vec3D");
private static Reflection.Field<Object> zeroVec3d = (Reflection.Field<Object>) Reflection.getField(vec3dClass, vec3dClass, 0);
private static Object ZERO_VEC3D = zeroVec3d.get(null);
private static Class<?> velocityPacketClass = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutEntityVelocity");
private static Class<?> velocityPacketClass = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutEntityVelocity");
private static Reflection.Constructor velocityPacketConstructor = Reflection.getConstructor(velocityPacketClass, int.class, vec3dClass);
private static Class<?> teleportPacketClass = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutEntityTeleport");
private static Class<?> entityClass = Reflection.getClass("{nms.world.entity}.Entity");
private static Class<?> teleportPacketClass = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutEntityTeleport");
private static Class<?> entityClass = Reflection.getClass("net.minecraft.world.entity.Entity");
private static Reflection.Constructor teleportPacketConstructor = Reflection.getConstructor(teleportPacketClass, entityClass);
private static Class<?> craftEntityClass = Reflection.getClass("{obc}.entity.CraftEntity");
private static Class<?> craftEntityClass = Reflection.getClass("org.bukkit.craftbukkit.entity.CraftEntity");
private static Reflection.Method getHandle = Reflection.getMethod(craftEntityClass, "getHandle");
private static Object noGravityDataWatcher = BountifulWrapper.impl.getDataWatcherObject(5, Boolean.class);
@@ -32,7 +32,7 @@ public class TPSFreezeUtils {
@Getter
private static final boolean canFreeze;
private static final Reflection.Method getWorldHandle = Reflection.getTypedMethod(Reflection.getClass("{obc}.CraftWorld"), "getHandle", null);
private static final Reflection.Method getWorldHandle = Reflection.getTypedMethod(Reflection.getClass("org.bukkit.craftbukkit.CraftWorld"), "getHandle", null);
@Getter
private static boolean frozen = false;
@@ -42,7 +42,7 @@ public class TPSFreezeUtils {
static {
Reflection.Field<Boolean> fieldAccessor;
try {
fieldAccessor = Reflection.getField(Reflection.getClass("{nms.server.level}.WorldServer"), "freezed", boolean.class);
fieldAccessor = Reflection.getField(Reflection.getClass("net.minecraft.server.level.WorldServer"), "freezed", boolean.class);
} catch (IllegalArgumentException e) {
fieldAccessor = null;
}
@@ -101,8 +101,8 @@ public class TPSLimitUtils {
}
*/
private static final Class<?> position = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInFlying$PacketPlayInPosition");
private static final Class<?> positionLook = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInFlying$PacketPlayInPositionLook");
private static final Class<?> position = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInFlying$PacketPlayInPosition");
private static final Class<?> positionLook = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInFlying$PacketPlayInPositionLook");
static {
BiFunction<Player, Object, Object> positionSetter = (player, o) -> {
if (tpsLimiter != null) {
@@ -49,15 +49,15 @@ import java.util.function.BiFunction;
@Linked
public class NoClipCommand extends SWCommand implements Listener {
public static final Class<?> gameStateChange = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutGameStateChange");
public static final Class<?> gameStateChange = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutGameStateChange");
private static final Reflection.Field<Float> floatFieldAccessor = Reflection.getField(gameStateChange, float.class, 0);
private static final Class<?> position = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInFlying$PacketPlayInPosition");
private static final Class<?> positionLook = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInFlying$PacketPlayInPositionLook");
private static final Class<?> useItem = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInUseItem");
private static final Class<?> blockDig = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInBlockDig");
private static final Class<?> windowClick = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInWindowClick");
private static final Class<?> setSlotStack = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInSetCreativeSlot");
private static final Class<?> position = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInFlying$PacketPlayInPosition");
private static final Class<?> positionLook = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInFlying$PacketPlayInPositionLook");
private static final Class<?> useItem = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInUseItem");
private static final Class<?> blockDig = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInBlockDig");
private static final Class<?> windowClick = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInWindowClick");
private static final Class<?> setSlotStack = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInSetCreativeSlot");
@Getter
private static final List<Player> NOCLIPS = new ArrayList<>();
@@ -32,7 +32,7 @@ public class AntiCursorReCentering implements Enable {
@Override
public void enable() {
Class<?> closeWindow = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutCloseWindow");
Class<?> closeWindow = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutCloseWindow");
TinyProtocol.instance.addFilter(closeWindow, (player, object) -> {
if (player.getOpenInventory().getTopInventory().getType() == InventoryType.CRAFTING) {
return object;
@@ -29,7 +29,7 @@ import org.bukkit.GameMode;
public class NoCreativeKnockback {
public NoCreativeKnockback() {
TinyProtocol.instance.addFilter(Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutExplosion"), (player, o) -> {
TinyProtocol.instance.addFilter(Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutExplosion"), (player, o) -> {
if (player.getGameMode() != GameMode.CREATIVE) return o;
return NMSWrapper.impl.resetExplosionKnockback(o);
});
@@ -48,19 +48,19 @@ import org.bukkit.util.Vector;
@MinVersion(20)
public class SignEditFrom20 implements Listener {
private static final Class<?> blockPosition = Reflection.getClass("{nms.core}.BlockPosition");
private static final Class<?> craftBlock = Reflection.getClass("{obc}.block.CraftBlock");
private static final Class<?> craftWorld = Reflection.getClass("{obc}.CraftWorld");
private static final Class<?> generatorAccess = Reflection.getClass("{nms.world.level}.GeneratorAccess");
private static final Class<?> blockPosition = Reflection.getClass("net.minecraft.core.BlockPosition");
private static final Class<?> craftBlock = Reflection.getClass("org.bukkit.craftbukkit.block.CraftBlock");
private static final Class<?> craftWorld = Reflection.getClass("org.bukkit.craftbukkit.CraftWorld");
private static final Class<?> generatorAccess = Reflection.getClass("net.minecraft.world.level.GeneratorAccess");
private static final Reflection.Method getPosition = Reflection.getTypedMethod(craftBlock, "getPosition", blockPosition);
private static final Reflection.Method getWorldHandle = Reflection.getTypedMethod(craftWorld, "getHandle", null);
private static final Reflection.Method at = Reflection.getTypedMethod(craftBlock, "at", craftBlock, generatorAccess, blockPosition);
private static final Class<?> openSign = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutOpenSignEditor");
private static final Class<?> openSign = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutOpenSignEditor");
private static final Reflection.Field<?> blockPositionFieldAccessor = Reflection.getField(openSign, blockPosition, 0);
private static final Reflection.Field<?> sideFieldAccessor = Reflection.getField(openSign, boolean.class, 0);
private static final Class<?> updateSign = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInUpdateSign");
private static final Class<?> updateSign = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInUpdateSign");
private static final Reflection.Field<?> getBlockPositionFieldAccessor = Reflection.getField(updateSign, blockPosition, 0);
private static final Reflection.Field<String[]> stringFieldAccessor = Reflection.getField(updateSign, String[].class, 0);
@@ -40,18 +40,18 @@ import org.bukkit.event.player.PlayerInteractEvent;
@MaxVersion(19)
public class SignEditUntil19 implements Listener {
private static final Class<?> blockPosition = Reflection.getClass("{nms.core}.BlockPosition");
private static final Class<?> craftBlock = Reflection.getClass("{obc}.block.CraftBlock");
private static final Class<?> craftWorld = Reflection.getClass("{obc}.CraftWorld");
private static final Class<?> generatorAccess = Reflection.getClass("{nms.world.level}.GeneratorAccess");
private static final Class<?> blockPosition = Reflection.getClass("net.minecraft.core.BlockPosition");
private static final Class<?> craftBlock = Reflection.getClass("org.bukkit.craftbukkit.block.CraftBlock");
private static final Class<?> craftWorld = Reflection.getClass("org.bukkit.craftbukkit.CraftWorld");
private static final Class<?> generatorAccess = Reflection.getClass("net.minecraft.world.level.GeneratorAccess");
private static final Reflection.Method getPosition = Reflection.getTypedMethod(craftBlock, "getPosition", blockPosition);
private static final Reflection.Method getWorldHandle = Reflection.getTypedMethod(craftWorld, "getHandle", null);
private static final Reflection.Method at = Reflection.getTypedMethod(craftBlock, "at", craftBlock, generatorAccess, blockPosition);
private static final Class<?> openSign = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutOpenSignEditor");
private static final Class<?> openSign = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayOutOpenSignEditor");
private static final Reflection.Field<?> blockPositionFieldAccessor = Reflection.getField(openSign, blockPosition, 0);
private static final Class<?> updateSign = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInUpdateSign");
private static final Class<?> updateSign = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInUpdateSign");
private static final Reflection.Field<?> getBlockPositionFieldAccessor = Reflection.getField(updateSign, blockPosition, 0);
private static final Reflection.Field<String[]> stringFieldAccessor = Reflection.getField(updateSign, String[].class, 0);
@@ -108,8 +108,8 @@ public class XrayCommand extends SWCommand implements Listener, ScoreboardElemen
});
}
private static final Class<?> position = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInFlying$PacketPlayInPosition");
private static final Class<?> positionLook = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInFlying$PacketPlayInPositionLook");
private static final Class<?> position = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInFlying$PacketPlayInPosition");
private static final Class<?> positionLook = Reflection.getClass("net.minecraft.network.protocol.game.PacketPlayInFlying$PacketPlayInPositionLook");
{
BiFunction<Player, Object, Object> positionSetter = (player, o) -> {