Skip to content

Commit efb52dc

Browse files
committed
Reset inventories on world switch
1 parent f104a3d commit efb52dc

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

core/src/main/java/org/geysermc/geyser/entity/type/AreaEffectCloudEntity.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ protected void initializeMetadata() {
5656
dirtyMetadata.put(EntityDataTypes.AREA_EFFECT_CLOUD_RADIUS, 3.0f);
5757
dirtyMetadata.put(EntityDataTypes.AREA_EFFECT_CLOUD_CHANGE_ON_PICKUP, Float.MIN_VALUE);
5858

59+
//noinspection deprecation - still needed for these to show up
60+
dirtyMetadata.put(EntityDataTypes.AREA_EFFECT_CLOUD_CHANGE_RATE, Float.MIN_VALUE);
5961
setFlag(EntityFlag.FIRE_IMMUNE, true);
6062
}
6163

core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaLoginTranslator.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ public void translate(GeyserSession session, ClientboundLoginPacket packet) {
7878
// Remove extra hearts, hunger, etc.
7979
entity.resetAttributes();
8080
entity.resetMetadata();
81+
82+
// Reset inventories; just in case. Might resolve some issues where inventories get stuck?
83+
session.setInventoryHolder(null);
84+
session.setPendingOrCurrentBedrockInventoryId(-1);
85+
session.setClosingInventory(false);
8186
}
8287

8388
session.setDimensionType(newDimension);

0 commit comments

Comments
 (0)