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

46 Zeilen
2.1 KiB
Diff

From 0d4bbe55a64c6a48f3a3416166665d87c4112ac0 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 9fd1bde0ef..29d5f30545 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -136,4 +136,10 @@ public class PaperWorldConfig {
//queueLightUpdates = getBoolean("queue-light-updates", false);
//log("Lighting Queue enabled: " + queueLightUpdates);
}
+
+ 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 09e2859c4a..95ab3d2cda 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -61,7 +61,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
private long cu = SystemUtils.b();
private Entity cv;
2017-05-14 20:05:01 +02:00
public boolean worldChangeInvuln;
- private boolean cx;
+ private boolean cx; private void setHasSeenCredits(boolean has) { this.cx = has; } // Paper - OBFHELPER
private final RecipeBookServer cy;
private Vec3D cz;
private int cA;
@@ -648,6 +648,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.world.kill(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
this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(4, this.cx ? 0.0F : 1.0F));
this.cx = true;
2017-05-14 20:05:01 +02:00
}
--
2.19.0