backpack dirty mark test

This commit is contained in:
mlus 2025-11-26 15:42:29 +08:00
parent 3e70f4b801
commit 3291fc54b2
3 changed files with 8 additions and 6 deletions

View File

@ -136,8 +136,8 @@ dependencies {
// We add the full version to localRuntime, not runtimeOnly, so that we do not publish a dependency on it
// modLocalRuntime "mezz.jei:jei-${mc_version}-neoforge:${jei_version}"
compileOnly "curse.maven:curios-309927:5266541"
compileOnly "curse.maven:sophisticated-backpacks-422301:6303388"
compileOnly "curse.maven:sophisticated-core-618298:6317048"
compileOnly "curse.maven:sophisticated-backpacks-422301:7169843"
compileOnly "curse.maven:sophisticated-core-618298:7169400"
// Example mod dependency using a mod jar from ./libs with a flat dir repository
// This maps to ./libs/coolmod-${mc_version}-${coolmod_version}.jar

View File

@ -640,10 +640,6 @@ public class VanillaSync {
ender_chest.put(i, getNbtForStorage(player.getEnderChestInventory().getItem(i)));
}
if (ModList.get().isLoaded("sophisticatedbackpacks")) {
ModsSupport.storeSophisticatedBackpacks(player);
}
// Effects
Map<MobEffect, MobEffectInstance> effects = player.getActiveEffectsMap();
Map<Integer, String> effectMap = new HashMap<>();

View File

@ -111,6 +111,7 @@ public class ModsSupport {
CompoundTag backpackNbt = NbtUtils.snbtToStructure(nbtString);
// Update BackpackStorage with the retrieved NBT
net.p3pp3rf1y.sophisticatedbackpacks.backpack.BackpackStorage.get().setBackpackContents(contentsUuid, backpackNbt);
net.p3pp3rf1y.sophisticatedbackpacks.backpack.BackpackStorage.get().setDirty();
PlayerSync.LOGGER.info("Restored backpack data for UUID " + contentsUuid);
}
rsBackpack.close();
@ -161,6 +162,11 @@ public class ModsSupport {
StoreCurios(player, false);
}
}
if (ModList.get().isLoaded("sophisticatedbackpacks")) {
ModsSupport.storeSophisticatedBackpacks(player);
}
}
public void StoreCurios(net.minecraft.world.entity.player.Player player, boolean init) throws SQLException {