diff --git a/pathetic-api/src/main/java/org/patheloper/api/snapshot/NMSInterface.java b/pathetic-api/src/main/java/org/patheloper/api/snapshot/ChunkDataProvider.java similarity index 95% rename from pathetic-api/src/main/java/org/patheloper/api/snapshot/NMSInterface.java rename to pathetic-api/src/main/java/org/patheloper/api/snapshot/ChunkDataProvider.java index b7390fab..5b85707f 100644 --- a/pathetic-api/src/main/java/org/patheloper/api/snapshot/NMSInterface.java +++ b/pathetic-api/src/main/java/org/patheloper/api/snapshot/ChunkDataProvider.java @@ -5,7 +5,7 @@ import org.bukkit.block.BlockState; /** This is for internal purpose only and is used to receive a ChunkSnapshot version-independent. */ -public interface NMSInterface { +public interface ChunkDataProvider { /** * Returns a {@link ChunkSnapshot} of the chunk at the given coordinates. diff --git a/pathetic-model/src/main/java/org/patheloper/model/snapshot/FailingSnapshotManager.java b/pathetic-model/src/main/java/org/patheloper/model/snapshot/FailingSnapshotManager.java index 7272db77..5235a0c2 100644 --- a/pathetic-model/src/main/java/org/patheloper/model/snapshot/FailingSnapshotManager.java +++ b/pathetic-model/src/main/java/org/patheloper/model/snapshot/FailingSnapshotManager.java @@ -15,7 +15,7 @@ import org.patheloper.api.wrapper.PathEnvironment; import org.patheloper.api.wrapper.PathPosition; import org.patheloper.model.snapshot.world.WorldDomain; -import org.patheloper.nms.NMSUtils; +import org.patheloper.provider.ChunkDataProviderResolver; import org.patheloper.util.BukkitVersionUtil; import org.patheloper.util.ChunkUtils; import org.patheloper.util.ErrorLogger; @@ -40,11 +40,12 @@ public class FailingSnapshotManager implements SnapshotManager { private static final Map SNAPSHOTS_MAP = new ConcurrentHashMap<>(); - private static final NMSUtils NMS_UTILS; + private static final ChunkDataProviderResolver CHUNK_DATA_PROVIDER_RESOLVER; static { BukkitVersionUtil.Version version = BukkitVersionUtil.getVersion(); - NMS_UTILS = new NMSUtils((int) version.major(), (int) version.minor()); + CHUNK_DATA_PROVIDER_RESOLVER = + new ChunkDataProviderResolver((int) version.major(), (int) version.minor()); } public static void invalidateChunk(UUID worldUUID, int chunkX, int chunkZ) { @@ -69,7 +70,9 @@ private static Optional fetchBlock(PathPosition position) { Material material = ChunkUtils.getMaterial(chunkSnapshotOptional.get(), x, position.getBlockY(), z); BlockState blockState = - NMS_UTILS.getNmsInterface().getBlockState(chunkSnapshotOptional.get(), x, position.getBlockY(), z); + CHUNK_DATA_PROVIDER_RESOLVER + .getChunkDataProvider() + .getBlockState(chunkSnapshotOptional.get(), x, position.getBlockY(), z); return Optional.of(new PathBlock(position, new BlockInformation(material, blockState))); } @@ -98,7 +101,9 @@ private static Optional getChunkSnapshot(PathPosition position) { position, chunkX, chunkZ, - NMS_UTILS.getNmsInterface().getSnapshot(world, chunkX, chunkZ))); + CHUNK_DATA_PROVIDER_RESOLVER + .getChunkDataProvider() + .getSnapshot(world, chunkX, chunkZ))); return Optional.empty(); } @@ -128,7 +133,9 @@ public static class RequestingSnapshotManager extends FailingSnapshotManager { private static ChunkSnapshot retrieveChunkSnapshot( PathEnvironment world, int chunkX, int chunkZ) { World bukkitWorld = Bukkit.getWorld(world.getUuid()); - return NMS_UTILS.getNmsInterface().getSnapshot(bukkitWorld, chunkX, chunkZ); + return CHUNK_DATA_PROVIDER_RESOLVER + .getChunkDataProvider() + .getSnapshot(bukkitWorld, chunkX, chunkZ); } private static ChunkSnapshot retrieveSnapshot(PathPosition position) { @@ -160,7 +167,9 @@ private static PathBlock ensureBlock(PathPosition pathPosition) { Material material = ChunkUtils.getMaterial(chunkSnapshot, x, pathPosition.getBlockY(), z); BlockState blockState = - NMS_UTILS.getNmsInterface().getBlockState(chunkSnapshot, x, pathPosition.getBlockY(), z); + CHUNK_DATA_PROVIDER_RESOLVER + .getChunkDataProvider() + .getBlockState(chunkSnapshot, x, pathPosition.getBlockY(), z); return new PathBlock(pathPosition, new BlockInformation(material, blockState)); } diff --git a/pathetic-nms/paper/src/main/java/org/patheloper/paper/PaperNMSInterface.java b/pathetic-nms/paper/src/main/java/org/patheloper/provider/paper/PaperChunkDataProvider.java similarity index 78% rename from pathetic-nms/paper/src/main/java/org/patheloper/paper/PaperNMSInterface.java rename to pathetic-nms/paper/src/main/java/org/patheloper/provider/paper/PaperChunkDataProvider.java index 55834013..48298d94 100644 --- a/pathetic-nms/paper/src/main/java/org/patheloper/paper/PaperNMSInterface.java +++ b/pathetic-nms/paper/src/main/java/org/patheloper/provider/paper/PaperChunkDataProvider.java @@ -1,12 +1,12 @@ -package org.patheloper.paper; +package org.patheloper.provider.paper; import org.bukkit.Bukkit; import org.bukkit.ChunkSnapshot; import org.bukkit.World; import org.bukkit.block.BlockState; -import org.patheloper.api.snapshot.NMSInterface; +import org.patheloper.api.snapshot.ChunkDataProvider; -public class PaperNMSInterface implements NMSInterface { +public class PaperChunkDataProvider implements ChunkDataProvider { @Override public ChunkSnapshot getSnapshot(World world, int chunkX, int chunkZ) { diff --git a/pathetic-nms/src/main/java/org/patheloper/nms/NMSUtils.java b/pathetic-nms/src/main/java/org/patheloper/nms/NMSUtils.java deleted file mode 100644 index 35ee3213..00000000 --- a/pathetic-nms/src/main/java/org/patheloper/nms/NMSUtils.java +++ /dev/null @@ -1,104 +0,0 @@ -package org.patheloper.nms; - -import lombok.Getter; -import lombok.extern.slf4j.Slf4j; -import org.patheloper.api.snapshot.NMSInterface; -import org.patheloper.nms.v1_12.OneTwelveNMSInterface; -import org.patheloper.nms.v1_15.OneFifteenNMSInterface; -import org.patheloper.nms.v1_16.OneSixteenNMSInterface; -import org.patheloper.nms.v1_17.OneSeventeenNMSInterface; -import org.patheloper.nms.v1_18.OneEighteenNMSInterface; -import org.patheloper.nms.v1_18_R2.OneEighteenTwoNMSInterface; -import org.patheloper.nms.v1_19_R2.OneNineteenTwoNMSInterface; -import org.patheloper.nms.v1_19_R3.OneNineteenThreeNMSInterface; -import org.patheloper.nms.v1_20_R1.OneTwentyOneNMSInterface; -import org.patheloper.nms.v1_20_R2.OneTwentyTwoNMSInterface; -import org.patheloper.nms.v1_20_R3.OneTwentyThreeNMSInterface; -import org.patheloper.nms.v1_20_R4.OneTwentyFourNMSInterface; -import org.patheloper.nms.v1_8.OneEightNMSInterface; -import org.patheloper.paper.PaperNMSInterface; - -@Getter -@Slf4j -public class NMSUtils { - - private final NMSInterface nmsInterface; - - public NMSUtils(int major, int minor) { - String version = "1." + major + "." + minor; - - if (isPaper()) { - nmsInterface = new PaperNMSInterface(); - log.info("Detected Paper v{}, using PaperNMSInterface", version); - return; - } - - nmsInterface = determineNMSInterface(major, minor); - log.info("Detected version v{}, using {}", version, nmsInterface.getClass().getSimpleName()); - } - - private NMSInterface determineNMSInterface(int major, int minor) { - final NMSInterface nmsInterface; - switch (major) { - case 20: - if (minor == 5 || minor == 6) { - nmsInterface = new OneTwentyFourNMSInterface(); - break; - } else if (minor == 3 || minor == 4) { - nmsInterface = new OneTwentyThreeNMSInterface(); - break; - } else if (minor == 2) { - nmsInterface = new OneTwentyTwoNMSInterface(); - break; - } else if (minor == 1) { - nmsInterface = new OneTwentyOneNMSInterface(); - break; - } - throw new IllegalArgumentException("Unsupported version: " + major + "." + minor); - case 19: - if (minor == 2 || minor == 3) { - nmsInterface = new OneNineteenTwoNMSInterface(); - break; - } - if (minor == 4) { - nmsInterface = new OneNineteenThreeNMSInterface(); - break; - } - throw new IllegalArgumentException("Unsupported version: " + major + "." + minor); - case 18: - if (minor == 2) { - nmsInterface = new OneEighteenTwoNMSInterface(); - break; - } - nmsInterface = new OneEighteenNMSInterface(); - break; - case 17: - nmsInterface = new OneSeventeenNMSInterface(); - break; - case 16: - nmsInterface = new OneSixteenNMSInterface(); - break; - case 15: - nmsInterface = new OneFifteenNMSInterface(); - break; - case 12: - nmsInterface = new OneTwelveNMSInterface(); - break; - case 8: - nmsInterface = new OneEightNMSInterface(); - break; - default: - throw new IllegalArgumentException("Unsupported version: " + major + "." + minor); - } - return nmsInterface; - } - - private boolean isPaper() { - try { - Class.forName("io.papermc.paper.configuration.GlobalConfiguration"); - return true; - } catch (ClassNotFoundException e) { - return false; - } - } -} diff --git a/pathetic-nms/src/main/java/org/patheloper/provider/ChunkDataProviderResolver.java b/pathetic-nms/src/main/java/org/patheloper/provider/ChunkDataProviderResolver.java new file mode 100644 index 00000000..0b693aa5 --- /dev/null +++ b/pathetic-nms/src/main/java/org/patheloper/provider/ChunkDataProviderResolver.java @@ -0,0 +1,104 @@ +package org.patheloper.provider; + +import lombok.Getter; +import lombok.extern.slf4j.Slf4j; +import org.patheloper.api.snapshot.ChunkDataProvider; +import org.patheloper.provider.v1_12.OneTwelveChunkDataProviderImpl; +import org.patheloper.provider.v1_15.OneFifteenChunkDataProviderImpl; +import org.patheloper.provider.v1_16.OneSixteenChunkDataProviderImpl; +import org.patheloper.provider.v1_17.OneSeventeenChunkDataProviderImpl; +import org.patheloper.provider.v1_18.OneEighteenChunkDataProviderImpl; +import org.patheloper.provider.v1_18_R2.OneEighteenTwoChunkDataProviderImpl; +import org.patheloper.provider.v1_19_R2.OneNineteenTwoChunkDataProviderImpl; +import org.patheloper.provider.v1_19_R3.OneNineteenThreeChunkDataProviderImpl; +import org.patheloper.provider.v1_20_R1.OneTwentyOneChunkDataProviderImpl; +import org.patheloper.provider.v1_20_R2.OneTwentyTwoChunkDataProviderImpl; +import org.patheloper.provider.v1_20_R3.OneTwentyThreeChunkDataProviderImpl; +import org.patheloper.provider.v1_20_R4.OneTwentyFourChunkDataProviderImpl; +import org.patheloper.provider.v1_8.OneEightChunkDataProviderImpl; +import org.patheloper.provider.paper.PaperChunkDataProvider; + +@Getter +@Slf4j +public class ChunkDataProviderResolver { + + private final ChunkDataProvider chunkDataProvider; + + public ChunkDataProviderResolver(int major, int minor) { + String version = "1." + major + "." + minor; + + if (isPaper()) { + chunkDataProvider = new PaperChunkDataProvider(); + } else { + chunkDataProvider = determineChunkDataProvider(major, minor); + } + + log.info( + "Detected version v{}, using {}", version, chunkDataProvider.getClass().getSimpleName()); + } + + private ChunkDataProvider determineChunkDataProvider(int major, int minor) { + final ChunkDataProvider chunkDataProvider; + switch (major) { + case 20: + if (minor == 5 || minor == 6) { + chunkDataProvider = new OneTwentyFourChunkDataProviderImpl(); + break; + } else if (minor == 3 || minor == 4) { + chunkDataProvider = new OneTwentyThreeChunkDataProviderImpl(); + break; + } else if (minor == 2) { + chunkDataProvider = new OneTwentyTwoChunkDataProviderImpl(); + break; + } else if (minor == 1) { + chunkDataProvider = new OneTwentyOneChunkDataProviderImpl(); + break; + } + throw new IllegalArgumentException("Unsupported version: " + major + "." + minor); + case 19: + if (minor == 2 || minor == 3) { + chunkDataProvider = new OneNineteenTwoChunkDataProviderImpl(); + break; + } + if (minor == 4) { + chunkDataProvider = new OneNineteenThreeChunkDataProviderImpl(); + break; + } + throw new IllegalArgumentException("Unsupported version: " + major + "." + minor); + case 18: + if (minor == 2) { + chunkDataProvider = new OneEighteenTwoChunkDataProviderImpl(); + break; + } + chunkDataProvider = new OneEighteenChunkDataProviderImpl(); + break; + case 17: + chunkDataProvider = new OneSeventeenChunkDataProviderImpl(); + break; + case 16: + chunkDataProvider = new OneSixteenChunkDataProviderImpl(); + break; + case 15: + chunkDataProvider = new OneFifteenChunkDataProviderImpl(); + break; + case 12: + chunkDataProvider = new OneTwelveChunkDataProviderImpl(); + break; + case 8: + chunkDataProvider = new OneEightChunkDataProviderImpl(); + break; + default: + throw new IllegalArgumentException("Unsupported version: " + major + "." + minor); + } + return chunkDataProvider; + } + + private boolean isPaper() { + try { + Class.forName("io.papermc.paper.configuration.GlobalConfiguration"); + return true; + } catch (ClassNotFoundException e) { + return false; + } + } +} diff --git a/pathetic-nms/v1_12/src/main/java/org/patheloper/nms/v1_12/OneTwelveNMSInterface.java b/pathetic-nms/v1_12/src/main/java/org/patheloper/provider/v1_12/OneTwelveChunkDataProviderImpl.java similarity index 81% rename from pathetic-nms/v1_12/src/main/java/org/patheloper/nms/v1_12/OneTwelveNMSInterface.java rename to pathetic-nms/v1_12/src/main/java/org/patheloper/provider/v1_12/OneTwelveChunkDataProviderImpl.java index d1fcc7ee..79e618e6 100644 --- a/pathetic-nms/v1_12/src/main/java/org/patheloper/nms/v1_12/OneTwelveNMSInterface.java +++ b/pathetic-nms/v1_12/src/main/java/org/patheloper/provider/v1_12/OneTwelveChunkDataProviderImpl.java @@ -1,4 +1,4 @@ -package org.patheloper.nms.v1_12; +package org.patheloper.provider.v1_12; import net.minecraft.server.v1_12_R1.Chunk; import net.minecraft.server.v1_12_R1.WorldServer; @@ -6,9 +6,9 @@ import org.bukkit.World; import org.bukkit.block.BlockState; import org.bukkit.craftbukkit.v1_12_R1.CraftWorld; -import org.patheloper.api.snapshot.NMSInterface; +import org.patheloper.api.snapshot.ChunkDataProvider; -public class OneTwelveNMSInterface implements NMSInterface { +public class OneTwelveChunkDataProviderImpl implements ChunkDataProvider { @Override public ChunkSnapshot getSnapshot(World world, int chunkX, int chunkZ) { diff --git a/pathetic-nms/v1_15/src/main/java/org/patheloper/nms/v1_15/OneFifteenNMSInterface.java b/pathetic-nms/v1_15/src/main/java/org/patheloper/provider/v1_15/OneFifteenChunkDataProviderImpl.java similarity index 83% rename from pathetic-nms/v1_15/src/main/java/org/patheloper/nms/v1_15/OneFifteenNMSInterface.java rename to pathetic-nms/v1_15/src/main/java/org/patheloper/provider/v1_15/OneFifteenChunkDataProviderImpl.java index d08aa7dc..3dc17e07 100644 --- a/pathetic-nms/v1_15/src/main/java/org/patheloper/nms/v1_15/OneFifteenNMSInterface.java +++ b/pathetic-nms/v1_15/src/main/java/org/patheloper/provider/v1_15/OneFifteenChunkDataProviderImpl.java @@ -1,4 +1,4 @@ -package org.patheloper.nms.v1_15; +package org.patheloper.provider.v1_15; import net.minecraft.server.v1_15_R1.ChunkStatus; import net.minecraft.server.v1_15_R1.WorldServer; @@ -7,9 +7,9 @@ import org.bukkit.block.BlockState; import org.bukkit.craftbukkit.v1_15_R1.CraftChunk; import org.bukkit.craftbukkit.v1_15_R1.CraftWorld; -import org.patheloper.api.snapshot.NMSInterface; +import org.patheloper.api.snapshot.ChunkDataProvider; -public class OneFifteenNMSInterface implements NMSInterface { +public class OneFifteenChunkDataProviderImpl implements ChunkDataProvider { @Override public ChunkSnapshot getSnapshot(World world, int chunkX, int chunkZ) { diff --git a/pathetic-nms/v1_16/src/main/java/org/patheloper/nms/v1_16/OneSixteenNMSInterface.java b/pathetic-nms/v1_16/src/main/java/org/patheloper/provider/v1_16/OneSixteenChunkDataProviderImpl.java similarity index 83% rename from pathetic-nms/v1_16/src/main/java/org/patheloper/nms/v1_16/OneSixteenNMSInterface.java rename to pathetic-nms/v1_16/src/main/java/org/patheloper/provider/v1_16/OneSixteenChunkDataProviderImpl.java index f0875f19..a9cdbfce 100644 --- a/pathetic-nms/v1_16/src/main/java/org/patheloper/nms/v1_16/OneSixteenNMSInterface.java +++ b/pathetic-nms/v1_16/src/main/java/org/patheloper/provider/v1_16/OneSixteenChunkDataProviderImpl.java @@ -1,4 +1,4 @@ -package org.patheloper.nms.v1_16; +package org.patheloper.provider.v1_16; import net.minecraft.server.v1_16_R3.ChunkStatus; import net.minecraft.server.v1_16_R3.WorldServer; @@ -7,9 +7,9 @@ import org.bukkit.block.BlockState; import org.bukkit.craftbukkit.v1_16_R3.CraftChunk; import org.bukkit.craftbukkit.v1_16_R3.CraftWorld; -import org.patheloper.api.snapshot.NMSInterface; +import org.patheloper.api.snapshot.ChunkDataProvider; -public class OneSixteenNMSInterface implements NMSInterface { +public class OneSixteenChunkDataProviderImpl implements ChunkDataProvider { @Override public ChunkSnapshot getSnapshot(World world, int chunkX, int chunkZ) { diff --git a/pathetic-nms/v1_17/src/main/java/org/patheloper/nms/v1_17/OneSeventeenNMSInterface.java b/pathetic-nms/v1_17/src/main/java/org/patheloper/provider/v1_17/OneSeventeenChunkDataProviderImpl.java similarity index 87% rename from pathetic-nms/v1_17/src/main/java/org/patheloper/nms/v1_17/OneSeventeenNMSInterface.java rename to pathetic-nms/v1_17/src/main/java/org/patheloper/provider/v1_17/OneSeventeenChunkDataProviderImpl.java index 64775aa0..288625cd 100644 --- a/pathetic-nms/v1_17/src/main/java/org/patheloper/nms/v1_17/OneSeventeenNMSInterface.java +++ b/pathetic-nms/v1_17/src/main/java/org/patheloper/provider/v1_17/OneSeventeenChunkDataProviderImpl.java @@ -1,4 +1,4 @@ -package org.patheloper.nms.v1_17; +package org.patheloper.provider.v1_17; import net.minecraft.server.level.WorldServer; import net.minecraft.world.level.block.state.IBlockData; @@ -11,9 +11,9 @@ import org.bukkit.craftbukkit.v1_17_R1.CraftWorld; import org.bukkit.craftbukkit.v1_17_R1.block.CraftBlockStates; import org.bukkit.craftbukkit.v1_17_R1.block.data.CraftBlockData; -import org.patheloper.api.snapshot.NMSInterface; +import org.patheloper.api.snapshot.ChunkDataProvider; -public class OneSeventeenNMSInterface implements NMSInterface { +public class OneSeventeenChunkDataProviderImpl implements ChunkDataProvider { @Override public ChunkSnapshot getSnapshot(World world, int chunkX, int chunkZ) { diff --git a/pathetic-nms/v1_18/src/main/java/org/patheloper/nms/v1_18/OneEighteenNMSInterface.java b/pathetic-nms/v1_18/src/main/java/org/patheloper/provider/v1_18/OneEighteenChunkDataProviderImpl.java similarity index 91% rename from pathetic-nms/v1_18/src/main/java/org/patheloper/nms/v1_18/OneEighteenNMSInterface.java rename to pathetic-nms/v1_18/src/main/java/org/patheloper/provider/v1_18/OneEighteenChunkDataProviderImpl.java index d113acd0..580931ec 100644 --- a/pathetic-nms/v1_18/src/main/java/org/patheloper/nms/v1_18/OneEighteenNMSInterface.java +++ b/pathetic-nms/v1_18/src/main/java/org/patheloper/provider/v1_18/OneEighteenChunkDataProviderImpl.java @@ -1,4 +1,4 @@ -package org.patheloper.nms.v1_18; +package org.patheloper.provider.v1_18; import java.lang.reflect.Field; import net.minecraft.server.level.WorldServer; @@ -13,9 +13,9 @@ import org.bukkit.craftbukkit.v1_18_R1.CraftWorld; import org.bukkit.craftbukkit.v1_18_R1.block.CraftBlockStates; import org.bukkit.craftbukkit.v1_18_R1.block.data.CraftBlockData; -import org.patheloper.api.snapshot.NMSInterface; +import org.patheloper.api.snapshot.ChunkDataProvider; -public class OneEighteenNMSInterface implements NMSInterface { +public class OneEighteenChunkDataProviderImpl implements ChunkDataProvider { private static final Field blockIDField; diff --git a/pathetic-nms/v1_18_R2/src/main/java/org/patheloper/nms/v1_18_R2/OneEighteenTwoNMSInterface.java b/pathetic-nms/v1_18_R2/src/main/java/org/patheloper/provider/v1_18_R2/OneEighteenTwoChunkDataProviderImpl.java similarity index 91% rename from pathetic-nms/v1_18_R2/src/main/java/org/patheloper/nms/v1_18_R2/OneEighteenTwoNMSInterface.java rename to pathetic-nms/v1_18_R2/src/main/java/org/patheloper/provider/v1_18_R2/OneEighteenTwoChunkDataProviderImpl.java index cf6fd26b..5e2490ac 100644 --- a/pathetic-nms/v1_18_R2/src/main/java/org/patheloper/nms/v1_18_R2/OneEighteenTwoNMSInterface.java +++ b/pathetic-nms/v1_18_R2/src/main/java/org/patheloper/provider/v1_18_R2/OneEighteenTwoChunkDataProviderImpl.java @@ -1,4 +1,4 @@ -package org.patheloper.nms.v1_18_R2; +package org.patheloper.provider.v1_18_R2; import java.lang.reflect.Field; import net.minecraft.server.level.WorldServer; @@ -13,9 +13,9 @@ import org.bukkit.craftbukkit.v1_18_R2.CraftWorld; import org.bukkit.craftbukkit.v1_18_R2.block.CraftBlockStates; import org.bukkit.craftbukkit.v1_18_R2.block.data.CraftBlockData; -import org.patheloper.api.snapshot.NMSInterface; +import org.patheloper.api.snapshot.ChunkDataProvider; -public class OneEighteenTwoNMSInterface implements NMSInterface { +public class OneEighteenTwoChunkDataProviderImpl implements ChunkDataProvider { private static final Field blockIDField; diff --git a/pathetic-nms/v1_19_R2/src/main/java/org/patheloper/nms/v1_19_R2/OneNineteenTwoNMSInterface.java b/pathetic-nms/v1_19_R2/src/main/java/org/patheloper/provider/v1_19_R2/OneNineteenTwoChunkDataProviderImpl.java similarity index 91% rename from pathetic-nms/v1_19_R2/src/main/java/org/patheloper/nms/v1_19_R2/OneNineteenTwoNMSInterface.java rename to pathetic-nms/v1_19_R2/src/main/java/org/patheloper/provider/v1_19_R2/OneNineteenTwoChunkDataProviderImpl.java index 32685a82..7c769789 100644 --- a/pathetic-nms/v1_19_R2/src/main/java/org/patheloper/nms/v1_19_R2/OneNineteenTwoNMSInterface.java +++ b/pathetic-nms/v1_19_R2/src/main/java/org/patheloper/provider/v1_19_R2/OneNineteenTwoChunkDataProviderImpl.java @@ -1,4 +1,4 @@ -package org.patheloper.nms.v1_19_R2; +package org.patheloper.provider.v1_19_R2; import java.lang.reflect.Field; import net.minecraft.server.level.WorldServer; @@ -13,9 +13,9 @@ import org.bukkit.craftbukkit.v1_19_R2.CraftWorld; import org.bukkit.craftbukkit.v1_19_R2.block.CraftBlockStates; import org.bukkit.craftbukkit.v1_19_R2.block.data.CraftBlockData; -import org.patheloper.api.snapshot.NMSInterface; +import org.patheloper.api.snapshot.ChunkDataProvider; -public class OneNineteenTwoNMSInterface implements NMSInterface { +public class OneNineteenTwoChunkDataProviderImpl implements ChunkDataProvider { private static final Field blockIDField; diff --git a/pathetic-nms/v1_19_R3/src/main/java/org/patheloper/nms/v1_19_R3/OneNineteenThreeNMSInterface.java b/pathetic-nms/v1_19_R3/src/main/java/org/patheloper/provider/v1_19_R3/OneNineteenThreeChunkDataProviderImpl.java similarity index 91% rename from pathetic-nms/v1_19_R3/src/main/java/org/patheloper/nms/v1_19_R3/OneNineteenThreeNMSInterface.java rename to pathetic-nms/v1_19_R3/src/main/java/org/patheloper/provider/v1_19_R3/OneNineteenThreeChunkDataProviderImpl.java index 3f20669e..be94f7f5 100644 --- a/pathetic-nms/v1_19_R3/src/main/java/org/patheloper/nms/v1_19_R3/OneNineteenThreeNMSInterface.java +++ b/pathetic-nms/v1_19_R3/src/main/java/org/patheloper/provider/v1_19_R3/OneNineteenThreeChunkDataProviderImpl.java @@ -1,4 +1,4 @@ -package org.patheloper.nms.v1_19_R3; +package org.patheloper.provider.v1_19_R3; import java.lang.reflect.Field; import net.minecraft.server.level.WorldServer; @@ -13,9 +13,9 @@ import org.bukkit.craftbukkit.v1_19_R3.CraftWorld; import org.bukkit.craftbukkit.v1_19_R3.block.CraftBlockStates; import org.bukkit.craftbukkit.v1_19_R3.block.data.CraftBlockData; -import org.patheloper.api.snapshot.NMSInterface; +import org.patheloper.api.snapshot.ChunkDataProvider; -public class OneNineteenThreeNMSInterface implements NMSInterface { +public class OneNineteenThreeChunkDataProviderImpl implements ChunkDataProvider { private static final Field blockIDField; diff --git a/pathetic-nms/v1_20_R1/src/main/java/org/patheloper/nms/v1_20_R1/OneTwentyOneNMSInterface.java b/pathetic-nms/v1_20_R1/src/main/java/org/patheloper/provider/v1_20_R1/OneTwentyOneChunkDataProviderImpl.java similarity index 90% rename from pathetic-nms/v1_20_R1/src/main/java/org/patheloper/nms/v1_20_R1/OneTwentyOneNMSInterface.java rename to pathetic-nms/v1_20_R1/src/main/java/org/patheloper/provider/v1_20_R1/OneTwentyOneChunkDataProviderImpl.java index 4fd29077..9a450dd2 100644 --- a/pathetic-nms/v1_20_R1/src/main/java/org/patheloper/nms/v1_20_R1/OneTwentyOneNMSInterface.java +++ b/pathetic-nms/v1_20_R1/src/main/java/org/patheloper/provider/v1_20_R1/OneTwentyOneChunkDataProviderImpl.java @@ -1,4 +1,4 @@ -package org.patheloper.nms.v1_20_R1; +package org.patheloper.provider.v1_20_R1; import java.lang.reflect.Field; import net.minecraft.server.level.WorldServer; @@ -10,9 +10,9 @@ import org.bukkit.block.BlockState; import org.bukkit.craftbukkit.v1_20_R1.CraftChunk; import org.bukkit.craftbukkit.v1_20_R1.CraftWorld; -import org.patheloper.api.snapshot.NMSInterface; +import org.patheloper.api.snapshot.ChunkDataProvider; -public class OneTwentyOneNMSInterface implements NMSInterface { +public class OneTwentyOneChunkDataProviderImpl implements ChunkDataProvider { private static final Field blockIDField; diff --git a/pathetic-nms/v1_20_R2/src/main/java/org/patheloper/nms/v1_20_R2/OneTwentyTwoNMSInterface.java b/pathetic-nms/v1_20_R2/src/main/java/org/patheloper/provider/v1_20_R2/OneTwentyTwoChunkDataProviderImpl.java similarity index 90% rename from pathetic-nms/v1_20_R2/src/main/java/org/patheloper/nms/v1_20_R2/OneTwentyTwoNMSInterface.java rename to pathetic-nms/v1_20_R2/src/main/java/org/patheloper/provider/v1_20_R2/OneTwentyTwoChunkDataProviderImpl.java index e5520fb9..2ab5379b 100644 --- a/pathetic-nms/v1_20_R2/src/main/java/org/patheloper/nms/v1_20_R2/OneTwentyTwoNMSInterface.java +++ b/pathetic-nms/v1_20_R2/src/main/java/org/patheloper/provider/v1_20_R2/OneTwentyTwoChunkDataProviderImpl.java @@ -1,4 +1,4 @@ -package org.patheloper.nms.v1_20_R2; +package org.patheloper.provider.v1_20_R2; import net.minecraft.server.level.WorldServer; import net.minecraft.world.level.block.state.IBlockData; @@ -9,11 +9,11 @@ import org.bukkit.block.BlockState; import org.bukkit.craftbukkit.v1_20_R2.CraftChunk; import org.bukkit.craftbukkit.v1_20_R2.CraftWorld; -import org.patheloper.api.snapshot.NMSInterface; +import org.patheloper.api.snapshot.ChunkDataProvider; import java.lang.reflect.Field; -public final class OneTwentyTwoNMSInterface implements NMSInterface { +public final class OneTwentyTwoChunkDataProviderImpl implements ChunkDataProvider { private static final Field blockIDField; diff --git a/pathetic-nms/v1_20_R3/src/main/java/org/patheloper/nms/v1_20_R3/OneTwentyThreeNMSInterface.java b/pathetic-nms/v1_20_R3/src/main/java/org/patheloper/provider/v1_20_R3/OneTwentyThreeChunkDataProviderImpl.java similarity index 89% rename from pathetic-nms/v1_20_R3/src/main/java/org/patheloper/nms/v1_20_R3/OneTwentyThreeNMSInterface.java rename to pathetic-nms/v1_20_R3/src/main/java/org/patheloper/provider/v1_20_R3/OneTwentyThreeChunkDataProviderImpl.java index 0d9e04f4..a658a09d 100644 --- a/pathetic-nms/v1_20_R3/src/main/java/org/patheloper/nms/v1_20_R3/OneTwentyThreeNMSInterface.java +++ b/pathetic-nms/v1_20_R3/src/main/java/org/patheloper/provider/v1_20_R3/OneTwentyThreeChunkDataProviderImpl.java @@ -1,4 +1,4 @@ -package org.patheloper.nms.v1_20_R3; +package org.patheloper.provider.v1_20_R3; import java.lang.reflect.Field; import net.minecraft.server.level.WorldServer; @@ -10,9 +10,9 @@ import org.bukkit.block.BlockState; import org.bukkit.craftbukkit.v1_20_R3.CraftChunk; import org.bukkit.craftbukkit.v1_20_R3.CraftWorld; -import org.patheloper.api.snapshot.NMSInterface; +import org.patheloper.api.snapshot.ChunkDataProvider; -public final class OneTwentyThreeNMSInterface implements NMSInterface { +public final class OneTwentyThreeChunkDataProviderImpl implements ChunkDataProvider { private static final Field blockIDField; diff --git a/pathetic-nms/v1_20_R4/src/main/java/org/patheloper/nms/v1_20_R4/OneTwentyFourNMSInterface.java b/pathetic-nms/v1_20_R4/src/main/java/org/patheloper/provider/v1_20_R4/OneTwentyFourChunkDataProviderImpl.java similarity index 90% rename from pathetic-nms/v1_20_R4/src/main/java/org/patheloper/nms/v1_20_R4/OneTwentyFourNMSInterface.java rename to pathetic-nms/v1_20_R4/src/main/java/org/patheloper/provider/v1_20_R4/OneTwentyFourChunkDataProviderImpl.java index fec83c29..9404afbb 100644 --- a/pathetic-nms/v1_20_R4/src/main/java/org/patheloper/nms/v1_20_R4/OneTwentyFourNMSInterface.java +++ b/pathetic-nms/v1_20_R4/src/main/java/org/patheloper/provider/v1_20_R4/OneTwentyFourChunkDataProviderImpl.java @@ -1,4 +1,4 @@ -package org.patheloper.nms.v1_20_R4; +package org.patheloper.provider.v1_20_R4; import net.minecraft.server.level.WorldServer; import net.minecraft.world.level.block.state.IBlockData; @@ -9,11 +9,11 @@ import org.bukkit.block.BlockState; import org.bukkit.craftbukkit.v1_20_R4.CraftChunk; import org.bukkit.craftbukkit.v1_20_R4.CraftWorld; -import org.patheloper.api.snapshot.NMSInterface; +import org.patheloper.api.snapshot.ChunkDataProvider; import java.lang.reflect.Field; -public class OneTwentyFourNMSInterface implements NMSInterface { +public class OneTwentyFourChunkDataProviderImpl implements ChunkDataProvider { private static final Field blockIDField; diff --git a/pathetic-nms/v1_8/src/main/java/org/patheloper/nms/v1_8/OneEightNMSInterface.java b/pathetic-nms/v1_8/src/main/java/org/patheloper/provider/v1_8/OneEightChunkDataProviderImpl.java similarity index 81% rename from pathetic-nms/v1_8/src/main/java/org/patheloper/nms/v1_8/OneEightNMSInterface.java rename to pathetic-nms/v1_8/src/main/java/org/patheloper/provider/v1_8/OneEightChunkDataProviderImpl.java index 46abfd70..e95b3605 100644 --- a/pathetic-nms/v1_8/src/main/java/org/patheloper/nms/v1_8/OneEightNMSInterface.java +++ b/pathetic-nms/v1_8/src/main/java/org/patheloper/provider/v1_8/OneEightChunkDataProviderImpl.java @@ -1,4 +1,4 @@ -package org.patheloper.nms.v1_8; +package org.patheloper.provider.v1_8; import net.minecraft.server.v1_8_R3.Chunk; import net.minecraft.server.v1_8_R3.WorldServer; @@ -6,9 +6,9 @@ import org.bukkit.World; import org.bukkit.block.BlockState; import org.bukkit.craftbukkit.v1_8_R3.CraftWorld; -import org.patheloper.api.snapshot.NMSInterface; +import org.patheloper.api.snapshot.ChunkDataProvider; -public class OneEightNMSInterface implements NMSInterface { +public class OneEightChunkDataProviderImpl implements ChunkDataProvider { @Override public ChunkSnapshot getSnapshot(World world, int chunkX, int chunkZ) {