From 0000000000000000000000000000000000000000 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 08281351cc99e904a3a388607425dde4c83f13e2..58c8c6db87492cf70de3a26d23209a931c6726b2 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -190,4 +190,10 @@ public class PaperWorldConfig { } } } + + 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/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java index a3436596d05547a60c9906c92f709bb56a9175bd..88b6be62678fc09b5a39db28c6d71cc31b16dbcd 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -974,6 +974,7 @@ public class ServerPlayer extends Player { this.unRide(); this.getLevel().removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION); if (!this.wonGame) { + if (level.paperConfig.disableEndCredits) this.seenCredits = true; // Paper - Toggle to always disable end credits this.wonGame = true; this.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.WIN_GAME, this.seenCredits ? 0.0F : 1.0F)); this.seenCredits = true;