Skip to content

Commit

Permalink
fix: lower version unable to create chunk cache
Browse files Browse the repository at this point in the history
  • Loading branch information
StarWishsama committed Aug 14, 2024
1 parent 443ba1c commit f53c2f6
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.xzavier0722.mc.plugin.slimefun4.storage.util;

import city.norain.slimefun4.SlimefunExtended;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.Location;
Expand Down Expand Up @@ -39,7 +40,11 @@ public static boolean isSameLoc(Location l1, Location l2) {

public static Chunk toChunk(World w, String cKey) {
var loc = cKey.split(";")[1].split(":");
return w.getChunkAt(Integer.parseInt(loc[0]), Integer.parseInt(loc[1]), false);
if (SlimefunExtended.getMinecraftVersion().isAtLeast(1, 19, 4)) {
return w.getChunkAt(Integer.parseInt(loc[0]), Integer.parseInt(loc[1]), false);
} else {
return w.getChunkAt(Integer.parseInt(loc[0]), Integer.parseInt(loc[1]));
}
}

public static boolean isSameWorld(World w1, World w2) {
Expand Down

0 comments on commit f53c2f6

Please sign in to comment.