diff --git a/.github/workflows/fabric-1.20.2.yml b/.github/workflows/fabric-1.20.2.yml index d8b02098..6ed38e93 100644 --- a/.github/workflows/fabric-1.20.2.yml +++ b/.github/workflows/fabric-1.20.2.yml @@ -5,13 +5,13 @@ on: branches: - "fabric-1.20.2" env: - WORLDMAP_VERSION: "1.34.1" - MINIMAP_VERSION: "23.8.2" + WORLDMAP_VERSION: "1.35.0" + MINIMAP_VERSION: "23.8.3" MINECRAFT_VERSION: "1.20.2" MINECRAFT_VERSION_SHORT: "1.20.2" MOD_LOADER: "Fabric" - FABRIC_API_VERSION: "0.89.1+1.20.2" - FABRIC_API_MODRINTH_VERSION_ID: "lRcC0FRh" + FABRIC_API_VERSION: "0.90.0+1.20.2" + FABRIC_API_MODRINTH_VERSION_ID: "Hk8zAzIB" jobs: build: diff --git a/build.gradle b/build.gradle index cb009f13..6cf56655 100644 --- a/build.gradle +++ b/build.gradle @@ -51,9 +51,9 @@ dependencies { jarLibs "com.github.collarmc:pounce:0e8492b68e" jarLibs 'org.xerial:sqlite-jdbc:3.43.0.0' - modImplementation "maven.modrinth:xaeros-world-map:1.34.1_Fabric_1.20.2" - modImplementation "maven.modrinth:xaeros-minimap:23.8.2_Fabric_1.20.2" - modCompileOnly files("libs/BetterPvP_23.8.2_Fabric_1.20.2.jar") + modImplementation "maven.modrinth:xaeros-world-map:1.35.0_Fabric_1.20.2" + modImplementation "maven.modrinth:xaeros-minimap:23.8.3_Fabric_1.20.2" + modCompileOnly files("libs/BetterPvP_23.8.3_Fabric_1.20.2.jar") modImplementation files("libs/baritone-unoptimized-fabric-1.10.2.jar") modCompileOnly "maven.modrinth:waystones:15.0.0+fabric-1.20.2" modCompileOnly "maven.modrinth:balm:8.0.1+fabric-1.20.2" diff --git a/gradle.properties b/gradle.properties index ce9bbc26..bdb0625a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,4 +11,4 @@ mod_version=1.20.2 maven_group=xaeroplus archives_base_name=xaeroplus # Dependencies -fabric_version=0.89.1+1.20.2 +fabric_version=0.90.0+1.20.2 diff --git a/libs/BetterPvP_23.8.2_Fabric_1.20.2.jar b/libs/BetterPvP_23.8.3_Fabric_1.20.2.jar similarity index 88% rename from libs/BetterPvP_23.8.2_Fabric_1.20.2.jar rename to libs/BetterPvP_23.8.3_Fabric_1.20.2.jar index 20f2ea58..30dbdddb 100644 Binary files a/libs/BetterPvP_23.8.2_Fabric_1.20.2.jar and b/libs/BetterPvP_23.8.3_Fabric_1.20.2.jar differ diff --git a/src/main/java/xaeroplus/XaeroPlus.java b/src/main/java/xaeroplus/XaeroPlus.java index 86d14bd1..3f8f3582 100644 --- a/src/main/java/xaeroplus/XaeroPlus.java +++ b/src/main/java/xaeroplus/XaeroPlus.java @@ -21,7 +21,7 @@ public class XaeroPlus implements ClientModInitializer { public static final Logger LOGGER = LoggerFactory.getLogger("XaeroPlus"); public static final EventBus EVENT_BUS = new EventBus(Runnable::run); public static AtomicBoolean initialized = new AtomicBoolean(false); - private static final String compatibleMinimapVersion = "23.8.2"; + private static final String compatibleMinimapVersion = "23.8.3"; public static void initialize() { if (initialized.compareAndSet(false, true)) { diff --git a/src/main/java/xaeroplus/mixin/client/MixinForgeEventHandler.java b/src/main/java/xaeroplus/mixin/client/MixinForgeEventHandler.java index 57b0280b..fa562c6b 100644 --- a/src/main/java/xaeroplus/mixin/client/MixinForgeEventHandler.java +++ b/src/main/java/xaeroplus/mixin/client/MixinForgeEventHandler.java @@ -4,7 +4,6 @@ import net.minecraft.network.message.MessageType; import net.minecraft.text.Text; import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @@ -29,22 +28,6 @@ public void onSystemChatReceived(final Text component, final CallbackInfoReturna if (XaeroPlusSettingRegistry.disableReceivingWaypoints.getValue()) { // cancelling at head so we avoid hitting the logic to parse the waypoint string cir.setReturnValue(false); // false will show the raw message in chat to the player - return; - } - final String textString = component.getString(); - if (!textString.contains("xaero_waypoint:") && !textString.contains("xaero-waypoint:")) - return; // not a xaero waypoint message - if (XaeroPlusSettingRegistry.waypointReceiveNoChatReportsFix.getValue()) { - // check if this looks like a chat message - if (textString.startsWith("<") && textString.contains(">")) { - // get the sender name - final String senderName = textString.substring(textString.indexOf("<") + 1, textString.indexOf(">")); - // handle chat message normally but with the sender name - cir.setReturnValue(handleChatMessage(senderName, component)); - } } } - - @Shadow - protected abstract boolean handleChatMessage(String playerName, Text text); } diff --git a/src/main/java/xaeroplus/mixin/client/MixinGuiMap.java b/src/main/java/xaeroplus/mixin/client/MixinGuiMap.java index e57c39f2..6e53be62 100644 --- a/src/main/java/xaeroplus/mixin/client/MixinGuiMap.java +++ b/src/main/java/xaeroplus/mixin/client/MixinGuiMap.java @@ -194,7 +194,7 @@ public abstract class MixinGuiMap extends ScreenBase implements IRightClickableE private long lastStartTime; @Final @Shadow - private GuiMapSwitching dimensionSettings; + private GuiMapSwitching mapSwitchingGui; @Shadow private MapMouseButtonPress leftMouseButton; @Shadow @@ -447,11 +447,11 @@ public void render(DrawContext guiGraphics, int scaledMouseX, int scaledMouseY, long startTime = System.currentTimeMillis(); MapDimension currentDim = !this.mapProcessor.isMapWorldUsable() ? null : this.mapProcessor.getMapWorld().getCurrentDimension(); if (currentDim != this.dimension) { - this.dimensionSettings.active = false; + this.mapSwitchingGui.active = false; this.init(this.client, this.width, this.height); } - this.dimensionSettings.preMapRender((GuiMap) (Object)this, this.client, this.width, this.height); + this.mapSwitchingGui.preMapRender((GuiMap) (Object)this, this.client, this.width, this.height); long passed = this.lastStartTime == 0L ? 16L : startTime - this.lastStartTime; double passedScrolls = (double)((float)passed / 64.0F); int direction = this.buttonPressed != this.zoomInButton && !ControlsHandler.isDown(ControlsRegister.keyZoomIn) @@ -684,10 +684,7 @@ public void render(DrawContext guiGraphics, int scaledMouseX, int scaledMouseY, } } - if (this.mapProcessor.getMapWorld().isMultiplayer()) { - guiGraphics.drawTextWithShadow(mc.textRenderer, "MultiWorld ID: " + this.mapProcessor.getMapWorld().getCurrentMultiworld(), 5, 255, -1); - } - + guiGraphics.drawTextWithShadow(mc.textRenderer, "MultiWorld ID: " + this.mapProcessor.getMapWorld().getCurrentMultiworld(), 5, 255, -1); LayeredRegionManager regions = this.mapProcessor.getMapWorld().getDimension(Shared.customDimensionId).getLayeredMapRegions(); guiGraphics.drawTextWithShadow( mc.textRenderer, @@ -1882,7 +1879,7 @@ public void render(DrawContext guiGraphics, int scaledMouseX, int scaledMouseY, } } - this.dimensionSettings.renderText(guiGraphics, this.client, scaledMouseX, scaledMouseY, this.width, this.height); + this.mapSwitchingGui.renderText(guiGraphics, this.client, scaledMouseX, scaledMouseY, this.width, this.height); if (!mc.options.hudHidden) { guiGraphics.drawTexture(WorldMap.guiTextures, this.width - 34, 2, 0, 37, 32, 32); } diff --git a/src/main/java/xaeroplus/mixin/client/MixinMapProcessor.java b/src/main/java/xaeroplus/mixin/client/MixinMapProcessor.java index 6dab2f28..daf03760 100644 --- a/src/main/java/xaeroplus/mixin/client/MixinMapProcessor.java +++ b/src/main/java/xaeroplus/mixin/client/MixinMapProcessor.java @@ -243,11 +243,10 @@ synchronized void updateWorldSynced(final CallbackInfo ci) throws IOException { changedDimension || !this.mapWorld.getFutureDimension().getFutureMultiworldUnsynced().equals(this.mapWorld.getFutureDimension().getCurrentMultiworld()) )) { - String newMultiworldId = !this.mapWorldUsableRequest ? null : this.mapWorld.getFutureMultiworldUnsynced(); + String newMwId = !this.mapWorldUsableRequest ? null : this.mapWorld.getFutureMultiworldUnsynced(); this.pushRenderPause(true, true); this.pushWriterPause(); String newWorldId = !this.mapWorldUsableRequest ? null : this.mapWorld.getMainId(); - String newMWId = !this.mapWorld.isMultiplayer() ? null : newMultiworldId; boolean shouldClearAllDimensions = this.state == 1; boolean shouldClearNewDimension = this.mapWorldUsableRequest && !this.mapWorld.getFutureMultiworldUnsynced().equals(this.mapWorld.getFutureDimension().getCurrentMultiworld()); @@ -274,7 +273,7 @@ synchronized void updateWorldSynced(final CallbackInfo ci) throws IOException { if (shouldFinishCurrentDim) { if (region.getLevel() == 0) { MapRegion leafRegion = (MapRegion)region; - if (!leafRegion.isMultiplayer() && !leafRegion.hasLookedForCache() && leafRegion.isOutdatedWithOtherLayers()) { + if (!leafRegion.isNormalMapData() && !leafRegion.hasLookedForCache() && leafRegion.isOutdatedWithOtherLayers()) { File potentialCacheFile = this.mapSaveLoad.getCacheFile(leafRegion, leafRegion.getCaveLayer(), false, false); if (potentialCacheFile.exists()) { leafRegion.setCacheFile(potentialCacheFile); @@ -360,7 +359,7 @@ synchronized void updateWorldSynced(final CallbackInfo ci) throws IOException { this.currentWorldId = newWorldId; this.currentDimId = !this.mapWorldUsableRequest ? null : ((MapProcessor) (Object) this).getDimensionName(this.mapWorld.getFutureDimensionId()); - this.currentMWId = newMWId; + this.currentMWId = newMwId; Path mapPath = this.mapSaveLoad.getMWSubFolder(this.currentWorldId, this.currentDimId, this.currentMWId); if (this.mapWorldUsable) { Files.createDirectories(mapPath); @@ -433,7 +432,7 @@ synchronized void updateWorldSynced(final CallbackInfo ci) throws IOException { XaeroPlus.EVENT_BUS.dispatch(new XaeroWorldChangeEvent(this.currentWorldId, this.currentDimId, this.currentMWId)); this.worldDataHandler.prepareSingleplayer(this.world, (MapProcessor) (Object) this); - if (this.worldDataHandler.getWorldDir() == null && this.currentWorldId != null && !this.mapWorld.isMultiplayer()) { + if (this.worldDataHandler.getWorldDir() == null && this.currentWorldId != null && this.mapWorld.getCurrentDimension().isUsingWorldSave()) { this.currentWorldId = this.currentDimId = null; } @@ -531,7 +530,7 @@ public MapRegion getMapRegionCustomDimension(int caveLayer, int regX, int regZ, regZ, caveLayer, this.getGlobalVersion(), - this.mapWorld.isMultiplayer(), + !mapDimension.isUsingWorldSave(), this.worldBiomeRegistry ); MapLayer mapLayer = regions.getLayer(caveLayer); @@ -540,7 +539,7 @@ public MapRegion getMapRegionCustomDimension(int caveLayer, int regX, int regZ, if (regionDetection != null) { regionDetection.transferInfoTo(region); mapLayer.removeRegionDetection(regX, regZ); - } else if (!region.isMultiplayer() && mapDimension.getWorldSaveRegionDetection(regX, regZ) == null) { + } else if (!region.isNormalMapData() && mapDimension.getWorldSaveRegionDetection(regX, regZ) == null) { RegionDetection worldSaveRegionDetection = new RegionDetection( region.getWorldId(), region.getDimId(), diff --git a/src/main/java/xaeroplus/mixin/client/MixinMapSaveLoad.java b/src/main/java/xaeroplus/mixin/client/MixinMapSaveLoad.java index 440e970f..874ffb47 100644 --- a/src/main/java/xaeroplus/mixin/client/MixinMapSaveLoad.java +++ b/src/main/java/xaeroplus/mixin/client/MixinMapSaveLoad.java @@ -124,7 +124,7 @@ public boolean loadRegion( BiomeGetter biomeGetter, int extraAttempts ) { - boolean multiplayer = region.isMultiplayer(); + boolean multiplayer = region.isNormalMapData(); int emptySize = multiplayer ? 0 : 8192; int minorSaveVersion = -1; int majorSaveVersion = 0; @@ -410,9 +410,9 @@ public boolean saveRegion(MapRegion region, int extraAttempts) { } return region.countChunks() > 0; - } else if (!region.isMultiplayer()) { + } else if (!region.isNormalMapData()) { if (WorldMap.settings.debug) { - WorldMap.LOGGER.info("Save not required for singleplayer: " + region + " " + region.getWorldId() + " " + region.getDimId()); + WorldMap.LOGGER.info("Save not required for world save map: " + region + " " + region.getWorldId() + " " + region.getDimId()); } return region.countChunks() > 0; @@ -584,12 +584,12 @@ public void detectRegionsInDimension(int attempts, final RegistryKey<World> dimI if (worldId != null && !this.mapProcessor.isCurrentMapLocked()) { final String dimIdStr = this.mapProcessor.getDimensionName(dimId); String mwId = this.mapProcessor.getCurrentMWId(); - boolean multiplayer = this.mapProcessor.isWorldMultiplayer(this.mapProcessor.isWorldRealms(worldId), worldId); + boolean usingNormalMapData = !mapDimension.isUsingWorldSave(); Path mapFolder = this.getMWSubFolder(worldId, dimIdStr, mwId); boolean mapFolderExists = mapFolder.toFile().exists(); String multiplayerMapRegex = "^(-?\\d+)_(-?\\d+)\\.(zip|xaero)$"; MapLayer mainLayer = mapDimension.getLayeredMapRegions().getLayer(Integer.MAX_VALUE); - if (multiplayer) { + if (usingNormalMapData) { if (mapFolderExists) { this.detectRegionsFromFiles(mapDimension, worldId, dimIdStr, mwId, mapFolder, multiplayerMapRegex, 1, 2, 0, 20, mainLayer::addRegionDetection); } @@ -636,7 +636,7 @@ public void detectRegionsInDimension(int attempts, final RegistryKey<World> dimI try { int layerInt = Integer.parseInt(folderName); MapLayer layer = mapDimension.getLayeredMapRegions().getLayer(layerInt); - if (multiplayer) { + if (usingNormalMapData) { this.detectRegionsFromFiles( mapDimension, worldId, diff --git a/src/main/java/xaeroplus/settings/XaeroPlusSettingRegistry.java b/src/main/java/xaeroplus/settings/XaeroPlusSettingRegistry.java index 4af3ec87..61c9e5d5 100644 --- a/src/main/java/xaeroplus/settings/XaeroPlusSettingRegistry.java +++ b/src/main/java/xaeroplus/settings/XaeroPlusSettingRegistry.java @@ -63,12 +63,6 @@ public final class XaeroPlusSettingRegistry { "setting.world_map.disable_receiving_waypoints.tooltip", false, SettingLocation.WORLD_MAP_MAIN); - public static final XaeroPlusBooleanSetting waypointReceiveNoChatReportsFix = XaeroPlusBooleanSetting.create( - "Waypoint Receive No Chat Reports Fix", - "setting.world_map.waypoint_receive_no_chat_reports_fix", - "setting.world_map.waypoint_receive_no_chat_reports_fix.tooltip", - true, - SettingLocation.WORLD_MAP_MAIN); public static final XaeroPlusBooleanSetting waystonesWaypointSyncSetting = XaeroPlusBooleanSetting.create( "Waystones Sync", "setting.world_map.waystones_sync", diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 1b44bb85..8acd9cd4 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -27,6 +27,6 @@ "minecraft": "1.20.2", "java": ">=17", "fabric-api": "*", - "xaeroworldmap": "1.34.1" + "xaeroworldmap": "1.35.0" } }