Skip to content

Commit

Permalink
WM1.35.0 MM23.8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
rfresh2 committed Oct 15, 2023
1 parent 52c8ffb commit 04b9af4
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 54 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/fabric-1.20.2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Binary file not shown.
2 changes: 1 addition & 1 deletion src/main/java/xaeroplus/XaeroPlus.java
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
17 changes: 0 additions & 17 deletions src/main/java/xaeroplus/mixin/client/MixinForgeEventHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
13 changes: 5 additions & 8 deletions src/main/java/xaeroplus/mixin/client/MixinGuiMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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);
}
Expand Down
13 changes: 6 additions & 7 deletions src/main/java/xaeroplus/mixin/client/MixinMapProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);
Expand All @@ -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(),
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/xaeroplus/mixin/client/MixinMapSaveLoad.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
"minecraft": "1.20.2",
"java": ">=17",
"fabric-api": "*",
"xaeroworldmap": "1.34.1"
"xaeroworldmap": "1.35.0"
}
}

0 comments on commit 04b9af4

Please sign in to comment.