1.21.5 bump
Some checks failed
Java CI / Build (push) Has been cancelled

This commit is contained in:
Stijn Bannink 2025-03-27 19:47:53 +01:00
parent bb4ef78a3f
commit ba5b1f5c6e
Signed by: SBDeveloper
GPG key ID: B730712F2C3A9D7A
3 changed files with 12 additions and 18 deletions

View file

@ -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

View file

@ -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++) {