Skip to content

Commit

Permalink
fix: 🐛 Fixed backpack data to properly save after backpack removal, a…
Browse files Browse the repository at this point in the history
…lso made it so that data of backpack worn by mobs is removed a bit more aggressively - in rare circumstances that would make jukebox upgrade disappear from these bags if the mob has just unloaded, but should fix the issue of backpack data continuously getting bigger the older the world gets
  • Loading branch information
P3pp3rF1y committed Dec 28, 2024
1 parent c74319f commit 5ab5e53
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ loader_version_range=[4,)
mod_id=sophisticatedbackpacks
mod_name=Sophisticated Backpacks
mod_license=GNU General Public License v3.0
mod_version=3.20.29
mod_version=3.20.30
mod_group_id=sophisticatedbackpacks
mod_authors=P3pp3rF1y, Ridanisaurus
mod_description=Fancy and functional backpacks.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ public void putAccessLog(AccessLogRecord alr) {

public void removeBackpackContents(UUID backpackUuid) {
backpackContents.remove(backpackUuid);
setDirty();
}

public void setBackpackContents(UUID backpackUuid, CompoundTag contents) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public static void removeBeneficialEffects(Creeper creeper) {
}

public static void removeBackpackUuid(Monster entity, Level level) {
if (level.isClientSide() || (entity.getRemovalReason() != Entity.RemovalReason.KILLED && entity.getRemovalReason() != Entity.RemovalReason.DISCARDED) || !entity.getTags().contains(SPAWNED_WITH_BACKPACK)) {
if (level.isClientSide() || !entity.getTags().contains(SPAWNED_WITH_BACKPACK)) {
return;
}

Expand Down

0 comments on commit 5ab5e53

Please sign in to comment.