Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.20.x dev #672

Merged
merged 2 commits into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/reliquary/items/GlacialStaffItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/reliquary/items/MobCharmItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ public void setCharmInventoryHandler(CharmInventoryHandler charmInventoryHandler
}

public static class CharmInventoryHandler {
private static long lastCharmCacheTime = -1;
private static final Map<UUID, Set<String>> charmsInInventoryCache = new HashMap<>();
private long lastCharmCacheTime = -1;
private final Map<UUID, Set<String>> charmsInInventoryCache = new HashMap<>();

protected Set<String> getCharmRegistryNames(Player player) {
Set<String> ret = new HashSet<>();
Expand All @@ -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);
}


Expand Down
Loading