PaperMC/Spigot-Server-Patches/0028-Configurable-end-credits.patch

46 lines
2 KiB
Diff
Raw Normal View History

2019-05-06 04:58:04 +02:00
From 96e182ab7959d4040f27304a92958605f8b05e5a 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
2019-04-24 04:34:11 +02:00
index a797a57671..c2b9690a0c 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
2019-04-24 04:34:11 +02:00
@@ -139,4 +139,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
2019-05-06 04:58:04 +02:00
index 67988b6c6a..550e6714bc 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
2019-05-06 04:58:04 +02:00
@@ -60,7 +60,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
2019-04-24 04:34:11 +02:00
private long cm = SystemUtils.getMonotonicMillis();
private Entity spectatedEntity;
2017-05-14 20:05:01 +02:00
public boolean worldChangeInvuln;
2019-04-24 04:34:11 +02:00
- private boolean cp;
+ private boolean cp; private void setHasSeenCredits(boolean has) { this.cp = has; } // Paper - OBFHELPER
private final RecipeBookServer recipeBook;
2019-04-24 04:34:11 +02:00
private Vec3D cr;
private int cs;
2019-05-06 04:58:04 +02:00
@@ -698,6 +698,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
2019-04-24 04:34:11 +02:00
this.getWorldServer().removePlayer(this);
if (!this.viewingCredits) {
this.viewingCredits = true;
2017-05-14 20:05:01 +02:00
+ if (world.paperConfig.disableEndCredits) this.setHasSeenCredits(true); // Paper - Toggle to always disable end credits
2019-04-24 04:34:11 +02:00
this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(4, this.cp ? 0.0F : 1.0F));
this.cp = true;
2017-05-14 20:05:01 +02:00
}
--
2.21.0