Skip to content

Commit

Permalink
GeyserSession: always send naturalRegeneration=false gamerule (#1097)
Browse files Browse the repository at this point in the history
This essentially gives the server full control over the health visual.
  • Loading branch information
Camotoy authored Aug 8, 2020
1 parent 7df4761 commit 0fde30f
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,12 @@ public void connect(RemoteServer remoteServer) {
attributes.add(new AttributeData("minecraft:movement", 0.0f, 1024f, 0.1f, 0.1f));
attributesPacket.setAttributes(attributes);
upstream.sendPacket(attributesPacket);

// 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
GameRulesChangedPacket gamerulePacket = new GameRulesChangedPacket();
gamerulePacket.getGameRules().add(new GameRuleData<>("naturalregeneration", false));
upstream.sendPacket(gamerulePacket);
}

public void login() {
Expand Down

0 comments on commit 0fde30f

Please sign in to comment.