Paper/Spigot-Server-Patches/0030-Configurable-end-credits.patch

57 lines
2.3 KiB
Diff
Raw Normal View History

2017-04-01 06:24:42 +02:00
From 6e48bc7be8c37a8e58e0a2731860aa4c48ce9190 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 fd606ee14..c00fa83d5 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -149,4 +149,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
2017-04-01 06:24:42 +02:00
index 030a3e51c..79c9601fa 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
2017-04-01 06:24:42 +02:00
@@ -515,6 +515,15 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
return this.world.pvpMode;
}
2016-05-12 04:07:46 +02:00
+
+ // Paper start - Give "theEnd2" achievement if the player doesn't already have it
+ private void giveTheEnd2() {
+ if (!this.a(AchievementList.D)) {
+ this.b(AchievementList.D);
+ }
+ }
2016-05-12 04:07:46 +02:00
+ // Paper end
+
2016-05-12 04:07:46 +02:00
@Nullable
public Entity c(int i) {
2017-03-31 01:26:00 +02:00
if (this.isSleeping()) return this; // CraftBukkit - SPIGOT-3154
2017-04-01 06:24:42 +02:00
@@ -524,7 +533,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.world.kill(this);
if (!this.viewingCredits) {
this.viewingCredits = true;
- if (this.a(AchievementList.D)) {
+ // Paper start - Allow configurable end portal credits
+ if (world.paperConfig.disableEndCredits || this.a(AchievementList.D)) {
+ this.giveTheEnd2();
+ // Paper end
this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(4, 0.0F));
} else {
this.b((Statistic) AchievementList.D);
--
2017-03-31 01:26:00 +02:00
2.12.1.windows.1