1
0
mirror of https://github.com/GeyserMC/Geyser.git synced 2026-01-06 15:41:50 +00:00

Reset inventories on world switch

This commit is contained in:
onebeastchris
2025-06-04 14:37:33 +02:00
parent f104a3d4ca
commit efb52dc8f9
2 changed files with 7 additions and 0 deletions

View File

@@ -56,6 +56,8 @@ public class AreaEffectCloudEntity extends Entity {
dirtyMetadata.put(EntityDataTypes.AREA_EFFECT_CLOUD_RADIUS, 3.0f);
dirtyMetadata.put(EntityDataTypes.AREA_EFFECT_CLOUD_CHANGE_ON_PICKUP, Float.MIN_VALUE);
//noinspection deprecation - still needed for these to show up
dirtyMetadata.put(EntityDataTypes.AREA_EFFECT_CLOUD_CHANGE_RATE, Float.MIN_VALUE);
setFlag(EntityFlag.FIRE_IMMUNE, true);
}

View File

@@ -78,6 +78,11 @@ public class JavaLoginTranslator extends PacketTranslator<ClientboundLoginPacket
// Remove extra hearts, hunger, etc.
entity.resetAttributes();
entity.resetMetadata();
// Reset inventories; just in case. Might resolve some issues where inventories get stuck?
session.setInventoryHolder(null);
session.setPendingOrCurrentBedrockInventoryId(-1);
session.setClosingInventory(false);
}
session.setDimensionType(newDimension);