Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-27 08:30:12 +01:00
GeyserSession: Always set Keep Inventory to true (#1213)
* GeyserSession: Always set Keep Inventory to true This prevents the client from removing items on death in creative mode if Keep Inventory is true, but doesn't break existing behavior. Essentially, this assures full server-side behavior of the inventory during death. * Small comment update * OK, it was fine before the last commit, but make it better
Dieser Commit ist enthalten in:
Ursprung
d717085c6b
Commit
6f161a380f
@ -301,10 +301,13 @@ public class GeyserSession implements CommandSender {
|
|||||||
attributesPacket.setAttributes(attributes);
|
attributesPacket.setAttributes(attributes);
|
||||||
upstream.sendPacket(attributesPacket);
|
upstream.sendPacket(attributesPacket);
|
||||||
|
|
||||||
|
GameRulesChangedPacket gamerulePacket = new GameRulesChangedPacket();
|
||||||
// Only allow the server to send health information
|
// Only allow the server to send health information
|
||||||
// Setting this to false allows natural regeneration to work false but doesn't break it being true
|
// Setting this to false allows natural regeneration to work false but doesn't break it being true
|
||||||
GameRulesChangedPacket gamerulePacket = new GameRulesChangedPacket();
|
|
||||||
gamerulePacket.getGameRules().add(new GameRuleData<>("naturalregeneration", false));
|
gamerulePacket.getGameRules().add(new GameRuleData<>("naturalregeneration", false));
|
||||||
|
// Don't let the client modify the inventory on death
|
||||||
|
// Setting this to true allows keep inventory to work if enabled but doesn't break functionality being false
|
||||||
|
gamerulePacket.getGameRules().add(new GameRuleData<>("keepinventory", true));
|
||||||
upstream.sendPacket(gamerulePacket);
|
upstream.sendPacket(gamerulePacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren