diff --git a/gradle.properties b/gradle.properties index 328ca6b5..80144b95 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ org.gradle.jvmargs=-Xmx2048m minecraft_version=1.20.1 forge_version=47.1.5 -mod_version=2.0.39 +mod_version=2.0.40 jei_mc_version=1.20.1-forge jei_version=15.1.0.19 curios_version=5.2.0-beta.3+1.20.1 diff --git a/src/main/java/reliquary/items/GlacialStaffItem.java b/src/main/java/reliquary/items/GlacialStaffItem.java index 272864eb..1dba9853 100644 --- a/src/main/java/reliquary/items/GlacialStaffItem.java +++ b/src/main/java/reliquary/items/GlacialStaffItem.java @@ -101,6 +101,10 @@ private void meltBlocks(ItemStack staff, Level world, Player player) { if (!world.isClientSide) { BlockPos playerPos = player.blockPosition(); for (BlockPos pos : getBlockLocations(staff)) { + if (!world.isLoaded(pos)) { + continue; + } + int xOff = Math.abs(playerPos.getX() - pos.getX()); int yOff = Math.abs(playerPos.getY() - pos.getY()); int zOff = Math.abs(playerPos.getZ() - pos.getZ()); diff --git a/src/main/java/reliquary/items/MobCharmItem.java b/src/main/java/reliquary/items/MobCharmItem.java index 487457fc..570799e0 100644 --- a/src/main/java/reliquary/items/MobCharmItem.java +++ b/src/main/java/reliquary/items/MobCharmItem.java @@ -224,8 +224,8 @@ public void setCharmInventoryHandler(CharmInventoryHandler charmInventoryHandler } public static class CharmInventoryHandler { - private static long lastCharmCacheTime = -1; - private static final Map> charmsInInventoryCache = new HashMap<>(); + private long lastCharmCacheTime = -1; + private final Map> charmsInInventoryCache = new HashMap<>(); protected Set getCharmRegistryNames(Player player) { Set ret = new HashSet<>(); @@ -249,9 +249,8 @@ public boolean playerHasMobCharm(Player player, MobCharmDefinition charmDefiniti if (lastCharmCacheTime != player.level().getGameTime()) { lastCharmCacheTime = player.level().getGameTime(); charmsInInventoryCache.clear(); - charmsInInventoryCache.put(player.getUUID(), getCharmRegistryNames(player)); } - return charmsInInventoryCache.get(player.getUUID()).contains(registryName); + return charmsInInventoryCache.computeIfAbsent(player.getUUID(), u -> getCharmRegistryNames(player)).contains(registryName); }