From e6867b527d0832f9eb00c8ce1ebee5af5061d9e8 Mon Sep 17 00:00:00 2001 From: DoctorDark Date: Wed, 16 Mar 2016 02:21:39 -0500 Subject: [PATCH] Configurable end credits diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java index 28b852b46..36e49616c 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -146,4 +146,10 @@ public class PaperWorldConfig { log("Warning: This feature may help reduce TPS loss from light, but comes at the cost of buggy light data"); log("We are working to improve this feature."); } + + public boolean disableEndCredits; + private void disableEndCredits() { + disableEndCredits = getBoolean("game-mechanics.disable-end-credits", false); + log("End credits disabled: " + disableEndCredits); + } } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java index 0902c69f3..c4a55c6a1 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -58,7 +58,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { private long cu = SystemUtils.getMonotonicMillis(); private Entity spectatedEntity; public boolean worldChangeInvuln; - private boolean cx; + private boolean cx; private void setHasSeenCredits(boolean has) { this.cx = has; } // Paper - OBFHELPER private final RecipeBookServer recipeBook; private Vec3D cz; private int cA; @@ -651,6 +651,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.world.kill(this); if (!this.viewingCredits) { this.viewingCredits = true; + if (world.paperConfig.disableEndCredits) this.setHasSeenCredits(true); // Paper - Toggle to always disable end credits this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(4, this.cx ? 0.0F : 1.0F)); this.cx = true; } -- 2.21.0