v1.6.5: 1.21.2 and 1.21.3 support #41
3 changed files with 12 additions and 18 deletions
14
pom.xml
14
pom.xml
|
@ -24,7 +24,7 @@
|
|||
|
||||
<groupId>tech.sbdevelopment</groupId>
|
||||
<artifactId>MapReflectionAPI</artifactId>
|
||||
<version>1.6.5</version>
|
||||
<version>1.6.6</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>MapReflectionAPI</name>
|
||||
|
@ -48,7 +48,7 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.13.0</version>
|
||||
<version>3.14.0</version>
|
||||
<configuration>
|
||||
<release>11</release>
|
||||
<annotationProcessorPaths>
|
||||
|
@ -119,7 +119,7 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.11.1</version>
|
||||
<version>3.11.2</version>
|
||||
<configuration>
|
||||
<release>11</release>
|
||||
<sourcepath>${maven.lombok.delombok-target}</sourcepath>
|
||||
|
@ -176,7 +176,7 @@
|
|||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.21.3-R0.1-SNAPSHOT</version>
|
||||
<version>1.21.5-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -192,9 +192,9 @@
|
|||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.stijnb1234</groupId>
|
||||
<groupId>com.github.cryptomorin</groupId>
|
||||
<artifactId>XSeries</artifactId>
|
||||
<version>5a4bf81a2c</version>
|
||||
<version>13.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Libraries below are provided by CraftBukkit -->
|
||||
|
@ -207,7 +207,7 @@
|
|||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-transport</artifactId>
|
||||
<version>4.1.97.Final</version>
|
||||
<version>4.1.118.Final</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
|
|
@ -69,8 +69,6 @@ public class MapWrapper extends AbstractMapWrapper {
|
|||
private static final Class<?> entityMetadataPacketClass = getNMSClass("network.protocol.game", "PacketPlayOutEntityMetadata");
|
||||
private static final Class<?> entityItemFrameClass = getNMSClass("world.entity.decoration", "EntityItemFrame");
|
||||
private static final Class<?> dataWatcherItemClass = getNMSClass("network.syncher", "DataWatcher$Item");
|
||||
private static final Class<?> minecraftKeyClass = getNMSClass("resources", "MinecraftKey");
|
||||
private static final Class<?> builtInRegistriesClass = getNMSClass("core.registries", "BuiltInRegistries");
|
||||
|
||||
protected MapController controller = new MapController() {
|
||||
private final Map<UUID, Integer> viewers = new HashMap<>();
|
||||
|
@ -169,8 +167,8 @@ public class MapWrapper extends AbstractMapWrapper {
|
|||
|
||||
String inventoryMenuName;
|
||||
if (supports(21)) {
|
||||
//1.21 = cc
|
||||
inventoryMenuName = "cc";
|
||||
//1.21.5 = bQ, 1.21 - 1.21.4 = cc
|
||||
inventoryMenuName = supports(21, 4) ? "bQ" : "cc";
|
||||
} else if (supports(20)) {
|
||||
//1.20.5 = cb, 1.20.2 - 1.20.4 = bR, 1.20(.1) = bQ
|
||||
inventoryMenuName = supports(20, 4) ? "cb" : supports(20, 2) ? "bR" : "bQ";
|
||||
|
@ -295,7 +293,7 @@ public class MapWrapper extends AbstractMapWrapper {
|
|||
|
||||
//1.20.5 uses new NBT compound system
|
||||
if (supports(20, 4)) {
|
||||
Object mapIdComponent = ReflectionUtil.getDeclaredField(getNMSClass("core.component", "DataComponents"), supports(21, 2) ? "L" : "B"); //1.21.2+ uses L, otherwise B
|
||||
Object mapIdComponent = ReflectionUtil.getDeclaredField(getNMSClass("core.component", "DataComponents"), supports(21, 4) ? "M" : supports(21, 2) ? "L" : "B"); //1.21.2+ uses L, otherwise B
|
||||
Object mapId1 = ReflectionUtil.callConstructor(getNMSClass("world.level.saveddata.maps", "MapId"), mapId);
|
||||
|
||||
// Use generic reflection because of generics
|
||||
|
|
|
@ -64,10 +64,8 @@ public class MultiMapWrapper extends AbstractMapWrapper {
|
|||
* Creates a new {@link MultiMapWrapper} from the given image.
|
||||
*
|
||||
* @param imageMatrix The image matrix to wrap
|
||||
* @deprecated Use {@link #MultiMapWrapper(ArrayImage, int, int)} instead, this method is meant for internal use only.
|
||||
*/
|
||||
@Deprecated(since = "1.6", forRemoval = true)
|
||||
public MultiMapWrapper(ArrayImage[][] imageMatrix) {
|
||||
protected MultiMapWrapper(ArrayImage[][] imageMatrix) {
|
||||
wrapperMatrix = new MapWrapper[imageMatrix.length][imageMatrix[0].length];
|
||||
|
||||
for (int row = 0; row < imageMatrix.length; row++) {
|
||||
|
@ -85,10 +83,8 @@ public class MultiMapWrapper extends AbstractMapWrapper {
|
|||
* Creates a new {@link MultiMapWrapper} from the given image.
|
||||
*
|
||||
* @param imageMatrix The image matrix to wrap
|
||||
* @deprecated Use {@link #MultiMapWrapper(BufferedImage, int, int)} instead, this method is meant for internal use only.
|
||||
*/
|
||||
@Deprecated(since = "1.6", forRemoval = true)
|
||||
public MultiMapWrapper(BufferedImage[][] imageMatrix) {
|
||||
protected MultiMapWrapper(BufferedImage[][] imageMatrix) {
|
||||
wrapperMatrix = new MapWrapper[imageMatrix.length][imageMatrix[0].length];
|
||||
|
||||
for (int row = 0; row < imageMatrix.length; row++) {
|
||||
|
|
Loading…
Add table
Reference in a new issue