Paper/Spigot-Server-Patches/0030-Configurable-end-credits.patch
Zach Brown 4ed5ab7c79
Update upstream CB/S
--- work/CraftBukkit
Submodule work/CraftBukkit 297ff400..83af86db:
  > SPIGOT-5457: Downgrade 'Mismatch in destroy block pos' message to debug
  > SPIGOT-5481: PlayerBedLeaveEvent returns wrong bed location
  > SPIGOT-5482: Structure Block setUsageMode encounters NullpointerException
  > SPIGOT-5426: isSimilar for player heads fails
  > SPIGOT-5478: XP not dropping when a player dies

--- work/Spigot
Submodule work/Spigot 05bb8bcf..492a7792:
  > Rebuild patches
2019-12-26 22:18:27 -05:00

46 lines
2.0 KiB
Diff

From 4463ac4edd3976bed5a7596736d4f9ea558630fa Mon Sep 17 00:00:00 2001
From: DoctorDark <doctordark11@gmail.com>
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 f7a0a33e4..50dec5cb5 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -144,4 +144,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/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 5fe744ae8..aa509b636 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -60,7 +60,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
private long cj = SystemUtils.getMonotonicMillis();
private Entity spectatedEntity;
public boolean worldChangeInvuln;
- private boolean cm;
+ private boolean cm; private void setHasSeenCredits(boolean has) { this.cm = has; } // Paper - OBFHELPER
private final RecipeBookServer recipeBook;
private Vec3D co;
private int cp;
@@ -691,6 +691,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.getWorldServer().removePlayer(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.cm ? 0.0F : 1.0F));
this.cm = true;
}
--
2.24.1