3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 20:40:07 +01:00
Paper/Spigot-Server-Patches/0030-Configurable-end-credits.patch

43 Zeilen
2.2 KiB
Diff

From 0000000000000000000000000000000000000000 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 f7a0a33e49cadf9b2bd43f118c106937760da762..50dec5cb5e924301842300e8fc80cb671b6b9173 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 {
2019-04-24 04:34:11 +02:00
}
}
}
+
+ 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 5bf3c279b86ed0fa416ee7dd9923172d6e6261a5..7012bd08fb4715eb66e6f47733b82f556c2b8a11 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 {
2020-06-25 11:27:25 +02:00
private long ch = SystemUtils.getMonotonicMillis();
private Entity spectatedEntity;
2017-05-14 20:05:01 +02:00
public boolean worldChangeInvuln;
2020-06-25 11:27:25 +02:00
- private boolean ck;
+ private boolean ck; private void setHasSeenCredits(boolean has) { this.ck = has; } // Paper - OBFHELPER
private final RecipeBookServer recipeBook = new RecipeBookServer();
private Vec3D cm;
private int cn;
@@ -749,6 +749,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
2020-06-25 11:27:25 +02:00
this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.e, this.ck ? 0.0F : 1.0F));
this.ck = true;
2017-05-14 20:05:01 +02:00
}