mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 09:57:43 +01:00
Update to 1.16.1
This commit is contained in:
@@ -1,44 +1,45 @@
|
||||
From e2ba591861d7dd7532a3a9e8669ce81dc81ef8d9 Mon Sep 17 00:00:00 2001
|
||||
From d8265c1939a992ff975a7d259bf3e60abec03067 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 4 May 2019 01:02:11 -0500
|
||||
Subject: [PATCH] Rebrand
|
||||
|
||||
---
|
||||
pom.xml | 34 ++++--
|
||||
pom.xml | 31 +++--
|
||||
.../paper/console/PaperConsole.java | 2 +-
|
||||
.../net/minecraft/server/MinecraftServer.java | 2 +-
|
||||
.../net/pl3x/purpur/PurpurVersionFetcher.java | 115 ++++++++++++++++++
|
||||
.../org/bukkit/craftbukkit/CraftServer.java | 2 +-
|
||||
.../craftbukkit/util/CraftMagicNumbers.java | 2 +-
|
||||
.../bukkit/craftbukkit/util/Versioning.java | 2 +-
|
||||
7 files changed, 144 insertions(+), 15 deletions(-)
|
||||
7 files changed, 142 insertions(+), 14 deletions(-)
|
||||
create mode 100644 src/main/java/net/pl3x/purpur/PurpurVersionFetcher.java
|
||||
|
||||
diff --git a/pom.xml b/pom.xml
|
||||
index 66517f30f..097c736bc 100644
|
||||
index ef8ee637a..97c73571b 100644
|
||||
--- a/pom.xml
|
||||
+++ b/pom.xml
|
||||
@@ -1,11 +1,11 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
@@ -1,12 +1,11 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
- <artifactId>tuinity</artifactId>
|
||||
- <artifactId>paper</artifactId>
|
||||
+ <artifactId>purpur</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.15.2-R0.1-SNAPSHOT</version>
|
||||
- <name>Tuinity-Server</name>
|
||||
- <url>https://github.com/Spottedleaf/Tuinity</url>
|
||||
<version>1.16.1-R0.1-SNAPSHOT</version>
|
||||
- <name>Paper</name>
|
||||
- <url>https://papermc.io</url>
|
||||
-
|
||||
+ <name>Purpur</name>
|
||||
+ <url>http://pl3x.net</url>
|
||||
<properties>
|
||||
<!-- <skipTests>true</skipTests> Paper - This [was] not going to end well -->
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
@@ -17,16 +17,16 @@
|
||||
@@ -18,16 +17,16 @@
|
||||
</properties>
|
||||
|
||||
<parent>
|
||||
- <groupId>com.tuinity</groupId>
|
||||
- <artifactId>tuinity-parent</artifactId>
|
||||
- <groupId>com.destroystokyo.paper</groupId>
|
||||
- <artifactId>paper-parent</artifactId>
|
||||
+ <groupId>net.pl3x.purpur</groupId>
|
||||
+ <artifactId>purpur-parent</artifactId>
|
||||
<version>dev-SNAPSHOT</version>
|
||||
@@ -47,14 +48,14 @@ index 66517f30f..097c736bc 100644
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
- <groupId>com.tuinity</groupId>
|
||||
- <artifactId>tuinity-api</artifactId>
|
||||
- <groupId>com.destroystokyo.paper</groupId>
|
||||
- <artifactId>paper-api</artifactId>
|
||||
+ <groupId>net.pl3x.purpur</groupId>
|
||||
+ <artifactId>purpur-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
@@ -42,6 +42,20 @@
|
||||
@@ -43,6 +42,20 @@
|
||||
<version>${minecraft.version}-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
@@ -75,25 +76,15 @@ index 66517f30f..097c736bc 100644
|
||||
<dependency>
|
||||
<groupId>net.minecrell</groupId>
|
||||
<artifactId>terminalconsoleappender</artifactId>
|
||||
@@ -163,15 +177,15 @@
|
||||
@@ -164,7 +177,7 @@
|
||||
|
||||
<!-- This builds a completely 'ready to start' jar with all dependencies inside -->
|
||||
<build>
|
||||
- <finalName>tuinity-${minecraft.version}</finalName>
|
||||
- <defaultGoal>install</defaultGoal> <!-- Paper -->
|
||||
- <finalName>paper-${minecraft.version}</finalName>
|
||||
+ <finalName>purpur-${minecraft.version}</finalName>
|
||||
+ <defaultGoal>clean install</defaultGoal> <!-- Paper -->
|
||||
<defaultGoal>clean install</defaultGoal> <!-- Paper -->
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>com.lukegb.mojo</groupId>
|
||||
<artifactId>gitdescribe-maven-plugin</artifactId>
|
||||
<version>1.3</version>
|
||||
<configuration>
|
||||
- <outputPrefix>git-Tuinity-</outputPrefix> <!-- Tuinity -->
|
||||
+ <outputPrefix>git-Purpur-</outputPrefix>
|
||||
<scmDirectory>..</scmDirectory>
|
||||
</configuration>
|
||||
<executions>
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
|
||||
index 74ed02fa9..c1280478e 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
|
||||
@@ -108,15 +99,15 @@ index 74ed02fa9..c1280478e 100644
|
||||
.completer(new ConsoleCommandCompleter(this.server))
|
||||
);
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 3c9392077..28d92cbce 100644
|
||||
index 5c862de2f..0d0998b06 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1630,7 +1630,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -1446,7 +1446,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
}
|
||||
|
||||
public String getServerModName() {
|
||||
- return "Tuinity"; // Tuinity //Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
|
||||
+ return "Purpur"; // Purpur // Tuinity // Paper // Spigot // CraftBukkit
|
||||
- return "Paper"; //Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
|
||||
+ return "Purpur"; // Purpur // Paper // Spigot // CraftBukkit
|
||||
}
|
||||
|
||||
public CrashReport b(CrashReport crashreport) {
|
||||
@@ -242,23 +233,23 @@ index 000000000..d8b408f06
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 760752eae..2a6fd01d6 100644
|
||||
index 25e012678..1026fd81b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -205,7 +205,7 @@ import javax.annotation.Nullable; // Paper
|
||||
@@ -229,7 +229,7 @@ import javax.annotation.Nullable; // Paper
|
||||
import javax.annotation.Nonnull; // Paper
|
||||
|
||||
public final class CraftServer implements Server {
|
||||
- private final String serverName = "Tuinity"; // Paper // Tuinity
|
||||
+ private final String serverName = "Purpur"; // Paper // Tuinity // Purpur
|
||||
- private final String serverName = "Paper"; // Paper
|
||||
+ private final String serverName = "Purpur"; // Paper // Purpur
|
||||
private final String serverVersion;
|
||||
private final String bukkitVersion = Versioning.getBukkitVersion();
|
||||
private final Logger logger = Logger.getLogger("Minecraft");
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 004b6ce13..e1cfde4ff 100644
|
||||
index 257f46003..63db398ec 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -312,7 +312,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -317,7 +317,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
|
||||
@Override
|
||||
public com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() {
|
||||
@@ -268,14 +259,14 @@ index 004b6ce13..e1cfde4ff 100644
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||
index 001b1e519..e9aee2d8a 100644
|
||||
index 674096cab..e9aee2d8a 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||
@@ -11,7 +11,7 @@ public final class Versioning {
|
||||
public static String getBukkitVersion() {
|
||||
String result = "Unknown-Version";
|
||||
|
||||
- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/com.tuinity/tuinity-api/pom.properties"); // Tuinity
|
||||
- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/com.destroystokyo.paper/paper-api/pom.properties");
|
||||
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/net.pl3x.purpur/purpur-api/pom.properties"); // Purpur
|
||||
Properties properties = new Properties();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
From ac0db702eab4e6197bb37c8e84a81b410eae71ba Mon Sep 17 00:00:00 2001
|
||||
From 99870e5b09eef243de5335b21a4efbeb4b427322 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 9 May 2019 18:09:43 -0500
|
||||
Subject: [PATCH] Purpur config files
|
||||
@@ -42,16 +42,16 @@ index 24641501a..b767dd1d0 100644
|
||||
metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> {
|
||||
Map<String, Map<String, Integer>> map = new HashMap<>();
|
||||
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
index 1f1243ae8..3190c709a 100644
|
||||
index 8b2755a3b..df75a9e8a 100644
|
||||
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
@@ -192,6 +192,15 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
@@ -168,6 +168,15 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
return false;
|
||||
}
|
||||
com.destroystokyo.paper.PaperConfig.registerCommands();
|
||||
+ // Purpur start
|
||||
+ try {
|
||||
+ net.pl3x.purpur.PurpurConfig.init((File) options.valueOf("purpur-settings"));
|
||||
+ net.pl3x.purpur.PurpurConfig.init((java.io.File) options.valueOf("purpur-settings"));
|
||||
+ } catch (Exception e) {
|
||||
+ DedicatedServer.LOGGER.error("Unable to load server configuration", e);
|
||||
+ return false;
|
||||
@@ -60,12 +60,12 @@ index 1f1243ae8..3190c709a 100644
|
||||
+ // Purpur end
|
||||
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now
|
||||
// Paper end
|
||||
com.tuinity.tuinity.config.TuinityConfig.init((File) options.valueOf("tuinity-settings")); // Tuinity - Server Config
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 6ae9ec627..bdb12d16f 100644
|
||||
index b598c4869..c59282ef3 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -85,6 +85,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
@@ -91,6 +91,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
public boolean populating;
|
||||
public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot
|
||||
|
||||
@@ -73,14 +73,14 @@ index 6ae9ec627..bdb12d16f 100644
|
||||
public final com.destroystokyo.paper.PaperWorldConfig paperConfig; // Paper
|
||||
public final ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
|
||||
|
||||
@@ -138,6 +139,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
protected World(WorldData worlddata, DimensionManager dimensionmanager, java.util.concurrent.Executor executor, BiFunction<World, WorldProvider, IChunkProvider> bifunction, GameProfilerFiller gameprofilerfiller, boolean flag, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env) { // Paper - executor
|
||||
this.spigotConfig = new org.spigotmc.SpigotWorldConfig( worlddata.getName() ); // Spigot
|
||||
this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(worlddata.getName(), this.spigotConfig); // Paper
|
||||
+ this.purpurConfig = new net.pl3x.purpur.PurpurWorldConfig(worlddata.getName(), this.paperConfig, this.spigotConfig); // Purpur
|
||||
@@ -120,6 +121,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
protected World(WorldDataMutable worlddatamutable, ResourceKey<World> resourcekey, ResourceKey<DimensionManager> resourcekey1, DimensionManager dimensionmanager, Supplier<GameProfilerFiller> supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env, java.util.concurrent.Executor executor) {
|
||||
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((WorldDataServer) worlddatamutable).getName()); // Spigot
|
||||
this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig((((WorldDataServer)worlddatamutable).getName()), this.spigotConfig); // Paper
|
||||
+ this.purpurConfig = new net.pl3x.purpur.PurpurWorldConfig((((WorldDataServer)worlddatamutable).getName()), this.paperConfig, this.spigotConfig); // Purpur
|
||||
this.chunkPacketBlockController = this.paperConfig.antiXray ? new ChunkPacketBlockControllerAntiXray(this.paperConfig, executor) : ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray
|
||||
this.tuinityConfig = new com.tuinity.tuinity.config.TuinityConfig.WorldConfig(worlddata.getName()); // Tuinity - Server Config
|
||||
this.generator = gen;
|
||||
this.world = new CraftWorld((WorldServer) this, gen, env);
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
new file mode 100644
|
||||
index 000000000..333c880bf
|
||||
@@ -364,26 +364,26 @@ index 000000000..7d983d9a5
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 2a6fd01d6..e3a012800 100644
|
||||
index 1026fd81b..6c602ef79 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -816,6 +816,7 @@ public final class CraftServer implements Server {
|
||||
@@ -846,6 +846,7 @@ public final class CraftServer implements Server {
|
||||
|
||||
org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot
|
||||
com.destroystokyo.paper.PaperConfig.init((File) console.options.valueOf("paper-settings")); // Paper
|
||||
com.tuinity.tuinity.config.TuinityConfig.init((File) console.options.valueOf("tuinity-settings")); // Tuinity - Server Config
|
||||
+ net.pl3x.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur
|
||||
for (WorldServer world : console.getWorlds()) {
|
||||
world.worldData.setDifficulty(config.difficulty);
|
||||
world.worldDataServer.setDifficulty(config.difficulty);
|
||||
world.setSpawnFlags(config.spawnMonsters, config.spawnAnimals);
|
||||
@@ -845,6 +846,7 @@ public final class CraftServer implements Server {
|
||||
@@ -880,6 +881,7 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
world.spigotConfig.init(); // Spigot
|
||||
world.paperConfig.init(); // Paper
|
||||
world.tuinityConfig.init(); // Tuinity - Server Config
|
||||
+ world.purpurConfig.init(); // Purpur
|
||||
}
|
||||
|
||||
Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper
|
||||
@@ -863,6 +865,7 @@ public final class CraftServer implements Server {
|
||||
@@ -898,6 +900,7 @@ public final class CraftServer implements Server {
|
||||
reloadData();
|
||||
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
|
||||
com.destroystokyo.paper.PaperConfig.registerCommands(); // Paper
|
||||
@@ -391,9 +391,9 @@ index 2a6fd01d6..e3a012800 100644
|
||||
overrideAllCommandBlockCommands = commandsConfiguration.getStringList("command-block-overrides").contains("*");
|
||||
ignoreVanillaPermissions = commandsConfiguration.getBoolean("ignore-vanilla-permissions");
|
||||
|
||||
@@ -2147,6 +2150,18 @@ public final class CraftServer implements Server {
|
||||
@@ -2204,6 +2207,18 @@ public final class CraftServer implements Server {
|
||||
return com.destroystokyo.paper.PaperConfig.config;
|
||||
}
|
||||
// Tuinity end - add config to timings report
|
||||
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
@@ -411,12 +411,12 @@ index 2a6fd01d6..e3a012800 100644
|
||||
public void restart() {
|
||||
org.spigotmc.RestartCommand.restart();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index 90a2f8fea..8d436d275 100644
|
||||
index 83151f3d7..8879c6421 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -146,6 +146,14 @@ public class Main {
|
||||
@@ -139,6 +139,14 @@ public class Main {
|
||||
.describedAs("Yml file");
|
||||
/* Conctete End - Server Config */
|
||||
// Paper end
|
||||
|
||||
+ // Purpur Start
|
||||
+ acceptsAll(asList("purpur", "purpur-settings"), "File for purpur settings")
|
||||
@@ -1,36 +1,34 @@
|
||||
From 8f0c3e0dbe590e8d7fd6e810a1a69e7c3959ce6c Mon Sep 17 00:00:00 2001
|
||||
From 89bd8621126f5990f782a9709221523940f229df Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Fri, 5 Jun 2020 21:30:19 -0500
|
||||
Subject: [PATCH] Timings stuff
|
||||
|
||||
---
|
||||
.../java/co/aikar/timings/TimingsExport.java | 27 +++++++++++++++----
|
||||
1 file changed, 22 insertions(+), 5 deletions(-)
|
||||
.../java/co/aikar/timings/TimingsExport.java | 25 ++++++++++++++++---
|
||||
1 file changed, 21 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
index b09981e9b..3342201b3 100644
|
||||
index e33e889c2..29174d903 100644
|
||||
--- a/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
@@ -227,10 +227,14 @@ public class TimingsExport extends Thread {
|
||||
@@ -227,9 +227,13 @@ public class TimingsExport extends Thread {
|
||||
// Information on the users Config
|
||||
|
||||
parent.put("config", createObject(
|
||||
- pair("spigot", mapAsJSON(Bukkit.spigot().getSpigotConfig(), null)),
|
||||
- pair("bukkit", mapAsJSON(Bukkit.spigot().getBukkitConfig(), null)),
|
||||
- pair("paper", mapAsJSON(Bukkit.spigot().getPaperConfig(), null)), // Tuinity - add config to timings report
|
||||
- pair("tuinity", mapAsJSON(Bukkit.spigot().getTuinityConfig(), null)) // Tuinity - add config to timings report
|
||||
- pair("paper", mapAsJSON(Bukkit.spigot().getPaperConfig(), null))
|
||||
+ // Purpur start
|
||||
+ pair("server.properties", mapAsJSON(Bukkit.spigot().getServerProperties())),
|
||||
+ pair("bukkit", mapAsJSON(Bukkit.spigot().getBukkitConfig(), null)),
|
||||
+ pair("spigot", mapAsJSON(Bukkit.spigot().getSpigotConfig(), null)),
|
||||
+ pair("paper", mapAsJSON(Bukkit.spigot().getPaperConfig(), null)),
|
||||
+ pair("tuinity", mapAsJSON(Bukkit.spigot().getTuinityConfig(), null)),
|
||||
+ pair("purpur", mapAsJSON(Bukkit.spigot().getPurpurConfig(), null))
|
||||
+ // Purpur end
|
||||
));
|
||||
|
||||
new TimingsExport(listeners, parent, history).start();
|
||||
@@ -271,6 +275,19 @@ public class TimingsExport extends Thread {
|
||||
@@ -270,6 +274,19 @@ public class TimingsExport extends Thread {
|
||||
return timingsCost;
|
||||
}
|
||||
|
||||
@@ -50,12 +48,12 @@ index b09981e9b..3342201b3 100644
|
||||
private static JSONObject mapAsJSON(ConfigurationSection config, String parentKey) {
|
||||
|
||||
JSONObject object = new JSONObject();
|
||||
@@ -307,7 +324,7 @@ public class TimingsExport extends Thread {
|
||||
@@ -306,7 +323,7 @@ public class TimingsExport extends Thread {
|
||||
String response = null;
|
||||
String timingsURL = null;
|
||||
try {
|
||||
- HttpURLConnection con = (HttpURLConnection) new URL("http://timings.aikar.co/post").openConnection();
|
||||
+ HttpURLConnection con = (HttpURLConnection) new URL(Bukkit.spigot().getPurpurConfig().getString("settings.timings.url", "https://timings.pl3x.net") + "/post").openConnection(); // Purpur
|
||||
+ HttpURLConnection con = (HttpURLConnection) new URL(net.pl3x.purpur.PurpurConfig.timingsUrl + "/post").openConnection(); // Purpur
|
||||
con.setDoOutput(true);
|
||||
String hostName = "BrokenHost";
|
||||
try {
|
||||
@@ -1,19 +1,19 @@
|
||||
From a45c6a3ab3401040e7ab6a00de1f3c847e183dc6 Mon Sep 17 00:00:00 2001
|
||||
From 6946e2a10fd1cb63084783c07c277936405d9b65 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 23 Jun 2019 17:01:26 -0500
|
||||
Subject: [PATCH] Enderchest 6 rows (plus permissions)
|
||||
Date: Thu, 23 May 2019 21:50:37 -0500
|
||||
Subject: [PATCH] Barrels and enderchests 6 rows
|
||||
|
||||
---
|
||||
.../net/minecraft/server/BlockEnderChest.java | 21 +++++++++++++++++++
|
||||
.../net/minecraft/server/BlockEnderChest.java | 21 ++++++++++++++++
|
||||
.../minecraft/server/InventoryEnderChest.java | 2 +-
|
||||
.../java/net/pl3x/purpur/PurpurConfig.java | 8 +++++++
|
||||
.../craftbukkit/inventory/CraftContainer.java | 2 +-
|
||||
.../minecraft/server/TileEntityBarrel.java | 5 ++--
|
||||
.../java/net/pl3x/purpur/PurpurConfig.java | 25 +++++++++++++++++++
|
||||
.../craftbukkit/inventory/CraftContainer.java | 4 ++-
|
||||
.../craftbukkit/inventory/CraftInventory.java | 2 +-
|
||||
.../permissions/CraftDefaultPermissions.java | 8 +++++++
|
||||
6 files changed, 40 insertions(+), 3 deletions(-)
|
||||
6 files changed, 54 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockEnderChest.java b/src/main/java/net/minecraft/server/BlockEnderChest.java
|
||||
index 0a892a5f1..e7ef571dc 100644
|
||||
index af2819bb8..73ab299a4 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockEnderChest.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockEnderChest.java
|
||||
@@ -48,6 +48,27 @@ public class BlockEnderChest extends BlockChestAbstract<TileEntityEnderChest> im
|
||||
@@ -45,7 +45,7 @@ index 0a892a5f1..e7ef571dc 100644
|
||||
}, BlockEnderChest.e));
|
||||
entityhuman.a(StatisticList.OPEN_ENDERCHEST);
|
||||
diff --git a/src/main/java/net/minecraft/server/InventoryEnderChest.java b/src/main/java/net/minecraft/server/InventoryEnderChest.java
|
||||
index fd31b9a6d..903c02e9e 100644
|
||||
index bf8c5436b..d147377e5 100644
|
||||
--- a/src/main/java/net/minecraft/server/InventoryEnderChest.java
|
||||
+++ b/src/main/java/net/minecraft/server/InventoryEnderChest.java
|
||||
@@ -20,7 +20,7 @@ public class InventoryEnderChest extends InventorySubcontainer {
|
||||
@@ -57,48 +57,95 @@ index fd31b9a6d..903c02e9e 100644
|
||||
this.owner = owner;
|
||||
// CraftBukkit end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntityBarrel.java b/src/main/java/net/minecraft/server/TileEntityBarrel.java
|
||||
index 195abfdff..7e368a2ed 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntityBarrel.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntityBarrel.java
|
||||
@@ -54,7 +54,7 @@ public class TileEntityBarrel extends TileEntityLootable {
|
||||
|
||||
private TileEntityBarrel(TileEntityTypes<?> tileentitytypes) {
|
||||
super(tileentitytypes);
|
||||
- this.items = NonNullList.a(27, ItemStack.b);
|
||||
+ this.items = NonNullList.a(net.pl3x.purpur.PurpurConfig.barrelSixRows ? 54 : 27, ItemStack.b); // Purpur
|
||||
}
|
||||
|
||||
public TileEntityBarrel() {
|
||||
@@ -83,7 +83,7 @@ public class TileEntityBarrel extends TileEntityLootable {
|
||||
|
||||
@Override
|
||||
public int getSize() {
|
||||
- return 27;
|
||||
+ return net.pl3x.purpur.PurpurConfig.barrelSixRows ? 54 : 27; // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -103,6 +103,7 @@ public class TileEntityBarrel extends TileEntityLootable {
|
||||
|
||||
@Override
|
||||
protected Container createContainer(int i, PlayerInventory playerinventory) {
|
||||
+ if (net.pl3x.purpur.PurpurConfig.barrelSixRows) return new ContainerChest(Containers.GENERIC_9X6, i, playerinventory, this, 6); // Purpur
|
||||
return ContainerChest.a(i, playerinventory, this);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 581e8eebe..c3ecd6fc7 100644
|
||||
index 333c880bf..fc38163b1 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -157,14 +157,22 @@ public class PurpurConfig {
|
||||
@@ -7,6 +7,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.configuration.InvalidConfigurationException;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
+import org.bukkit.event.inventory.InventoryType;
|
||||
|
||||
public static boolean barrelSixRows = false;
|
||||
public static boolean slimeBlocksNotPushable = false;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -127,4 +128,28 @@ public class PurpurConfig {
|
||||
config.addDefault(path, def);
|
||||
return config.getString(path, config.getString(path));
|
||||
}
|
||||
+
|
||||
+ public static String timingsUrl = "https://timings.pl3x.net";
|
||||
+ private static void timingsSettings() {
|
||||
+ timingsUrl = getString("settings.timings.url", timingsUrl);
|
||||
+ }
|
||||
+
|
||||
+ public static boolean barrelSixRows = false;
|
||||
+ public static boolean enderChestSixRows = false;
|
||||
+ public static boolean enderChestPermissionRows = false;
|
||||
private static void blockSettings() {
|
||||
if (version < 3) {
|
||||
boolean oldValue = getBoolean("settings.barrel.packed-barrels", true);
|
||||
set("settings.blocks.barrel.six-rows", oldValue);
|
||||
set("settings.packed-barrels", null);
|
||||
+ private static void blockSettings() {
|
||||
+ if (version < 3) {
|
||||
+ boolean oldValue = getBoolean("settings.barrel.packed-barrels", true);
|
||||
+ set("settings.blocks.barrel.six-rows", oldValue);
|
||||
+ set("settings.packed-barrels", null);
|
||||
+ oldValue = getBoolean("settings.large-ender-chests", true);
|
||||
+ set("settings.blocks.ender_chest.six-rows", oldValue);
|
||||
+ set("settings.large-ender-chests", null);
|
||||
}
|
||||
barrelSixRows = getBoolean("settings.blocks.barrel.six-rows", barrelSixRows);
|
||||
InventoryType.BARREL.setDefaultSize(barrelSixRows ? 54 : 27);
|
||||
+ }
|
||||
+ barrelSixRows = getBoolean("settings.blocks.barrel.six-rows", barrelSixRows);
|
||||
+ InventoryType.BARREL.setDefaultSize(barrelSixRows ? 54 : 27);
|
||||
+ enderChestSixRows = getBoolean("settings.blocks.ender_chest.six-rows", enderChestSixRows);
|
||||
+ InventoryType.ENDER_CHEST.setDefaultSize(enderChestSixRows ? 54 : 27);
|
||||
+ enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
|
||||
slimeBlocksNotPushable = getBoolean("settings.blocks.slime.not-movable-by-piston", slimeBlocksNotPushable);
|
||||
}
|
||||
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
|
||||
index d295821c5..610cbbe85 100644
|
||||
index 8c714c743..cae362bae 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
|
||||
@@ -195,7 +195,7 @@ public class CraftContainer extends Container {
|
||||
@@ -198,8 +198,10 @@ public class CraftContainer extends Container {
|
||||
case PLAYER:
|
||||
case CHEST:
|
||||
case ENDER_CHEST:
|
||||
- delegate = new ContainerChest(Containers.GENERIC_9X3, windowId, bottom, top, top.getSize() / 9); // Purpur
|
||||
+ delegate = new ContainerChest(net.pl3x.purpur.PurpurConfig.enderChestSixRows ? Containers.GENERIC_9X6 : Containers.GENERIC_9X3, windowId, bottom, top, top.getSize() / 9); // Purpur
|
||||
break; // Purpur
|
||||
+ break; // Purpur
|
||||
case BARREL:
|
||||
delegate = new ContainerChest(net.pl3x.purpur.PurpurConfig.barrelSixRows ? Containers.GENERIC_9X6 : Containers.GENERIC_9X3, windowId, bottom, top, top.getSize() / 9); // Purpur
|
||||
- delegate = new ContainerChest(Containers.GENERIC_9X3, windowId, bottom, top, top.getSize() / 9);
|
||||
+ delegate = new ContainerChest(net.pl3x.purpur.PurpurConfig.barrelSixRows ? Containers.GENERIC_9X6 : Containers.GENERIC_9X3, windowId, bottom, top, top.getSize() / 9); // Purpur
|
||||
break;
|
||||
case DISPENSER:
|
||||
case DROPPER:
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
|
||||
index 57858327a..d57ad13f7 100644
|
||||
index 726631348..a45100034 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
|
||||
@@ -81,7 +81,7 @@ public class CraftInventory implements Inventory {
|
||||
@@ -110,25 +157,6 @@ index 57858327a..d57ad13f7 100644
|
||||
throw new IllegalArgumentException("Invalid inventory size; expected " + getSize() + " or less");
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/permissions/CraftDefaultPermissions.java b/src/main/java/org/bukkit/craftbukkit/util/permissions/CraftDefaultPermissions.java
|
||||
index a4a809f30..e7d19d67c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/permissions/CraftDefaultPermissions.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/permissions/CraftDefaultPermissions.java
|
||||
@@ -18,6 +18,14 @@ public final class CraftDefaultPermissions {
|
||||
DefaultPermissions.registerPermission(ROOT + ".debugstick.always", "Gives the user the ability to use the debug stick in all game modes", org.bukkit.permissions.PermissionDefault.FALSE, parent);
|
||||
DefaultPermissions.registerPermission(ROOT + ".commandblock", "Gives the user the ability to use command blocks.", org.bukkit.permissions.PermissionDefault.OP, parent); // Paper
|
||||
// Spigot end
|
||||
+ // Purpur start
|
||||
+ DefaultPermissions.registerPermission("purpur.enderchest.rows.six", "Gives the user six rows of enderchest space", org.bukkit.permissions.PermissionDefault.FALSE);
|
||||
+ DefaultPermissions.registerPermission("purpur.enderchest.rows.five", "Gives the user five rows of enderchest space", org.bukkit.permissions.PermissionDefault.FALSE);
|
||||
+ DefaultPermissions.registerPermission("purpur.enderchest.rows.four", "Gives the user four rows of enderchest space", org.bukkit.permissions.PermissionDefault.FALSE);
|
||||
+ DefaultPermissions.registerPermission("purpur.enderchest.rows.three", "Gives the user three rows of enderchest space", org.bukkit.permissions.PermissionDefault.FALSE);
|
||||
+ DefaultPermissions.registerPermission("purpur.enderchest.rows.two", "Gives the user two rows of enderchest space", org.bukkit.permissions.PermissionDefault.FALSE);
|
||||
+ DefaultPermissions.registerPermission("purpur.enderchest.rows.one", "Gives the user one row of enderchest space", org.bukkit.permissions.PermissionDefault.FALSE);
|
||||
+ // Purpur end
|
||||
parent.recalculatePermissibles();
|
||||
}
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 334b15abb698261d55af562dca76653a34cac4a9 Mon Sep 17 00:00:00 2001
|
||||
From f38bc41c719f4ec2f111350a6fb57cdf1cb1444a Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 31 May 2019 21:24:33 -0500
|
||||
Subject: [PATCH] Advancement API Additions
|
||||
Subject: [PATCH] Advancement API
|
||||
|
||||
---
|
||||
.../net/minecraft/server/Advancement.java | 2 +-
|
||||
@@ -14,10 +14,10 @@ Subject: [PATCH] Advancement API Additions
|
||||
create mode 100644 src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancementDisplay.java
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Advancement.java b/src/main/java/net/minecraft/server/Advancement.java
|
||||
index 4b85551fa..4cba4187a 100644
|
||||
index 315a03cf5..07d4c4cfd 100644
|
||||
--- a/src/main/java/net/minecraft/server/Advancement.java
|
||||
+++ b/src/main/java/net/minecraft/server/Advancement.java
|
||||
@@ -65,7 +65,7 @@ public class Advancement {
|
||||
@@ -64,7 +64,7 @@ public class Advancement {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -27,10 +27,10 @@ index 4b85551fa..4cba4187a 100644
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/AdvancementDisplay.java b/src/main/java/net/minecraft/server/AdvancementDisplay.java
|
||||
index e8172d56f..976c85ef1 100644
|
||||
index 12c63a53b..0d3900456 100644
|
||||
--- a/src/main/java/net/minecraft/server/AdvancementDisplay.java
|
||||
+++ b/src/main/java/net/minecraft/server/AdvancementDisplay.java
|
||||
@@ -16,10 +16,11 @@ public class AdvancementDisplay {
|
||||
@@ -15,10 +15,11 @@ public class AdvancementDisplay {
|
||||
private final MinecraftKey d;
|
||||
private final AdvancementFrameType e;
|
||||
private final boolean f;
|
||||
@@ -44,7 +44,7 @@ index e8172d56f..976c85ef1 100644
|
||||
|
||||
public AdvancementDisplay(ItemStack itemstack, IChatBaseComponent ichatbasecomponent, IChatBaseComponent ichatbasecomponent1, @Nullable MinecraftKey minecraftkey, AdvancementFrameType advancementframetype, boolean flag, boolean flag1, boolean flag2) {
|
||||
this.a = ichatbasecomponent;
|
||||
@@ -37,22 +38,29 @@ public class AdvancementDisplay {
|
||||
@@ -36,22 +37,29 @@ public class AdvancementDisplay {
|
||||
this.j = f1;
|
||||
}
|
||||
|
||||
@@ -107,10 +107,10 @@ index a9c49a434..551a84547 100644
|
||||
this.e = i;
|
||||
this.f = enumchatformat;
|
||||
diff --git a/src/main/java/net/minecraft/server/CriterionTrigger.java b/src/main/java/net/minecraft/server/CriterionTrigger.java
|
||||
index 4fe732447..6e5d81daf 100644
|
||||
index cfb420a9c..6fd3671c3 100644
|
||||
--- a/src/main/java/net/minecraft/server/CriterionTrigger.java
|
||||
+++ b/src/main/java/net/minecraft/server/CriterionTrigger.java
|
||||
@@ -27,6 +27,7 @@ public interface CriterionTrigger<T extends CriterionInstance> {
|
||||
@@ -26,6 +26,7 @@ public interface CriterionTrigger<T extends CriterionInstance> {
|
||||
this.c = s;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,135 +0,0 @@
|
||||
From b1cd21795f45b71ae265cebd95060a23cfcf9310 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 26 Mar 2020 13:17:09 -0500
|
||||
Subject: [PATCH] Add language asset purpur.lang
|
||||
|
||||
---
|
||||
.../net/minecraft/server/EntityPlayer.java | 1 +
|
||||
.../net/minecraft/server/LocaleLanguage.java | 48 +++++++++++++++++--
|
||||
.../pl3x/purpur/command/PurpurCommand.java | 3 ++
|
||||
src/main/resources/purpur.lang | 1 +
|
||||
4 files changed, 49 insertions(+), 4 deletions(-)
|
||||
create mode 100644 src/main/resources/purpur.lang
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
index 39072ebdc..fe1e9ea61 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
@@ -1582,6 +1582,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
}
|
||||
|
||||
public void a(IChatBaseComponent ichatbasecomponent, ChatMessageType chatmessagetype) {
|
||||
+ if (ichatbasecomponent == null) return; // Purpur
|
||||
this.playerConnection.a((Packet) (new PacketPlayOutChat(ichatbasecomponent, chatmessagetype)), (future) -> {
|
||||
if (!future.isSuccess() && (chatmessagetype == ChatMessageType.GAME_INFO || chatmessagetype == ChatMessageType.SYSTEM)) {
|
||||
boolean flag = true;
|
||||
diff --git a/src/main/java/net/minecraft/server/LocaleLanguage.java b/src/main/java/net/minecraft/server/LocaleLanguage.java
|
||||
index 601273933..75707adcd 100644
|
||||
--- a/src/main/java/net/minecraft/server/LocaleLanguage.java
|
||||
+++ b/src/main/java/net/minecraft/server/LocaleLanguage.java
|
||||
@@ -15,18 +15,41 @@ import java.util.Map.Entry;
|
||||
import java.util.regex.Pattern;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
+import org.bukkit.ChatColor;
|
||||
|
||||
public class LocaleLanguage {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
private static final Pattern b = Pattern.compile("%(\\d+\\$)?[\\d\\.]*[df]");
|
||||
private static final LocaleLanguage c = new LocaleLanguage();
|
||||
- private final Map<String, String> d = Maps.newHashMap();
|
||||
- private long e;
|
||||
+ private final Map<String, String> d = Maps.newHashMap(); public Map<String, String> getStorage() { return this.d; } // Purpur - OBFHELPER
|
||||
+ private long e; public long getLastUpdateTime() { return this.e; } public void setLastUpdateTime(int time) { this.e = time; } // Purpur - OBFHELPER
|
||||
|
||||
public LocaleLanguage() {
|
||||
+ // Purpur start
|
||||
+ reload(this);
|
||||
+ }
|
||||
+
|
||||
+ private void loadFromFile(String resource) {
|
||||
try {
|
||||
- InputStream inputstream = LocaleLanguage.class.getResourceAsStream("/assets/minecraft/lang/en_us.json");
|
||||
+ java.io.File file = new java.io.File(resource);
|
||||
+ if (!file.exists()) {
|
||||
+ java.nio.file.Files.copy(getClass().getResourceAsStream("/" + resource), file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING);
|
||||
+ }
|
||||
+ loadFromJar("/" + resource);
|
||||
+ loadFromStream(resource, new java.io.FileInputStream(file));
|
||||
+ } catch (IOException e) {
|
||||
+ LOGGER.error("Couldn't read string from " + resource, e);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private void loadFromJar(String resource) {
|
||||
+ loadFromStream(resource, getClass().getResourceAsStream(resource));
|
||||
+ }
|
||||
+
|
||||
+ private void loadFromStream(String resource, InputStream inputstream) {
|
||||
+ try {
|
||||
+ // Purpur end
|
||||
Throwable throwable = null;
|
||||
|
||||
try {
|
||||
@@ -60,7 +83,7 @@ public class LocaleLanguage {
|
||||
|
||||
}
|
||||
} catch (JsonParseException | IOException ioexception) {
|
||||
- LocaleLanguage.LOGGER.error("Couldn't read strings from /assets/minecraft/lang/en_us.json", ioexception);
|
||||
+ LocaleLanguage.LOGGER.error("Couldn't read strings from " + resource, ioexception); // Purpur
|
||||
}
|
||||
|
||||
}
|
||||
@@ -88,4 +111,21 @@ public class LocaleLanguage {
|
||||
public long b() {
|
||||
return this.e;
|
||||
}
|
||||
+
|
||||
+ // Purpur start
|
||||
+ public static void reload(LocaleLanguage instance) {
|
||||
+ instance.setLastUpdateTime(0);
|
||||
+ instance.getStorage().clear();
|
||||
+ instance.loadFromJar("/assets/minecraft/lang/en_us.json");
|
||||
+ instance.loadFromFile("purpur.lang");
|
||||
+ }
|
||||
+
|
||||
+ public static ChatMessage translate(String key, Object... args) {
|
||||
+ String str = getInstance().translateKey(key);
|
||||
+ if (str == null) return null;
|
||||
+ str = ChatColor.translateAlternateColorCodes('&', str);
|
||||
+ if (str.isEmpty()) return null;
|
||||
+ return new ChatMessage(str, args);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/command/PurpurCommand.java b/src/main/java/net/pl3x/purpur/command/PurpurCommand.java
|
||||
index 7d983d9a5..36260e0ec 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/command/PurpurCommand.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/command/PurpurCommand.java
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.pl3x.purpur.command;
|
||||
|
||||
+import net.minecraft.server.LocaleLanguage;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.WorldServer;
|
||||
import net.pl3x.purpur.PurpurConfig;
|
||||
@@ -45,6 +46,8 @@ public class PurpurCommand extends Command {
|
||||
Command.broadcastCommandMessage(sender, ChatColor.RED + "Please note that this command is not supported and may cause issues.");
|
||||
Command.broadcastCommandMessage(sender, ChatColor.RED + "If you encounter any issues please use the /stop command to restart your server.");
|
||||
|
||||
+ LocaleLanguage.reload(LocaleLanguage.getInstance());
|
||||
+
|
||||
MinecraftServer console = MinecraftServer.getServer();
|
||||
PurpurConfig.init((File) console.options.valueOf("purpur-settings"));
|
||||
for (WorldServer world : console.getWorlds()) {
|
||||
diff --git a/src/main/resources/purpur.lang b/src/main/resources/purpur.lang
|
||||
new file mode 100644
|
||||
index 000000000..0967ef424
|
||||
--- /dev/null
|
||||
+++ b/src/main/resources/purpur.lang
|
||||
@@ -0,0 +1 @@
|
||||
+{}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From eab02ae8ebe093cfce94311b02c3c76349add5bd Mon Sep 17 00:00:00 2001
|
||||
From ce23a90cbb5d648a846bdfc45696a55bab8a3ed9 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 18 Oct 2019 22:50:12 -0500
|
||||
Subject: [PATCH] Add more llama API
|
||||
Subject: [PATCH] Llama API
|
||||
|
||||
---
|
||||
.../net/minecraft/server/EntityLlama.java | 18 ++++++--
|
||||
@@ -10,20 +10,20 @@ Subject: [PATCH] Add more llama API
|
||||
3 files changed, 61 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java
|
||||
index c5f87cbdd..082aac258 100644
|
||||
index 4fe769c76..cf3192085 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLlama.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLlama.java
|
||||
@@ -12,7 +12,8 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
|
||||
@@ -13,7 +13,8 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
|
||||
@Nullable
|
||||
private EntityLlama bJ;
|
||||
private EntityLlama bI;
|
||||
@Nullable
|
||||
- private EntityLlama bK;
|
||||
+ private EntityLlama bK; public EntityLlama getCaravanTail() { return bK; } // Purpur - OBFHELPER
|
||||
- private EntityLlama bJ;
|
||||
+ private EntityLlama bJ; public EntityLlama getCaravanTail() { return bJ; } // Purpur - OBFHELPER
|
||||
+ public boolean shouldJoinCaravan = true; // Purpur
|
||||
|
||||
public EntityLlama(EntityTypes<? extends EntityLlama> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -79,7 +80,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
|
||||
@@ -41,7 +42,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
|
||||
if (!this.inventoryChest.getItem(1).isEmpty()) {
|
||||
nbttagcompound.set("DecorItem", this.inventoryChest.getItem(1).save(new NBTTagCompound()));
|
||||
}
|
||||
@@ -32,7 +32,7 @@ index c5f87cbdd..082aac258 100644
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -90,7 +91,11 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
|
||||
@@ -52,7 +53,11 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
|
||||
if (nbttagcompound.hasKeyOfType("DecorItem", 10)) {
|
||||
this.inventoryChest.setItem(1, ItemStack.a(nbttagcompound.getCompound("DecorItem")));
|
||||
}
|
||||
@@ -42,45 +42,45 @@ index c5f87cbdd..082aac258 100644
|
||||
+ nbttagcompound.setBoolean("Purpur.ShouldJoinCaravan", shouldJoinCaravan);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
this.eI();
|
||||
this.ff();
|
||||
}
|
||||
|
||||
@@ -413,19 +418,24 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
|
||||
@@ -387,19 +392,24 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
|
||||
}
|
||||
}
|
||||
|
||||
+ public void leaveCaravan() { fb(); } // Purpur - OBFHELPER
|
||||
public void fb() {
|
||||
if (this.bJ != null) {
|
||||
+ public void leaveCaravan() { fB(); } // Purpur - OBFHELPER
|
||||
public void fB() {
|
||||
if (this.bI != null) {
|
||||
+ new net.pl3x.purpur.event.entity.LlamaLeaveCaravanEvent((org.bukkit.entity.Llama) getBukkitEntity()).callEvent(); // Purpur
|
||||
this.bJ.bK = null;
|
||||
this.bI.bJ = null;
|
||||
}
|
||||
|
||||
this.bJ = null;
|
||||
this.bI = null;
|
||||
}
|
||||
|
||||
+ public void joinCaravan(EntityLlama entitiyllama) { a(entitiyllama); } // Purpur - OBFHELPER
|
||||
public void a(EntityLlama entityllama) {
|
||||
+ if (!shouldJoinCaravan || !new net.pl3x.purpur.event.entity.LlamaJoinCaravanEvent((org.bukkit.entity.Llama) getBukkitEntity(), (org.bukkit.entity.Llama) entityllama.getBukkitEntity()).callEvent()) return; // Purpur
|
||||
this.bJ = entityllama;
|
||||
this.bJ.bK = this;
|
||||
this.bI = entityllama;
|
||||
this.bI.bJ = this;
|
||||
}
|
||||
|
||||
+ public boolean hasCaravanTail() { return fc(); } // Purpur - OBFHELPER
|
||||
public boolean fc() {
|
||||
return this.bK != null;
|
||||
+ public boolean hasCaravanTail() { return fC(); } // Purpur - OBFHELPER
|
||||
public boolean fC() {
|
||||
return this.bJ != null;
|
||||
}
|
||||
@@ -436,7 +446,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
|
||||
@@ -410,7 +420,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
|
||||
}
|
||||
|
||||
@Nullable
|
||||
- public EntityLlama fe() {
|
||||
+ public EntityLlama fe() { return getCaravanHead(); } public EntityLlama getCaravanHead() { // Purpur - OBFHELPER
|
||||
return this.bJ;
|
||||
- public EntityLlama fE() {
|
||||
+ public EntityLlama fE() { return getCaravanHead(); } public EntityLlama getCaravanHead() { // Purpur - OBFHELPER
|
||||
return this.bI;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalLlamaFollow.java b/src/main/java/net/minecraft/server/PathfinderGoalLlamaFollow.java
|
||||
index e181d8350..8376f1dc4 100644
|
||||
index 938c271fa..e21901a72 100644
|
||||
--- a/src/main/java/net/minecraft/server/PathfinderGoalLlamaFollow.java
|
||||
+++ b/src/main/java/net/minecraft/server/PathfinderGoalLlamaFollow.java
|
||||
@@ -6,7 +6,7 @@ import java.util.List;
|
||||
@@ -97,7 +97,7 @@ index e181d8350..8376f1dc4 100644
|
||||
@Override
|
||||
public boolean a() {
|
||||
+ if (!getLlama().shouldJoinCaravan) return false; // Purpur
|
||||
if (!this.a.isLeashed() && !this.a.fd()) {
|
||||
if (!this.a.isLeashed() && !this.a.fD()) {
|
||||
List<Entity> list = this.a.world.getEntities(this.a, this.a.getBoundingBox().grow(9.0D, 4.0D, 9.0D), (entity) -> {
|
||||
EntityTypes<?> entitytypes = entity.getEntityType();
|
||||
@@ -77,6 +78,7 @@ public class PathfinderGoalLlamaFollow extends PathfinderGoal {
|
||||
@@ -105,8 +105,8 @@ index e181d8350..8376f1dc4 100644
|
||||
@Override
|
||||
public boolean b() {
|
||||
+ if (!getLlama().shouldJoinCaravan) return false; // Purpur
|
||||
if (this.a.fd() && this.a.fe().isAlive() && this.a(this.a, 0)) {
|
||||
double d0 = this.a.h((Entity) this.a.fe());
|
||||
if (this.a.fD() && this.a.fE().isAlive() && this.a(this.a, 0)) {
|
||||
double d0 = this.a.h((Entity) this.a.fE());
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java
|
||||
index 3f94c5a92..a02763480 100644
|
||||
74
patches/server/0007-Evoker-API.patch
Normal file
74
patches/server/0007-Evoker-API.patch
Normal file
@@ -0,0 +1,74 @@
|
||||
From b509638d3539212f7aa2d9dd86aebaac925ac2ab Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 19 Oct 2019 00:29:02 -0500
|
||||
Subject: [PATCH] Evoker API
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/EntityEvoker.java | 5 +++--
|
||||
.../bukkit/craftbukkit/entity/CraftEvoker.java | 17 +++++++++++++++++
|
||||
2 files changed, 20 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityEvoker.java b/src/main/java/net/minecraft/server/EntityEvoker.java
|
||||
index dd55e5e5b..c37c2930e 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityEvoker.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityEvoker.java
|
||||
@@ -24,7 +24,7 @@ public class EntityEvoker extends EntityIllagerWizard {
|
||||
this.goalSelector.a(8, new PathfinderGoalRandomStroll(this, 0.6D));
|
||||
this.goalSelector.a(9, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 3.0F, 1.0F));
|
||||
this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 8.0F));
|
||||
- this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityRaider.class})).a());
|
||||
+ this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityRaider.class})).a(new Class[0])); // Purpur - decompile error
|
||||
this.targetSelector.a(2, (new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)).a(300));
|
||||
this.targetSelector.a(3, (new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, false)).a(300));
|
||||
this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, false));
|
||||
@@ -79,12 +79,13 @@ public class EntityEvoker extends EntityIllagerWizard {
|
||||
return SoundEffects.ENTITY_EVOKER_HURT;
|
||||
}
|
||||
|
||||
+ public void setWololoTarget(@Nullable EntitySheep sheep) { a(sheep); } // Purpur - OBFHELPER
|
||||
private void a(@Nullable EntitySheep entitysheep) {
|
||||
this.bv = entitysheep;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
- private EntitySheep fh() {
|
||||
+ private EntitySheep fh() { return getWololoTarget(); } public EntitySheep getWololoTarget() { // Purpur - OBFHELPER
|
||||
return this.bv;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java
|
||||
index 0636d2647..a7a548421 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java
|
||||
@@ -5,6 +5,10 @@ import net.minecraft.server.EntityIllagerWizard;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Evoker;
|
||||
+// Purpur start
|
||||
+import net.minecraft.server.EntitySheep;
|
||||
+import javax.annotation.Nullable;
|
||||
+// Purpur end
|
||||
|
||||
public class CraftEvoker extends CraftSpellcaster implements Evoker {
|
||||
|
||||
@@ -36,4 +40,17 @@ public class CraftEvoker extends CraftSpellcaster implements Evoker {
|
||||
public void setCurrentSpell(Evoker.Spell spell) {
|
||||
getHandle().setSpell(spell == null ? EntityIllagerWizard.Spell.NONE : EntityIllagerWizard.Spell.a(spell.ordinal()));
|
||||
}
|
||||
+
|
||||
+ // Purpur start
|
||||
+ @Nullable
|
||||
+ public org.bukkit.entity.Sheep getWololoTarget() {
|
||||
+ EntitySheep target = getHandle().getWololoTarget();
|
||||
+ return target == null ? null : (org.bukkit.entity.Sheep) target.getBukkitEntity();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setWololoTarget(@Nullable org.bukkit.entity.Sheep sheep) {
|
||||
+ getHandle().setWololoTarget(sheep == null ? null : (EntitySheep) ((CraftEntity) sheep).getHandle());
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
From fa7ce62a34d0cd0e28afe493de492cb5e8c0d4df Mon Sep 17 00:00:00 2001
|
||||
From d92c7dd2a708064c634e5a66ce12f673acddf32e Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 8 Aug 2019 15:29:15 -0500
|
||||
Subject: [PATCH] Implement AFK API
|
||||
Subject: [PATCH] AFK API
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/Entity.java | 1 +
|
||||
.../net/minecraft/server/EntityHuman.java | 9 ++++
|
||||
.../net/minecraft/server/EntityPlayer.java | 43 +++++++++++++++++++
|
||||
.../net/minecraft/server/IEntityAccess.java | 34 ++++++---------
|
||||
.../net/minecraft/server/EntityPlayer.java | 46 +++++++++++++++++++
|
||||
.../net/minecraft/server/IEntityAccess.java | 34 +++++---------
|
||||
.../net/minecraft/server/IEntitySelector.java | 2 +
|
||||
.../minecraft/server/PlayerConnection.java | 12 +++++-
|
||||
.../minecraft/server/PlayerConnection.java | 12 ++++-
|
||||
.../net/minecraft/server/WorldServer.java | 4 +-
|
||||
.../java/net/pl3x/purpur/PurpurConfig.java | 8 ++++
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 11 +++++
|
||||
.../craftbukkit/entity/CraftPlayer.java | 17 ++++++++
|
||||
.../craftbukkit/entity/CraftPlayer.java | 17 +++++++
|
||||
.../java/org/spigotmc/ActivationRange.java | 1 +
|
||||
src/main/resources/purpur.lang | 4 +-
|
||||
11 files changed, 112 insertions(+), 26 deletions(-)
|
||||
11 files changed, 120 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 08645bd03..580843686 100644
|
||||
index 38887c1b7..3709f3386 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -1623,6 +1623,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@@ -1384,6 +1384,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
return MathHelper.c(f * f + f1 * f1 + f2 * f2);
|
||||
}
|
||||
|
||||
@@ -30,10 +30,10 @@ index 08645bd03..580843686 100644
|
||||
double d3 = this.locX() - d0;
|
||||
double d4 = this.locY() - d1;
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
index 27cfc6654..d62174e9c 100644
|
||||
index 2cada09ce..a69a69859 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
@@ -86,6 +86,15 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
@@ -84,6 +84,15 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -46,17 +46,17 @@ index 27cfc6654..d62174e9c 100644
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
public EntityHuman(World world, GameProfile gameprofile) {
|
||||
public EntityHuman(World world, BlockPosition blockposition, GameProfile gameprofile) {
|
||||
super(EntityTypes.PLAYER, world);
|
||||
this.bV = ItemStack.a;
|
||||
this.bS = ItemStack.b;
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
index b781aa3ae..d7ce31284 100644
|
||||
index c047d8ff1..6fbbe515c 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
@@ -1646,8 +1646,51 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
@@ -1755,8 +1755,54 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
|
||||
public void resetIdleTimer() {
|
||||
this.cj = SystemUtils.getMonotonicMillis();
|
||||
this.ch = SystemUtils.getMonotonicMillis();
|
||||
+ setAfk(false); // Purpur
|
||||
}
|
||||
|
||||
@@ -68,8 +68,10 @@ index b781aa3ae..d7ce31284 100644
|
||||
+ if (this.isAfk == setAfk) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ String msg = setAfk ? net.pl3x.purpur.PurpurConfig.afkBroadcastAway : net.pl3x.purpur.PurpurConfig.afkBroadcastBack;
|
||||
+
|
||||
+ net.pl3x.purpur.event.PlayerAFKEvent event = new net.pl3x.purpur.event.PlayerAFKEvent(getBukkitEntity(), setAfk, world.purpurConfig.idleTimeoutKick, LocaleLanguage.getInstance().translateKey("idle.timeout.broadcast." + (setAfk ? "away" : "back")), !Bukkit.isPrimaryThread());
|
||||
+ net.pl3x.purpur.event.PlayerAFKEvent event = new net.pl3x.purpur.event.PlayerAFKEvent(getBukkitEntity(), setAfk, world.purpurConfig.idleTimeoutKick, msg, !Bukkit.isPrimaryThread());
|
||||
+ if (!event.callEvent() || event.shouldKick()) {
|
||||
+ return;
|
||||
+ }
|
||||
@@ -80,8 +82,9 @@ index b781aa3ae..d7ce31284 100644
|
||||
+ resetIdleTimer();
|
||||
+ }
|
||||
+
|
||||
+ if (event.getBroadcastMsg() != null && !event.getBroadcastMsg().isEmpty()) {
|
||||
+ server.getPlayerList().sendAll(new PacketPlayOutChat(new ChatMessage(event.getBroadcastMsg(), getScoreboardDisplayName())));
|
||||
+ msg = event.getBroadcastMsg();
|
||||
+ if (msg != null && !msg.isEmpty()) {
|
||||
+ server.getPlayerList().sendAll(new PacketPlayOutChat(new ChatMessage(msg, getScoreboardDisplayName()), ChatMessageType.SYSTEM, SystemUtils.getNullUUID()));
|
||||
+ }
|
||||
+
|
||||
+ if (world.purpurConfig.idleTimeoutUpdateTabList) {
|
||||
@@ -97,8 +100,8 @@ index b781aa3ae..d7ce31284 100644
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isCollidable(boolean ignoreClimbing) {
|
||||
+ return !isAfk() && super.isCollidable(ignoreClimbing);
|
||||
+ public boolean isCollidable() {
|
||||
+ return !isAfk() && super.isCollidable();
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@@ -106,12 +109,12 @@ index b781aa3ae..d7ce31284 100644
|
||||
return this.serverStatisticManager;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java
|
||||
index e0d97d2c8..e1a7926d7 100644
|
||||
index 267a6baae..d3ea51c27 100644
|
||||
--- a/src/main/java/net/minecraft/server/IEntityAccess.java
|
||||
+++ b/src/main/java/net/minecraft/server/IEntityAccess.java
|
||||
@@ -150,28 +150,18 @@ public interface IEntityAccess {
|
||||
return entityhuman;
|
||||
@@ -143,28 +143,18 @@ public interface IEntityAccess {
|
||||
}
|
||||
// Paper end
|
||||
|
||||
- default boolean isPlayerNearby(double d0, double d1, double d2, double d3) {
|
||||
- Iterator iterator = this.getPlayers().iterator();
|
||||
@@ -128,7 +131,7 @@ index e0d97d2c8..e1a7926d7 100644
|
||||
- }
|
||||
-
|
||||
- entityhuman = (EntityHuman) iterator.next();
|
||||
- } while (!IEntitySelector.f.test(entityhuman));
|
||||
- } while (!IEntitySelector.g.test(entityhuman));
|
||||
- } while (!IEntitySelector.b.test(entityhuman));
|
||||
-
|
||||
- d4 = entityhuman.g(d0, d1, d2);
|
||||
@@ -151,7 +154,7 @@ index e0d97d2c8..e1a7926d7 100644
|
||||
|
||||
@Nullable
|
||||
diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java
|
||||
index 1398c47a2..0bf1a14b7 100644
|
||||
index a52dd0c02..9b4795f3b 100644
|
||||
--- a/src/main/java/net/minecraft/server/IEntitySelector.java
|
||||
+++ b/src/main/java/net/minecraft/server/IEntitySelector.java
|
||||
@@ -7,6 +7,7 @@ import javax.annotation.Nullable;
|
||||
@@ -162,19 +165,19 @@ index 1398c47a2..0bf1a14b7 100644
|
||||
public static final Predicate<EntityLiving> b = EntityLiving::isAlive;
|
||||
public static final Predicate<Entity> c = (entity) -> {
|
||||
return entity.isAlive() && !entity.isVehicle() && !entity.isPassenger();
|
||||
@@ -24,6 +25,7 @@ public final class IEntitySelector {
|
||||
@@ -27,6 +28,7 @@ public final class IEntitySelector {
|
||||
return !entity.isSpectator();
|
||||
};
|
||||
public static Predicate<EntityHuman> isInsomniac = (player) -> MathHelper.clamp(((EntityPlayer) player).getStatisticManager().getStatisticValue(StatisticList.CUSTOM.get(StatisticList.TIME_SINCE_REST)), 1, Integer.MAX_VALUE) >= 72000; // Paper
|
||||
+ public static Predicate<EntityHuman> notAfk = (player) -> !player.isAfk(); // Purpur
|
||||
|
||||
public static Predicate<Entity> a(double d0, double d1, double d2, double d3) {
|
||||
double d4 = d3 * d3;
|
||||
// Paper start
|
||||
public static final Predicate<Entity> affectsSpawning = (entity) -> {
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index 8a5059b4f..148beb1b6 100644
|
||||
index 5765e0f04..48a03c44f 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -233,6 +233,12 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
@@ -232,6 +232,12 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
}
|
||||
|
||||
if (this.player.F() > 0L && this.minecraftServer.getIdleTimeout() > 0 && SystemUtils.getMonotonicMillis() - this.player.F() > (long) (this.minecraftServer.getIdleTimeout() * 1000 * 60)) {
|
||||
@@ -185,18 +188,18 @@ index 8a5059b4f..148beb1b6 100644
|
||||
+ }
|
||||
+ // Purpur end
|
||||
this.player.resetIdleTimer(); // CraftBukkit - SPIGOT-854
|
||||
this.disconnect(new ChatMessage("multiplayer.disconnect.idling", new Object[0]));
|
||||
this.disconnect(new ChatMessage("multiplayer.disconnect.idling"));
|
||||
}
|
||||
@@ -456,6 +462,8 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
@@ -448,6 +454,8 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
this.lastYaw = to.getYaw();
|
||||
this.lastPitch = to.getPitch();
|
||||
|
||||
+ if (!to.getWorld().getUID().equals(from.getWorld().getUID()) || to.getBlockX() != from.getBlockX() || to.getBlockY() != from.getBlockY() || to.getBlockZ() != from.getBlockZ()) this.player.resetIdleTimer(); // Purpur
|
||||
+ if (!to.getWorld().getUID().equals(from.getWorld().getUID()) || to.getBlockX() != from.getBlockX() || to.getBlockY() != from.getBlockY() || to.getBlockZ() != from.getBlockZ() || to.getYaw() != from.getYaw() || to.getPitch() != from.getPitch()) this.player.resetIdleTimer(); // Purpur
|
||||
+
|
||||
// Skip the first time we do this
|
||||
if (true) { // Spigot - don't skip any move events
|
||||
Location oldTo = to.clone();
|
||||
@@ -1112,7 +1120,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
@@ -1117,7 +1125,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
|
||||
if (!this.player.H() && d11 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.playerInteractManager.isCreative() && this.player.playerInteractManager.getGameMode() != EnumGamemode.SPECTATOR) { // Spigot
|
||||
flag1 = true;
|
||||
@@ -205,21 +208,21 @@ index 8a5059b4f..148beb1b6 100644
|
||||
}
|
||||
|
||||
this.player.setLocation(d4, d5, d6, f, f1);
|
||||
@@ -1158,6 +1166,8 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
this.lastYaw = to.getYaw();
|
||||
this.lastPitch = to.getPitch();
|
||||
@@ -1156,6 +1164,8 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
this.lastYaw = to.getYaw();
|
||||
this.lastPitch = to.getPitch();
|
||||
|
||||
+ if (!to.getWorld().getUID().equals(from.getWorld().getUID()) || to.getBlockX() != from.getBlockX() || to.getBlockY() != from.getBlockY() || to.getBlockZ() != from.getBlockZ() || to.getYaw() != from.getYaw() || to.getPitch() != from.getPitch()) this.player.resetIdleTimer(); // Purpur
|
||||
+ if (!to.getWorld().getUID().equals(from.getWorld().getUID()) || to.getBlockX() != from.getBlockX() || to.getBlockY() != from.getBlockY() || to.getBlockZ() != from.getBlockZ() || to.getYaw() != from.getYaw() || to.getPitch() != from.getPitch()) this.player.resetIdleTimer(); // Purpur
|
||||
+
|
||||
// Skip the first time we do this
|
||||
if (from.getX() != Double.MAX_VALUE) {
|
||||
Location oldTo = to.clone();
|
||||
// Skip the first time we do this
|
||||
if (from.getX() != Double.MAX_VALUE) {
|
||||
Location oldTo = to.clone();
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index edf24791b..156c87ed4 100644
|
||||
index f24c4def3..093fa8074 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -846,7 +846,7 @@ public class WorldServer extends World {
|
||||
}
|
||||
@@ -425,7 +425,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
// CraftBukkit end
|
||||
|
||||
if (this.everyoneSleeping && this.players.stream().noneMatch((entityplayer) -> {
|
||||
- return !entityplayer.isSpectator() && !entityplayer.isDeeplySleeping() && !entityplayer.fauxSleeping; // CraftBukkit
|
||||
@@ -227,7 +230,7 @@ index edf24791b..156c87ed4 100644
|
||||
})) {
|
||||
// CraftBukkit start
|
||||
long l = this.worldData.getDayTime() + 24000L;
|
||||
@@ -1165,7 +1165,7 @@ public class WorldServer extends World {
|
||||
@@ -745,7 +745,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
while (iterator.hasNext()) {
|
||||
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
|
||||
|
||||
@@ -236,33 +239,57 @@ index edf24791b..156c87ed4 100644
|
||||
++i;
|
||||
} else if (entityplayer.isSleeping()) {
|
||||
++j;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index d6405b2ec..41dd1b861 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -138,6 +138,17 @@ public class PurpurWorldConfig {
|
||||
disableDropsOnCrammingDeath = getBoolean("gameplay-mechanics.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index fc38163b1..cc08ad33e 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.pl3x.purpur;
|
||||
|
||||
import com.google.common.base.Throwables;
|
||||
+import net.minecraft.server.LocaleLanguage;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.pl3x.purpur.command.PurpurCommand;
|
||||
import org.bukkit.Bukkit;
|
||||
@@ -129,6 +130,13 @@ public class PurpurConfig {
|
||||
return config.getString(path, config.getString(path));
|
||||
}
|
||||
|
||||
+ public static String afkBroadcastAway = "§e§o%s is now AFK";
|
||||
+ public static String afkBroadcastBack = "§e§o%s is no longer AFK";
|
||||
+ private static void messages() {
|
||||
+ afkBroadcastAway = getString("settings.messages.afk-broadcast-away", afkBroadcastAway);
|
||||
+ afkBroadcastBack = getString("settings.messages.afk-broadcast-back", afkBroadcastBack);
|
||||
+ }
|
||||
+
|
||||
public static String timingsUrl = "https://timings.pl3x.net";
|
||||
private static void timingsSettings() {
|
||||
timingsUrl = getString("settings.timings.url", timingsUrl);
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index eda37fa43..5fa333037 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -64,4 +64,15 @@ public class PurpurWorldConfig {
|
||||
PurpurConfig.config.addDefault("world-settings.default." + path, def);
|
||||
return PurpurConfig.config.getString("world-settings." + worldName + "." + path, PurpurConfig.config.getString("world-settings.default." + path));
|
||||
}
|
||||
+
|
||||
+ public boolean idleTimeoutKick = true;
|
||||
+ public boolean idleTimeoutTickNearbyEntities = true;
|
||||
+ public boolean idleTimeoutCountAsSleeping = false;
|
||||
+ public boolean idleTimeoutUpdateTabList = false;
|
||||
+ private void idleTimeoutSettings() {
|
||||
+ private void playerIdleTimeoutSettings() {
|
||||
+ idleTimeoutKick = getBoolean("gameplay-mechanics.player.idle-timeout.kick-if-idle", idleTimeoutKick);
|
||||
+ idleTimeoutTickNearbyEntities = getBoolean("gameplay-mechanics.player.idle-timeout.tick-nearby-entities", idleTimeoutTickNearbyEntities);
|
||||
+ idleTimeoutCountAsSleeping = getBoolean("gameplay-mechanics.player.idle-timeout.count-as-sleeping", idleTimeoutCountAsSleeping);
|
||||
+ idleTimeoutUpdateTabList = getBoolean("gameplay-mechanics.player.idle-timeout.update-tab-list", idleTimeoutUpdateTabList);
|
||||
+ }
|
||||
+
|
||||
public boolean batRidable = false;
|
||||
public boolean batRidableInWater = false;
|
||||
public boolean batRequireShiftToMount = true;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 141003ca7..e15c12387 100644
|
||||
index 97a24b4df..3bd2ffc20 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -2086,4 +2086,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -2128,4 +2128,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
return spigot;
|
||||
}
|
||||
// Spigot end
|
||||
@@ -285,7 +312,7 @@ index 141003ca7..e15c12387 100644
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
index f735217e7..818f8070c 100644
|
||||
index f78e44e05..da4c49daf 100644
|
||||
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
||||
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
@@ -207,6 +207,7 @@ public class ActivationRange
|
||||
@@ -296,17 +323,6 @@ index f735217e7..818f8070c 100644
|
||||
maxBB = player.getBoundingBox().grow( maxRange, 256, maxRange );
|
||||
ActivationType.MISC.boundingBox = player.getBoundingBox().grow( miscActivationRange, 256, miscActivationRange );
|
||||
ActivationType.RAIDER.boundingBox = player.getBoundingBox().grow( raiderActivationRange, 256, raiderActivationRange );
|
||||
diff --git a/src/main/resources/purpur.lang b/src/main/resources/purpur.lang
|
||||
index 7125c0477..e925e1374 100644
|
||||
--- a/src/main/resources/purpur.lang
|
||||
+++ b/src/main/resources/purpur.lang
|
||||
@@ -1,3 +1,5 @@
|
||||
{
|
||||
- "cannot.ride.mob": "You cannot mount that mob"
|
||||
+ "cannot.ride.mob": "You cannot mount that mob",
|
||||
+ "idle.timeout.broadcast.away": "§e§o%s is now AFK",
|
||||
+ "idle.timeout.broadcast.back": "§e§o%s is no longer AFK"
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
From fabde23890d8301331617afb56b2285ee9ec1765 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Tue, 18 Feb 2020 20:38:34 -0600
|
||||
Subject: [PATCH] Host our own timings
|
||||
|
||||
---
|
||||
src/main/java/net/pl3x/purpur/PurpurConfig.java | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 333c880bf..2673de821 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -127,4 +127,8 @@ public class PurpurConfig {
|
||||
config.addDefault(path, def);
|
||||
return config.getString(path, config.getString(path));
|
||||
}
|
||||
+
|
||||
+ private static void timingsSettings() {
|
||||
+ getString("settings.timings.url", "https://timings.pl3x.net");
|
||||
+ }
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
From 1ff4358c48066bbe6694b68332dd8a7c3088a4bf Mon Sep 17 00:00:00 2001
|
||||
From fb7aa2524aa13598c3a498a60c44795a2647522f Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 26 May 2019 15:19:14 -0500
|
||||
Subject: [PATCH] Bring back server name
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/DedicatedServerProperties.java | 1 +
|
||||
src/main/java/org/bukkit/craftbukkit/CraftServer.java | 5 +++++
|
||||
2 files changed, 6 insertions(+)
|
||||
.../net/minecraft/server/DedicatedServerProperties.java | 1 +
|
||||
src/main/java/org/bukkit/craftbukkit/CraftServer.java | 7 +++++++
|
||||
2 files changed, 8 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/DedicatedServerProperties.java
|
||||
index 0c3ec8357..309f5562b 100644
|
||||
index 6786fd094..8a9be3fdb 100644
|
||||
--- a/src/main/java/net/minecraft/server/DedicatedServerProperties.java
|
||||
+++ b/src/main/java/net/minecraft/server/DedicatedServerProperties.java
|
||||
@@ -10,6 +10,7 @@ public class DedicatedServerProperties extends PropertyManager<DedicatedServerPr
|
||||
@@ -21,21 +21,21 @@ index 0c3ec8357..309f5562b 100644
|
||||
public final boolean spawnNpcs = this.getBoolean("spawn-npcs", true);
|
||||
public final boolean pvp = this.getBoolean("pvp", true);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 97159dfe1..0483ec062 100644
|
||||
index 6c602ef79..39aa8c336 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2301,6 +2301,11 @@ public final class CraftServer implements Server {
|
||||
@@ -2356,4 +2356,11 @@ public final class CraftServer implements Server {
|
||||
return mobGoals;
|
||||
}
|
||||
// Paper end
|
||||
|
||||
// Purpur start
|
||||
+
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public String getServerName() {
|
||||
+ return getProperties().serverName;
|
||||
+ }
|
||||
+
|
||||
@Override
|
||||
public boolean isLagging() {
|
||||
return getServer().lagging;
|
||||
+ // Purpur end
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
From 9fd9d6cc9145840f9407ba06cac930d39d480d94 Mon Sep 17 00:00:00 2001
|
||||
From 8cabdcc1fff88ba9e699619de4a6898a2c3ab69d Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 21 Mar 2020 11:47:39 -0500
|
||||
Subject: [PATCH] Configurable server mod name
|
||||
@@ -9,24 +9,24 @@ Subject: [PATCH] Configurable server mod name
|
||||
2 files changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index d9e5eda9b..d91d3a82c 100644
|
||||
index 0d0998b06..377cd8812 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1648,7 +1648,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -1446,7 +1446,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
}
|
||||
|
||||
public String getServerModName() {
|
||||
- return "Purpur"; // Purpur // Tuinity // Paper // Spigot // CraftBukkit
|
||||
+ return net.pl3x.purpur.PurpurConfig.serverModName; // Purpur // Tuinity // Paper // Spigot // CraftBukkit
|
||||
- return "Purpur"; // Purpur // Paper // Spigot // CraftBukkit
|
||||
+ return net.pl3x.purpur.PurpurConfig.serverModName; // Purpur // Paper // Spigot // CraftBukkit
|
||||
}
|
||||
|
||||
public CrashReport b(CrashReport crashreport) {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index fe38b3ce9..a729e7d20 100644
|
||||
index cc08ad33e..3d779b0dc 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -181,6 +181,11 @@ public class PurpurConfig {
|
||||
slimeBlocksNotPushable = getBoolean("settings.blocks.slime.not-movable-by-piston", slimeBlocksNotPushable);
|
||||
@@ -137,6 +137,11 @@ public class PurpurConfig {
|
||||
afkBroadcastBack = getString("settings.messages.afk-broadcast-back", afkBroadcastBack);
|
||||
}
|
||||
|
||||
+ public static String serverModName = "Purpur";
|
||||
@@ -34,9 +34,9 @@ index fe38b3ce9..a729e7d20 100644
|
||||
+ serverModName = getString("settings.server-mod-name", serverModName);
|
||||
+ }
|
||||
+
|
||||
public static String timingsUrl = "https://timings.pl3x.net";
|
||||
private static void timingsSettings() {
|
||||
getString("settings.timings.url", "https://timings.pl3x.net");
|
||||
}
|
||||
timingsUrl = getString("settings.timings.url", timingsUrl);
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
From ff8ebf864e0f3f5d70b43bfbe7353e347897442b Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 19 Oct 2019 00:52:12 -0500
|
||||
Subject: [PATCH] Logger settings (suppressing pointless logs)
|
||||
|
||||
---
|
||||
.../net/minecraft/server/AdvancementDataPlayer.java | 1 +
|
||||
.../java/net/minecraft/server/GenericAttributes.java | 1 +
|
||||
.../minecraft/server/WorldGenFeatureConfigured.java | 1 +
|
||||
src/main/java/net/pl3x/purpur/PurpurConfig.java | 11 +++++++++++
|
||||
.../org/bukkit/craftbukkit/legacy/CraftLegacy.java | 1 +
|
||||
5 files changed, 15 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java
|
||||
index c41e13847..44331cea7 100644
|
||||
--- a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java
|
||||
@@ -162,6 +162,7 @@ public class AdvancementDataPlayer {
|
||||
if (advancement == null) {
|
||||
// CraftBukkit start
|
||||
if (entry.getKey().getNamespace().equals("minecraft")) {
|
||||
+ if (!net.pl3x.purpur.PurpurConfig.loggerSuppressIgnoredAdvancementWarnings) // Purpur
|
||||
AdvancementDataPlayer.LOGGER.warn("Ignored advancement '{}' in progress file {} - it doesn't exist anymore?", entry.getKey(), this.e);
|
||||
}
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/net/minecraft/server/GenericAttributes.java b/src/main/java/net/minecraft/server/GenericAttributes.java
|
||||
index 469e293c2..ca58302cf 100644
|
||||
--- a/src/main/java/net/minecraft/server/GenericAttributes.java
|
||||
+++ b/src/main/java/net/minecraft/server/GenericAttributes.java
|
||||
@@ -79,6 +79,7 @@ public class GenericAttributes {
|
||||
AttributeInstance attributeinstance = attributemapbase.a(nbttagcompound.getString("Name"));
|
||||
|
||||
if (attributeinstance == null) {
|
||||
+ if (!net.pl3x.purpur.PurpurConfig.loggerSuppressUnknownAttributeWarnings) // Purpur
|
||||
GenericAttributes.LOGGER.warn("Ignoring unknown attribute '{}'", nbttagcompound.getString("Name"));
|
||||
} else {
|
||||
a(attributeinstance, nbttagcompound);
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldGenFeatureConfigured.java b/src/main/java/net/minecraft/server/WorldGenFeatureConfigured.java
|
||||
index 73402f2b5..1c2320cc5 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldGenFeatureConfigured.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldGenFeatureConfigured.java
|
||||
@@ -47,6 +47,7 @@ public class WorldGenFeatureConfigured<FC extends WorldGenFeatureConfiguration,
|
||||
try {
|
||||
return new WorldGenFeatureConfigured<>(worldgenerator, dynamic.get("config").orElseEmptyMap());
|
||||
} catch (RuntimeException runtimeexception) {
|
||||
+ if (!net.pl3x.purpur.PurpurConfig.loggerSuppressWorldGenFeatureDeserializationError) // Purpur
|
||||
WorldGenFeatureConfigured.LOGGER.warn("Error while deserializing {}", s);
|
||||
return new WorldGenFeatureConfigured<>(WorldGenerator.NO_OP, WorldGenFeatureEmptyConfiguration.e);
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 2673de821..d6f82d119 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -128,6 +128,17 @@ public class PurpurConfig {
|
||||
return config.getString(path, config.getString(path));
|
||||
}
|
||||
|
||||
+ public static boolean loggerSuppressUnknownAttributeWarnings = false;
|
||||
+ public static boolean loggerSuppressInitLegacyMaterialError = false;
|
||||
+ public static boolean loggerSuppressWorldGenFeatureDeserializationError = false;
|
||||
+ public static boolean loggerSuppressIgnoredAdvancementWarnings = false;
|
||||
+ private static void loggerSettings() {
|
||||
+ loggerSuppressUnknownAttributeWarnings = getBoolean("settings.logger.suppress-unknown-attribute-warnings", loggerSuppressUnknownAttributeWarnings);
|
||||
+ loggerSuppressInitLegacyMaterialError = getBoolean("settings.logger.suppress-init-legacy-material-errors", loggerSuppressInitLegacyMaterialError);
|
||||
+ loggerSuppressWorldGenFeatureDeserializationError = getBoolean("settings.logger.suppress-world-gen-feature-deserialization-errors", loggerSuppressWorldGenFeatureDeserializationError);
|
||||
+ loggerSuppressIgnoredAdvancementWarnings = getBoolean("settings.logger.suppress-ignored-advancement-warnings", loggerSuppressIgnoredAdvancementWarnings);
|
||||
+ }
|
||||
+
|
||||
private static void timingsSettings() {
|
||||
getString("settings.timings.url", "https://timings.pl3x.net");
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
||||
index 049e9f98d..1d179cd5b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
||||
@@ -254,6 +254,7 @@ public final class CraftLegacy {
|
||||
}
|
||||
|
||||
static {
|
||||
+ if (!net.pl3x.purpur.PurpurConfig.loggerSuppressInitLegacyMaterialError) // Purpur
|
||||
System.err.println("Initializing Legacy Material Support. Unless you have legacy plugins and/or data this is a bug!");
|
||||
if (MinecraftServer.getServer() != null && MinecraftServer.getServer().isDebugging()) {
|
||||
new Exception().printStackTrace();
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,34 +1,32 @@
|
||||
From 7922b68914319be86e725f89951217ee05ab2b59 Mon Sep 17 00:00:00 2001
|
||||
From cf295f5a020f34fbf464fb820db12df399df7586 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 5 May 2019 12:58:45 -0500
|
||||
Subject: [PATCH] Implement LivingEntity safeFallDistance
|
||||
Subject: [PATCH] LivingEntity safeFallDistance
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/EntityGiantZombie.java | 3 +++
|
||||
.../java/net/minecraft/server/EntityGiantZombie.java | 1 +
|
||||
.../net/minecraft/server/EntityHorseAbstract.java | 2 +-
|
||||
src/main/java/net/minecraft/server/EntityLiving.java | 3 ++-
|
||||
src/main/java/net/minecraft/server/EntityLiving.java | 7 ++++---
|
||||
.../bukkit/craftbukkit/entity/CraftLivingEntity.java | 12 ++++++++++++
|
||||
4 files changed, 18 insertions(+), 2 deletions(-)
|
||||
4 files changed, 18 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityGiantZombie.java b/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
||||
index 4296aaa07..a2e3e6001 100644
|
||||
index 603fe5caa..37618126f 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
||||
@@ -5,6 +5,9 @@ public class EntityGiantZombie extends EntityMonster {
|
||||
@@ -4,6 +4,7 @@ public class EntityGiantZombie extends EntityMonster {
|
||||
|
||||
public EntityGiantZombie(EntityTypes<? extends EntityGiantZombie> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
setStepHeight(world.purpurConfig.giantStepHeight); // Purpur
|
||||
+ // Purpur start
|
||||
+ this.safeFallDistance = 10.0F;
|
||||
+ // Purpur end
|
||||
+ this.safeFallDistance = 10.0F; // Purpur
|
||||
}
|
||||
|
||||
// Purpur start
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityHorseAbstract.java b/src/main/java/net/minecraft/server/EntityHorseAbstract.java
|
||||
index 0ecdea671..e099ef9a0 100644
|
||||
index 364697e01..ee7a2fedd 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityHorseAbstract.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityHorseAbstract.java
|
||||
@@ -222,7 +222,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven
|
||||
@@ -210,7 +210,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven
|
||||
|
||||
@Override
|
||||
protected int e(float f, float f1) {
|
||||
@@ -38,18 +36,29 @@ index 0ecdea671..e099ef9a0 100644
|
||||
|
||||
protected int getChestSlots() {
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index 288942e9d..28e555d6e 100644
|
||||
index 7a2140e4b..732a3f21d 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -125,6 +125,7 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -132,6 +132,7 @@ public abstract class EntityLiving extends Entity {
|
||||
// CraftBukkit start
|
||||
public int expToDrop;
|
||||
public int maxAirTicks = 300;
|
||||
+ public float safeFallDistance = 3.0F; // Purpur
|
||||
boolean forceDrops;
|
||||
ArrayList<org.bukkit.inventory.ItemStack> drops = new ArrayList<org.bukkit.inventory.ItemStack>();
|
||||
public org.bukkit.craftbukkit.attribute.CraftAttributeMap craftAttributes;
|
||||
@@ -1546,7 +1547,7 @@ public abstract class EntityLiving extends Entity {
|
||||
public final org.bukkit.craftbukkit.attribute.CraftAttributeMap craftAttributes;
|
||||
@@ -226,8 +227,8 @@ public abstract class EntityLiving extends Entity {
|
||||
this.cQ();
|
||||
}
|
||||
|
||||
- if (!this.world.isClientSide && this.fallDistance > 3.0F && flag) {
|
||||
- float f = (float) MathHelper.f(this.fallDistance - 3.0F);
|
||||
+ if (!this.world.isClientSide && this.fallDistance > this.safeFallDistance && flag) { // Purpur
|
||||
+ float f = (float) MathHelper.f(this.fallDistance - this.safeFallDistance); // Purpur
|
||||
|
||||
if (!iblockdata.isAir()) {
|
||||
double d1 = Math.min((double) (0.2F + f / 15.0F), 2.5D);
|
||||
@@ -1681,7 +1682,7 @@ public abstract class EntityLiving extends Entity {
|
||||
MobEffect mobeffect = this.getEffect(MobEffects.JUMP);
|
||||
float f2 = mobeffect == null ? 0.0F : (float) (mobeffect.getAmplifier() + 1);
|
||||
|
||||
@@ -57,12 +66,12 @@ index 288942e9d..28e555d6e 100644
|
||||
+ return MathHelper.f((f - this.safeFallDistance - f2) * f1); // Purpur
|
||||
}
|
||||
|
||||
protected void cZ() {
|
||||
protected void playBlockStepSound() {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index a461ac361..4874c2242 100644
|
||||
index 3777aba5f..2a82a2bb7 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -739,4 +739,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -752,4 +752,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
}
|
||||
|
||||
// Paper end
|
||||
@@ -1,58 +0,0 @@
|
||||
From 7ad6f9948748ee7bc32a5f8682016e0d47b27a80 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Wed, 1 Jan 2020 20:12:39 -0600
|
||||
Subject: [PATCH] Add obfhelpers for plugin use
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/IChatBaseComponent.java | 2 ++
|
||||
src/main/java/net/minecraft/server/ItemStack.java | 1 +
|
||||
src/main/java/net/minecraft/server/NBTTagString.java | 1 +
|
||||
3 files changed, 4 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/IChatBaseComponent.java b/src/main/java/net/minecraft/server/IChatBaseComponent.java
|
||||
index fb97c51bb..50ed4001d 100644
|
||||
--- a/src/main/java/net/minecraft/server/IChatBaseComponent.java
|
||||
+++ b/src/main/java/net/minecraft/server/IChatBaseComponent.java
|
||||
@@ -145,6 +145,7 @@ public interface IChatBaseComponent extends Message, Iterable<IChatBaseComponent
|
||||
return this;
|
||||
}
|
||||
|
||||
+ default IChatBaseComponent setFormat(EnumChatFormat enumchatformat) { return a(enumchatformat); } // Purpur - OBFHELPER
|
||||
default IChatBaseComponent a(EnumChatFormat enumchatformat) {
|
||||
ChatModifier chatmodifier = this.getChatModifier();
|
||||
|
||||
@@ -431,6 +432,7 @@ public interface IChatBaseComponent extends Message, Iterable<IChatBaseComponent
|
||||
return jsonobject;
|
||||
}
|
||||
|
||||
+ public static String toJson(IChatBaseComponent ichatbasecomponent) { return a(ichatbasecomponent); } // Purpur - OBFHELPER
|
||||
public static String a(IChatBaseComponent ichatbasecomponent) {
|
||||
return IChatBaseComponent.ChatSerializer.a.toJson(ichatbasecomponent);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
index ea60880c6..413b888a0 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
@@ -596,6 +596,7 @@ public final class ItemStack {
|
||||
return this.tag;
|
||||
}
|
||||
|
||||
+ public NBTTagCompound getOrCreateSubTag(String s) { return a(s); } // Purpur - OBFHELPER
|
||||
public NBTTagCompound a(String s) {
|
||||
if (this.tag != null && this.tag.hasKeyOfType(s, 10)) {
|
||||
return this.tag.getCompound(s);
|
||||
diff --git a/src/main/java/net/minecraft/server/NBTTagString.java b/src/main/java/net/minecraft/server/NBTTagString.java
|
||||
index bea4a0b80..c6481c7ff 100644
|
||||
--- a/src/main/java/net/minecraft/server/NBTTagString.java
|
||||
+++ b/src/main/java/net/minecraft/server/NBTTagString.java
|
||||
@@ -40,6 +40,7 @@ public class NBTTagString implements NBTBase {
|
||||
this.data = s;
|
||||
}
|
||||
|
||||
+ public static NBTTagString create(String s) { return a(s); } // Purpur - OBFHELPER
|
||||
public static NBTTagString a(String s) {
|
||||
return s.isEmpty() ? NBTTagString.b : new NBTTagString(s);
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
From 3783ea32482a168cacafaf3dd37e311a2ac4d2eb Mon Sep 17 00:00:00 2001
|
||||
From 74be5db066f9d9d2bf3105b9f718361ad3c67ec6 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 1 Feb 2020 22:22:16 -0600
|
||||
Subject: [PATCH] Add moon phase API
|
||||
Subject: [PATCH] MoonPhase API
|
||||
|
||||
---
|
||||
src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 32d4aa0f4..e55be5271 100644
|
||||
index fb24b9d07..192c99db1 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -2477,6 +2477,14 @@ public class CraftWorld implements World {
|
||||
|
||||
return new CraftDragonBattle(((WorldProviderTheEnd) worldProvider).o()); // PAIL rename getDragonBattle
|
||||
@@ -2604,4 +2604,11 @@ public class CraftWorld implements World {
|
||||
return spigot;
|
||||
}
|
||||
// Spigot end
|
||||
+
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
@@ -22,10 +22,7 @@ index 32d4aa0f4..e55be5271 100644
|
||||
+ return net.pl3x.purpur.MoonPhase.getPhase(getFullTime() / 24000L);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
// Paper start
|
||||
@Override
|
||||
public CompletableFuture<Chunk> getChunkAtAsync(int x, int z, boolean gen, boolean urgent) {
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
From 227bedf9b854210d5b7cd9408ca62f7547ff0170 Mon Sep 17 00:00:00 2001
|
||||
From 66165fa04ec062dbe138f99824d32840512a43c1 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Tue, 23 Jul 2019 10:07:16 -0500
|
||||
Subject: [PATCH] Implement lagging threshold
|
||||
Subject: [PATCH] Lagging threshold
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/MinecraftServer.java | 2 ++
|
||||
src/main/java/net/pl3x/purpur/PurpurConfig.java | 5 +++++
|
||||
src/main/java/org/bukkit/craftbukkit/CraftServer.java | 7 +++++++
|
||||
3 files changed, 14 insertions(+)
|
||||
src/main/java/org/bukkit/craftbukkit/CraftServer.java | 5 +++++
|
||||
3 files changed, 12 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index da8c98356..3568e076e 100644
|
||||
index 377cd8812..822798741 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -184,6 +184,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -166,6 +166,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
public static final int TICK_TIME = 1000000000 / TPS;
|
||||
private static final int SAMPLE_INTERVAL = 20; // Paper
|
||||
public final double[] recentTps = new double[ 3 ];
|
||||
@@ -21,20 +21,20 @@ index da8c98356..3568e076e 100644
|
||||
public final SlackActivityAccountant slackActivityAccountant = new SlackActivityAccountant();
|
||||
// Spigot end
|
||||
|
||||
@@ -952,6 +953,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -984,6 +985,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
recentTps[1] = tps5.getAverage();
|
||||
recentTps[2] = tps15.getAverage();
|
||||
// Paper end
|
||||
+ lagging = recentTps[0] < net.pl3x.purpur.PurpurConfig.laggingThreshold; // Purpur
|
||||
tickSection = curTime;
|
||||
}
|
||||
// Tuinity - replace logic
|
||||
midTickChunksTasksRan = 0; // Paper
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index d3e1c8c40..ab20fa2fa 100644
|
||||
index 3d779b0dc..d8b826f6b 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -139,6 +139,11 @@ public class PurpurConfig {
|
||||
loggerSuppressIgnoredAdvancementWarnings = getBoolean("settings.logger.suppress-ignored-advancement-warnings", loggerSuppressIgnoredAdvancementWarnings);
|
||||
@@ -147,6 +147,11 @@ public class PurpurConfig {
|
||||
timingsUrl = getString("settings.timings.url", timingsUrl);
|
||||
}
|
||||
|
||||
+ public static double laggingThreshold = 19.0D;
|
||||
@@ -42,24 +42,23 @@ index d3e1c8c40..ab20fa2fa 100644
|
||||
+ laggingThreshold = getDouble("settings.lagging-threshold", laggingThreshold);
|
||||
+ }
|
||||
+
|
||||
public static boolean dontSendUselessEntityPackets = false;
|
||||
private static void dontSendUselessEntityPackets() {
|
||||
dontSendUselessEntityPackets = getBoolean("settings.dont-send-useless-entity-packets", dontSendUselessEntityPackets);
|
||||
public static boolean barrelSixRows = false;
|
||||
public static boolean enderChestSixRows = false;
|
||||
public static boolean enderChestPermissionRows = false;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index e3a012800..97159dfe1 100644
|
||||
index 39aa8c336..bca0487ad 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2299,4 +2299,11 @@ public final class CraftServer implements Server {
|
||||
return mobGoals;
|
||||
@@ -2362,5 +2362,10 @@ public final class CraftServer implements Server {
|
||||
public String getServerName() {
|
||||
return getProperties().serverName;
|
||||
}
|
||||
// Paper end
|
||||
+
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public boolean isLagging() {
|
||||
+ return getServer().lagging;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
// Purpur end
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
@@ -1,129 +0,0 @@
|
||||
From 4b620999fe1c124f14cfcad42fcf1d9c4af85953 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 12 May 2019 00:43:12 -0500
|
||||
Subject: [PATCH] Give giants AI
|
||||
|
||||
---
|
||||
.../minecraft/server/EntityGiantZombie.java | 47 +++++++++++++++++--
|
||||
.../minecraft/server/EntityInsentient.java | 2 +
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 10 ++++
|
||||
3 files changed, 55 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityGiantZombie.java b/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
||||
index ff8a41a53..4296aaa07 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
||||
@@ -23,6 +23,45 @@ public class EntityGiantZombie extends EntityMonster {
|
||||
return world.purpurConfig.giantRequireShiftToMount;
|
||||
}
|
||||
|
||||
+ protected void initPathfinder() {
|
||||
+ if (world.purpurConfig.giantHaveAI) {
|
||||
+ this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
||||
+ this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
||||
+ this.goalSelector.a(7, new PathfinderGoalRandomStrollLand(this, 1.0D));
|
||||
+ this.goalSelector.a(8, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 16.0F));
|
||||
+ this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this));
|
||||
+ this.goalSelector.a(5, new PathfinderGoalMoveTowardsRestriction(this, 1.0D));
|
||||
+ if (world.purpurConfig.giantHaveHostileAI) {
|
||||
+ this.goalSelector.a(2, new PathfinderGoalMeleeAttack(this, 1.0D, false));
|
||||
+ this.targetSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
||||
+ this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this).a(EntityPigZombie.class));
|
||||
+ this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true));
|
||||
+ this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillager.class, false));
|
||||
+ this.targetSelector.a(4, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, true));
|
||||
+ this.targetSelector.a(5, new PathfinderGoalNearestAttackableTarget<>(this, EntityTurtle.class, true));
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public GroupDataEntity prepare(GeneratorAccess world, DifficultyDamageScaler difficulty, EnumMobSpawn enummobspawn, GroupDataEntity groupDataEntity, NBTTagCompound nbt) {
|
||||
+ GroupDataEntity groupData = super.prepare(world, difficulty, enummobspawn, groupDataEntity, nbt);
|
||||
+ if (groupData == null) {
|
||||
+ setEquipmentBasedOnDifficulty(difficulty);
|
||||
+ setEnchantmentBasedOnDifficulty(difficulty);
|
||||
+ }
|
||||
+ return groupData;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ protected void setEquipmentBasedOnDifficulty(DifficultyDamageScaler difficulty) {
|
||||
+ super.setEquipmentBasedOnDifficulty(difficulty);
|
||||
+ // TODO make configurable
|
||||
+ if (random.nextFloat() < (world.getDifficulty() == EnumDifficulty.HARD ? 0.1F : 0.05F)) {
|
||||
+ setSlot(EnumItemSlot.MAINHAND, new ItemStack(Items.IRON_SWORD));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@Override
|
||||
public float getJumpHeight() {
|
||||
// make giants jump as high as everything else relative to their size
|
||||
@@ -39,13 +78,13 @@ public class EntityGiantZombie extends EntityMonster {
|
||||
@Override
|
||||
protected void initAttributes() {
|
||||
super.initAttributes();
|
||||
- this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(100.0D);
|
||||
- this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.5D);
|
||||
- this.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(50.0D);
|
||||
+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(world.purpurConfig.giantMaxHealth); // Purpur
|
||||
+ this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(world.purpurConfig.giantMovementSpeed); // Purpur
|
||||
+ this.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(world.purpurConfig.giantAttackDamage); // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
public float a(BlockPosition blockposition, IWorldReader iworldreader) {
|
||||
- return iworldreader.w(blockposition) - 0.5F;
|
||||
+ return super.a(blockposition, iworldreader); // Purpur - fix light requirements for natural spawns
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
index cbbbc875b..fbca42909 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
@@ -867,6 +867,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
return f;
|
||||
}
|
||||
|
||||
+ protected void setEquipmentBasedOnDifficulty(DifficultyDamageScaler difficultydamagescaler) { a(difficultydamagescaler); } // Purpur - OBFHELPER
|
||||
protected void a(DifficultyDamageScaler difficultydamagescaler) {
|
||||
if (this.random.nextFloat() < 0.15F * difficultydamagescaler.d()) {
|
||||
int i = this.random.nextInt(2);
|
||||
@@ -974,6 +975,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
}
|
||||
}
|
||||
|
||||
+ protected void setEnchantmentBasedOnDifficulty(DifficultyDamageScaler difficultydamagescaler) { b(difficultydamagescaler); } // Purpur - OBFHELPER
|
||||
protected void b(DifficultyDamageScaler difficultydamagescaler) {
|
||||
float f = difficultydamagescaler.d();
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 69f99a993..7cf7ae3dc 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -255,12 +255,22 @@ public class PurpurWorldConfig {
|
||||
public boolean giantRequireShiftToMount = true;
|
||||
public float giantStepHeight = 2.0F;
|
||||
public float giantJumpHeight = 1.0F;
|
||||
+ public double giantMaxHealth = 100.0D;
|
||||
+ public double giantMovementSpeed = 0.5D;
|
||||
+ public double giantAttackDamage = 50.0D;
|
||||
+ public boolean giantHaveAI = false;
|
||||
+ public boolean giantHaveHostileAI = false;
|
||||
private void giantSettings() {
|
||||
giantRidable = getBoolean("mobs.giant.ridable", giantRidable);
|
||||
giantRidableInWater = getBoolean("mobs.giant.ridable-in-water", giantRidableInWater);
|
||||
giantRequireShiftToMount = getBoolean("mobs.giant.require-shift-to-mount", giantRequireShiftToMount);
|
||||
giantStepHeight = (float) getDouble("mobs.giant.step-height", giantStepHeight);
|
||||
giantJumpHeight = (float) getDouble("mobs.giant.jump-height", giantJumpHeight);
|
||||
+ giantMaxHealth = getDouble("mobs.giant.max-health", giantMaxHealth);
|
||||
+ giantMovementSpeed = getDouble("mobs.giant.movement-speed", giantMovementSpeed);
|
||||
+ giantAttackDamage = getDouble("mobs.giant.attack-damage", giantAttackDamage);
|
||||
+ giantHaveAI = getBoolean("mobs.giant.have-ai", giantHaveAI);
|
||||
+ giantHaveHostileAI = getBoolean("mobs.giant.have-hostile-ai", giantHaveHostileAI);
|
||||
}
|
||||
|
||||
public boolean guardianRidable = false;
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 061042c1a14095bb5264328ecf40c63c20212dd6 Mon Sep 17 00:00:00 2001
|
||||
From 38fdad1ea7b019df25e4e4d00c6f0776795bc7e1 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 5 Jul 2019 16:36:55 -0500
|
||||
Subject: [PATCH] Implement ItemFactory#getMonsterEgg
|
||||
Subject: [PATCH] ItemFactory#getMonsterEgg
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/ItemMonsterEgg.java | 2 +-
|
||||
@@ -9,10 +9,10 @@ Subject: [PATCH] Implement ItemFactory#getMonsterEgg
|
||||
2 files changed, 15 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemMonsterEgg.java b/src/main/java/net/minecraft/server/ItemMonsterEgg.java
|
||||
index 24af4c11d..8ef2c3223 100644
|
||||
index 6d8321080..793e42072 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemMonsterEgg.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemMonsterEgg.java
|
||||
@@ -8,7 +8,7 @@ import javax.annotation.Nullable;
|
||||
@@ -9,7 +9,7 @@ import javax.annotation.Nullable;
|
||||
|
||||
public class ItemMonsterEgg extends Item {
|
||||
|
||||
@@ -22,10 +22,10 @@ index 24af4c11d..8ef2c3223 100644
|
||||
private final int c;
|
||||
private final EntityTypes<?> d;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
index 23d775645..29161032c 100644
|
||||
index 0d62f3ae9..53038d096 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
@@ -354,4 +354,18 @@ public final class CraftItemFactory implements ItemFactory {
|
||||
@@ -345,4 +345,18 @@ public final class CraftItemFactory implements ItemFactory {
|
||||
return nms != null ? net.minecraft.server.LocaleLanguage.getInstance().translateKey(nms.getItem().getName()) : null;
|
||||
}
|
||||
// Paper end
|
||||
@@ -1,51 +0,0 @@
|
||||
From 329d09c1593e86d9267736552d421f226208abda Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 5 Jul 2019 11:09:25 -0500
|
||||
Subject: [PATCH] Illusioners AI settings
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/EntityIllagerIllusioner.java | 6 +++---
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 6 ++++++
|
||||
2 files changed, 9 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java
|
||||
index 3e6722cfc..13545a8ef 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java
|
||||
@@ -58,9 +58,9 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan
|
||||
@Override
|
||||
protected void initAttributes() {
|
||||
super.initAttributes();
|
||||
- this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.5D);
|
||||
- this.getAttributeInstance(GenericAttributes.FOLLOW_RANGE).setValue(18.0D);
|
||||
- this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(32.0D);
|
||||
+ this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(world.purpurConfig.illusionerMovementSpeed); // Purpur
|
||||
+ this.getAttributeInstance(GenericAttributes.FOLLOW_RANGE).setValue(world.purpurConfig.illusionerFollowRange); // Purpur
|
||||
+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(world.purpurConfig.illusionerMaxHealth); // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 7cf7ae3dc..96a66926f 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -299,10 +299,16 @@ public class PurpurWorldConfig {
|
||||
public boolean illusionerRidable = false;
|
||||
public boolean illusionerRidableInWater = false;
|
||||
public boolean illusionerRequireShiftToMount = true;
|
||||
+ public double illusionerMaxHealth = 32.0D;
|
||||
+ public double illusionerMovementSpeed = 0.5D;
|
||||
+ public double illusionerFollowRange = 18.0D;
|
||||
private void illusionerSettings() {
|
||||
illusionerRidable = getBoolean("mobs.illusioner.ridable", illusionerRidable);
|
||||
illusionerRidableInWater = getBoolean("mobs.illusioner.ridable-in-water", illusionerRidableInWater);
|
||||
illusionerRequireShiftToMount = getBoolean("mobs.illusioner.require-shift-to-mount", illusionerRequireShiftToMount);
|
||||
+ illusionerMaxHealth = getDouble("mobs.illusioner.max-health", illusionerMaxHealth);
|
||||
+ illusionerMovementSpeed = getDouble("mobs.illusioner.movement-speed", illusionerMovementSpeed);
|
||||
+ illusionerFollowRange = getDouble("mobs.illusioner.follow-range", illusionerFollowRange);
|
||||
}
|
||||
|
||||
public boolean ironGolemRidable = false;
|
||||
--
|
||||
2.26.2
|
||||
|
||||
98
patches/server/0015-PlayerSetSpawnerTypeWithEggEvent.patch
Normal file
98
patches/server/0015-PlayerSetSpawnerTypeWithEggEvent.patch
Normal file
@@ -0,0 +1,98 @@
|
||||
From 00f1a7cbcc9ae0a4f2ad78b44287a34d81ed54e7 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 5 Jul 2019 18:21:00 -0500
|
||||
Subject: [PATCH] PlayerSetSpawnerTypeWithEggEvent
|
||||
|
||||
---
|
||||
.../net/minecraft/server/EntityTypes.java | 22 +++++++++++++++++++
|
||||
.../net/minecraft/server/ItemMonsterEgg.java | 16 ++++++++++++++
|
||||
2 files changed, 38 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java
|
||||
index 18a806ebb..7f2dcc1de 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityTypes.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityTypes.java
|
||||
@@ -142,10 +142,21 @@ public class EntityTypes<T extends Entity> {
|
||||
return (EntityTypes) IRegistry.a((IRegistry) IRegistry.ENTITY_TYPE, s, (Object) entitytypes_builder.a(s));
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ public static EntityTypes getFromBukkitType(org.bukkit.entity.EntityType bukkitType) {
|
||||
+ return getFromKey(new MinecraftKey(bukkitType.getKey().toString()));
|
||||
+ }
|
||||
+
|
||||
+ public static EntityTypes getFromKey(MinecraftKey key) {
|
||||
+ return IRegistry.ENTITY_TYPE.get(key);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
public static MinecraftKey getName(EntityTypes<?> entitytypes) {
|
||||
return IRegistry.ENTITY_TYPE.getKey(entitytypes);
|
||||
}
|
||||
|
||||
+ public static Optional<EntityTypes<?>> getType(String name) { return a(name); } // Purpur - OBFHELPER
|
||||
public static Optional<EntityTypes<?>> a(String s) {
|
||||
return IRegistry.ENTITY_TYPE.getOptional(MinecraftKey.a(s));
|
||||
}
|
||||
@@ -270,6 +281,16 @@ public class EntityTypes<T extends Entity> {
|
||||
return this.bf;
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ public String getName() {
|
||||
+ return IRegistry.ENTITY_TYPE.getKey(this).getKey();
|
||||
+ }
|
||||
+
|
||||
+ public String getTranslatedName() {
|
||||
+ return getNameComponent().getString();
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
public String f() {
|
||||
if (this.bn == null) {
|
||||
this.bn = SystemUtils.a("entity", IRegistry.ENTITY_TYPE.getKey(this));
|
||||
@@ -278,6 +299,7 @@ public class EntityTypes<T extends Entity> {
|
||||
return this.bn;
|
||||
}
|
||||
|
||||
+ public IChatBaseComponent getNameComponent() { return g(); } // Purpur - OBFHELPER
|
||||
public IChatBaseComponent g() {
|
||||
if (this.bo == null) {
|
||||
this.bo = new ChatMessage(this.f());
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemMonsterEgg.java b/src/main/java/net/minecraft/server/ItemMonsterEgg.java
|
||||
index 793e42072..cf4c12ff8 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemMonsterEgg.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemMonsterEgg.java
|
||||
@@ -7,6 +7,13 @@ import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
+// Purpur start
|
||||
+import net.pl3x.purpur.event.PlayerSetSpawnerTypeWithEggEvent;
|
||||
+import org.bukkit.block.CreatureSpawner;
|
||||
+import org.bukkit.entity.EntityType;
|
||||
+import org.bukkit.entity.Player;
|
||||
+// Purpur end
|
||||
+
|
||||
public class ItemMonsterEgg extends Item {
|
||||
|
||||
public static final Map<EntityTypes<?>, ItemMonsterEgg> a = Maps.newIdentityHashMap(); // Purpur - private -> public
|
||||
@@ -41,6 +48,15 @@ public class ItemMonsterEgg extends Item {
|
||||
MobSpawnerAbstract mobspawnerabstract = ((TileEntityMobSpawner) tileentity).getSpawner();
|
||||
EntityTypes<?> entitytypes = this.a(itemstack.getTag());
|
||||
|
||||
+ // Purpur start
|
||||
+ org.bukkit.block.Block bukkitBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
||||
+ PlayerSetSpawnerTypeWithEggEvent event = new PlayerSetSpawnerTypeWithEggEvent((Player) itemactioncontext.b.getBukkitEntity(), bukkitBlock, (CreatureSpawner) bukkitBlock.getState(), EntityType.fromName(entitytypes.getName()));
|
||||
+ if (!event.callEvent()) {
|
||||
+ return EnumInteractionResult.FAIL;
|
||||
+ }
|
||||
+ entitytypes = EntityTypes.getFromBukkitType(event.getEntityType());
|
||||
+ // Purpur end
|
||||
+
|
||||
mobspawnerabstract.setMobName(entitytypes);
|
||||
tileentity.update();
|
||||
world.notify(blockposition, iblockdata, iblockdata, 3);
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
From ff08fe5bfa4a978c4db1e6e039d4eadea593d3f0 Mon Sep 17 00:00:00 2001
|
||||
From ebc3f075549750efdaf6d045a951b5082b1aa9c0 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Sat, 20 Jul 2013 22:40:56 -0400
|
||||
Subject: [PATCH] EMC - MonsterEggSpawn Event
|
||||
Subject: [PATCH] EMC - MonsterEggSpawnEvent
|
||||
|
||||
---
|
||||
.../net/minecraft/server/EntityTypes.java | 28 ++++++++++++++++++-
|
||||
1 file changed, 27 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java
|
||||
index 8e8d392a1..ff11baa7c 100644
|
||||
index 7f2dcc1de..5aea85595 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityTypes.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityTypes.java
|
||||
@@ -163,19 +163,45 @@ public class EntityTypes<T extends Entity> {
|
||||
@@ -176,19 +176,45 @@ public class EntityTypes<T extends Entity> {
|
||||
|
||||
@Nullable
|
||||
public Entity spawnCreature(World world, @Nullable ItemStack itemstack, @Nullable EntityHuman entityhuman, BlockPosition blockposition, EnumMobSpawn enummobspawn, boolean flag, boolean flag1) {
|
||||
@@ -1,7 +1,7 @@
|
||||
From f47732a9410ca8fffaa03331ac3deb642af7e1ed Mon Sep 17 00:00:00 2001
|
||||
From f78891becd000d9c7787bc38deb9d35aa797405b Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Mon, 7 Oct 2019 00:15:37 -0500
|
||||
Subject: [PATCH] Add API for Villager#resetOffers()
|
||||
Subject: [PATCH] Villager#resetOffers
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/EntityVillagerAbstract.java | 8 ++++++++
|
||||
@@ -9,10 +9,10 @@ Subject: [PATCH] Add API for Villager#resetOffers()
|
||||
2 files changed, 15 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityVillagerAbstract.java b/src/main/java/net/minecraft/server/EntityVillagerAbstract.java
|
||||
index 463528532..5fbd13512 100644
|
||||
index 81823b5d5..beb84a2ab 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityVillagerAbstract.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityVillagerAbstract.java
|
||||
@@ -84,6 +84,13 @@ public abstract class EntityVillagerAbstract extends EntityAgeable implements NP
|
||||
@@ -86,6 +86,13 @@ public abstract class EntityVillagerAbstract extends EntityAgeable implements NP
|
||||
return this.tradingPlayer != null;
|
||||
}
|
||||
|
||||
@@ -26,12 +26,12 @@ index 463528532..5fbd13512 100644
|
||||
@Override
|
||||
public MerchantRecipeList getOffers() {
|
||||
if (this.trades == null) {
|
||||
@@ -225,6 +232,7 @@ public abstract class EntityVillagerAbstract extends EntityAgeable implements NP
|
||||
@@ -208,6 +215,7 @@ public abstract class EntityVillagerAbstract extends EntityAgeable implements NP
|
||||
return this.world;
|
||||
}
|
||||
|
||||
+ protected void updateTrades() { eC(); } // Purpur
|
||||
protected abstract void eC();
|
||||
+ protected void updateTrades() { eW(); } // Purpur
|
||||
protected abstract void eW();
|
||||
|
||||
protected void a(MerchantRecipeList merchantrecipelist, VillagerTrades.IMerchantRecipeOption[] avillagertrades_imerchantrecipeoption, int i) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
|
||||
27
patches/server/0018-World-getPlacementBlockData.patch
Normal file
27
patches/server/0018-World-getPlacementBlockData.patch
Normal file
@@ -0,0 +1,27 @@
|
||||
From ccf75c0f071428349a26221eb9c05d22d6c11466 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 8 Feb 2020 23:30:17 -0600
|
||||
Subject: [PATCH] World#getPlacementBlockData
|
||||
|
||||
---
|
||||
src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 192c99db1..be2d2040c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -2610,5 +2610,10 @@ public class CraftWorld implements World {
|
||||
public net.pl3x.purpur.MoonPhase getMoonPhase() {
|
||||
return net.pl3x.purpur.MoonPhase.getPhase(getFullTime() / 24000L);
|
||||
}
|
||||
+
|
||||
+ public BlockData getPlacementBlockData(BlockData blockdata, Location location) {
|
||||
+ IBlockData validData = net.minecraft.server.Block.getValidBlockForPosition(((CraftBlockData) blockdata).getState(), getHandle(), net.minecraft.server.MCUtil.toBlockPosition(location));
|
||||
+ return CraftBlockData.fromData(validData == null ? Blocks.AIR.getBlockData() : validData);
|
||||
+ }
|
||||
// Purpur end
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
From c673dd6d4a16db19278e99bd2355469d93c2a79f Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 26 Dec 2019 18:52:55 -0600
|
||||
Subject: [PATCH] Cat spawning options
|
||||
|
||||
---
|
||||
.../net/minecraft/server/MobSpawnerCat.java | 23 +++++++++++++------
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 6 +++++
|
||||
2 files changed, 22 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MobSpawnerCat.java b/src/main/java/net/minecraft/server/MobSpawnerCat.java
|
||||
index 6024478dc..4b55c07d4 100644
|
||||
--- a/src/main/java/net/minecraft/server/MobSpawnerCat.java
|
||||
+++ b/src/main/java/net/minecraft/server/MobSpawnerCat.java
|
||||
@@ -15,7 +15,7 @@ public class MobSpawnerCat {
|
||||
if (this.a > 0) {
|
||||
return 0;
|
||||
} else {
|
||||
- this.a = 1200;
|
||||
+ this.a = worldserver.purpurConfig.catSpawnDelay; // Purpur
|
||||
EntityPlayer entityplayer = worldserver.k();
|
||||
|
||||
if (entityplayer == null) {
|
||||
@@ -49,10 +49,14 @@ public class MobSpawnerCat {
|
||||
}
|
||||
|
||||
private int a(WorldServer worldserver, BlockPosition blockposition) {
|
||||
- boolean flag = true;
|
||||
-
|
||||
- if (worldserver.B().a(VillagePlaceType.q.c(), blockposition, 48, VillagePlace.Occupancy.IS_OCCUPIED) > 4L) {
|
||||
- List<EntityCat> list = worldserver.a(EntityCat.class, (new AxisAlignedBB(blockposition)).grow(48.0D, 8.0D, 48.0D));
|
||||
+ // Purpur start
|
||||
+ int range = worldserver.purpurConfig.catSpawnVillageScanRange;
|
||||
+ if (range <= 0) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+ if (worldserver.B().a(VillagePlaceType.q.c(), blockposition, range, VillagePlace.Occupancy.IS_OCCUPIED) > 4L) {
|
||||
+ List<EntityCat> list = worldserver.a(EntityCat.class, (new AxisAlignedBB(blockposition)).grow(range, 8.0D, range));
|
||||
+ // Purpur end
|
||||
|
||||
if (list.size() < 5) {
|
||||
return this.a(blockposition, (World) worldserver);
|
||||
@@ -63,8 +67,13 @@ public class MobSpawnerCat {
|
||||
}
|
||||
|
||||
private int a(World world, BlockPosition blockposition) {
|
||||
- boolean flag = true;
|
||||
- List<EntityCat> list = world.a(EntityCat.class, (new AxisAlignedBB(blockposition)).grow(16.0D, 8.0D, 16.0D));
|
||||
+ // Purpur start
|
||||
+ int range = world.purpurConfig.catSpawnSwampHutScanRange;
|
||||
+ if (range <= 0) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+ List<EntityCat> list = world.a(EntityCat.class, (new AxisAlignedBB(blockposition)).grow(range, 8.0D, range));
|
||||
+ // Purpur end
|
||||
|
||||
return list.size() < 1 ? this.a(blockposition, world) : 0;
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 4aaf75fcf..12fbdf65c 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -101,10 +101,16 @@ public class PurpurWorldConfig {
|
||||
public boolean catRidable = false;
|
||||
public boolean catRidableInWater = false;
|
||||
public boolean catRequireShiftToMount = true;
|
||||
+ public int catSpawnDelay = 1200;
|
||||
+ public int catSpawnSwampHutScanRange = 16;
|
||||
+ public int catSpawnVillageScanRange = 48;
|
||||
private void catSettings() {
|
||||
catRidable = getBoolean("mobs.cat.ridable", catRidable);
|
||||
catRidableInWater = getBoolean("mobs.cat.ridable-in-water", catRidableInWater);
|
||||
catRequireShiftToMount = getBoolean("mobs.cat.require-shift-to-mount", catRequireShiftToMount);
|
||||
+ catSpawnDelay = getInt("mobs.cat.spawn-delay", catSpawnDelay);
|
||||
+ catSpawnSwampHutScanRange = getInt("mobs.cat.scan-range-for-other-cats.swamp-hut", catSpawnSwampHutScanRange);
|
||||
+ catSpawnVillageScanRange = getInt("mobs.cat.scan-range-for-other-cats.village", catSpawnVillageScanRange);
|
||||
}
|
||||
|
||||
public boolean caveSpiderRidable = false;
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
From 8d2281f398ecd5a18ce82bbe36815336b45564ca Mon Sep 17 00:00:00 2001
|
||||
From ad5c59131a490f3a1acf7e51ec0a25698f1d5d40 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 19 Oct 2019 02:25:16 -0500
|
||||
Subject: [PATCH] Add playPickupItemAnimation to LivingEntity
|
||||
Subject: [PATCH] LivingEntity#playPickupItemAnimation
|
||||
|
||||
---
|
||||
.../org/bukkit/craftbukkit/entity/CraftLivingEntity.java | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index 4874c2242..d8207b322 100644
|
||||
index 2a82a2bb7..a415707e9 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -750,5 +750,10 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -763,5 +763,10 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
public void setSafeFallDistance(float safeFallDistance) {
|
||||
getHandle().safeFallDistance = safeFallDistance;
|
||||
}
|
||||
@@ -1,14 +1,14 @@
|
||||
From 8e48776996b8bb36d3834d576e20a70ffd0f332b Mon Sep 17 00:00:00 2001
|
||||
From 31aa2e07a779236b98b8415007409eed934d8452 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 19 Oct 2019 02:35:35 -0500
|
||||
Subject: [PATCH] Add getPlayer to SkeletonHorseTrapEvent
|
||||
Subject: [PATCH] SkeletonHorseTrapEvent#getPlayer
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/PathfinderGoalHorseTrap.java | 7 ++++---
|
||||
1 file changed, 4 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java b/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java
|
||||
index 37626f925..f8fd2d99c 100644
|
||||
index b37e4aa37..4d8c4ac07 100644
|
||||
--- a/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java
|
||||
+++ b/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java
|
||||
@@ -2,7 +2,8 @@ package net.minecraft.server;
|
||||
@@ -33,9 +33,9 @@ index 37626f925..f8fd2d99c 100644
|
||||
public void e() {
|
||||
- if (!new com.destroystokyo.paper.event.entity.SkeletonHorseTrapEvent((org.bukkit.entity.SkeletonHorse) this.a.getBukkitEntity()).callEvent()) return; // Paper
|
||||
+ if (!new com.destroystokyo.paper.event.entity.SkeletonHorseTrapEvent((org.bukkit.entity.SkeletonHorse) this.a.getBukkitEntity(), (org.bukkit.entity.Player) player.getBukkitEntity()).callEvent()) return; // Paper // Purpur
|
||||
DifficultyDamageScaler difficultydamagescaler = this.a.world.getDamageScaler(new BlockPosition(this.a));
|
||||
DifficultyDamageScaler difficultydamagescaler = this.a.world.getDamageScaler(this.a.getChunkCoordinates());
|
||||
|
||||
this.a.r(false);
|
||||
this.a.t(false);
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 4ccb3f307363426180c14b91fd024e297f003f8e Mon Sep 17 00:00:00 2001
|
||||
From 8a99e19fa0556853736568a269dd892342449daf Mon Sep 17 00:00:00 2001
|
||||
From: KennyTV <kennytv@t-online.de>
|
||||
Date: Mon, 20 Apr 2020 13:57:06 +0200
|
||||
Subject: [PATCH] PaperPR - PlayerItemCooldownEvent
|
||||
@@ -1,34 +1,26 @@
|
||||
From ba39fe270c169902970625051d27f30b23d54dc9 Mon Sep 17 00:00:00 2001
|
||||
From c61f071c2eb1be7789fc51fc08b363eacf5e0473 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Tue, 11 Feb 2020 21:56:48 -0600
|
||||
Subject: [PATCH] Implement EntityMoveEvent
|
||||
Subject: [PATCH] EntityMoveEvent
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/EntityLiving.java | 15 +++++++++++++++
|
||||
1 file changed, 15 insertions(+)
|
||||
.../java/net/minecraft/server/EntityLiving.java | 14 ++++++++++++++
|
||||
1 file changed, 14 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index 28e555d6e..387f74fe1 100644
|
||||
index 732a3f21d..f917cd5df 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -17,6 +17,7 @@ import java.util.Random;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import javax.annotation.Nullable;
|
||||
+import net.pl3x.purpur.event.entity.EntityMoveEvent; // Purpur
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -2648,6 +2649,20 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -2790,6 +2790,20 @@ public abstract class EntityLiving extends Entity {
|
||||
|
||||
this.collideNearby();
|
||||
this.world.getMethodProfiler().exit();
|
||||
+ // Purpur start
|
||||
+ if (EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0) {
|
||||
+ if (net.pl3x.purpur.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0) {
|
||||
+ if (lastX != locX() || lastY != locY() || lastZ != locZ() || lastYaw != yaw || lastPitch != pitch) {
|
||||
+ Location from = new Location(world.getWorld(), lastX, lastY, lastZ, lastYaw, lastPitch);
|
||||
+ Location to = new Location (world.getWorld(), locX(), locY(), locZ(), yaw, pitch);
|
||||
+ EntityMoveEvent event = new EntityMoveEvent(getBukkitLivingEntity(), from, to.clone());
|
||||
+ net.pl3x.purpur.event.entity.EntityMoveEvent event = new net.pl3x.purpur.event.entity.EntityMoveEvent(getBukkitLivingEntity(), from, to.clone());
|
||||
+ if (!event.callEvent()) {
|
||||
+ setLocation(from.getX(), from.getY(), from.getZ(), from.getYaw(), from.getPitch());
|
||||
+ } else if (!to.equals(event.getTo())) {
|
||||
@@ -37,9 +29,9 @@ index 28e555d6e..387f74fe1 100644
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
private void n() {
|
||||
if (!this.world.isClientSide && this.dN() && this.aC()) {
|
||||
this.damageEntity(DamageSource.DROWN, 1.0F);
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
From 2cafa9014b47d301c4f70ca2503bc8398c260a18 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 3 May 2019 23:53:16 -0500
|
||||
Subject: [PATCH] Fix cow rotation when shearing mooshroom
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityMushroomCow.java | 8 +++++++-
|
||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityMushroomCow.java b/src/main/java/net/minecraft/server/EntityMushroomCow.java
|
||||
index 53bc31287..bf835aaf9 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityMushroomCow.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityMushroomCow.java
|
||||
@@ -114,7 +114,13 @@ public class EntityMushroomCow extends EntityCow {
|
||||
|
||||
entitycow.setPositionRotation(this.locX(), this.locY(), this.locZ(), this.yaw, this.pitch);
|
||||
entitycow.setHealth(this.getHealth());
|
||||
- entitycow.aI = this.aI;
|
||||
+ // Purpur start - correctly copy rotation
|
||||
+ entitycow.copyPositionRotation(this);
|
||||
+ entitycow.setRenderYawOffset(this.getRenderYawOffset());
|
||||
+ entitycow.setHeadRotation(this.getHeadRotation());
|
||||
+ entitycow.lastYaw = this.lastYaw;
|
||||
+ entitycow.lastPitch = this.lastPitch;
|
||||
+ // Purpur end
|
||||
if (this.hasCustomName()) {
|
||||
entitycow.setCustomName(this.getCustomName());
|
||||
entitycow.setCustomNameVisible(this.getCustomNameVisible());
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 3e5f9a68fcae710e4090815afb8f635865e12f0b Mon Sep 17 00:00:00 2001
|
||||
From 0d8728d2c77181579b7efcc4ca6d588d45f1615a Mon Sep 17 00:00:00 2001
|
||||
From: Eearslya Sleiarion <eearslya@gmail.com>
|
||||
Date: Mon, 24 Jun 2019 21:27:32 -0700
|
||||
Subject: [PATCH] PaperPR - Add BellRingEvent
|
||||
@@ -8,19 +8,19 @@ Subject: [PATCH] PaperPR - Add BellRingEvent
|
||||
1 file changed, 13 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockBell.java b/src/main/java/net/minecraft/server/BlockBell.java
|
||||
index dbdbfb8ad..0bbd1e159 100644
|
||||
index 2ef899c76..7db4e22c6 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockBell.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockBell.java
|
||||
@@ -45,7 +45,7 @@ public class BlockBell extends BlockTileEntity {
|
||||
Entity entity1 = ((EntityArrow) entity).getShooter();
|
||||
EntityHuman entityhuman = entity1 instanceof EntityHuman ? (EntityHuman) entity1 : null;
|
||||
|
||||
- this.a(world, iblockdata, movingobjectpositionblock, entityhuman, true);
|
||||
+ this.handleBellRing(world, iblockdata, movingobjectpositionblock, entityhuman, true, entity); // Purpur
|
||||
}
|
||||
@@ -44,7 +44,7 @@ public class BlockBell extends BlockTileEntity {
|
||||
Entity entity = iprojectile.getShooter();
|
||||
EntityHuman entityhuman = entity instanceof EntityHuman ? (EntityHuman) entity : null;
|
||||
|
||||
- this.a(world, iblockdata, movingobjectpositionblock, entityhuman, true);
|
||||
+ this.handleBellRing(world, iblockdata, movingobjectpositionblock, entityhuman, true, entity); // Purpur
|
||||
}
|
||||
@@ -56,11 +56,23 @@ public class BlockBell extends BlockTileEntity {
|
||||
|
||||
@Override
|
||||
@@ -53,11 +53,23 @@ public class BlockBell extends BlockTileEntity {
|
||||
}
|
||||
|
||||
public boolean a(World world, IBlockData iblockdata, MovingObjectPositionBlock movingobjectpositionblock, @Nullable EntityHuman entityhuman, boolean flag) {
|
||||
@@ -37,7 +37,7 @@ index dbdbfb8ad..0bbd1e159 100644
|
||||
if (flag1) {
|
||||
+ // Purpur start - BellRingEvent
|
||||
+ org.bukkit.block.Block block = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
||||
+ if (!new com.destroystokyo.paper.event.block.BellRingEvent(block, (org.bukkit.entity.Entity) entity.getBukkitEntity()).callEvent()) {
|
||||
+ if (!new com.destroystokyo.paper.event.block.BellRingEvent(block, entity.getBukkitEntity()).callEvent()) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
@@ -1,52 +0,0 @@
|
||||
From 1807f5647ff8b32508f3af2d41c656d755f46f39 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 12 May 2019 01:14:46 -0500
|
||||
Subject: [PATCH] Pigs give saddle back
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityPig.java | 12 ++++++++++++
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
2 files changed, 14 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java
|
||||
index e6a7f8ef3..d78666dbb 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPig.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPig.java
|
||||
@@ -135,6 +135,18 @@ public class EntityPig extends EntityAnimal {
|
||||
return true;
|
||||
}
|
||||
if (hasSaddle() && !isVehicle()) {
|
||||
+ // Purpur start
|
||||
+ if (world.purpurConfig.pigGiveSaddleBack && entityhuman.isSneaking()) {
|
||||
+ setSaddle(false);
|
||||
+ if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
+ ItemStack saddle = new ItemStack(Items.SADDLE);
|
||||
+ if (!entityhuman.inventory.pickup(saddle)) {
|
||||
+ entityhuman.drop(saddle, false);
|
||||
+ }
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
entityhuman.startRiding(this);
|
||||
return true;
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 091f30727..85692500b 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -413,9 +413,11 @@ public class PurpurWorldConfig {
|
||||
|
||||
public boolean pigRidable = false;
|
||||
public boolean pigRidableInWater = false;
|
||||
+ public boolean pigGiveSaddleBack = false;
|
||||
private void pigSettings() {
|
||||
pigRidable = getBoolean("mobs.pig.ridable", pigRidable);
|
||||
pigRidableInWater = getBoolean("mobs.pig.ridable-in-water", pigRidableInWater);
|
||||
+ pigGiveSaddleBack = getBoolean("mobs.pig.give-saddle-back", pigGiveSaddleBack);
|
||||
}
|
||||
|
||||
public boolean pillagerRidable = false;
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
From 7c51cf494632ddcecb2ee18c559a9930f3b4a681 Mon Sep 17 00:00:00 2001
|
||||
From 475fd521ac59a8425121d35cf70eb47039c89dab Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 2 May 2020 20:55:44 -0500
|
||||
Subject: [PATCH] Player invulnerabilities
|
||||
|
||||
---
|
||||
.../net/minecraft/server/EntityPlayer.java | 22 +++++++++++++++++--
|
||||
.../net/minecraft/server/EntityPlayer.java | 21 +++++++++++++++++--
|
||||
.../minecraft/server/PlayerConnection.java | 1 +
|
||||
.../java/net/minecraft/server/PlayerList.java | 2 ++
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 4 ++++
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 7 +++++++
|
||||
.../craftbukkit/entity/CraftPlayer.java | 15 +++++++++++++
|
||||
5 files changed, 42 insertions(+), 2 deletions(-)
|
||||
5 files changed, 44 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
index 3e0e49dbb..e73b33721 100644
|
||||
index 6fbbe515c..c627ea053 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
@@ -137,6 +137,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
@@ -141,6 +141,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
this.canPickUpLoot = true;
|
||||
this.maxHealthCache = this.getMaxHealth();
|
||||
this.cachedSingleMobDistanceMap = new com.destroystokyo.paper.util.PooledHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper
|
||||
@@ -24,7 +24,7 @@ index 3e0e49dbb..e73b33721 100644
|
||||
}
|
||||
// Paper start
|
||||
public BlockPosition getPointInFront(double inFront) {
|
||||
@@ -748,6 +750,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
@@ -804,6 +806,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
|
||||
}
|
||||
|
||||
@@ -37,25 +37,24 @@ index 3e0e49dbb..e73b33721 100644
|
||||
@Override
|
||||
public boolean damageEntity(DamageSource damagesource, float f) {
|
||||
if (this.isInvulnerable(damagesource)) {
|
||||
@@ -755,7 +763,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
@@ -811,7 +819,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
} else {
|
||||
boolean flag = this.server.m() && this.canPvP() && "fall".equals(damagesource.translationIndex);
|
||||
boolean flag = this.server.j() && this.canPvP() && "fall".equals(damagesource.translationIndex);
|
||||
|
||||
- if (!flag && this.invulnerableTicks > 0 && damagesource != DamageSource.OUT_OF_WORLD) {
|
||||
+ if (!flag && isSpawnInvulnerable() && damagesource != DamageSource.OUT_OF_WORLD) { // Purpur
|
||||
return false;
|
||||
} else {
|
||||
if (damagesource instanceof EntityDamageSource) {
|
||||
@@ -1022,6 +1030,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
@@ -1057,6 +1065,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
PlayerChangedWorldEvent changeEvent = new PlayerChangedWorldEvent(this.getBukkitEntity(), worldserver.getWorld());
|
||||
this.world.getServer().getPluginManager().callEvent(changeEvent);
|
||||
// CraftBukkit end
|
||||
+
|
||||
+ this.invulnerableTicks = worldserver.purpurConfig.playerSpawnInvulnerableTicks; // Purpur
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -2010,9 +2020,17 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
@@ -2152,9 +2161,17 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
|
||||
@Override
|
||||
public boolean isFrozen() { // Paper - protected > public
|
||||
@@ -75,10 +74,10 @@ index 3e0e49dbb..e73b33721 100644
|
||||
public Scoreboard getScoreboard() {
|
||||
return getBukkitEntity().getScoreboard().getHandle();
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index 82faee937..86715ff3c 100644
|
||||
index 48a03c44f..85016aa76 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -1548,6 +1548,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
@@ -1563,6 +1563,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinresourcepackstatus, this, this.player.getWorldServer());
|
||||
// Paper start
|
||||
PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packetplayinresourcepackstatus.status.ordinal()];
|
||||
@@ -87,10 +86,10 @@ index 82faee937..86715ff3c 100644
|
||||
this.server.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(getPlayer(), packStatus));
|
||||
// Paper end
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
index af2cdbf4d..5cacea602 100644
|
||||
index 3c5ba8f2f..5807e77da 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
@@ -828,6 +828,8 @@ public abstract class PlayerList {
|
||||
@@ -869,6 +869,8 @@ public abstract class PlayerList {
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@@ -100,32 +99,26 @@ index af2cdbf4d..5cacea602 100644
|
||||
return entityplayer1;
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index efdc176e6..81969d2dc 100644
|
||||
index 5fa333037..bd9b82dad 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -209,6 +209,8 @@ public class PurpurWorldConfig {
|
||||
public boolean milkCuresBadOmen = true;
|
||||
public String playerDeathExpDropEquation = "expLevel * 7";
|
||||
public int playerDeathExpDropMax = 100;
|
||||
@@ -75,4 +75,11 @@ public class PurpurWorldConfig {
|
||||
idleTimeoutCountAsSleeping = getBoolean("gameplay-mechanics.player.idle-timeout.count-as-sleeping", idleTimeoutCountAsSleeping);
|
||||
idleTimeoutUpdateTabList = getBoolean("gameplay-mechanics.player.idle-timeout.update-tab-list", idleTimeoutUpdateTabList);
|
||||
}
|
||||
+
|
||||
+ public int playerSpawnInvulnerableTicks = 60;
|
||||
+ public boolean playerInvulnerableWhileAcceptingResourcePack = false;
|
||||
public boolean playerSleepOnlyWithCondition = false;
|
||||
public String playerSleepCondition = "time >= 12541 && time <= 23458";
|
||||
public boolean useBetterMending = false;
|
||||
@@ -254,6 +256,8 @@ public class PurpurWorldConfig {
|
||||
milkCuresBadOmen = getBoolean("gameplay-mechanics.milk-cures-bad-omen", milkCuresBadOmen);
|
||||
playerDeathExpDropEquation = getString("gameplay-mechanics.player.exp-dropped-on-death.equation", playerDeathExpDropEquation);
|
||||
playerDeathExpDropMax = getInt("gameplay-mechanics.player.exp-dropped-on-death.maximum", playerDeathExpDropMax);
|
||||
+ private void playerInvulnerabilities() {
|
||||
+ playerSpawnInvulnerableTicks = getInt("gameplay-mechanics.player.spawn-invulnerable-ticks", playerSpawnInvulnerableTicks);
|
||||
+ playerInvulnerableWhileAcceptingResourcePack = getBoolean("gameplay-mechanics.player.invulnerable-while-accepting-resource-pack", playerInvulnerableWhileAcceptingResourcePack);
|
||||
playerSleepOnlyWithCondition = getBoolean("gameplay-mechanics.player.sleep.only-with-condition", playerSleepOnlyWithCondition);
|
||||
playerSleepCondition = getString("gameplay-mechanics.player.sleep.condition", playerSleepCondition);
|
||||
useBetterMending = getBoolean("gameplay-mechanics.use-better-mending", useBetterMending);
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index e15c12387..137699c3e 100644
|
||||
index 3bd2ffc20..9b1c4d932 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -2102,5 +2102,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -2144,5 +2144,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
public void resetIdleTimer() {
|
||||
getHandle().resetIdleTimer();
|
||||
}
|
||||
@@ -1,53 +1,45 @@
|
||||
From aff14f5361f3b98c2bf66fa61d766e1db14af17e Mon Sep 17 00:00:00 2001
|
||||
From 44cafc5974e016c61841d8fd29e480e8605416b0 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sun, 19 Apr 2020 00:17:56 -0500
|
||||
Subject: [PATCH] More anvil controls
|
||||
Subject: [PATCH] Anvil API
|
||||
|
||||
---
|
||||
.../net/minecraft/server/ContainerAnvil.java | 31 +++++++++++++++++--
|
||||
.../inventory/CraftInventoryAnvil.java | 24 +++++++++++++-
|
||||
2 files changed, 51 insertions(+), 4 deletions(-)
|
||||
.../net/minecraft/server/ContainerAnvil.java | 29 +++++++++++++++++--
|
||||
.../inventory/CraftInventoryAnvil.java | 24 ++++++++++++++-
|
||||
2 files changed, 49 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ContainerAnvil.java b/src/main/java/net/minecraft/server/ContainerAnvil.java
|
||||
index 286b930dd..d418c0441 100644
|
||||
index 24631b2bc..126effe5b 100644
|
||||
--- a/src/main/java/net/minecraft/server/ContainerAnvil.java
|
||||
+++ b/src/main/java/net/minecraft/server/ContainerAnvil.java
|
||||
@@ -8,6 +8,7 @@ import org.apache.logging.log4j.Logger;
|
||||
|
||||
// CraftBukkit start
|
||||
import org.bukkit.craftbukkit.inventory.CraftInventoryView;
|
||||
+import org.bukkit.inventory.AnvilInventory;
|
||||
// CraftBukkit end
|
||||
|
||||
public class ContainerAnvil extends Container {
|
||||
@@ -25,6 +26,8 @@ public class ContainerAnvil extends Container {
|
||||
private int lastLevelCost;
|
||||
@@ -20,6 +20,8 @@ public class ContainerAnvil extends ContainerAnvilAbstract {
|
||||
public int maximumRepairCost = 40;
|
||||
private CraftInventoryView bukkitEntity;
|
||||
private PlayerInventory playerInventory;
|
||||
// CraftBukkit end
|
||||
+ public boolean bypassCost = false; // Purpur
|
||||
+ public boolean canDoUnsafeEnchants = false; // Purpur
|
||||
// CraftBukkit end
|
||||
|
||||
public ContainerAnvil(int i, PlayerInventory playerinventory) {
|
||||
@@ -56,12 +59,14 @@ public class ContainerAnvil extends Container {
|
||||
this(i, playerinventory, ContainerAccess.a);
|
||||
@@ -38,12 +40,14 @@ public class ContainerAnvil extends ContainerAnvilAbstract {
|
||||
|
||||
@Override
|
||||
public boolean isAllowed(EntityHuman entityhuman) {
|
||||
- return (entityhuman.abilities.canInstantlyBuild || entityhuman.expLevel >= ContainerAnvil.this.levelCost.get()) && ContainerAnvil.this.levelCost.get() > 0 && this.hasItem();
|
||||
+ return (entityhuman.abilities.canInstantlyBuild || entityhuman.expLevel >= ContainerAnvil.this.levelCost.get()) && (bypassCost || ContainerAnvil.this.levelCost.get() > 0) && this.hasItem(); // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack a(EntityHuman entityhuman, ItemStack itemstack) {
|
||||
+ if (net.pl3x.purpur.event.inventory.AnvilTakeResultEvent.getHandlerList().getRegisteredListeners().length > 0) new net.pl3x.purpur.event.inventory.AnvilTakeResultEvent(entityhuman.getBukkitEntity(), getBukkitView(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack)).callEvent(); // Purpur
|
||||
if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
+ if (bypassCost) ((EntityPlayer) entityhuman).lastSentExp = -1; else // Purpur
|
||||
entityhuman.levelDown(-ContainerAnvil.this.levelCost.get());
|
||||
}
|
||||
|
||||
@@ -136,6 +141,12 @@ public class ContainerAnvil extends Container {
|
||||
@Override
|
||||
protected boolean b(EntityHuman entityhuman, boolean flag) {
|
||||
- return (entityhuman.abilities.canInstantlyBuild || entityhuman.expLevel >= this.levelCost.get()) && this.levelCost.get() > 0;
|
||||
+ return (entityhuman.abilities.canInstantlyBuild || entityhuman.expLevel >= this.levelCost.get()) && (bypassCost || this.levelCost.get() > 0); // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ItemStack a(EntityHuman entityhuman, ItemStack itemstack) {
|
||||
+ if (net.pl3x.purpur.event.inventory.AnvilTakeResultEvent.getHandlerList().getRegisteredListeners().length > 0) new net.pl3x.purpur.event.inventory.AnvilTakeResultEvent(entityhuman.getBukkitEntity(), getBukkitView(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack)).callEvent(); // Purpur
|
||||
if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
+ if (bypassCost) ((EntityPlayer) entityhuman).lastSentExp = -1; else // Purpur
|
||||
entityhuman.levelDown(-this.levelCost.get());
|
||||
}
|
||||
|
||||
@@ -94,6 +98,12 @@ public class ContainerAnvil extends ContainerAnvilAbstract {
|
||||
|
||||
@Override
|
||||
public void e() {
|
||||
+ // Purpur start
|
||||
+ bypassCost = false;
|
||||
@@ -58,7 +50,7 @@ index 286b930dd..d418c0441 100644
|
||||
ItemStack itemstack = this.repairInventory.getItem(0);
|
||||
|
||||
this.levelCost.set(1);
|
||||
@@ -212,7 +223,7 @@ public class ContainerAnvil extends Container {
|
||||
@@ -170,7 +180,7 @@ public class ContainerAnvil extends ContainerAnvilAbstract {
|
||||
int i2 = (Integer) map1.get(enchantment);
|
||||
|
||||
i2 = l1 == i2 ? i2 + 1 : Math.max(i2, l1);
|
||||
@@ -67,7 +59,7 @@ index 286b930dd..d418c0441 100644
|
||||
|
||||
if (this.player.abilities.canInstantlyBuild || itemstack.getItem() == Items.ENCHANTED_BOOK) {
|
||||
flag3 = true;
|
||||
@@ -224,7 +235,7 @@ public class ContainerAnvil extends Container {
|
||||
@@ -182,7 +192,7 @@ public class ContainerAnvil extends ContainerAnvilAbstract {
|
||||
Enchantment enchantment1 = (Enchantment) iterator1.next();
|
||||
|
||||
if (enchantment1 != enchantment && !enchantment.isCompatible(enchantment1)) {
|
||||
@@ -76,7 +68,7 @@ index 286b930dd..d418c0441 100644
|
||||
++i;
|
||||
}
|
||||
}
|
||||
@@ -295,6 +306,13 @@ public class ContainerAnvil extends Container {
|
||||
@@ -253,6 +263,13 @@ public class ContainerAnvil extends ContainerAnvilAbstract {
|
||||
this.levelCost.set(maximumRepairCost - 1); // CraftBukkit
|
||||
}
|
||||
|
||||
@@ -88,9 +80,9 @@ index 286b930dd..d418c0441 100644
|
||||
+ // Purpur end
|
||||
+
|
||||
if (this.levelCost.get() >= maximumRepairCost && !this.player.abilities.canInstantlyBuild) { // CraftBukkit
|
||||
itemstack1 = ItemStack.a;
|
||||
itemstack1 = ItemStack.b;
|
||||
}
|
||||
@@ -316,6 +334,12 @@ public class ContainerAnvil extends Container {
|
||||
@@ -274,6 +291,12 @@ public class ContainerAnvil extends ContainerAnvilAbstract {
|
||||
|
||||
org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), itemstack1); // CraftBukkit
|
||||
this.c();
|
||||
@@ -103,14 +95,6 @@ index 286b930dd..d418c0441 100644
|
||||
}
|
||||
}
|
||||
|
||||
@@ -349,6 +373,7 @@ public class ContainerAnvil extends Container {
|
||||
|
||||
itemstack = itemstack1.cloneItemStack();
|
||||
if (i == 2) {
|
||||
+ if (net.pl3x.purpur.event.inventory.AnvilTakeResultEvent.getHandlerList().getRegisteredListeners().length > 0) new net.pl3x.purpur.event.inventory.AnvilTakeResultEvent(entityhuman.getBukkitEntity(), getBukkitView(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack)).callEvent(); // Purpur
|
||||
if (!this.a(itemstack1, 3, 39, true)) {
|
||||
return ItemStack.a;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java
|
||||
index 9374c2706..d45f356be 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java
|
||||
@@ -1,63 +1,60 @@
|
||||
From d24813dc8ea3cdfc744c0cf5c9a0e50e6e0ca301 Mon Sep 17 00:00:00 2001
|
||||
From c748533f4bbafc0c16603882168e2cbf46960287 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Tue, 23 Jul 2019 08:28:21 -0500
|
||||
Subject: [PATCH] Implement configurable villager brain ticks
|
||||
Subject: [PATCH] Configurable villager brain ticks
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityVillager.java | 6 ++++++
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 4 ++++
|
||||
2 files changed, 10 insertions(+)
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 7 +++++++
|
||||
2 files changed, 13 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java
|
||||
index 5b0de0d9d..843f22260 100644
|
||||
index bf019043a..7925c8991 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityVillager.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityVillager.java
|
||||
@@ -53,6 +53,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
@@ -58,6 +58,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
}, MemoryModuleType.MEETING_POINT, (entityvillager, villageplacetype) -> {
|
||||
return villageplacetype == VillagePlaceType.r;
|
||||
return villageplacetype == VillagePlaceType.s;
|
||||
});
|
||||
+ private final int brainTickOffset; // Purpur
|
||||
|
||||
public EntityVillager(EntityTypes<? extends EntityVillager> entitytypes, World world) {
|
||||
this(entitytypes, world, VillagerType.PLAINS);
|
||||
@@ -66,6 +67,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
@@ -70,6 +71,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
this.getNavigation().d(true);
|
||||
this.setCanPickupLoot(true);
|
||||
this.setVillagerData(this.getVillagerData().withType(villagertype).withProfession(VillagerProfession.NONE));
|
||||
this.bo = this.a(new Dynamic(DynamicOpsNBT.a, new NBTTagCompound()));
|
||||
+ brainTickOffset = getRandom().nextInt(100); // Purpur
|
||||
+ this.brainTickOffset = getRandom().nextInt(100); // Purpur
|
||||
}
|
||||
|
||||
// Purpur start
|
||||
@@ -180,6 +182,10 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
@Override
|
||||
@@ -166,6 +168,10 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
protected void mobTick() { mobTick(false); }
|
||||
protected void mobTick(boolean inactive) {
|
||||
// Paper end
|
||||
this.world.getMethodProfiler().enter("brain");
|
||||
this.world.getMethodProfiler().enter("villagerBrain");
|
||||
+ // Purpur start
|
||||
+ boolean tick = (world.getTime() + brainTickOffset) % world.purpurConfig.villagerBrainTicks == 0;
|
||||
+ if (((WorldServer) world).getMinecraftServer().lagging ? tick : world.purpurConfig.villagerUseBrainTicksOnlyWhenLagging || tick)
|
||||
+ // Purpur end
|
||||
if (!inactive) this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error // Paper
|
||||
this.world.getMethodProfiler().exit();
|
||||
if (!this.et() && this.bB > 0) {
|
||||
if (this.bM) {
|
||||
this.bM = false;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 9c60855d6..f1ed653b3 100644
|
||||
index bd9b82dad..8f8e61442 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -737,10 +737,14 @@ public class PurpurWorldConfig {
|
||||
public boolean villagerRidable = false;
|
||||
public boolean villagerRidableInWater = false;
|
||||
public boolean villagerRequireShiftToMount = true;
|
||||
@@ -82,4 +82,11 @@ public class PurpurWorldConfig {
|
||||
playerSpawnInvulnerableTicks = getInt("gameplay-mechanics.player.spawn-invulnerable-ticks", playerSpawnInvulnerableTicks);
|
||||
playerInvulnerableWhileAcceptingResourcePack = getBoolean("gameplay-mechanics.player.invulnerable-while-accepting-resource-pack", playerInvulnerableWhileAcceptingResourcePack);
|
||||
}
|
||||
+
|
||||
+ public int villagerBrainTicks = 1;
|
||||
+ public boolean villagerUseBrainTicksOnlyWhenLagging = true;
|
||||
private void villagerSettings() {
|
||||
villagerRidable = getBoolean("mobs.villager.ridable", villagerRidable);
|
||||
villagerRidableInWater = getBoolean("mobs.villager.ridable-in-water", villagerRidableInWater);
|
||||
villagerRequireShiftToMount = getBoolean("mobs.villager.require-shift-to-mount", villagerRequireShiftToMount);
|
||||
+ private void villagerSettings() {
|
||||
+ villagerBrainTicks = getInt("mobs.villager.brain-ticks", villagerBrainTicks);
|
||||
+ villagerUseBrainTicksOnlyWhenLagging = getBoolean("mobs.villager.use-brain-ticks-only-when-lagging", villagerUseBrainTicksOnlyWhenLagging);
|
||||
}
|
||||
|
||||
public boolean villagerTraderRidable = false;
|
||||
+ }
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
From 6e1fb8864c1acffb17aa73a8d86d2090c574f2b1 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Fri, 7 Feb 2020 04:42:57 -0600
|
||||
Subject: [PATCH] Ender dragon always drop egg
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EnderDragonBattle.java | 5 +++--
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
2 files changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EnderDragonBattle.java b/src/main/java/net/minecraft/server/EnderDragonBattle.java
|
||||
index 687efa022..ead334607 100644
|
||||
--- a/src/main/java/net/minecraft/server/EnderDragonBattle.java
|
||||
+++ b/src/main/java/net/minecraft/server/EnderDragonBattle.java
|
||||
@@ -21,7 +21,7 @@ public class EnderDragonBattle {
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
private static final Predicate<Entity> b = IEntitySelector.a.and(IEntitySelector.a(0.0D, 128.0D, 0.0D, 192.0D));
|
||||
public final BossBattleServer bossBattle;
|
||||
- public final WorldServer d; // CraftBukkit PAIL private -> public, rename world
|
||||
+ public final WorldServer d; public WorldServer getWorld() { return d; } // Purpur - OBFHELPER
|
||||
private final List<Integer> e;
|
||||
private final ShapeDetector f;
|
||||
private int g;
|
||||
@@ -358,7 +358,7 @@ public class EnderDragonBattle {
|
||||
this.bossBattle.setVisible(false);
|
||||
this.a(true);
|
||||
this.n();
|
||||
- if (!this.l) {
|
||||
+ if (getWorld().purpurConfig.enderDragonAlwaysDropsEggBlock || !wasPreviouslyKilled()) { // Purpur - always place dragon egg
|
||||
this.d.setTypeUpdate(this.d.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING, WorldGenEndTrophy.a), Blocks.DRAGON_EGG.getBlockData());
|
||||
}
|
||||
|
||||
@@ -439,6 +439,7 @@ public class EnderDragonBattle {
|
||||
|
||||
}
|
||||
|
||||
+ public boolean wasPreviouslyKilled() { return d(); } // Purpur - OBFHELPER;
|
||||
public boolean d() {
|
||||
return this.l;
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 56b67c408..cc6f8563b 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -206,11 +206,13 @@ public class PurpurWorldConfig {
|
||||
public boolean enderDragonRidableInWater = false;
|
||||
public boolean enderDragonRequireShiftToMount = true;
|
||||
public double enderDragonMaxY = 256D;
|
||||
+ public boolean enderDragonAlwaysDropsEggBlock = false;
|
||||
private void enderDragonSettings() {
|
||||
enderDragonRidable = getBoolean("mobs.ender_dragon.ridable", enderDragonRidable);
|
||||
enderDragonRidableInWater = getBoolean("mobs.ender_dragon.ridable-in-water", enderDragonRidableInWater);
|
||||
enderDragonRequireShiftToMount = getBoolean("mobs.ender_dragon.require-shift-to-mount", enderDragonRequireShiftToMount);
|
||||
enderDragonMaxY = getDouble("mobs.ender_dragon.ridable-max-y", enderDragonMaxY);
|
||||
+ enderDragonAlwaysDropsEggBlock = getBoolean("mobs.ender_dragon.always-drop-egg-block", enderDragonAlwaysDropsEggBlock);
|
||||
}
|
||||
|
||||
public boolean endermanRidable = false;
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
From ac25e2c7e75e91a4b246439af0fe5d213b369c34 Mon Sep 17 00:00:00 2001
|
||||
From 753e40b5abc1fde5f33910bd9b5a77898f44ea0d Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 11 Oct 2019 00:17:39 -0500
|
||||
Subject: [PATCH] Alternative Keepalive Handling
|
||||
|
||||
---
|
||||
.../server/PacketPlayInKeepAlive.java | 1 +
|
||||
.../minecraft/server/PlayerConnection.java | 27 +++++++++++++++++++
|
||||
.../minecraft/server/PlayerConnection.java | 26 +++++++++++++++++++
|
||||
.../java/net/pl3x/purpur/PurpurConfig.java | 5 ++++
|
||||
3 files changed, 33 insertions(+)
|
||||
3 files changed, 32 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketPlayInKeepAlive.java b/src/main/java/net/minecraft/server/PacketPlayInKeepAlive.java
|
||||
index 8e93f1540..470f92c4f 100644
|
||||
@@ -22,7 +22,7 @@ index 8e93f1540..470f92c4f 100644
|
||||
return this.a;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index 148beb1b6..82faee937 100644
|
||||
index 85016aa76..d2d96eacc 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -75,6 +75,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
@@ -55,13 +55,12 @@ index 148beb1b6..82faee937 100644
|
||||
if (this.isPendingPing()) {
|
||||
if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected
|
||||
PlayerConnection.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getName()); // more info
|
||||
@@ -2683,6 +2699,17 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
@@ -2704,6 +2720,16 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
|
||||
@Override
|
||||
public void a(PacketPlayInKeepAlive packetplayinkeepalive) {
|
||||
+ // Purpur start
|
||||
+ if (net.pl3x.purpur.PurpurConfig.useAlternateKeepAlive) {
|
||||
+ PlayerConnectionUtils.ensureMainThread(packetplayinkeepalive, this, player.getWorldServer()); // This SHOULD be on the main thread...
|
||||
+ long id = packetplayinkeepalive.getId();
|
||||
+ if (keepAlives.size() > 0 && keepAlives.contains(id)) {
|
||||
+ int ping = (int) (SystemUtils.getMonotonicMillis() - id);
|
||||
@@ -74,10 +73,10 @@ index 148beb1b6..82faee937 100644
|
||||
if (this.awaitingKeepAlive && packetplayinkeepalive.b() == this.h) {
|
||||
int i = (int) (SystemUtils.getMonotonicMillis() - this.lastKeepAlive);
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 72ad9dce7..ed2a31277 100644
|
||||
index d8b826f6b..571917ffa 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -144,6 +144,11 @@ public class PurpurConfig {
|
||||
@@ -152,6 +152,11 @@ public class PurpurConfig {
|
||||
laggingThreshold = getDouble("settings.lagging-threshold", laggingThreshold);
|
||||
}
|
||||
|
||||
@@ -86,9 +85,9 @@ index 72ad9dce7..ed2a31277 100644
|
||||
+ useAlternateKeepAlive = getBoolean("settings.use-alternate-keepalive", useAlternateKeepAlive);
|
||||
+ }
|
||||
+
|
||||
public static boolean dontSendUselessEntityPackets = false;
|
||||
private static void dontSendUselessEntityPackets() {
|
||||
dontSendUselessEntityPackets = getBoolean("settings.dont-send-useless-entity-packets", dontSendUselessEntityPackets);
|
||||
public static boolean barrelSixRows = false;
|
||||
public static boolean enderChestSixRows = false;
|
||||
public static boolean enderChestPermissionRows = false;
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
From bc8027e2ac0110d889bc31b125cbff05b13b7e70 Mon Sep 17 00:00:00 2001
|
||||
From 836c6dcd9b9cb396daeec8ddd59834f431bf1275 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 9 May 2019 14:27:37 -0500
|
||||
Subject: [PATCH] Silk touch spawners
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/Block.java | 1 +
|
||||
.../net/minecraft/server/BlockMobSpawner.java | 34 +++++++++++++++++++
|
||||
.../net/minecraft/server/EntityTypes.java | 12 +++++++
|
||||
3 files changed, 47 insertions(+)
|
||||
.../net/minecraft/server/BlockMobSpawner.java | 35 +++++++++++++++++++
|
||||
.../net/minecraft/server/ItemSpawner.java | 23 ++++++++++++
|
||||
src/main/java/net/minecraft/server/Items.java | 2 +-
|
||||
4 files changed, 60 insertions(+), 1 deletion(-)
|
||||
create mode 100644 src/main/java/net/minecraft/server/ItemSpawner.java
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
|
||||
index 66244a9d0..9c7faa2bd 100644
|
||||
index 81725611d..c7232047c 100644
|
||||
--- a/src/main/java/net/minecraft/server/Block.java
|
||||
+++ b/src/main/java/net/minecraft/server/Block.java
|
||||
@@ -502,6 +502,7 @@ public class Block implements IMaterial {
|
||||
@@ -226,6 +226,7 @@ public class Block extends BlockBase implements IMaterial {
|
||||
iblockdata.dropNaturally(world, blockposition, itemstack);
|
||||
}
|
||||
|
||||
@@ -22,7 +24,7 @@ index 66244a9d0..9c7faa2bd 100644
|
||||
if (!world.isClientSide && !itemstack.isEmpty() && world.getGameRules().getBoolean(GameRules.DO_TILE_DROPS)) {
|
||||
float f = 0.5F;
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockMobSpawner.java b/src/main/java/net/minecraft/server/BlockMobSpawner.java
|
||||
index 5296fdf16..69d04f6cb 100644
|
||||
index 16f9fb8e5..cf059e982 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockMobSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockMobSpawner.java
|
||||
@@ -11,6 +11,40 @@ public class BlockMobSpawner extends BlockTileEntity {
|
||||
@@ -66,47 +68,56 @@ index 5296fdf16..69d04f6cb 100644
|
||||
@Override
|
||||
public void dropNaturally(IBlockData iblockdata, World world, BlockPosition blockposition, ItemStack itemstack) {
|
||||
super.dropNaturally(iblockdata, world, blockposition, itemstack);
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java
|
||||
index 5a7494947..8e8d392a1 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityTypes.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityTypes.java
|
||||
@@ -136,10 +136,17 @@ public class EntityTypes<T extends Entity> {
|
||||
return (EntityTypes) IRegistry.a((IRegistry) IRegistry.ENTITY_TYPE, s, (Object) entitytypes_a.a(s));
|
||||
}
|
||||
@@ -23,6 +57,7 @@ public class BlockMobSpawner extends BlockTileEntity {
|
||||
|
||||
+ // Purpur start
|
||||
+ public static EntityTypes getFromKey(MinecraftKey key) {
|
||||
+ return IRegistry.ENTITY_TYPE.get(key);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
@Override
|
||||
public int getExpDrop(IBlockData iblockdata, World world, BlockPosition blockposition, ItemStack itemstack) {
|
||||
+ if (isSilkTouch(itemstack)) return 0; // Purpur
|
||||
int i = 15 + world.random.nextInt(15) + world.random.nextInt(15);
|
||||
|
||||
return i;
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemSpawner.java b/src/main/java/net/minecraft/server/ItemSpawner.java
|
||||
new file mode 100644
|
||||
index 000000000..7dc68ffe9
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/minecraft/server/ItemSpawner.java
|
||||
@@ -0,0 +1,23 @@
|
||||
+package net.minecraft.server;
|
||||
+
|
||||
public static MinecraftKey getName(EntityTypes<?> entitytypes) {
|
||||
return IRegistry.ENTITY_TYPE.getKey(entitytypes);
|
||||
}
|
||||
|
||||
+ public static Optional<EntityTypes<?>> getType(String name) { return a(name); } // Purpur - OBFHELPER
|
||||
public static Optional<EntityTypes<?>> a(String s) {
|
||||
return IRegistry.ENTITY_TYPE.getOptional(MinecraftKey.a(s));
|
||||
}
|
||||
@@ -263,6 +270,10 @@ public class EntityTypes<T extends Entity> {
|
||||
public String getName() {
|
||||
return IRegistry.ENTITY_TYPE.getKey(this).getKey();
|
||||
}
|
||||
+
|
||||
+ public String getTranslatedName() {
|
||||
+ return getNameComponent().getString();
|
||||
+public class ItemSpawner extends ItemBlock {
|
||||
+ public ItemSpawner(Block block, Info info) {
|
||||
+ super(block, info);
|
||||
+ }
|
||||
// Purpur end
|
||||
|
||||
public String f() {
|
||||
@@ -273,6 +284,7 @@ public class EntityTypes<T extends Entity> {
|
||||
return this.bg;
|
||||
}
|
||||
|
||||
+ public IChatBaseComponent getNameComponent() { return g(); } // Purpur - OBFHELPER
|
||||
public IChatBaseComponent g() {
|
||||
if (this.bh == null) {
|
||||
this.bh = new ChatMessage(this.f(), new Object[0]);
|
||||
+
|
||||
+ @Override
|
||||
+ protected boolean a(BlockPosition blockposition, World world, EntityHuman entityhuman, ItemStack itemstack, IBlockData iblockdata) {
|
||||
+ boolean handled = super.a(blockposition, world, entityhuman, itemstack, iblockdata);
|
||||
+ if (entityhuman.getBukkitEntity().hasPermission("purpur.place.spawners")) {
|
||||
+ TileEntity spawner = world.getTileEntity(blockposition);
|
||||
+ if (spawner instanceof TileEntityMobSpawner && itemstack.hasTag()) {
|
||||
+ NBTTagCompound tag = itemstack.getTag();
|
||||
+ if (tag.hasKey("Purpur.mob_type")) {
|
||||
+ EntityTypes.getType(tag.getString("Purpur.mob_type")).ifPresent(type ->
|
||||
+ ((TileEntityMobSpawner) spawner).getSpawner().setMobName(type));
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ return handled;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/Items.java b/src/main/java/net/minecraft/server/Items.java
|
||||
index 89a9eec99..619c40b27 100644
|
||||
--- a/src/main/java/net/minecraft/server/Items.java
|
||||
+++ b/src/main/java/net/minecraft/server/Items.java
|
||||
@@ -180,7 +180,7 @@ public class Items {
|
||||
public static final Item ct = a(Blocks.PURPUR_BLOCK, CreativeModeTab.b);
|
||||
public static final Item cu = a(Blocks.PURPUR_PILLAR, CreativeModeTab.b);
|
||||
public static final Item cv = a(Blocks.PURPUR_STAIRS, CreativeModeTab.b);
|
||||
- public static final Item cw = a(Blocks.SPAWNER);
|
||||
+ public static final Item cw = a(Blocks.SPAWNER, new ItemSpawner(Blocks.SPAWNER, new Item.Info().a(EnumItemRarity.EPIC))); // Purpur
|
||||
public static final Item cx = a(Blocks.OAK_STAIRS, CreativeModeTab.b);
|
||||
public static final Item cy = a(Blocks.CHEST, CreativeModeTab.c);
|
||||
public static final Item cz = a(Blocks.DIAMOND_ORE, CreativeModeTab.b);
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From b9d6a9418690fed6b75e7f4ca46dcc7a9fa94200 Mon Sep 17 00:00:00 2001
|
||||
From 6bfbeb52d059e6241fbd31cb1c909fc4f4cd4e98 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Fri, 21 Feb 2020 17:04:51 -0600
|
||||
Subject: [PATCH] MC-125757 Fix - Always increment arrow despawn counter
|
||||
@@ -8,33 +8,30 @@ Subject: [PATCH] MC-125757 Fix - Always increment arrow despawn counter
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java
|
||||
index ae44f878f..4ab857853 100644
|
||||
index 6195a45e3..8ee76ca4b 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityArrow.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityArrow.java
|
||||
@@ -154,6 +154,8 @@ public abstract class EntityArrow extends Entity implements IProjectile {
|
||||
@@ -124,11 +124,13 @@ public abstract class EntityArrow extends IProjectile {
|
||||
this.extinguish();
|
||||
}
|
||||
|
||||
+ this.checkDespawnCounter(); // Purpur - moved from below - MC-125757
|
||||
+
|
||||
if (this.inGround && !flag) {
|
||||
if (this.aq != iblockdata && this.world.a(this.getBoundingBox().g(0.06D))) {
|
||||
this.inGround = false;
|
||||
@@ -161,7 +163,7 @@ public abstract class EntityArrow extends Entity implements IProjectile {
|
||||
this.despawnCounter = 0;
|
||||
this.as = 0;
|
||||
if (this.an != iblockdata && this.u()) {
|
||||
this.z();
|
||||
} else if (!this.world.isClientSide) {
|
||||
- this.i();
|
||||
+ // this.i(); // Purpur moved up - MC-125757
|
||||
- this.h();
|
||||
+ // this.h(); // Purpur - moved up MC-125757
|
||||
}
|
||||
|
||||
++this.d;
|
||||
@@ -282,6 +284,7 @@ public abstract class EntityArrow extends Entity implements IProjectile {
|
||||
}
|
||||
++this.c;
|
||||
@@ -254,6 +256,7 @@ public abstract class EntityArrow extends IProjectile {
|
||||
|
||||
}
|
||||
|
||||
+ protected void checkDespawnCounter() { i(); } // Purpur - OBFHELPER
|
||||
protected void i() {
|
||||
protected void h() {
|
||||
++this.despawnCounter;
|
||||
if (this.despawnCounter >= (fromPlayer == PickupStatus.CREATIVE_ONLY ? world.paperConfig.creativeArrowDespawnRate : (fromPlayer == PickupStatus.DISALLOWED ? world.paperConfig.nonPlayerArrowDespawnRate : ((this instanceof EntityThrownTrident) ? world.spigotConfig.tridentDespawnRate : world.spigotConfig.arrowDespawnRate)))) { // Spigot // Paper - TODO: Extract this to init?
|
||||
--
|
||||
@@ -1,4 +1,4 @@
|
||||
From c127ee26dc42f88155087b8dcdf7b61c067088ec Mon Sep 17 00:00:00 2001
|
||||
From 3cdc8d59eb0d60369650ba50ff81fb65b9f5ecc3 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 6 Jun 2019 22:15:46 -0500
|
||||
Subject: [PATCH] MC-168772 Fix - Add turtle egg block options
|
||||
@@ -9,14 +9,14 @@ Subject: [PATCH] MC-168772 Fix - Add turtle egg block options
|
||||
2 files changed, 27 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockTurtleEgg.java b/src/main/java/net/minecraft/server/BlockTurtleEgg.java
|
||||
index cb36334e4..aa83ef169 100644
|
||||
index 553c8affa..92cca6c44 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockTurtleEgg.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockTurtleEgg.java
|
||||
@@ -157,6 +157,23 @@ public class BlockTurtleEgg extends Block {
|
||||
@@ -163,6 +163,23 @@ public class BlockTurtleEgg extends Block {
|
||||
}
|
||||
|
||||
private boolean a(World world, Entity entity) {
|
||||
- return entity instanceof EntityTurtle ? false : (entity instanceof EntityLiving && !(entity instanceof EntityHuman) ? world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) : true);
|
||||
- return !(entity instanceof EntityTurtle) && !(entity instanceof EntityBat) ? (!(entity instanceof EntityLiving) ? false : entity instanceof EntityHuman || world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) : false;
|
||||
+ // Purpur start - fix MC-168772
|
||||
+ if (entity instanceof EntityTurtle) {
|
||||
+ return false;
|
||||
@@ -38,11 +38,11 @@ index cb36334e4..aa83ef169 100644
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 81969d2dc..296274896 100644
|
||||
index 8f8e61442..3367cfd47 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -191,6 +191,15 @@ public class PurpurWorldConfig {
|
||||
signRightClickEdit = getBoolean("blocks.sign.right-click-edit", signRightClickEdit);
|
||||
@@ -83,6 +83,15 @@ public class PurpurWorldConfig {
|
||||
playerInvulnerableWhileAcceptingResourcePack = getBoolean("gameplay-mechanics.player.invulnerable-while-accepting-resource-pack", playerInvulnerableWhileAcceptingResourcePack);
|
||||
}
|
||||
|
||||
+ public boolean turtleEggsBreakFromExpOrbs = true;
|
||||
@@ -54,9 +54,9 @@ index 81969d2dc..296274896 100644
|
||||
+ turtleEggsBreakFromMinecarts = getBoolean("blocks.turtle_egg.break-from-minecarts", turtleEggsBreakFromMinecarts);
|
||||
+ }
|
||||
+
|
||||
public boolean boatEjectPlayersOnLand = false;
|
||||
public float armorstandStepHeight = 0.0F;
|
||||
public boolean controllableMinecarts = false;
|
||||
public int villagerBrainTicks = 1;
|
||||
public boolean villagerUseBrainTicksOnlyWhenLagging = true;
|
||||
private void villagerSettings() {
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From fbb5d60cfb97f9a166ecea0361abdbcb72385ee7 Mon Sep 17 00:00:00 2001
|
||||
From eabe6232aad2e846f11e6082b5d9510ad3aa658c Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 6 Jul 2019 21:12:58 -0500
|
||||
Subject: [PATCH] MC-4 Fix - Item position desync
|
||||
@@ -6,28 +6,28 @@ Subject: [PATCH] MC-4 Fix - Item position desync
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityTrackerEntry.java | 6 ++++++
|
||||
src/main/java/net/minecraft/server/PacketPlayOutEntity.java | 2 ++
|
||||
src/main/java/net/pl3x/purpur/PurpurConfig.java | 2 ++
|
||||
3 files changed, 10 insertions(+)
|
||||
src/main/java/net/pl3x/purpur/PurpurConfig.java | 5 +++++
|
||||
3 files changed, 13 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||
index adf7c9180..20d98c206 100644
|
||||
index f75c09d44..10cae053b 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||
@@ -132,6 +132,12 @@ public class EntityTrackerEntry {
|
||||
@@ -133,6 +133,12 @@ public class EntityTrackerEntry {
|
||||
double vec3d_dz = this.tracker.locZ() - 2.44140625E-4D*(this.zLoc);
|
||||
boolean flag1 = (vec3d_dx * vec3d_dx + vec3d_dy * vec3d_dy + vec3d_dz * vec3d_dz) >= 7.62939453125E-6D;
|
||||
// Paper end - reduce allocation of Vec3D here
|
||||
+ // Purpur start - fixes MC-4
|
||||
+ // Purpur start - fix MC-4
|
||||
+ if (net.pl3x.purpur.PurpurConfig.fixItemPositionDesync && this.tracker instanceof EntityItem) {
|
||||
+ Vec3D loc = PacketPlayOutEntity.decrypt(PacketPlayOutEntity.encrypt(tracker.locX()), PacketPlayOutEntity.encrypt(tracker.locY()), PacketPlayOutEntity.encrypt(tracker.locZ()));
|
||||
+ tracker.setPosition(loc.getX(), loc.getY(), loc.getZ());
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+ // Purpur end - fix MC-4
|
||||
Packet<?> packet1 = null;
|
||||
boolean flag2 = flag1 || this.tickCounter % 60 == 0;
|
||||
boolean flag3 = Math.abs(i - this.yRot) >= 1 || Math.abs(j - this.xRot) >= 1;
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutEntity.java b/src/main/java/net/minecraft/server/PacketPlayOutEntity.java
|
||||
index 5b1d95935..0010448e3 100644
|
||||
index e5da2b19c..6d9d52e4f 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketPlayOutEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketPlayOutEntity.java
|
||||
@@ -14,10 +14,12 @@ public class PacketPlayOutEntity implements Packet<PacketListenerPlayOut> {
|
||||
@@ -44,20 +44,19 @@ index 5b1d95935..0010448e3 100644
|
||||
return (new Vec3D((double) i, (double) j, (double) k)).a(2.44140625E-4D);
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 68bad6a13..ab88636ca 100644
|
||||
index 571917ffa..4ac6fa44b 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -163,8 +163,10 @@ public class PurpurConfig {
|
||||
@@ -175,4 +175,9 @@ public class PurpurConfig {
|
||||
InventoryType.ENDER_CHEST.setDefaultSize(enderChestSixRows ? 54 : 27);
|
||||
enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
|
||||
}
|
||||
|
||||
public static boolean dontSendUselessEntityPackets = false;
|
||||
+
|
||||
+ public static boolean fixItemPositionDesync = false;
|
||||
private static void dontSendUselessEntityPackets() {
|
||||
dontSendUselessEntityPackets = getBoolean("settings.dont-send-useless-entity-packets", dontSendUselessEntityPackets);
|
||||
+ private static void fixItemPositionDesync() {
|
||||
+ fixItemPositionDesync = getBoolean("settings.fix-item-position-desync", fixItemPositionDesync);
|
||||
}
|
||||
|
||||
public static boolean barrelSixRows = false;
|
||||
+ }
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 630e9dc4596781fdc3a496147184301aac82dd31 Mon Sep 17 00:00:00 2001
|
||||
From 7627086a8214c93b0a9c2e61981377aeb30553c1 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 28 Mar 2020 01:51:32 -0500
|
||||
Subject: [PATCH] Fix vanilla command permission handler
|
||||
@@ -0,0 +1,54 @@
|
||||
From f6bc74d6d724638fe97b923a0caa06deced56b92 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 19 Oct 2019 00:52:12 -0500
|
||||
Subject: [PATCH] Logger settings (suppressing pointless logs)
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/AdvancementDataPlayer.java | 1 +
|
||||
src/main/java/net/pl3x/purpur/PurpurConfig.java | 7 +++++++
|
||||
.../java/org/bukkit/craftbukkit/legacy/CraftLegacy.java | 1 +
|
||||
3 files changed, 9 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java
|
||||
index 57b9d1344..c89e843e2 100644
|
||||
--- a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java
|
||||
@@ -165,6 +165,7 @@ public class AdvancementDataPlayer {
|
||||
if (advancement == null) {
|
||||
// CraftBukkit start
|
||||
if (entry.getKey().getNamespace().equals("minecraft")) {
|
||||
+ if (!net.pl3x.purpur.PurpurConfig.loggerSuppressIgnoredAdvancementWarnings) // Purpur
|
||||
AdvancementDataPlayer.LOGGER.warn("Ignored advancement '{}' in progress file {} - it doesn't exist anymore?", entry.getKey(), this.f);
|
||||
}
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 4ac6fa44b..b520cd28b 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -180,4 +180,11 @@ public class PurpurConfig {
|
||||
private static void fixItemPositionDesync() {
|
||||
fixItemPositionDesync = getBoolean("settings.fix-item-position-desync", fixItemPositionDesync);
|
||||
}
|
||||
+
|
||||
+ public static boolean loggerSuppressInitLegacyMaterialError = false;
|
||||
+ public static boolean loggerSuppressIgnoredAdvancementWarnings = false;
|
||||
+ private static void loggerSettings() {
|
||||
+ loggerSuppressInitLegacyMaterialError = getBoolean("settings.logger.suppress-init-legacy-material-errors", loggerSuppressInitLegacyMaterialError);
|
||||
+ loggerSuppressIgnoredAdvancementWarnings = getBoolean("settings.logger.suppress-ignored-advancement-warnings", loggerSuppressIgnoredAdvancementWarnings);
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
||||
index b14333ce9..d25204f7d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
||||
@@ -254,6 +254,7 @@ public final class CraftLegacy {
|
||||
}
|
||||
|
||||
static {
|
||||
+ if (!net.pl3x.purpur.PurpurConfig.loggerSuppressInitLegacyMaterialError) // Purpur
|
||||
System.err.println("Initializing Legacy Material Support. Unless you have legacy plugins and/or data this is a bug!");
|
||||
if (MinecraftServer.getServer() != null && MinecraftServer.getServer().isDebugging()) {
|
||||
new Exception().printStackTrace();
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,203 +0,0 @@
|
||||
From 9b77d9886cde434034d95d1dd086971e27e85222 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 19 May 2019 18:11:53 -0500
|
||||
Subject: [PATCH] Campfires have regen effect
|
||||
|
||||
---
|
||||
.../net/minecraft/server/BlockCampfire.java | 2 +-
|
||||
.../net/minecraft/server/EntityLiving.java | 15 ++++++++--
|
||||
.../net/minecraft/server/EntityPotion.java | 26 ++++++++++++++++
|
||||
.../minecraft/server/TileEntityCampfire.java | 30 +++++++++++++++++++
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 23 ++++++++++++++
|
||||
5 files changed, 92 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockCampfire.java b/src/main/java/net/minecraft/server/BlockCampfire.java
|
||||
index 6303be944..65f8d803b 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockCampfire.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockCampfire.java
|
||||
@@ -8,7 +8,7 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged
|
||||
|
||||
protected static final VoxelShape a = Block.a(0.0D, 0.0D, 0.0D, 16.0D, 7.0D, 16.0D);
|
||||
public static final BlockStateBoolean b = BlockProperties.r;
|
||||
- public static final BlockStateBoolean c = BlockProperties.y;
|
||||
+ public static final BlockStateBoolean c = BlockProperties.y; public static BlockStateBoolean signalFire() { return c; } // Purpur - OBFHELPER
|
||||
public static final BlockStateBoolean d = BlockProperties.C;
|
||||
public static final BlockStateDirection e = BlockProperties.N;
|
||||
private static final VoxelShape f = Block.a(6.0D, 0.0D, 6.0D, 10.0D, 16.0D, 10.0D);
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index 685538793..aaaa98318 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -2799,10 +2799,19 @@ public abstract class EntityLiving extends Entity {
|
||||
|
||||
public boolean hasLineOfSight(Entity entity) {
|
||||
if (this.world != entity.world) return false; // CraftBukkit - SPIGOT-5675, SPIGOT-5798, MC-149563
|
||||
- Vec3D vec3d = new Vec3D(this.locX(), this.getHeadY(), this.locZ());
|
||||
- Vec3D vec3d1 = new Vec3D(entity.locX(), entity.getHeadY(), entity.locZ());
|
||||
+ // Purpur start
|
||||
+ return hasLineOfSight(entity.locX(), entity.getHeadY(), entity.locZ());
|
||||
+ }
|
||||
+
|
||||
+ public boolean hasLineOfSight(TileEntity te) {
|
||||
+ return hasLineOfSight(te.position.getX() + 0.5, te.position.getY() + 0.5, te.position.getZ() + 0.5);
|
||||
+ }
|
||||
|
||||
- return this.world.rayTrace(new RayTrace(vec3d, vec3d1, RayTrace.BlockCollisionOption.COLLIDER, RayTrace.FluidCollisionOption.NONE, this)).getType() == MovingObjectPosition.EnumMovingObjectType.MISS;
|
||||
+ public boolean hasLineOfSight(double x, double y, double z) {
|
||||
+ Vec3D start = new Vec3D(locX(), getHeadY(), locZ());
|
||||
+ Vec3D end = new Vec3D(x, y, z);
|
||||
+ return world.rayTrace(new RayTrace(start, end, RayTrace.BlockCollisionOption.COLLIDER, RayTrace.FluidCollisionOption.NONE, this)).getType() == MovingObjectPosition.EnumMovingObjectType.MISS;
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPotion.java b/src/main/java/net/minecraft/server/EntityPotion.java
|
||||
index b56b021b4..fcc5a5c23 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPotion.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPotion.java
|
||||
@@ -92,6 +92,7 @@ public class EntityPotion extends EntityProjectile {
|
||||
} else {
|
||||
this.a(list, movingobjectposition.getType() == MovingObjectPosition.EnumMovingObjectType.ENTITY ? ((MovingObjectPositionEntity) movingobjectposition).getEntity() : null);
|
||||
}
|
||||
+ splashCampfires(list); // Purpur
|
||||
}
|
||||
|
||||
int i = potionregistry.b() ? 2007 : 2002;
|
||||
@@ -101,6 +102,31 @@ public class EntityPotion extends EntityProjectile {
|
||||
}
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ private void splashCampfires(List<MobEffect> list) {
|
||||
+ AxisAlignedBB aabb = getBoundingBox().grow(4.0D, 2.0D, 4.0D);
|
||||
+ for (int x = (int) aabb.minX; x <= aabb.maxX; x++) {
|
||||
+ for (int z = (int) aabb.minZ; z <= aabb.maxZ; z++) {
|
||||
+ for (int y = (int) aabb.minY; y <= aabb.maxY; y++) {
|
||||
+ BlockPosition pos = new BlockPosition(x, y, z);
|
||||
+ TileEntity te = world.getTileEntity(pos);
|
||||
+ if (te instanceof TileEntityCampfire) {
|
||||
+ for (MobEffect effect : list) {
|
||||
+ if (effect.getMobEffect() == MobEffects.REGENERATION) {
|
||||
+ for (int i = 0; i < 6 ; i++) {
|
||||
+ ((WorldServer) world).sendParticles(((WorldServer) world).players, null, Particles.HEART, te.position.getX(), te.position.getY() + 1, te.position.getZ(), 1, 0.5, 0.5, 0.5, 0, true);
|
||||
+ }
|
||||
+ ((TileEntityCampfire) te).splashed = true;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
private void splash() {
|
||||
AxisAlignedBB axisalignedbb = this.getBoundingBox().grow(4.0D, 2.0D, 4.0D);
|
||||
List<EntityLiving> list = this.world.a(EntityLiving.class, axisalignedbb, EntityPotion.e);
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntityCampfire.java b/src/main/java/net/minecraft/server/TileEntityCampfire.java
|
||||
index a1580b8c6..618ca2d76 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntityCampfire.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntityCampfire.java
|
||||
@@ -14,6 +14,7 @@ public class TileEntityCampfire extends TileEntity implements Clearable, ITickab
|
||||
private final NonNullList<ItemStack> items;
|
||||
public final int[] cookingTimes;
|
||||
public final int[] cookingTotalTimes;
|
||||
+ public boolean splashed = false; // Purpur
|
||||
|
||||
public TileEntityCampfire() {
|
||||
super(TileEntityTypes.CAMPFIRE);
|
||||
@@ -34,6 +35,27 @@ public class TileEntityCampfire extends TileEntity implements Clearable, ITickab
|
||||
|
||||
} else {
|
||||
if (flag) {
|
||||
+ // Purpur start
|
||||
+ if ((splashed || !world.purpurConfig.campfireRequireRegenPotion) && world.purpurConfig.campfireRegenInterval > 0 && world.getTime() % world.purpurConfig.campfireRegenInterval == 0L) {
|
||||
+ boolean signalBoost = getBlock().get(BlockCampfire.signalFire());
|
||||
+ int duration = signalBoost ? world.purpurConfig.campfireRegenBoostDuration : world.purpurConfig.campfireRegenDuration;
|
||||
+ byte amp = (byte) (signalBoost ? world.purpurConfig.campfireRegenBoostAmp : world.purpurConfig.campfireRegenAmp);
|
||||
+ int range = signalBoost ? world.purpurConfig.campfireRegenBoostRange : world.purpurConfig.campfireRegenRange;
|
||||
+ MobEffect regeneration = new MobEffect(MobEffects.REGENERATION, duration, amp, true, true);
|
||||
+ world.getEntitiesByClass(EntityHuman.class, new AxisAlignedBB(position).grow(range)).forEach(entityhuman -> {
|
||||
+ boolean noLineOfSign = true;
|
||||
+ if (!signalBoost && world.purpurConfig.campfireRegenRequireLineOfSight) {
|
||||
+ noLineOfSign = false;
|
||||
+ }
|
||||
+ if (signalBoost && world.purpurConfig.campfireRegenBoostRequireLineOfSight) {
|
||||
+ noLineOfSign = false;
|
||||
+ }
|
||||
+ if (noLineOfSign || entityhuman.hasLineOfSight(this)) {
|
||||
+ entityhuman.addEffect(regeneration);
|
||||
+ }
|
||||
+ });
|
||||
+ }
|
||||
+ // Purpur end
|
||||
this.h();
|
||||
} else {
|
||||
for (int i = 0; i < this.items.size(); ++i) {
|
||||
@@ -41,6 +63,7 @@ public class TileEntityCampfire extends TileEntity implements Clearable, ITickab
|
||||
this.cookingTimes[i] = MathHelper.clamp(this.cookingTimes[i] - 2, 0, this.cookingTotalTimes[i]);
|
||||
}
|
||||
}
|
||||
+ splashed = false; // Purpur
|
||||
}
|
||||
|
||||
}
|
||||
@@ -137,6 +160,12 @@ public class TileEntityCampfire extends TileEntity implements Clearable, ITickab
|
||||
System.arraycopy(aint, 0, this.cookingTotalTimes, 0, Math.min(this.cookingTotalTimes.length, aint.length));
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ if (nbttagcompound.hasKey("Purpur.splashed")) {
|
||||
+ splashed = nbttagcompound.getBoolean("Purpur.splashed");
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -144,6 +173,7 @@ public class TileEntityCampfire extends TileEntity implements Clearable, ITickab
|
||||
this.d(nbttagcompound);
|
||||
nbttagcompound.setIntArray("CookingTimes", this.cookingTimes);
|
||||
nbttagcompound.setIntArray("CookingTotalTimes", this.cookingTotalTimes);
|
||||
+ nbttagcompound.setBoolean("Purpur.splashed", splashed); // Purpur
|
||||
return nbttagcompound;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 94744c78b..d8d95d787 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -71,6 +71,29 @@ public class PurpurWorldConfig {
|
||||
return PurpurConfig.config.getString("world-settings." + worldName + "." + path, PurpurConfig.config.getString("world-settings.default." + path));
|
||||
}
|
||||
|
||||
+ public int campfireRegenInterval = 0;
|
||||
+ public int campfireRegenDuration = 80;
|
||||
+ public int campfireRegenRange = 5;
|
||||
+ public int campfireRegenAmp = 0;
|
||||
+ public boolean campfireRegenRequireLineOfSight = true;
|
||||
+ public int campfireRegenBoostDuration = 0;
|
||||
+ public int campfireRegenBoostRange = 10;
|
||||
+ public int campfireRegenBoostAmp = 1;
|
||||
+ public boolean campfireRegenBoostRequireLineOfSight = false;
|
||||
+ public boolean campfireRequireRegenPotion = true;
|
||||
+ private void campfireSettings() {
|
||||
+ campfireRegenInterval = getInt("blocks.campfire.regen.interval", campfireRegenInterval);
|
||||
+ campfireRegenDuration = getInt("blocks.campfire.regen.duration", campfireRegenDuration);
|
||||
+ campfireRegenRange = getInt("blocks.campfire.regen.range", campfireRegenRange);
|
||||
+ campfireRegenAmp = getInt("blocks.campfire.regen.amplifier", campfireRegenAmp);
|
||||
+ campfireRegenRequireLineOfSight = getBoolean("blocks.campfire.regen.require-line-of-sight", campfireRegenRequireLineOfSight);
|
||||
+ campfireRegenBoostDuration = getInt("blocks.campfire.regen.boost-duration", campfireRegenBoostDuration);
|
||||
+ campfireRegenBoostRange = getInt("blocks.campfire.regen.boost-range", campfireRegenBoostRange);
|
||||
+ campfireRegenBoostAmp = getInt("blocks.campfire.regen.boost-amplifier", campfireRegenBoostAmp);
|
||||
+ campfireRegenBoostRequireLineOfSight = getBoolean("blocks.campfire.regen.boost-require-line-of-sight", campfireRegenBoostRequireLineOfSight);
|
||||
+ campfireRequireRegenPotion = getBoolean("blocks.campfire.regen.requires-potion-to-activate", campfireRequireRegenPotion);
|
||||
+ }
|
||||
+
|
||||
public boolean farmlandGetsMoistFromBelow = false;
|
||||
private void farmlandSettings() {
|
||||
farmlandGetsMoistFromBelow = getBoolean("blocks.farmland.gets-moist-from-below", farmlandGetsMoistFromBelow);
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 2094c83c3f1ac0a54a44a83a97dd93640767160f Mon Sep 17 00:00:00 2001
|
||||
From 1926ac0f3c9733e80ebe5b761edc0b805bc59ed0 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sun, 15 Dec 2019 12:53:59 -0600
|
||||
Subject: [PATCH] Disable outdated build check
|
||||
@@ -8,14 +8,14 @@ Subject: [PATCH] Disable outdated build check
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index 77b9ce301..b007840a5 100644
|
||||
index 8879c6421..2434a5af8 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -259,7 +259,7 @@ public class Main {
|
||||
@@ -252,7 +252,7 @@ public class Main {
|
||||
System.setProperty(TerminalConsoleAppender.JLINE_OVERRIDE_PROPERTY, "false"); // Paper
|
||||
}
|
||||
|
||||
- if (false && Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) {
|
||||
- if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) {
|
||||
+ if (false) { // Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) { // Purpur
|
||||
Date buildDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").parse(Main.class.getPackage().getImplementationVendor()); // Paper
|
||||
|
||||
200
patches/server/0035-Giants-AI-settings.patch
Normal file
200
patches/server/0035-Giants-AI-settings.patch
Normal file
@@ -0,0 +1,200 @@
|
||||
From 44ff3cae556ebd8727d61cfc675f6d482b69fed6 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 12 May 2019 00:43:12 -0500
|
||||
Subject: [PATCH] Giants AI settings
|
||||
|
||||
---
|
||||
.../minecraft/server/AttributeMapBase.java | 4 +-
|
||||
.../java/net/minecraft/server/Entity.java | 2 +-
|
||||
.../minecraft/server/EntityGiantZombie.java | 63 ++++++++++++++++++-
|
||||
.../minecraft/server/EntityInsentient.java | 6 +-
|
||||
.../net/minecraft/server/EntityLiving.java | 2 +-
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 17 +++++
|
||||
6 files changed, 87 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/AttributeMapBase.java b/src/main/java/net/minecraft/server/AttributeMapBase.java
|
||||
index c57e23e16..772079a27 100644
|
||||
--- a/src/main/java/net/minecraft/server/AttributeMapBase.java
|
||||
+++ b/src/main/java/net/minecraft/server/AttributeMapBase.java
|
||||
@@ -41,8 +41,8 @@ public class AttributeMapBase {
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
- @Nullable
|
||||
- public AttributeModifiable a(AttributeBase attributebase) {
|
||||
+ @Nullable public AttributeModifiable getAttribute(AttributeBase attributebase) { return a(attributebase); } // Purpur - OBFHELPER
|
||||
+ @Nullable public AttributeModifiable a(AttributeBase attributebase) {
|
||||
return (AttributeModifiable) this.b.computeIfAbsent(attributebase, (attributebase1) -> {
|
||||
return this.d.a(this::a, attributebase1);
|
||||
});
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 3709f3386..ee36c537d 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -136,7 +136,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
public double D;
|
||||
public double E;
|
||||
public double F;
|
||||
- public float G;
|
||||
+ public float G; public void setStepHeight(float stepHeight) { this.G = stepHeight; } // Purpur - OBFHELPER
|
||||
public boolean noclip;
|
||||
public float I;
|
||||
protected final Random random;
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityGiantZombie.java b/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
||||
index 37618126f..4b8edc8df 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
||||
@@ -4,7 +4,10 @@ public class EntityGiantZombie extends EntityMonster {
|
||||
|
||||
public EntityGiantZombie(EntityTypes<? extends EntityGiantZombie> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
- this.safeFallDistance = 10.0F; // Purpur
|
||||
+ // Purpur start
|
||||
+ this.safeFallDistance = 10.0F;
|
||||
+ setStepHeight(world.purpurConfig.giantStepHeight);
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -18,6 +21,62 @@ public class EntityGiantZombie extends EntityMonster {
|
||||
|
||||
@Override
|
||||
public float a(BlockPosition blockposition, IWorldReader iworldreader) {
|
||||
- return iworldreader.y(blockposition) - 0.5F;
|
||||
+ return super.a(blockposition, iworldreader); // Purpur - fix light requirements for natural spawns
|
||||
}
|
||||
+
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ protected void initPathfinder() {
|
||||
+ if (world.purpurConfig.giantHaveAI) {
|
||||
+ this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
||||
+ this.goalSelector.a(7, new PathfinderGoalRandomStrollLand(this, 1.0D));
|
||||
+ this.goalSelector.a(8, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 16.0F));
|
||||
+ this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this));
|
||||
+ this.goalSelector.a(5, new PathfinderGoalMoveTowardsRestriction(this, 1.0D));
|
||||
+ if (world.purpurConfig.giantHaveHostileAI) {
|
||||
+ this.goalSelector.a(2, new PathfinderGoalMeleeAttack(this, 1.0D, false));
|
||||
+ this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this).a(EntityPigZombie.class));
|
||||
+ this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true));
|
||||
+ this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillager.class, false));
|
||||
+ this.targetSelector.a(4, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, true));
|
||||
+ this.targetSelector.a(5, new PathfinderGoalNearestAttackableTarget<>(this, EntityTurtle.class, true));
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ protected void initAttributes(World world) {
|
||||
+ if (world != null) {
|
||||
+ getAttributeMap().getAttribute(GenericAttributes.MAX_HEALTH).setValue(world.purpurConfig.giantMaxHealth);
|
||||
+ getAttributeMap().getAttribute(GenericAttributes.MOVEMENT_SPEED).setValue(world.purpurConfig.giantMovementSpeed);
|
||||
+ getAttributeMap().getAttribute(GenericAttributes.ATTACK_DAMAGE).setValue(world.purpurConfig.giantAttackDamage);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public GroupDataEntity prepare(GeneratorAccess world, DifficultyDamageScaler difficulty, EnumMobSpawn enummobspawn, GroupDataEntity groupDataEntity, NBTTagCompound nbt) {
|
||||
+ GroupDataEntity groupData = super.prepare(world, difficulty, enummobspawn, groupDataEntity, nbt);
|
||||
+ if (groupData == null) {
|
||||
+ setEquipmentBasedOnDifficulty(difficulty);
|
||||
+ setEnchantmentBasedOnDifficulty(difficulty);
|
||||
+ }
|
||||
+ return groupData;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ protected void setEquipmentBasedOnDifficulty(DifficultyDamageScaler difficulty) {
|
||||
+ super.setEquipmentBasedOnDifficulty(difficulty);
|
||||
+ // TODO make configurable
|
||||
+ if (random.nextFloat() < (world.getDifficulty() == EnumDifficulty.HARD ? 0.1F : 0.05F)) {
|
||||
+ setSlot(EnumItemSlot.MAINHAND, new ItemStack(Items.IRON_SWORD));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public float getJumpHeight() {
|
||||
+ // make giants jump as high as everything else relative to their size
|
||||
+ // 1.0 makes bottom of feet about as high as their waist when they jump
|
||||
+ return world.purpurConfig.giantJumpHeight;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
index 605bbf017..93714e5d9 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
@@ -939,6 +939,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
return f;
|
||||
}
|
||||
|
||||
+ protected void setEquipmentBasedOnDifficulty(DifficultyDamageScaler difficultydamagescaler) { a(difficultydamagescaler); } // Purpur - OBFHELPER
|
||||
protected void a(DifficultyDamageScaler difficultydamagescaler) {
|
||||
if (this.random.nextFloat() < 0.15F * difficultydamagescaler.d()) {
|
||||
int i = this.random.nextInt(2);
|
||||
@@ -1046,6 +1047,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
}
|
||||
}
|
||||
|
||||
+ protected void setEnchantmentBasedOnDifficulty(DifficultyDamageScaler difficultydamagescaler) { b(difficultydamagescaler); } // Purpur - OBFHELPER
|
||||
protected void b(DifficultyDamageScaler difficultydamagescaler) {
|
||||
float f = difficultydamagescaler.d();
|
||||
|
||||
@@ -1078,10 +1080,12 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
} else {
|
||||
this.setLeftHanded(false);
|
||||
}
|
||||
-
|
||||
+ initAttributes(world.getMinecraftWorld()); // Purpur
|
||||
return groupdataentity;
|
||||
}
|
||||
|
||||
+ protected void initAttributes(World world) {} // Purpur
|
||||
+
|
||||
public boolean es() {
|
||||
return false;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index f917cd5df..03477c6e9 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -2150,7 +2150,7 @@ public abstract class EntityLiving extends Entity {
|
||||
this.enderTeleportTo(vec3d.x, vec3d.y, vec3d.z);
|
||||
}
|
||||
|
||||
- protected float dI() {
|
||||
+ protected float dI() { return getJumpHeight(); } public float getJumpHeight() { // Purpur - OBFHELPER
|
||||
return 0.42F * this.getBlockJumpFactor();
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 3367cfd47..2db2dd26d 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -92,6 +92,23 @@ public class PurpurWorldConfig {
|
||||
turtleEggsBreakFromMinecarts = getBoolean("blocks.turtle_egg.break-from-minecarts", turtleEggsBreakFromMinecarts);
|
||||
}
|
||||
|
||||
+ public float giantStepHeight = 2.0F;
|
||||
+ public float giantJumpHeight = 1.0F;
|
||||
+ public double giantMaxHealth = 100.0D;
|
||||
+ public double giantMovementSpeed = 0.5D;
|
||||
+ public double giantAttackDamage = 50.0D;
|
||||
+ public boolean giantHaveAI = false;
|
||||
+ public boolean giantHaveHostileAI = false;
|
||||
+ private void giantSettings() {
|
||||
+ giantStepHeight = (float) getDouble("mobs.giant.step-height", giantStepHeight);
|
||||
+ giantJumpHeight = (float) getDouble("mobs.giant.jump-height", giantJumpHeight);
|
||||
+ giantMaxHealth = getDouble("mobs.giant.max-health", giantMaxHealth);
|
||||
+ giantMovementSpeed = getDouble("mobs.giant.movement-speed", giantMovementSpeed);
|
||||
+ giantAttackDamage = getDouble("mobs.giant.attack-damage", giantAttackDamage);
|
||||
+ giantHaveAI = getBoolean("mobs.giant.have-ai", giantHaveAI);
|
||||
+ giantHaveHostileAI = getBoolean("mobs.giant.have-hostile-ai", giantHaveHostileAI);
|
||||
+ }
|
||||
+
|
||||
public int villagerBrainTicks = 1;
|
||||
public boolean villagerUseBrainTicksOnlyWhenLagging = true;
|
||||
private void villagerSettings() {
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
From e95433c37c07dd0343e1336c9a49661974ddc28f Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 6 Jun 2019 21:30:49 -0500
|
||||
Subject: [PATCH] Campfires burn out in rain
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/Block.java | 2 +-
|
||||
.../net/minecraft/server/BlockCampfire.java | 17 ++++++++++++++++-
|
||||
.../java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
3 files changed, 19 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
|
||||
index 9c7faa2bd..97e553b38 100644
|
||||
--- a/src/main/java/net/minecraft/server/Block.java
|
||||
+++ b/src/main/java/net/minecraft/server/Block.java
|
||||
@@ -395,7 +395,7 @@ public class Block implements IMaterial {
|
||||
PacketDebug.a(world, blockposition);
|
||||
}
|
||||
|
||||
- public int a(IWorldReader iworldreader) {
|
||||
+ public int a(IWorldReader world) { return tickRate(world); } public int tickRate(IWorldReader world) { // Purpur - OBFHELPER
|
||||
return 10;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockCampfire.java b/src/main/java/net/minecraft/server/BlockCampfire.java
|
||||
index 65f8d803b..3b95dfaaa 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockCampfire.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockCampfire.java
|
||||
@@ -7,7 +7,7 @@ import javax.annotation.Nullable;
|
||||
public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged {
|
||||
|
||||
protected static final VoxelShape a = Block.a(0.0D, 0.0D, 0.0D, 16.0D, 7.0D, 16.0D);
|
||||
- public static final BlockStateBoolean b = BlockProperties.r;
|
||||
+ public static final BlockStateBoolean b = BlockProperties.r; public static BlockStateBoolean lit() { return b; } // Purpur - OBFHELPER
|
||||
public static final BlockStateBoolean c = BlockProperties.y; public static BlockStateBoolean signalFire() { return c; } // Purpur - OBFHELPER
|
||||
public static final BlockStateBoolean d = BlockProperties.C;
|
||||
public static final BlockStateDirection e = BlockProperties.N;
|
||||
@@ -74,6 +74,21 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged
|
||||
return (IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.getBlockData().set(BlockCampfire.d, flag)).set(BlockCampfire.c, this.h(world.getType(blockposition.down())))).set(BlockCampfire.b, !flag)).set(BlockCampfire.e, blockactioncontext.f());
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public void tick(IBlockData iblockdata, WorldServer world, BlockPosition pos, Random random) {
|
||||
+ if (world.purpurConfig.campfireBurnOutInRain && world.getTime() % 20 == 0L && iblockdata.get(lit()) && world.isRainingAt(pos.shift(EnumDirection.UP))) {
|
||||
+ world.setTypeAndData(pos, iblockdata.set(lit(), false), 3);
|
||||
+ }
|
||||
+ world.getBlockTickList().a(pos, this, tickRate(world));
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int tickRate(IWorldReader world) {
|
||||
+ return 1;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
|
||||
if ((Boolean) iblockdata.get(BlockCampfire.d)) {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 8c84431e5..a761b2c73 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -81,6 +81,7 @@ public class PurpurWorldConfig {
|
||||
public int campfireRegenBoostAmp = 1;
|
||||
public boolean campfireRegenBoostRequireLineOfSight = false;
|
||||
public boolean campfireRequireRegenPotion = true;
|
||||
+ public boolean campfireBurnOutInRain = false;
|
||||
private void campfireSettings() {
|
||||
campfireRegenInterval = getInt("blocks.campfire.regen.interval", campfireRegenInterval);
|
||||
campfireRegenDuration = getInt("blocks.campfire.regen.duration", campfireRegenDuration);
|
||||
@@ -92,6 +93,7 @@ public class PurpurWorldConfig {
|
||||
campfireRegenBoostAmp = getInt("blocks.campfire.regen.boost-amplifier", campfireRegenBoostAmp);
|
||||
campfireRegenBoostRequireLineOfSight = getBoolean("blocks.campfire.regen.boost-require-line-of-sight", campfireRegenBoostRequireLineOfSight);
|
||||
campfireRequireRegenPotion = getBoolean("blocks.campfire.regen.requires-potion-to-activate", campfireRequireRegenPotion);
|
||||
+ campfireBurnOutInRain = getBoolean("blocks.campfire.burn-out-in-rain", campfireBurnOutInRain);
|
||||
}
|
||||
|
||||
public boolean farmlandGetsMoistFromBelow = false;
|
||||
--
|
||||
2.26.2
|
||||
|
||||
55
patches/server/0036-Illusioners-AI-settings.patch
Normal file
55
patches/server/0036-Illusioners-AI-settings.patch
Normal file
@@ -0,0 +1,55 @@
|
||||
From 441173477d957d8b8af8f86d72cb50e22c99bfb8 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 5 Jul 2019 11:09:25 -0500
|
||||
Subject: [PATCH] Illusioners AI settings
|
||||
|
||||
---
|
||||
.../net/minecraft/server/EntityIllagerIllusioner.java | 11 +++++++++++
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 9 +++++++++
|
||||
2 files changed, 20 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java
|
||||
index 76fd0513f..1a5b9a0f0 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java
|
||||
@@ -40,6 +40,17 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan
|
||||
return EntityMonster.eS().a(GenericAttributes.MOVEMENT_SPEED, 0.5D).a(GenericAttributes.FOLLOW_RANGE, 18.0D).a(GenericAttributes.MAX_HEALTH, 32.0D);
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ protected void initAttributes(World world) {
|
||||
+ if (world != null) {
|
||||
+ getAttributeMap().getAttribute(GenericAttributes.MOVEMENT_SPEED).setValue(world.purpurConfig.illusionerMovementSpeed);
|
||||
+ getAttributeMap().getAttribute(GenericAttributes.FOLLOW_RANGE).setValue(world.purpurConfig.illusionerFollowRange);
|
||||
+ getAttributeMap().getAttribute(GenericAttributes.MAX_HEALTH).setValue(world.purpurConfig.illusionerMaxHealth);
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
public GroupDataEntity prepare(GeneratorAccess generatoraccess, DifficultyDamageScaler difficultydamagescaler, EnumMobSpawn enummobspawn, @Nullable GroupDataEntity groupdataentity, @Nullable NBTTagCompound nbttagcompound) {
|
||||
this.setSlot(EnumItemSlot.MAINHAND, new ItemStack(Items.BOW));
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 2db2dd26d..d79a7e242 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -109,6 +109,15 @@ public class PurpurWorldConfig {
|
||||
giantHaveHostileAI = getBoolean("mobs.giant.have-hostile-ai", giantHaveHostileAI);
|
||||
}
|
||||
|
||||
+ public double illusionerMaxHealth = 32.0D;
|
||||
+ public double illusionerMovementSpeed = 0.5D;
|
||||
+ public double illusionerFollowRange = 18.0D;
|
||||
+ private void illusionerSettings() {
|
||||
+ illusionerMaxHealth = getDouble("mobs.illusioner.max-health", illusionerMaxHealth);
|
||||
+ illusionerMovementSpeed = getDouble("mobs.illusioner.movement-speed", illusionerMovementSpeed);
|
||||
+ illusionerFollowRange = getDouble("mobs.illusioner.follow-range", illusionerFollowRange);
|
||||
+ }
|
||||
+
|
||||
public int villagerBrainTicks = 1;
|
||||
public boolean villagerUseBrainTicksOnlyWhenLagging = true;
|
||||
private void villagerSettings() {
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
From dd79210dd48515873533b7a50d14eab5db537495 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 23 May 2019 16:20:21 -0500
|
||||
Subject: [PATCH] Campfires should fall with gravity
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/BlockCampfire.java | 16 ++++++++++++++--
|
||||
.../java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
2 files changed, 16 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockCampfire.java b/src/main/java/net/minecraft/server/BlockCampfire.java
|
||||
index 3b95dfaaa..418fa6d1f 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockCampfire.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockCampfire.java
|
||||
@@ -9,7 +9,7 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged
|
||||
protected static final VoxelShape a = Block.a(0.0D, 0.0D, 0.0D, 16.0D, 7.0D, 16.0D);
|
||||
public static final BlockStateBoolean b = BlockProperties.r; public static BlockStateBoolean lit() { return b; } // Purpur - OBFHELPER
|
||||
public static final BlockStateBoolean c = BlockProperties.y; public static BlockStateBoolean signalFire() { return c; } // Purpur - OBFHELPER
|
||||
- public static final BlockStateBoolean d = BlockProperties.C;
|
||||
+ public static final BlockStateBoolean d = BlockProperties.C; public static BlockStateBoolean waterlogged() { return d; } // Purpur - OBFHELPER
|
||||
public static final BlockStateDirection e = BlockProperties.N;
|
||||
private static final VoxelShape f = Block.a(6.0D, 0.0D, 6.0D, 10.0D, 16.0D, 10.0D);
|
||||
|
||||
@@ -75,8 +75,19 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged
|
||||
}
|
||||
|
||||
// Purpur start
|
||||
+ @Override
|
||||
+ public void onPlace(IBlockData iblockdata, World world, BlockPosition pos, IBlockData iblockdata1, boolean flag) {
|
||||
+ world.getBlockTickList().a(pos, this, tickRate(world));
|
||||
+ }
|
||||
+
|
||||
@Override
|
||||
public void tick(IBlockData iblockdata, WorldServer world, BlockPosition pos, Random random) {
|
||||
+ if (world.purpurConfig.campfireFallWithGravity && BlockFalling.canFallThrough(world.getType(pos.down())) && pos.getY() >= 0) {
|
||||
+ world.addEntity(new EntityFallingBlock(world, pos.getX() + 0.5D, pos.getY(), pos.getZ() + 0.5D, world.getType(pos)));
|
||||
+ }
|
||||
+ if (iblockdata.get(waterlogged()) && iblockdata.get(lit())) {
|
||||
+ world.setTypeAndData(pos, iblockdata.set(lit(), false), 3);
|
||||
+ }
|
||||
if (world.purpurConfig.campfireBurnOutInRain && world.getTime() % 20 == 0L && iblockdata.get(lit()) && world.isRainingAt(pos.shift(EnumDirection.UP))) {
|
||||
world.setTypeAndData(pos, iblockdata.set(lit(), false), 3);
|
||||
}
|
||||
@@ -91,6 +102,7 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged
|
||||
|
||||
@Override
|
||||
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
|
||||
+ generatoraccess.getBlockTickList().a(blockposition, this, tickRate(generatoraccess)); // Purpur - Campfires should fall with gravity
|
||||
if ((Boolean) iblockdata.get(BlockCampfire.d)) {
|
||||
generatoraccess.getFluidTickList().a(blockposition, FluidTypes.WATER, FluidTypes.WATER.a((IWorldReader) generatoraccess));
|
||||
}
|
||||
@@ -119,7 +131,7 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged
|
||||
|
||||
@Override
|
||||
public boolean place(GeneratorAccess generatoraccess, BlockPosition blockposition, IBlockData iblockdata, Fluid fluid) {
|
||||
- if (!(Boolean) iblockdata.get(BlockProperties.C) && fluid.getType() == FluidTypes.WATER) {
|
||||
+ if (!(Boolean) iblockdata.get(BlockCampfire.d) && fluid.getType() == FluidTypes.WATER) { // Purpur
|
||||
boolean flag = (Boolean) iblockdata.get(BlockCampfire.b);
|
||||
|
||||
if (flag) {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index a761b2c73..d6405b2ec 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -82,6 +82,7 @@ public class PurpurWorldConfig {
|
||||
public boolean campfireRegenBoostRequireLineOfSight = false;
|
||||
public boolean campfireRequireRegenPotion = true;
|
||||
public boolean campfireBurnOutInRain = false;
|
||||
+ public boolean campfireFallWithGravity = false;
|
||||
private void campfireSettings() {
|
||||
campfireRegenInterval = getInt("blocks.campfire.regen.interval", campfireRegenInterval);
|
||||
campfireRegenDuration = getInt("blocks.campfire.regen.duration", campfireRegenDuration);
|
||||
@@ -94,6 +95,7 @@ public class PurpurWorldConfig {
|
||||
campfireRegenBoostRequireLineOfSight = getBoolean("blocks.campfire.regen.boost-require-line-of-sight", campfireRegenBoostRequireLineOfSight);
|
||||
campfireRequireRegenPotion = getBoolean("blocks.campfire.regen.requires-potion-to-activate", campfireRequireRegenPotion);
|
||||
campfireBurnOutInRain = getBoolean("blocks.campfire.burn-out-in-rain", campfireBurnOutInRain);
|
||||
+ campfireFallWithGravity = getBoolean("blocks.campfire.fall-with-gravity", campfireFallWithGravity);
|
||||
}
|
||||
|
||||
public boolean farmlandGetsMoistFromBelow = false;
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
From cae7ca5f7ee6a31f421a401abed8141b9037c9a3 Mon Sep 17 00:00:00 2001
|
||||
From 08672f6e86a74640abb8a9b29f440da692558a85 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 7 Jul 2019 19:52:16 -0500
|
||||
Subject: [PATCH] Zombie horse naturally spawn
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/WorldServer.java | 18 ++++++++++++------
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
2 files changed, 14 insertions(+), 6 deletions(-)
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
||||
2 files changed, 17 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 24cd10c96..edf24791b 100644
|
||||
index 093fa8074..7955a079b 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -1038,12 +1038,18 @@ public class WorldServer extends World {
|
||||
@@ -622,12 +622,18 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
boolean flag1 = this.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance; // Paper
|
||||
|
||||
if (flag1) {
|
||||
- EntityHorseSkeleton entityhorseskeleton = (EntityHorseSkeleton) EntityTypes.SKELETON_HORSE.a((World) this);
|
||||
-
|
||||
- entityhorseskeleton.r(true);
|
||||
- entityhorseskeleton.t(true);
|
||||
- entityhorseskeleton.setAgeRaw(0);
|
||||
- entityhorseskeleton.setPosition((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ());
|
||||
- this.addEntity(entityhorseskeleton, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
|
||||
@@ -36,23 +36,21 @@ index 24cd10c96..edf24791b 100644
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
this.strikeLightning(new EntityLightning(this, (double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, flag1), org.bukkit.event.weather.LightningStrikeEvent.Cause.WEATHER); // CraftBukkit
|
||||
EntityLightning entitylightning = (EntityLightning) EntityTypes.LIGHTNING_BOLT.a((World) this);
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 96a66926f..4c7469b90 100644
|
||||
index d79a7e242..3dad7bded 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -657,9 +657,11 @@ public class PurpurWorldConfig {
|
||||
|
||||
public boolean zombieHorseCanSwim = false;
|
||||
public boolean zombieHorseRidableInWater = false;
|
||||
+ public double zombieHorseSpawnChance = 0.0D;
|
||||
private void zombieHorseSettings() {
|
||||
zombieHorseCanSwim = getBoolean("mobs.zombie_horse.can-swim", zombieHorseCanSwim);
|
||||
zombieHorseRidableInWater = getBoolean("mobs.zombie_horse.ridable-in-water", zombieHorseRidableInWater);
|
||||
+ zombieHorseSpawnChance = getDouble("mobs.zombie_horse.spawn-chance", zombieHorseSpawnChance);
|
||||
@@ -124,4 +124,9 @@ public class PurpurWorldConfig {
|
||||
villagerBrainTicks = getInt("mobs.villager.brain-ticks", villagerBrainTicks);
|
||||
villagerUseBrainTicksOnlyWhenLagging = getBoolean("mobs.villager.use-brain-ticks-only-when-lagging", villagerUseBrainTicksOnlyWhenLagging);
|
||||
}
|
||||
|
||||
public boolean zombiePigmanRidable = false;
|
||||
+
|
||||
+ public double zombieHorseSpawnChance = 0.0D;
|
||||
+ private void zombieHorseSettings() {
|
||||
+ zombieHorseSpawnChance = getDouble("mobs.zombie_horse.spawn-chance", zombieHorseSpawnChance);
|
||||
+ }
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,21 +1,22 @@
|
||||
From 2de0a875233bb6be5ed54394ac9cba44a7b32764 Mon Sep 17 00:00:00 2001
|
||||
From 4e0bfa3879efb2558a9e2139c4fd0f5554b59a45 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Fri, 29 Nov 2019 22:37:44 -0600
|
||||
Subject: [PATCH] Charged creeper naturally spawn
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityCreeper.java | 11 +++++++++++
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
2 files changed, 13 insertions(+)
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
||||
2 files changed, 16 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java
|
||||
index 48fd8e716..ce366f401 100644
|
||||
index 5e7f3af37..ec5287fa5 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityCreeper.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityCreeper.java
|
||||
@@ -87,6 +87,17 @@ public class EntityCreeper extends EntityMonster {
|
||||
this.datawatcher.register(EntityCreeper.d, false);
|
||||
@@ -275,4 +275,15 @@ public class EntityCreeper extends EntityMonster {
|
||||
public void setCausedHeadDrop() {
|
||||
++this.bz;
|
||||
}
|
||||
|
||||
+
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public GroupDataEntity prepare(GeneratorAccess generatoraccess, DifficultyDamageScaler difficultydamagescaler, EnumMobSpawn enummobspawn, GroupDataEntity groupdataentity, NBTTagCompound nbttagcompound) {
|
||||
@@ -26,27 +27,23 @@ index 48fd8e716..ce366f401 100644
|
||||
+ return super.prepare(generatoraccess, difficultydamagescaler, enummobspawn, groupdataentity, nbttagcompound);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
public void b(NBTTagCompound nbttagcompound) {
|
||||
super.b(nbttagcompound);
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 4c7469b90..bbae44ddb 100644
|
||||
index 3dad7bded..d9c4ffbe8 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -148,10 +148,12 @@ public class PurpurWorldConfig {
|
||||
public boolean creeperRidable = false;
|
||||
public boolean creeperRidableInWater = false;
|
||||
public boolean creeperRequireShiftToMount = true;
|
||||
+ public double creeperChargedChance = 0.0D;
|
||||
private void creeperSettings() {
|
||||
creeperRidable = getBoolean("mobs.creeper.ridable", creeperRidable);
|
||||
creeperRidableInWater = getBoolean("mobs.creeper.ridable-in-water", creeperRidableInWater);
|
||||
creeperRequireShiftToMount = getBoolean("mobs.creeper.require-shift-to-mount", creeperRequireShiftToMount);
|
||||
+ creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
|
||||
@@ -92,6 +92,11 @@ public class PurpurWorldConfig {
|
||||
turtleEggsBreakFromMinecarts = getBoolean("blocks.turtle_egg.break-from-minecarts", turtleEggsBreakFromMinecarts);
|
||||
}
|
||||
|
||||
public boolean dolphinRidable = false;
|
||||
+ public double creeperChargedChance = 0.0D;
|
||||
+ private void creeperSettings() {
|
||||
+ creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
|
||||
+ }
|
||||
+
|
||||
public float giantStepHeight = 2.0F;
|
||||
public float giantJumpHeight = 1.0F;
|
||||
public double giantMaxHealth = 100.0D;
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
From aeb5f32f4179df8b3e0eace094ed06a31e65b87c Mon Sep 17 00:00:00 2001
|
||||
From 65ded2f0ce2ede0d1b623971d998474e1b52c791 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 31 Aug 2019 17:47:11 -0500
|
||||
Subject: [PATCH] Rabbit naturally spawn toast and killer
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/EntityRabbit.java | 14 ++++++++++++++
|
||||
.../java/net/pl3x/purpur/PurpurWorldConfig.java | 4 ++++
|
||||
2 files changed, 18 insertions(+)
|
||||
.../java/net/pl3x/purpur/PurpurWorldConfig.java | 7 +++++++
|
||||
2 files changed, 21 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityRabbit.java b/src/main/java/net/minecraft/server/EntityRabbit.java
|
||||
index 9040ab1c5..0232226f0 100644
|
||||
index 00c9233f8..1be0f943b 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityRabbit.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityRabbit.java
|
||||
@@ -364,6 +364,10 @@ public class EntityRabbit extends EntityAnimal {
|
||||
@@ -297,6 +297,10 @@ public class EntityRabbit extends EntityAnimal {
|
||||
if (!this.hasCustomName()) {
|
||||
this.setCustomName(new ChatMessage(SystemUtils.a("entity", EntityRabbit.bx), new Object[0]));
|
||||
this.setCustomName(new ChatMessage(SystemUtils.a("entity", EntityRabbit.bw)));
|
||||
}
|
||||
+ // Purpur start
|
||||
+ } else if (i == 98) {
|
||||
@@ -22,8 +22,8 @@ index 9040ab1c5..0232226f0 100644
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
this.datawatcher.set(EntityRabbit.bw, i);
|
||||
@@ -385,6 +389,16 @@ public class EntityRabbit extends EntityAnimal {
|
||||
this.datawatcher.set(EntityRabbit.bv, i);
|
||||
@@ -318,6 +322,16 @@ public class EntityRabbit extends EntityAnimal {
|
||||
}
|
||||
|
||||
private int a(GeneratorAccess generatoraccess) {
|
||||
@@ -36,29 +36,28 @@ index 9040ab1c5..0232226f0 100644
|
||||
+ return 98;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
BiomeBase biomebase = generatoraccess.getBiome(new BlockPosition(this));
|
||||
+
|
||||
BiomeBase biomebase = generatoraccess.getBiome(this.getChunkCoordinates());
|
||||
int i = this.random.nextInt(100);
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index bbae44ddb..4aaf75fcf 100644
|
||||
index d9c4ffbe8..9e144a369 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -440,10 +440,14 @@ public class PurpurWorldConfig {
|
||||
public boolean rabbitRidable = false;
|
||||
public boolean rabbitRidableInWater = false;
|
||||
public boolean rabbitRequireShiftToMount = true;
|
||||
+ public double rabbitNaturalToast = 0.0D;
|
||||
+ public double rabbitNaturalKiller = 0.0D;
|
||||
private void rabbitSettings() {
|
||||
rabbitRidable = getBoolean("mobs.rabbit.ridable", rabbitRidable);
|
||||
rabbitRidableInWater = getBoolean("mobs.rabbit.ridable-in-water", rabbitRidableInWater);
|
||||
rabbitRequireShiftToMount = getBoolean("mobs.rabbit.require-shift-to-mount", rabbitRequireShiftToMount);
|
||||
+ rabbitNaturalToast = getDouble("mobs.rabbit.spawn-toast-chance", rabbitNaturalToast);
|
||||
+ rabbitNaturalKiller = getDouble("mobs.rabbit.spawn-killer-rabbit-chance", rabbitNaturalKiller);
|
||||
@@ -123,6 +123,13 @@ public class PurpurWorldConfig {
|
||||
illusionerFollowRange = getDouble("mobs.illusioner.follow-range", illusionerFollowRange);
|
||||
}
|
||||
|
||||
public boolean ravagerRidable = false;
|
||||
+ public double rabbitNaturalToast = 0.0D;
|
||||
+ public double rabbitNaturalKiller = 0.0D;
|
||||
+ private void rabbitSettings() {
|
||||
+ rabbitNaturalToast = getDouble("mobs.rabbit.spawn-toast-chance", rabbitNaturalToast);
|
||||
+ rabbitNaturalKiller = getDouble("mobs.rabbit.spawn-killer-rabbit-chance", rabbitNaturalKiller);
|
||||
+ }
|
||||
+
|
||||
public int villagerBrainTicks = 1;
|
||||
public boolean villagerUseBrainTicksOnlyWhenLagging = true;
|
||||
private void villagerSettings() {
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 8dc9cf85d82ebcfb89d97fb0bd172bb58794b9d4 Mon Sep 17 00:00:00 2001
|
||||
From d465dcaf5f07f171e1293db0e0066c7120d7fe19 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Tue, 4 Jun 2019 15:50:08 -0500
|
||||
Subject: [PATCH] Fix 'outdated server' showing in ping before server fully
|
||||
@@ -9,7 +9,7 @@ Subject: [PATCH] Fix 'outdated server' showing in ping before server fully
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketStatusListener.java b/src/main/java/net/minecraft/server/PacketStatusListener.java
|
||||
index 4bb21c48b..30f16db02 100644
|
||||
index da804a990..6b32bc233 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketStatusListener.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketStatusListener.java
|
||||
@@ -135,6 +135,7 @@ public class PacketStatusListener implements PacketStatusInListener {
|
||||
@@ -1,42 +1,41 @@
|
||||
From 2379deeae65cfb447a5c515621504e1092df675f Mon Sep 17 00:00:00 2001
|
||||
From a74080199c03418349b2f1857905c2349fce12c4 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 15 Jun 2019 03:12:15 -0500
|
||||
Subject: [PATCH] Make Iron Golems Swim
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityIronGolem.java | 1 +
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
2 files changed, 3 insertions(+)
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
||||
2 files changed, 6 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityIronGolem.java b/src/main/java/net/minecraft/server/EntityIronGolem.java
|
||||
index 288a043fb..0cc3b8eb0 100644
|
||||
index e38a675be..ab0731c2a 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityIronGolem.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityIronGolem.java
|
||||
@@ -36,6 +36,7 @@ public class EntityIronGolem extends EntityGolem {
|
||||
@@ -24,6 +24,7 @@ public class EntityIronGolem extends EntityGolem implements IEntityAngerable {
|
||||
|
||||
@Override
|
||||
protected void initPathfinder() {
|
||||
+ if (world.purpurConfig.ironGolemCanSwim) this.goalSelector.a(0, new PathfinderGoalFloat(this)); // Purpur
|
||||
this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
||||
this.goalSelector.a(1, new PathfinderGoalMeleeAttack(this, 1.0D, true));
|
||||
this.goalSelector.a(2, new PathfinderGoalMoveTowardsTarget(this, 0.9D, 32.0F));
|
||||
this.goalSelector.a(2, new PathfinderGoalStrollVillage(this, 0.6D, false));
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index f098a36b5..a07781929 100644
|
||||
index 9e144a369..c89d2221b 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -333,10 +333,12 @@ public class PurpurWorldConfig {
|
||||
public boolean ironGolemRidable = false;
|
||||
public boolean ironGolemRidableInWater = false;
|
||||
public boolean ironGolemRequireShiftToMount = true;
|
||||
+ public boolean ironGolemCanSwim = false;
|
||||
private void ironGolemSettings() {
|
||||
ironGolemRidable = getBoolean("mobs.iron_golem.ridable", ironGolemRidable);
|
||||
ironGolemRidableInWater = getBoolean("mobs.iron_golem.ridable-in-water", ironGolemRidableInWater);
|
||||
ironGolemRequireShiftToMount = getBoolean("mobs.iron_golem.require-shift-to-mount", ironGolemRequireShiftToMount);
|
||||
+ ironGolemCanSwim = getBoolean("mobs.iron_golem.can-swim", ironGolemCanSwim);
|
||||
@@ -123,6 +123,11 @@ public class PurpurWorldConfig {
|
||||
illusionerFollowRange = getDouble("mobs.illusioner.follow-range", illusionerFollowRange);
|
||||
}
|
||||
|
||||
public boolean llamaRidable = false;
|
||||
+ public boolean ironGolemCanSwim = false;
|
||||
+ private void ironGolemSettings() {
|
||||
+ ironGolemCanSwim = getBoolean("mobs.iron_golem.can-swim", ironGolemCanSwim);
|
||||
+ }
|
||||
+
|
||||
public double rabbitNaturalToast = 0.0D;
|
||||
public double rabbitNaturalKiller = 0.0D;
|
||||
private void rabbitSettings() {
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 610bf17eeaba736705cb6223e21e9f03327de3b3 Mon Sep 17 00:00:00 2001
|
||||
From 2e265fe093ff3fefc0579df66571791c61b4e0e4 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 6 Jul 2019 17:00:04 -0500
|
||||
Subject: [PATCH] Dont send useless entity packets
|
||||
@@ -10,10 +10,10 @@ Subject: [PATCH] Dont send useless entity packets
|
||||
3 files changed, 27 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||
index 1bd703848..adf7c9180 100644
|
||||
index 10cae053b..509df9bab 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||
@@ -170,6 +170,7 @@ public class EntityTrackerEntry {
|
||||
@@ -177,6 +177,7 @@ public class EntityTrackerEntry {
|
||||
this.o = 0;
|
||||
packet1 = new PacketPlayOutEntityTeleport(this.tracker);
|
||||
}
|
||||
@@ -21,7 +21,7 @@ index 1bd703848..adf7c9180 100644
|
||||
}
|
||||
|
||||
if ((this.e || this.tracker.impulse || this.tracker instanceof EntityLiving && ((EntityLiving) this.tracker).isGliding()) && this.tickCounter > 0) {
|
||||
@@ -256,6 +257,22 @@ public class EntityTrackerEntry {
|
||||
@@ -263,6 +264,22 @@ public class EntityTrackerEntry {
|
||||
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ index 1bd703848..adf7c9180 100644
|
||||
this.tracker.c(entityplayer);
|
||||
entityplayer.c(this.tracker);
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutEntity.java b/src/main/java/net/minecraft/server/PacketPlayOutEntity.java
|
||||
index e5da2b19c..5b1d95935 100644
|
||||
index 6d9d52e4f..0010448e3 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketPlayOutEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketPlayOutEntity.java
|
||||
@@ -5,11 +5,11 @@ import java.io.IOException;
|
||||
@@ -66,11 +66,11 @@ index e5da2b19c..5b1d95935 100644
|
||||
protected boolean h;
|
||||
protected boolean i;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index d6f82d119..d3e1c8c40 100644
|
||||
index b520cd28b..e8a0438ec 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -139,6 +139,11 @@ public class PurpurConfig {
|
||||
loggerSuppressIgnoredAdvancementWarnings = getBoolean("settings.logger.suppress-ignored-advancement-warnings", loggerSuppressIgnoredAdvancementWarnings);
|
||||
@@ -176,6 +176,11 @@ public class PurpurConfig {
|
||||
enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
|
||||
}
|
||||
|
||||
+ public static boolean dontSendUselessEntityPackets = false;
|
||||
@@ -78,9 +78,9 @@ index d6f82d119..d3e1c8c40 100644
|
||||
+ dontSendUselessEntityPackets = getBoolean("settings.dont-send-useless-entity-packets", dontSendUselessEntityPackets);
|
||||
+ }
|
||||
+
|
||||
private static void timingsSettings() {
|
||||
getString("settings.timings.url", "https://timings.pl3x.net");
|
||||
}
|
||||
public static boolean fixItemPositionDesync = false;
|
||||
private static void fixItemPositionDesync() {
|
||||
fixItemPositionDesync = getBoolean("settings.fix-item-position-desync", fixItemPositionDesync);
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,111 +0,0 @@
|
||||
From 5b624aa8deb3cfbba28a2f8dbee3ac28b61afad6 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 13 Jul 2019 15:56:22 -0500
|
||||
Subject: [PATCH] Tulips change fox type
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/EntityFox.java | 33 +++++++++++++++++--
|
||||
src/main/java/net/minecraft/server/Items.java | 4 +--
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
3 files changed, 34 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityFox.java b/src/main/java/net/minecraft/server/EntityFox.java
|
||||
index 4f53090d3..13afd7bcd 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityFox.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityFox.java
|
||||
@@ -37,9 +37,9 @@ public class EntityFox extends EntityAnimal {
|
||||
private static final Predicate<Entity> bD = (entity) -> {
|
||||
return !entity.bm() && IEntitySelector.e.test(entity);
|
||||
};
|
||||
- private PathfinderGoal bE;
|
||||
- private PathfinderGoal bF;
|
||||
- private PathfinderGoal bG;
|
||||
+ private PathfinderGoal bE; private PathfinderGoal attackAnimalGoal() { return bE; } // Purpur - OBFHELPER
|
||||
+ private PathfinderGoal bF; private PathfinderGoal attackTurtleGoal() { return bF; } // Purpur - OBFHELPER
|
||||
+ private PathfinderGoal bG; private PathfinderGoal attackFishGoal() { return bG; } // Purpur - OBFHELPER
|
||||
private float bH;
|
||||
private float bI;
|
||||
private float bJ;
|
||||
@@ -245,6 +245,11 @@ public class EntityFox extends EntityAnimal {
|
||||
}
|
||||
|
||||
private void initializePathFinderGoals() {
|
||||
+ // Purpur start - do not add duplicate goals
|
||||
+ this.targetSelector.a(attackAnimalGoal());
|
||||
+ this.targetSelector.a(attackTurtleGoal());
|
||||
+ this.targetSelector.a(attackFishGoal());
|
||||
+ // Purpur end
|
||||
if (this.getFoxType() == EntityFox.Type.RED) {
|
||||
this.targetSelector.a(4, this.bE);
|
||||
this.targetSelector.a(4, this.bF);
|
||||
@@ -277,6 +282,7 @@ public class EntityFox extends EntityAnimal {
|
||||
|
||||
public void setFoxType(EntityFox.Type entityfox_type) {
|
||||
this.datawatcher.set(EntityFox.bw, entityfox_type.c());
|
||||
+ initializePathFinderGoals(); // Purpur - fix API bug not updating pathfinders on type change
|
||||
}
|
||||
|
||||
private List<UUID> eE() {
|
||||
@@ -620,6 +626,27 @@ public class EntityFox extends EntityAnimal {
|
||||
return !hasRider() ? super.getJumpHeight() : 0.5F;
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public boolean a(EntityHuman entityhuman, EnumHand enumhand) {
|
||||
+ if (world.purpurConfig.foxTypeChangesWithTulips) {
|
||||
+ ItemStack itemstack = entityhuman.b(enumhand);
|
||||
+ if (getFoxType() == Type.RED && itemstack.getItem() == Items.whiteTulip()) {
|
||||
+ setFoxType(Type.SNOW);
|
||||
+ if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
+ itemstack.subtract(1);
|
||||
+ }
|
||||
+ return true;
|
||||
+ } else if (getFoxType() == Type.SNOW && itemstack.getItem() == Items.orangeTulip()) {
|
||||
+ setFoxType(Type.RED);
|
||||
+ if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
+ itemstack.subtract(1);
|
||||
+ }
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+ return super.a(entityhuman, enumhand);
|
||||
+ }
|
||||
+
|
||||
@Override
|
||||
public void onMount(EntityHuman entityhuman) {
|
||||
super.onMount(entityhuman);
|
||||
diff --git a/src/main/java/net/minecraft/server/Items.java b/src/main/java/net/minecraft/server/Items.java
|
||||
index 54670f64c..9c9b93f28 100644
|
||||
--- a/src/main/java/net/minecraft/server/Items.java
|
||||
+++ b/src/main/java/net/minecraft/server/Items.java
|
||||
@@ -106,8 +106,8 @@ public class Items {
|
||||
public static final Item aX = a(Blocks.ALLIUM, CreativeModeTab.c);
|
||||
public static final Item aY = a(Blocks.AZURE_BLUET, CreativeModeTab.c);
|
||||
public static final Item aZ = a(Blocks.RED_TULIP, CreativeModeTab.c);
|
||||
- public static final Item ba = a(Blocks.ORANGE_TULIP, CreativeModeTab.c);
|
||||
- public static final Item bb = a(Blocks.WHITE_TULIP, CreativeModeTab.c);
|
||||
+ public static final Item ba = a(Blocks.ORANGE_TULIP, CreativeModeTab.c); public static Item orangeTulip() { return ba; } // Purpur - OBFHELPER
|
||||
+ public static final Item bb = a(Blocks.WHITE_TULIP, CreativeModeTab.c); public static Item whiteTulip() { return bb; } // Purpur - OBFHELPER
|
||||
public static final Item bc = a(Blocks.PINK_TULIP, CreativeModeTab.c);
|
||||
public static final Item bd = a(Blocks.OXEYE_DAISY, CreativeModeTab.c);
|
||||
public static final Item be = a(Blocks.CORNFLOWER, CreativeModeTab.c);
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index b76a8c5be..a2fce0c63 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -335,10 +335,12 @@ public class PurpurWorldConfig {
|
||||
public boolean foxRidable = false;
|
||||
public boolean foxRidableInWater = false;
|
||||
public boolean foxRequireShiftToMount = true;
|
||||
+ public boolean foxTypeChangesWithTulips = false;
|
||||
private void foxSettings() {
|
||||
foxRidable = getBoolean("mobs.fox.ridable", foxRidable);
|
||||
foxRidableInWater = getBoolean("mobs.fox.ridable-in-water", foxRidableInWater);
|
||||
foxRequireShiftToMount = getBoolean("mobs.fox.require-shift-to-mount", foxRequireShiftToMount);
|
||||
+ foxTypeChangesWithTulips = getBoolean("mobs.fox.tulips-change-type", foxTypeChangesWithTulips);
|
||||
}
|
||||
|
||||
public boolean ghastRidable = false;
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
From 48d14d7c57478a6af1c85d20a59ebef69b43ec9e Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Mon, 22 Jul 2019 14:24:26 -0500
|
||||
Subject: [PATCH] Pillager limits and leaders chance
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/ChunkProviderGenerate.java | 1 +
|
||||
.../java/net/minecraft/server/EntityMonsterPatrolling.java | 7 ++++++-
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 6 ++++++
|
||||
3 files changed, 13 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkProviderGenerate.java b/src/main/java/net/minecraft/server/ChunkProviderGenerate.java
|
||||
index 70f43c515..fa08b8e1a 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkProviderGenerate.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkProviderGenerate.java
|
||||
@@ -143,6 +143,7 @@ public class ChunkProviderGenerate extends ChunkGeneratorAbstract<GeneratorSetti
|
||||
}
|
||||
} else if (enumcreaturetype == EnumCreatureType.MONSTER) {
|
||||
if (WorldGenerator.PILLAGER_OUTPOST.a(this.a, blockposition)) {
|
||||
+ if (getWorld().purpurConfig.pillagerLimitOutpostSpawns <= 0 || getWorld().getEntitiesByClass(EntityPillager.class, new AxisAlignedBB(blockposition).grow(128)).size() < getWorld().purpurConfig.pillagerLimitOutpostSpawns) // Purpur
|
||||
return WorldGenerator.PILLAGER_OUTPOST.e();
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityMonsterPatrolling.java b/src/main/java/net/minecraft/server/EntityMonsterPatrolling.java
|
||||
index f44334b9e..70559714a 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityMonsterPatrolling.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityMonsterPatrolling.java
|
||||
@@ -49,6 +49,7 @@ public abstract class EntityMonsterPatrolling extends EntityMonster {
|
||||
return -0.45D;
|
||||
}
|
||||
|
||||
+ public boolean canBeLeader() { return this.es(); } // Purpur
|
||||
public boolean es() {
|
||||
return true;
|
||||
}
|
||||
@@ -56,7 +57,11 @@ public abstract class EntityMonsterPatrolling extends EntityMonster {
|
||||
@Nullable
|
||||
@Override
|
||||
public GroupDataEntity prepare(GeneratorAccess generatoraccess, DifficultyDamageScaler difficultydamagescaler, EnumMobSpawn enummobspawn, @Nullable GroupDataEntity groupdataentity, @Nullable NBTTagCompound nbttagcompound) {
|
||||
- if (enummobspawn != EnumMobSpawn.PATROL && enummobspawn != EnumMobSpawn.EVENT && enummobspawn != EnumMobSpawn.STRUCTURE && this.random.nextFloat() < 0.06F && this.es()) {
|
||||
+ // Purpur start
|
||||
+ World world = generatoraccess.getMinecraftWorld();
|
||||
+ if (this.canBeLeader() && enummobspawn != EnumMobSpawn.PATROL && enummobspawn != EnumMobSpawn.EVENT && enummobspawn != EnumMobSpawn.STRUCTURE && this.random.nextFloat() < world.purpurConfig.pillagerLeaderChance) {
|
||||
+ if (world.purpurConfig.pillagerLeaderRangeCheck <= 0 || (this instanceof EntityPillager && world.getEntitiesByClass(EntityPillager.class, new AxisAlignedBB(new BlockPosition(this)).grow(world.purpurConfig.pillagerLeaderRangeCheck)).size() == 0))
|
||||
+ // Purpur end
|
||||
this.patrolLeader = true;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index a2fce0c63..299b080c8 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -525,10 +525,16 @@ public class PurpurWorldConfig {
|
||||
public boolean pillagerRidable = false;
|
||||
public boolean pillagerRidableInWater = false;
|
||||
public boolean pillagerRequireShiftToMount = true;
|
||||
+ public int pillagerLimitOutpostSpawns = 0;
|
||||
+ public float pillagerLeaderChance = 0.06F;
|
||||
+ public int pillagerLeaderRangeCheck = 0;
|
||||
private void pillagerSettings() {
|
||||
pillagerRidable = getBoolean("mobs.pillager.ridable", pillagerRidable);
|
||||
pillagerRidableInWater = getBoolean("mobs.pillager.ridable-in-water", pillagerRidableInWater);
|
||||
pillagerRequireShiftToMount = getBoolean("mobs.pillager.require-shift-to-mount", pillagerRequireShiftToMount);
|
||||
+ pillagerLimitOutpostSpawns = getInt("mobs.pillager.limit-outpost-spawns", pillagerLimitOutpostSpawns);
|
||||
+ pillagerLeaderChance = (float) getDouble("mobs.pillager.leader.chance", pillagerLeaderChance);
|
||||
+ pillagerLeaderRangeCheck = getInt("mobs.pillager.leader.range-check-for-other-leaders", pillagerLeaderRangeCheck);
|
||||
}
|
||||
|
||||
public boolean polarBearRidable = false;
|
||||
--
|
||||
2.26.2
|
||||
|
||||
110
patches/server/0043-Tulips-change-fox-type.patch
Normal file
110
patches/server/0043-Tulips-change-fox-type.patch
Normal file
@@ -0,0 +1,110 @@
|
||||
From d544c399255148396c6f85f93a1dc42826115de5 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 13 Jul 2019 15:56:22 -0500
|
||||
Subject: [PATCH] Tulips change fox type
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/EntityFox.java | 33 +++++++++++++++++--
|
||||
src/main/java/net/minecraft/server/Items.java | 4 +--
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 5 +++
|
||||
3 files changed, 37 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityFox.java b/src/main/java/net/minecraft/server/EntityFox.java
|
||||
index e6275a9fe..90b01adbe 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityFox.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityFox.java
|
||||
@@ -37,9 +37,9 @@ public class EntityFox extends EntityAnimal {
|
||||
private static final Predicate<Entity> bC = (entity) -> {
|
||||
return !entity.bt() && IEntitySelector.e.test(entity);
|
||||
};
|
||||
- private PathfinderGoal bD;
|
||||
- private PathfinderGoal bE;
|
||||
- private PathfinderGoal bF;
|
||||
+ private PathfinderGoal bD; private PathfinderGoal attackAnimalGoal() { return bD; } // Purpur - OBFHELPER
|
||||
+ private PathfinderGoal bE; private PathfinderGoal attackTurtleGoal() { return bE; } // Purpur - OBFHELPER
|
||||
+ private PathfinderGoal bF; private PathfinderGoal attackFishGoal() { return bF; } // Purpur - OBFHELPER
|
||||
private float bG;
|
||||
private float bH;
|
||||
private float bI;
|
||||
@@ -227,6 +227,11 @@ public class EntityFox extends EntityAnimal {
|
||||
}
|
||||
|
||||
private void initializePathFinderGoals() {
|
||||
+ // Purpur start - do not add duplicate goals
|
||||
+ this.targetSelector.a(attackAnimalGoal());
|
||||
+ this.targetSelector.a(attackTurtleGoal());
|
||||
+ this.targetSelector.a(attackFishGoal());
|
||||
+ // Purpur end
|
||||
if (this.getFoxType() == EntityFox.Type.RED) {
|
||||
this.targetSelector.a(4, this.bD);
|
||||
this.targetSelector.a(4, this.bE);
|
||||
@@ -259,6 +264,7 @@ public class EntityFox extends EntityAnimal {
|
||||
|
||||
public void setFoxType(EntityFox.Type entityfox_type) {
|
||||
this.datawatcher.set(EntityFox.bv, entityfox_type.c());
|
||||
+ initializePathFinderGoals(); // Purpur - fix API bug not updating pathfinders on type change
|
||||
}
|
||||
|
||||
private List<UUID> fb() {
|
||||
@@ -575,6 +581,27 @@ public class EntityFox extends EntityAnimal {
|
||||
return this.fb().contains(uuid);
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public EnumInteractionResult b(EntityHuman entityhuman, EnumHand enumhand) {
|
||||
+ if (world.purpurConfig.foxTypeChangesWithTulips) {
|
||||
+ ItemStack itemstack = entityhuman.b(enumhand);
|
||||
+ if (getFoxType() == Type.RED && itemstack.getItem() == Items.whiteTulip()) {
|
||||
+ setFoxType(Type.SNOW);
|
||||
+ if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
+ itemstack.subtract(1);
|
||||
+ }
|
||||
+ return EnumInteractionResult.SUCCESS;
|
||||
+ } else if (getFoxType() == Type.SNOW && itemstack.getItem() == Items.orangeTulip()) {
|
||||
+ setFoxType(Type.RED);
|
||||
+ if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
+ itemstack.subtract(1);
|
||||
+ }
|
||||
+ return EnumInteractionResult.SUCCESS;
|
||||
+ }
|
||||
+ }
|
||||
+ return super.b(entityhuman, enumhand);
|
||||
+ }
|
||||
+
|
||||
@Override
|
||||
protected org.bukkit.event.entity.EntityDeathEvent d(DamageSource damagesource) { // Paper
|
||||
ItemStack itemstack = this.getEquipment(EnumItemSlot.MAINHAND).cloneItemStack(); // Paper
|
||||
diff --git a/src/main/java/net/minecraft/server/Items.java b/src/main/java/net/minecraft/server/Items.java
|
||||
index 619c40b27..b5305eaa9 100644
|
||||
--- a/src/main/java/net/minecraft/server/Items.java
|
||||
+++ b/src/main/java/net/minecraft/server/Items.java
|
||||
@@ -119,8 +119,8 @@ public class Items {
|
||||
public static final Item bk = a(Blocks.ALLIUM, CreativeModeTab.c);
|
||||
public static final Item bl = a(Blocks.AZURE_BLUET, CreativeModeTab.c);
|
||||
public static final Item bm = a(Blocks.RED_TULIP, CreativeModeTab.c);
|
||||
- public static final Item bn = a(Blocks.ORANGE_TULIP, CreativeModeTab.c);
|
||||
- public static final Item bo = a(Blocks.WHITE_TULIP, CreativeModeTab.c);
|
||||
+ public static final Item bn = a(Blocks.ORANGE_TULIP, CreativeModeTab.c); public static Item orangeTulip() { return bn; } // Purpur - OBFHELPER
|
||||
+ public static final Item bo = a(Blocks.WHITE_TULIP, CreativeModeTab.c); public static Item whiteTulip() { return bo; } // Purpur - OBFHELPER
|
||||
public static final Item bp = a(Blocks.PINK_TULIP, CreativeModeTab.c);
|
||||
public static final Item bq = a(Blocks.OXEYE_DAISY, CreativeModeTab.c);
|
||||
public static final Item br = a(Blocks.CORNFLOWER, CreativeModeTab.c);
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index c89d2221b..8d620b4ef 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -97,6 +97,11 @@ public class PurpurWorldConfig {
|
||||
creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
|
||||
}
|
||||
|
||||
+ public boolean foxTypeChangesWithTulips = false;
|
||||
+ private void foxSettings() {
|
||||
+ foxTypeChangesWithTulips = getBoolean("mobs.fox.tulips-change-type", foxTypeChangesWithTulips);
|
||||
+ }
|
||||
+
|
||||
public float giantStepHeight = 2.0F;
|
||||
public float giantJumpHeight = 1.0F;
|
||||
public double giantMaxHealth = 100.0D;
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,22 +1,26 @@
|
||||
From 1ee64e547cf37152de6744d3774470e7a29f945e Mon Sep 17 00:00:00 2001
|
||||
From de732dfe84607cb98f4cda698738c786db24a793 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 26 Mar 2020 19:46:44 -0500
|
||||
Subject: [PATCH] Breedable Polar Bears
|
||||
|
||||
---
|
||||
.../net/minecraft/server/EntityPolarBear.java | 30 ++++++++++++++++++-
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 5 ++++
|
||||
2 files changed, 34 insertions(+), 1 deletion(-)
|
||||
.../net/minecraft/server/EntityPolarBear.java | 34 ++++++++++++++++++-
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 12 +++++++
|
||||
2 files changed, 45 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPolarBear.java b/src/main/java/net/minecraft/server/EntityPolarBear.java
|
||||
index 0a3906bde..42fef3aba 100644
|
||||
index 69e5c1aed..6506e0055 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPolarBear.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPolarBear.java
|
||||
@@ -32,6 +32,28 @@ public class EntityPolarBear extends EntityAnimal {
|
||||
public boolean requireShiftToMount() {
|
||||
return world.purpurConfig.polarBearRequireShiftToMount;
|
||||
@@ -28,15 +28,45 @@ public class EntityPolarBear extends EntityAnimal implements IEntityAngerable {
|
||||
|
||||
@Override
|
||||
public boolean k(ItemStack itemstack) {
|
||||
- return false;
|
||||
+ return world.purpurConfig.polarBearBreedableItem != null && itemstack.getItem() == world.purpurConfig.polarBearBreedableItem; // Purpur;
|
||||
}
|
||||
+
|
||||
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public boolean mate(EntityAnimal entityanimal) {
|
||||
+ if (entityanimal == this) {
|
||||
@@ -38,20 +42,12 @@ index 0a3906bde..42fef3aba 100644
|
||||
+ return this.isInLove() && polarbear.isInLove();
|
||||
+ }
|
||||
+ }
|
||||
// Purpur end
|
||||
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
@@ -41,7 +63,7 @@ public class EntityPolarBear extends EntityAnimal {
|
||||
|
||||
@Override
|
||||
public boolean i(ItemStack itemstack) {
|
||||
- return false;
|
||||
+ return world.purpurConfig.polarBearBreedableItem != null && itemstack.getItem() == world.purpurConfig.polarBearBreedableItem; // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -51,6 +73,12 @@ public class EntityPolarBear extends EntityAnimal {
|
||||
this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
||||
protected void initPathfinder() {
|
||||
super.initPathfinder();
|
||||
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
||||
this.goalSelector.a(1, new EntityPolarBear.c());
|
||||
this.goalSelector.a(1, new EntityPolarBear.d());
|
||||
+ // Purpur start
|
||||
@@ -63,26 +59,49 @@ index 0a3906bde..42fef3aba 100644
|
||||
this.goalSelector.a(4, new PathfinderGoalFollowParent(this, 1.25D));
|
||||
this.goalSelector.a(5, new PathfinderGoalRandomStroll(this, 1.0D));
|
||||
this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F));
|
||||
@@ -178,10 +208,12 @@ public class EntityPolarBear extends EntityAnimal implements IEntityAngerable {
|
||||
return flag;
|
||||
}
|
||||
|
||||
+ public boolean isStanding() { return eN(); } // Purpur - OBFHELPER
|
||||
public boolean eN() {
|
||||
return (Boolean) this.datawatcher.get(EntityPolarBear.bv);
|
||||
}
|
||||
|
||||
+ public void setStanding(boolean standing) { t(standing); } // Purpur - OBFHELPER
|
||||
public void t(boolean flag) {
|
||||
this.datawatcher.set(EntityPolarBear.bv, flag);
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 01b8fffe1..ced9edf82 100644
|
||||
index 8d620b4ef..12e263d21 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -666,10 +666,15 @@ public class PurpurWorldConfig {
|
||||
public boolean polarBearRidable = false;
|
||||
public boolean polarBearRidableInWater = false;
|
||||
public boolean polarBearRequireShiftToMount = true;
|
||||
@@ -1,6 +1,10 @@
|
||||
package net.pl3x.purpur;
|
||||
|
||||
import com.destroystokyo.paper.PaperWorldConfig;
|
||||
+import net.minecraft.server.IRegistry;
|
||||
+import net.minecraft.server.Item;
|
||||
+import net.minecraft.server.Items;
|
||||
+import net.minecraft.server.MinecraftKey;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.spigotmc.SpigotWorldConfig;
|
||||
|
||||
@@ -133,6 +137,14 @@ public class PurpurWorldConfig {
|
||||
ironGolemCanSwim = getBoolean("mobs.iron_golem.can-swim", ironGolemCanSwim);
|
||||
}
|
||||
|
||||
+ public String polarBearBreedableItemString = "";
|
||||
+ public Item polarBearBreedableItem = null;
|
||||
private void polarBearSettings() {
|
||||
polarBearRidable = getBoolean("mobs.polar_bear.ridable", polarBearRidable);
|
||||
polarBearRidableInWater = getBoolean("mobs.polar_bear.ridable-in-water", polarBearRidableInWater);
|
||||
polarBearRequireShiftToMount = getBoolean("mobs.polar_bear.require-shift-to-mount", polarBearRequireShiftToMount);
|
||||
+ private void polarBearSettings() {
|
||||
+ polarBearBreedableItemString = getString("mobs.polar_bear.breedable-item", polarBearBreedableItemString);
|
||||
+ Item item = IRegistry.ITEM.get(new MinecraftKey(polarBearBreedableItemString));
|
||||
+ if (item != Items.AIR) polarBearBreedableItem = item;
|
||||
}
|
||||
|
||||
public boolean pufferfishRidable = false;
|
||||
+ }
|
||||
+
|
||||
public double rabbitNaturalToast = 0.0D;
|
||||
public double rabbitNaturalKiller = 0.0D;
|
||||
private void rabbitSettings() {
|
||||
--
|
||||
2.26.2
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
68
patches/server/0045-Chickens-can-retaliate.patch
Normal file
68
patches/server/0045-Chickens-can-retaliate.patch
Normal file
@@ -0,0 +1,68 @@
|
||||
From c4779abb7e9a4c114128b2c3358b6f88f7fc3578 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sun, 12 Apr 2020 13:19:34 -0500
|
||||
Subject: [PATCH] Chickens can retaliate
|
||||
|
||||
---
|
||||
.../net/minecraft/server/EntityChicken.java | 21 ++++++++++++++++++-
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
||||
2 files changed, 25 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityChicken.java b/src/main/java/net/minecraft/server/EntityChicken.java
|
||||
index c6ee92343..ae1f4cb49 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityChicken.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityChicken.java
|
||||
@@ -20,14 +20,33 @@ public class EntityChicken extends EntityAnimal {
|
||||
@Override
|
||||
protected void initPathfinder() {
|
||||
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
||||
- this.goalSelector.a(1, new PathfinderGoalPanic(this, 1.4D));
|
||||
+ //this.goalSelector.a(1, new PathfinderGoalPanic(this, 1.4D)); // Purpur - moved down
|
||||
this.goalSelector.a(2, new PathfinderGoalBreed(this, 1.0D));
|
||||
this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.0D, false, EntityChicken.bC));
|
||||
this.goalSelector.a(4, new PathfinderGoalFollowParent(this, 1.1D));
|
||||
this.goalSelector.a(5, new PathfinderGoalRandomStrollLand(this, 1.0D));
|
||||
this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F));
|
||||
this.goalSelector.a(7, new PathfinderGoalRandomLookaround(this));
|
||||
+ // Purpur start
|
||||
+ if (world.purpurConfig.chickenRetaliate) {
|
||||
+ this.goalSelector.a(1, new PathfinderGoalMeleeAttack(this, 1.0D, false));
|
||||
+ this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this));
|
||||
+ } else {
|
||||
+ this.goalSelector.a(1, new PathfinderGoalPanic(this, 1.4D));
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+ }
|
||||
+
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ protected void initAttributes(World world) {
|
||||
+ if (world != null) {
|
||||
+ if (world.purpurConfig.chickenRetaliate) {
|
||||
+ this.getAttributeMap().getAttribute(GenericAttributes.ATTACK_DAMAGE).setValue(2.0D);
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
+ // Purpur end
|
||||
|
||||
@Override
|
||||
protected float b(EntityPose entitypose, EntitySize entitysize) {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 12e263d21..77cdd94d5 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -96,6 +96,11 @@ public class PurpurWorldConfig {
|
||||
turtleEggsBreakFromMinecarts = getBoolean("blocks.turtle_egg.break-from-minecarts", turtleEggsBreakFromMinecarts);
|
||||
}
|
||||
|
||||
+ public boolean chickenRetaliate = false;
|
||||
+ private void chickenSettings() {
|
||||
+ chickenRetaliate = getBoolean("mobs.chicken.retaliate", chickenRetaliate);
|
||||
+ }
|
||||
+
|
||||
public double creeperChargedChance = 0.0D;
|
||||
private void creeperSettings() {
|
||||
creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,158 +0,0 @@
|
||||
From 76ab9614c42d949915127a45567be02453e414ef Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 11 Jan 2020 23:12:52 -0600
|
||||
Subject: [PATCH] Add EntityPortalReadyEvent
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/BlockPortal.java | 16 +++++++++-------
|
||||
src/main/java/net/minecraft/server/Entity.java | 7 ++++---
|
||||
.../net/minecraft/server/PortalTravelAgent.java | 5 +++--
|
||||
.../java/net/minecraft/server/WorldServer.java | 2 +-
|
||||
4 files changed, 17 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockPortal.java b/src/main/java/net/minecraft/server/BlockPortal.java
|
||||
index 09c7c1318..6880cdd7f 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockPortal.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockPortal.java
|
||||
@@ -54,6 +54,7 @@ public class BlockPortal extends Block {
|
||||
|
||||
}
|
||||
|
||||
+ public boolean createPortal(GeneratorAccess generatoraccess, BlockPosition blockposition) { return a(generatoraccess, blockposition); } // Purpur - OBFHELPER
|
||||
public boolean a(GeneratorAccess generatoraccess, BlockPosition blockposition) {
|
||||
BlockPortal.Shape blockportal_shape = this.b(generatoraccess, blockposition);
|
||||
|
||||
@@ -67,8 +68,8 @@ public class BlockPortal extends Block {
|
||||
}
|
||||
}
|
||||
|
||||
- @Nullable
|
||||
- public BlockPortal.Shape b(GeneratorAccess generatoraccess, BlockPosition blockposition) {
|
||||
+ public BlockPortal.Shape createShape(GeneratorAccess generatoraccess, BlockPosition blockposition) { return b(generatoraccess, blockposition); } // Purpur - OBFHELPER
|
||||
+ @Nullable public BlockPortal.Shape b(GeneratorAccess generatoraccess, BlockPosition blockposition) {
|
||||
BlockPortal.Shape blockportal_shape = new BlockPortal.Shape(generatoraccess, blockposition, EnumDirection.EnumAxis.X);
|
||||
|
||||
if (blockportal_shape.d() && blockportal_shape.e == 0) {
|
||||
@@ -189,6 +190,7 @@ public class BlockPortal extends Block {
|
||||
private int height;
|
||||
private int width;
|
||||
java.util.List<org.bukkit.block.BlockState> blocks = new java.util.ArrayList<org.bukkit.block.BlockState>(); // CraftBukkit - add field
|
||||
+ public static Block FRAME_BLOCK = Blocks.OBSIDIAN; // Purpur
|
||||
|
||||
public Shape(GeneratorAccess generatoraccess, BlockPosition blockposition, EnumDirection.EnumAxis enumdirection_enumaxis) {
|
||||
this.a = generatoraccess;
|
||||
@@ -228,14 +230,14 @@ public class BlockPortal extends Block {
|
||||
for (i = 0; i < 22; ++i) {
|
||||
BlockPosition blockposition1 = blockposition.shift(enumdirection, i);
|
||||
|
||||
- if (!this.a(this.a.getType(blockposition1)) || this.a.getType(blockposition1.down()).getBlock() != Blocks.OBSIDIAN) {
|
||||
+ if (!this.a(this.a.getType(blockposition1)) || this.a.getType(blockposition1.down()).getBlock() != FRAME_BLOCK) { // Purpur
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Block block = this.a.getType(blockposition.shift(enumdirection, i)).getBlock();
|
||||
|
||||
- return block == Blocks.OBSIDIAN ? i : 0;
|
||||
+ return block == FRAME_BLOCK ? i : 0; // Purpur
|
||||
}
|
||||
|
||||
public int a() {
|
||||
@@ -270,7 +272,7 @@ public class BlockPortal extends Block {
|
||||
|
||||
if (i == 0) {
|
||||
block = this.a.getType(blockposition.shift(this.d)).getBlock();
|
||||
- if (block != Blocks.OBSIDIAN) {
|
||||
+ if (block != FRAME_BLOCK) { // Purpur
|
||||
break label56;
|
||||
// CraftBukkit start - add the block to our list
|
||||
} else {
|
||||
@@ -280,7 +282,7 @@ public class BlockPortal extends Block {
|
||||
}
|
||||
} else if (i == this.width - 1) {
|
||||
block = this.a.getType(blockposition.shift(this.c)).getBlock();
|
||||
- if (block != Blocks.OBSIDIAN) {
|
||||
+ if (block != FRAME_BLOCK) { // Purpur
|
||||
break label56;
|
||||
// CraftBukkit start - add the block to our list
|
||||
} else {
|
||||
@@ -293,7 +295,7 @@ public class BlockPortal extends Block {
|
||||
}
|
||||
|
||||
for (i = 0; i < this.width; ++i) {
|
||||
- if (this.a.getType(this.position.shift(this.c, i).up(this.height)).getBlock() != Blocks.OBSIDIAN) {
|
||||
+ if (this.a.getType(this.position.shift(this.c, i).up(this.height)).getBlock() != FRAME_BLOCK) { // Purpur
|
||||
this.height = 0;
|
||||
break;
|
||||
// CraftBukkit start - add the block to our list
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 580843686..bdf79302b 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -170,9 +170,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
protected boolean af; public final boolean inPortal() { return this.af; } // Paper - OBFHELPER
|
||||
protected int ag;
|
||||
public DimensionManager dimension;
|
||||
- protected BlockPosition ai;
|
||||
- protected Vec3D aj;
|
||||
- protected EnumDirection ak;
|
||||
+ public BlockPosition ai; // Purpur - protected -> public
|
||||
+ public Vec3D aj; // Purpur - protected -> public
|
||||
+ public EnumDirection ak; // Purpur - protected -> public
|
||||
private boolean invulnerable;
|
||||
protected UUID uniqueID;
|
||||
protected String am;
|
||||
@@ -2472,6 +2472,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
this.world.getMethodProfiler().enter("portal");
|
||||
this.ag = i;
|
||||
this.portalCooldown = this.ba();
|
||||
+ if (new net.pl3x.purpur.event.entity.EntityPortalReadyEvent(getBukkitEntity()).callEvent()) // Purpur
|
||||
// CraftBukkit start
|
||||
if (this instanceof EntityPlayer) {
|
||||
((EntityPlayer) this).a(this.world.worldProvider.getDimensionManager().getType() == DimensionManager.NETHER ? DimensionManager.OVERWORLD : DimensionManager.NETHER, PlayerTeleportEvent.TeleportCause.NETHER_PORTAL);
|
||||
diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java
|
||||
index f84dd6d9b..f50e9670b 100644
|
||||
--- a/src/main/java/net/minecraft/server/PortalTravelAgent.java
|
||||
+++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java
|
||||
@@ -11,6 +11,7 @@ public class PortalTravelAgent {
|
||||
|
||||
private final WorldServer world;
|
||||
private final Random b;
|
||||
+ public Block FRAME_BLOCK = Blocks.OBSIDIAN; // Purpur
|
||||
|
||||
public PortalTravelAgent(WorldServer worldserver) {
|
||||
this.world = worldserver;
|
||||
@@ -233,7 +234,7 @@ public class PortalTravelAgent {
|
||||
boolean flag1 = l2 < 0;
|
||||
|
||||
blockposition_mutableblockposition.d(j3, l3, i4);
|
||||
- blockList.setTypeAndData(blockposition_mutableblockposition, flag1 ? Blocks.OBSIDIAN.getBlockData() : Blocks.AIR.getBlockData(), 3); // CraftBukkit
|
||||
+ blockList.setTypeAndData(blockposition_mutableblockposition, flag1 ? FRAME_BLOCK.getBlockData() : Blocks.AIR.getBlockData(), 3); // CraftBukkit // Purpur
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -243,7 +244,7 @@ public class PortalTravelAgent {
|
||||
for (i3 = -1; i3 < 4; ++i3) {
|
||||
if (k2 == -1 || k2 == 2 || i3 == -1 || i3 == 3) {
|
||||
blockposition_mutableblockposition.d(i5 + k2 * k5, j5 + i3, j2 + k2 * l5);
|
||||
- blockList.setTypeAndData(blockposition_mutableblockposition, Blocks.OBSIDIAN.getBlockData(), 3); // CraftBukkit
|
||||
+ blockList.setTypeAndData(blockposition_mutableblockposition, FRAME_BLOCK.getBlockData(), 3); // CraftBukkit // Purpur
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 156c87ed4..610542dc8 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -76,7 +76,7 @@ public class WorldServer extends World {
|
||||
public boolean savingDisabled;
|
||||
private boolean everyoneSleeping;
|
||||
private int emptyTime;
|
||||
- private final PortalTravelAgent portalTravelAgent;
|
||||
+ public PortalTravelAgent portalTravelAgent; // Purpur - private final -> public non-final
|
||||
private final TickListServer<Block> nextTickListBlock;
|
||||
private final TickListServer<FluidType> nextTickListFluid;
|
||||
private final Set<NavigationAbstract> navigators; final com.tuinity.tuinity.util.maplist.IteratorSafeOrderedReferenceSet<NavigationAbstract> navigatorsForIteration = new com.tuinity.tuinity.util.maplist.IteratorSafeOrderedReferenceSet<>(2048, 0.5f, 2048, 0.2); // Tuinity - make removing entities while ticking safe
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
From 400fc0a593ffa7945c7d199507bcddd2273666e0 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 6 Oct 2019 12:46:35 -0500
|
||||
Subject: [PATCH] Add option to set armorstand step height
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityArmorStand.java | 1 +
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
||||
2 files changed, 6 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java
|
||||
index 250bccee4..7543f2cee 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityArmorStand.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityArmorStand.java
|
||||
@@ -615,6 +615,7 @@ public class EntityArmorStand extends EntityLiving {
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
+ setStepHeight(world.purpurConfig.armorstandStepHeight); // Purpur
|
||||
// Paper start
|
||||
if (!this.canTick) {
|
||||
if (this.noTickPoseDirty) {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 77cdd94d5..d403450e2 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -69,6 +69,11 @@ public class PurpurWorldConfig {
|
||||
return PurpurConfig.config.getString("world-settings." + worldName + "." + path, PurpurConfig.config.getString("world-settings.default." + path));
|
||||
}
|
||||
|
||||
+ public float armorstandStepHeight = 0.0F;
|
||||
+ private void armorstandSettings() {
|
||||
+ armorstandStepHeight = (float) getDouble("gameplay-mechanics.armorstand.step-height", armorstandStepHeight);
|
||||
+ }
|
||||
+
|
||||
public boolean idleTimeoutKick = true;
|
||||
public boolean idleTimeoutTickNearbyEntities = true;
|
||||
public boolean idleTimeoutCountAsSleeping = false;
|
||||
--
|
||||
2.26.2
|
||||
|
||||
143
patches/server/0047-Cat-spawning-options.patch
Normal file
143
patches/server/0047-Cat-spawning-options.patch
Normal file
@@ -0,0 +1,143 @@
|
||||
From 55b3a3d0f209f9fed5b1973bb36c08b6534aaafc Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 26 Dec 2019 18:52:55 -0600
|
||||
Subject: [PATCH] Cat spawning options
|
||||
|
||||
---
|
||||
.../net/minecraft/server/IEntityAccess.java | 1 +
|
||||
.../net/minecraft/server/MobSpawnerCat.java | 24 ++++++++++++-------
|
||||
.../net/minecraft/server/VillagePlace.java | 1 +
|
||||
.../minecraft/server/VillagePlaceType.java | 3 ++-
|
||||
.../net/minecraft/server/WorldServer.java | 1 +
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 9 +++++++
|
||||
6 files changed, 30 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java
|
||||
index d3ea51c27..c9a808e22 100644
|
||||
--- a/src/main/java/net/minecraft/server/IEntityAccess.java
|
||||
+++ b/src/main/java/net/minecraft/server/IEntityAccess.java
|
||||
@@ -45,6 +45,7 @@ public interface IEntityAccess {
|
||||
}
|
||||
}
|
||||
|
||||
+ default <T extends Entity> List<T> getEntitiesInAABB(Class<? extends T> oclass, AxisAlignedBB axisalignedbb) { return a(oclass, axisalignedbb); } // Purpur - OBFHELPER
|
||||
default <T extends Entity> List<T> a(Class<? extends T> oclass, AxisAlignedBB axisalignedbb) {
|
||||
return this.a(oclass, axisalignedbb, IEntitySelector.g);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/MobSpawnerCat.java b/src/main/java/net/minecraft/server/MobSpawnerCat.java
|
||||
index 67c20747a..68d37121f 100644
|
||||
--- a/src/main/java/net/minecraft/server/MobSpawnerCat.java
|
||||
+++ b/src/main/java/net/minecraft/server/MobSpawnerCat.java
|
||||
@@ -16,7 +16,7 @@ public class MobSpawnerCat implements MobSpawner {
|
||||
if (this.a > 0) {
|
||||
return 0;
|
||||
} else {
|
||||
- this.a = 1200;
|
||||
+ this.a = worldserver.purpurConfig.catSpawnDelay; // Purpur;
|
||||
EntityPlayer entityplayer = worldserver.h();
|
||||
|
||||
if (entityplayer == null) {
|
||||
@@ -50,10 +50,14 @@ public class MobSpawnerCat implements MobSpawner {
|
||||
}
|
||||
|
||||
private int a(WorldServer worldserver, BlockPosition blockposition) {
|
||||
- boolean flag = true;
|
||||
-
|
||||
- if (worldserver.x().a(VillagePlaceType.r.c(), blockposition, 48, VillagePlace.Occupancy.IS_OCCUPIED) > 4L) {
|
||||
- List<EntityCat> list = worldserver.a(EntityCat.class, (new AxisAlignedBB(blockposition)).grow(48.0D, 8.0D, 48.0D));
|
||||
+ // Purpur start
|
||||
+ int range = worldserver.purpurConfig.catSpawnVillageScanRange;
|
||||
+ if (range <= 0) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+ if (worldserver.getVillagePlace().count(VillagePlaceType.home().predicate(), blockposition, range, VillagePlace.Occupancy.IS_OCCUPIED) > 4L) {
|
||||
+ List<EntityCat> list = worldserver.a(EntityCat.class, (new AxisAlignedBB(blockposition)).grow(range, 8.0D, range));
|
||||
+ // Purpur end
|
||||
|
||||
if (list.size() < 5) {
|
||||
return this.a(blockposition, (World) worldserver);
|
||||
@@ -64,9 +68,13 @@ public class MobSpawnerCat implements MobSpawner {
|
||||
}
|
||||
|
||||
private int a(World world, BlockPosition blockposition) {
|
||||
- boolean flag = true;
|
||||
- List<EntityCat> list = world.a(EntityCat.class, (new AxisAlignedBB(blockposition)).grow(16.0D, 8.0D, 16.0D));
|
||||
-
|
||||
+ // Purpur start
|
||||
+ int range = world.purpurConfig.catSpawnSwampHutScanRange;
|
||||
+ if (range <= 0) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+ List<EntityCat> list = world.getEntitiesInAABB(EntityCat.class, (new AxisAlignedBB(blockposition)).grow(range, 8.0D, range));
|
||||
+ // Purpur end
|
||||
return list.size() < 1 ? this.a(blockposition, world) : 0;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/VillagePlace.java b/src/main/java/net/minecraft/server/VillagePlace.java
|
||||
index 303f6b095..11d16842d 100644
|
||||
--- a/src/main/java/net/minecraft/server/VillagePlace.java
|
||||
+++ b/src/main/java/net/minecraft/server/VillagePlace.java
|
||||
@@ -45,6 +45,7 @@ public class VillagePlace extends RegionFileSection<VillagePlaceSection> {
|
||||
((VillagePlaceSection) this.e(SectionPosition.a(blockposition).s())).a(blockposition);
|
||||
}
|
||||
|
||||
+ public long count(Predicate<VillagePlaceType> predicate, BlockPosition blockposition, int i, VillagePlace.Occupancy villageplace_occupancy) { return a(predicate, blockposition, i, villageplace_occupancy); } // Purpur - OBFHELPER
|
||||
public long a(Predicate<VillagePlaceType> predicate, BlockPosition blockposition, int i, VillagePlace.Occupancy villageplace_occupancy) {
|
||||
return this.c(predicate, blockposition, i, villageplace_occupancy).count();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/VillagePlaceType.java b/src/main/java/net/minecraft/server/VillagePlaceType.java
|
||||
index 5bd3bcc2b..5f2bb140a 100644
|
||||
--- a/src/main/java/net/minecraft/server/VillagePlaceType.java
|
||||
+++ b/src/main/java/net/minecraft/server/VillagePlaceType.java
|
||||
@@ -44,7 +44,7 @@ public class VillagePlaceType {
|
||||
public static final VillagePlaceType o = a("shepherd", a(Blocks.LOOM), 1, 1);
|
||||
public static final VillagePlaceType p = a("toolsmith", a(Blocks.SMITHING_TABLE), 1, 1);
|
||||
public static final VillagePlaceType q = a("weaponsmith", a(Blocks.GRINDSTONE), 1, 1);
|
||||
- public static final VillagePlaceType r = a("home", VillagePlaceType.z, 1, 1);
|
||||
+ public static final VillagePlaceType r = a("home", VillagePlaceType.z, 1, 1); public static VillagePlaceType home() { return r; } // Purpur - OBFHELPER
|
||||
public static final VillagePlaceType s = a("meeting", a(Blocks.BELL), 32, 6);
|
||||
public static final VillagePlaceType t = a("beehive", a(Blocks.BEEHIVE), 0, 1);
|
||||
public static final VillagePlaceType u = a("bee_nest", a(Blocks.BEE_NEST), 0, 1);
|
||||
@@ -83,6 +83,7 @@ public class VillagePlaceType {
|
||||
return this.D;
|
||||
}
|
||||
|
||||
+ public Predicate<VillagePlaceType> predicate() { return c(); } // Purpur - OBFHELPER
|
||||
public Predicate<VillagePlaceType> c() {
|
||||
return this.E;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 7955a079b..149a0ada4 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -1881,6 +1881,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
}
|
||||
}
|
||||
|
||||
+ public VillagePlace getVillagePlace() { return x(); } // Purpur - OBFHELPER
|
||||
public VillagePlace x() {
|
||||
return this.getChunkProvider().j();
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index d403450e2..ec490745b 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -101,6 +101,15 @@ public class PurpurWorldConfig {
|
||||
turtleEggsBreakFromMinecarts = getBoolean("blocks.turtle_egg.break-from-minecarts", turtleEggsBreakFromMinecarts);
|
||||
}
|
||||
|
||||
+ public int catSpawnDelay = 1200;
|
||||
+ public int catSpawnSwampHutScanRange = 16;
|
||||
+ public int catSpawnVillageScanRange = 48;
|
||||
+ private void catSettings() {
|
||||
+ catSpawnDelay = getInt("mobs.cat.spawn-delay", catSpawnDelay);
|
||||
+ catSpawnSwampHutScanRange = getInt("mobs.cat.scan-range-for-other-cats.swamp-hut", catSpawnSwampHutScanRange);
|
||||
+ catSpawnVillageScanRange = getInt("mobs.cat.scan-range-for-other-cats.village", catSpawnVillageScanRange);
|
||||
+ }
|
||||
+
|
||||
public boolean chickenRetaliate = false;
|
||||
private void chickenSettings() {
|
||||
chickenRetaliate = getBoolean("mobs.chicken.retaliate", chickenRetaliate);
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,102 +0,0 @@
|
||||
From 5de138cbdf306a02f264c50f32f22c6864d001f1 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 1 Aug 2019 19:15:12 -0500
|
||||
Subject: [PATCH] Add blacklist option for grindstone
|
||||
|
||||
---
|
||||
.../minecraft/server/ContainerGrindstone.java | 17 +++++++++++++++++
|
||||
.../java/net/minecraft/server/ItemStack.java | 6 ++++++
|
||||
.../java/net/pl3x/purpur/PurpurWorldConfig.java | 12 ++++++++++++
|
||||
3 files changed, 35 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ContainerGrindstone.java b/src/main/java/net/minecraft/server/ContainerGrindstone.java
|
||||
index 83cb0cd64..2a849d0ec 100644
|
||||
--- a/src/main/java/net/minecraft/server/ContainerGrindstone.java
|
||||
+++ b/src/main/java/net/minecraft/server/ContainerGrindstone.java
|
||||
@@ -61,12 +61,24 @@ public class ContainerGrindstone extends Container {
|
||||
this.a(new Slot(this.craftInventory, 0, 49, 19) {
|
||||
@Override
|
||||
public boolean isAllowed(ItemStack itemstack) {
|
||||
+ // Purpur start
|
||||
+ if (containeraccess.getWorld().purpurConfig.grindstoneBlacklistDisallowPlacement && containeraccess.getWorld().purpurConfig.grindstoneBlacklist.contains(itemstack.getId())) {
|
||||
+ getBukkitView().getTopInventory().getViewers().forEach(viewer -> ((Player) viewer).updateInventory());
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
return itemstack.e() || itemstack.getItem() == Items.ENCHANTED_BOOK || itemstack.hasEnchantments();
|
||||
}
|
||||
});
|
||||
this.a(new Slot(this.craftInventory, 1, 49, 40) {
|
||||
@Override
|
||||
public boolean isAllowed(ItemStack itemstack) {
|
||||
+ // Purpur start
|
||||
+ if (containeraccess.getWorld().purpurConfig.grindstoneBlacklistDisallowPlacement && containeraccess.getWorld().purpurConfig.grindstoneBlacklist.contains(itemstack.getId())) {
|
||||
+ getBukkitView().getTopInventory().getViewers().forEach(viewer -> ((Player) viewer).updateInventory());
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
return itemstack.e() || itemstack.getItem() == Items.ENCHANTED_BOOK || itemstack.hasEnchantments();
|
||||
}
|
||||
});
|
||||
@@ -110,6 +122,11 @@ public class ContainerGrindstone extends Container {
|
||||
}
|
||||
|
||||
private int e(ItemStack itemstack) {
|
||||
+ // Purpur start
|
||||
+ if (containeraccess.getWorld().purpurConfig.grindstoneBlacklistReturnsZeroExp && containeraccess.getWorld().purpurConfig.grindstoneBlacklist.contains(itemstack.getId())) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
int j = 0;
|
||||
Map<Enchantment, Integer> map = EnchantmentManager.a(itemstack);
|
||||
Iterator iterator = map.entrySet().iterator();
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
index 8c3bbef66..d5e0578b2 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
@@ -542,6 +542,12 @@ public final class ItemStack {
|
||||
return !this.e() ? this.doMaterialsMatch(itemstack) : !itemstack.isEmpty() && this.getItem() == itemstack.getItem();
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ public String getId() {
|
||||
+ return IRegistry.ITEM.getKey(getItem()).toString();
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
public String j() {
|
||||
return this.getItem().f(this);
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 5318a8e32..9c60855d6 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -8,6 +8,7 @@ import net.minecraft.server.MinecraftKey;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.spigotmc.SpigotWorldConfig;
|
||||
|
||||
+import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -103,6 +104,17 @@ public class PurpurWorldConfig {
|
||||
farmlandGetsMoistFromBelow = getBoolean("blocks.farmland.gets-moist-from-below", farmlandGetsMoistFromBelow);
|
||||
}
|
||||
|
||||
+ public List<String> grindstoneBlacklist = new ArrayList<>();
|
||||
+ public boolean grindstoneBlacklistDisallowPlacement = true;
|
||||
+ public boolean grindstoneBlacklistReturnsZeroExp = true;
|
||||
+ private void grindstoneBlacklist() {
|
||||
+ List<String> blacklist = getList("blocks.grindstone.blacklist.blacklisted-items", grindstoneBlacklist);
|
||||
+ grindstoneBlacklistDisallowPlacement = getBoolean("blocks.grindstone.blacklist.disallow-placement", grindstoneBlacklistDisallowPlacement);
|
||||
+ grindstoneBlacklistReturnsZeroExp = getBoolean("blocks.grindstone.blacklist.returns-zero-exp", grindstoneBlacklistReturnsZeroExp);
|
||||
+ grindstoneBlacklist.clear();
|
||||
+ grindstoneBlacklist.addAll(blacklist);
|
||||
+ }
|
||||
+
|
||||
public boolean signAllowColors = false;
|
||||
public boolean signRightClickEdit = false;
|
||||
private void signSettings() {
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
From 7f22b67baa5bb382abe62b70dfb1ec5bb7ce5929 Mon Sep 17 00:00:00 2001
|
||||
From 6cef8b3a0a207fe01ddf73117cc3770203e8c01c Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 2 Jan 2020 01:23:22 -0600
|
||||
Subject: [PATCH] Fix non black cat types spawning in swamp huts
|
||||
Subject: [PATCH] MC-147659 - Fix non black cats spawning in swamp huts
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/MobSpawnerCat.java | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MobSpawnerCat.java b/src/main/java/net/minecraft/server/MobSpawnerCat.java
|
||||
index 4b55c07d4..fa2222355 100644
|
||||
index 68d37121f..318d051b0 100644
|
||||
--- a/src/main/java/net/minecraft/server/MobSpawnerCat.java
|
||||
+++ b/src/main/java/net/minecraft/server/MobSpawnerCat.java
|
||||
@@ -84,8 +84,9 @@ public class MobSpawnerCat {
|
||||
@@ -84,8 +84,9 @@ public class MobSpawnerCat implements MobSpawner {
|
||||
if (entitycat == null) {
|
||||
return 0;
|
||||
} else {
|
||||
@@ -1,28 +1,20 @@
|
||||
From e3b69abad347357a82d5891d9d16bd203d99891f Mon Sep 17 00:00:00 2001
|
||||
From 9f6feaf7259dfa214dc7e781eee36b81382ba624 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 4 May 2019 01:10:30 -0500
|
||||
Subject: [PATCH] Cows eat mushrooms
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/Entity.java | 2 +
|
||||
.../java/net/minecraft/server/Entity.java | 1 +
|
||||
.../java/net/minecraft/server/EntityCow.java | 70 +++++++++++++++++++
|
||||
.../net/minecraft/server/EntityLiving.java | 5 +-
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 2 +
|
||||
4 files changed, 77 insertions(+), 2 deletions(-)
|
||||
.../net/minecraft/server/EntityLiving.java | 2 +-
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 5 ++
|
||||
4 files changed, 77 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index dc72ee435..f5ea12b02 100644
|
||||
index ee36c537d..028f94a88 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -1283,6 +1283,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
return false;
|
||||
}
|
||||
|
||||
+ public void playSound(SoundEffect soundeffect, float volume, float pitch) { a(soundeffect, volume, pitch); } // Paper - OBFHELPER
|
||||
public void a(SoundEffect soundeffect, float f, float f1) {
|
||||
if (!this.isSilent()) {
|
||||
this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), soundeffect, this.getSoundCategory(), f, f1);
|
||||
@@ -2831,6 +2832,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@@ -2555,6 +2555,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
this.invulnerable = flag;
|
||||
}
|
||||
|
||||
@@ -31,27 +23,27 @@ index dc72ee435..f5ea12b02 100644
|
||||
this.setPositionRotation(entity.locX(), entity.locY(), entity.locZ(), entity.yaw, entity.pitch);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityCow.java b/src/main/java/net/minecraft/server/EntityCow.java
|
||||
index 723a9fa1e..f56fd7c01 100644
|
||||
index 30ee6df6b..d6baddb9d 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityCow.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityCow.java
|
||||
@@ -34,6 +34,7 @@ public class EntityCow extends EntityAnimal {
|
||||
this.goalSelector.a(0, new net.pl3x.purpur.pathfinder.PathfinderGoalHasRider(this)); // Purpur
|
||||
@@ -16,6 +16,7 @@ public class EntityCow extends EntityAnimal {
|
||||
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
||||
this.goalSelector.a(1, new PathfinderGoalPanic(this, 2.0D));
|
||||
this.goalSelector.a(2, new PathfinderGoalBreed(this, 1.0D));
|
||||
+ if (world.purpurConfig.cowFeedMushrooms > 0) this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.25D, RecipeItemStack.a(Items.WHEAT, Blocks.RED_MUSHROOM.getItem(), Blocks.BROWN_MUSHROOM.getItem()), false)); else // Purpur
|
||||
this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.25D, RecipeItemStack.a(Items.WHEAT), false));
|
||||
this.goalSelector.a(4, new PathfinderGoalFollowParent(this, 1.25D));
|
||||
this.goalSelector.a(5, new PathfinderGoalRandomStrollLand(this, 1.0D));
|
||||
@@ -96,11 +97,80 @@ public class EntityCow extends EntityAnimal {
|
||||
// CraftBukkit end
|
||||
@@ -70,11 +71,80 @@ public class EntityCow extends EntityAnimal {
|
||||
|
||||
return true;
|
||||
+ // Purpur start - feed mushroom to change to mooshroom
|
||||
entityhuman.a(enumhand, itemstack1);
|
||||
return EnumInteractionResult.a(this.world.isClientSide);
|
||||
+ // Purpur start - feed mushroom to change to mooshroom
|
||||
+ } else if (world.purpurConfig.cowFeedMushrooms > 0 && getEntityType() != EntityTypes.MOOSHROOM && isMushroom(itemstack)) {
|
||||
+ return feedMushroom(entityhuman, itemstack);
|
||||
+ // Purpur end
|
||||
+ // Purpur end
|
||||
} else {
|
||||
return super.a(entityhuman, enumhand);
|
||||
return super.b(entityhuman, enumhand);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,18 +63,18 @@ index 723a9fa1e..f56fd7c01 100644
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private boolean feedMushroom(EntityHuman entityhuman, ItemStack itemstack) {
|
||||
+ private EnumInteractionResult feedMushroom(EntityHuman entityhuman, ItemStack itemstack) {
|
||||
+ world.broadcastEntityEffect(this, (byte) 18); // hearts
|
||||
+ playSound(SoundEffects.ENTITY_COW_MILK, 1.0F, 1.0F);
|
||||
+ if (incrementFeedCount(itemstack) < world.purpurConfig.cowFeedMushrooms) {
|
||||
+ if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
+ itemstack.subtract(1);
|
||||
+ }
|
||||
+ return true; // require 5 mushrooms to transform (prevents mushroom duping)
|
||||
+ return EnumInteractionResult.CONSUME; // require 5 mushrooms to transform (prevents mushroom duping)
|
||||
+ }
|
||||
+ EntityMushroomCow mooshroom = EntityTypes.MOOSHROOM.create(world);
|
||||
+ if (mooshroom == null) {
|
||||
+ return false;
|
||||
+ return EnumInteractionResult.PASS;
|
||||
+ }
|
||||
+ if (itemstack.getItem() == Blocks.BROWN_MUSHROOM.getItem()) {
|
||||
+ mooshroom.setVariant(EntityMushroomCow.Type.BROWN);
|
||||
@@ -101,10 +93,10 @@ index 723a9fa1e..f56fd7c01 100644
|
||||
+ mooshroom.setCustomName(this.getCustomName());
|
||||
+ }
|
||||
+ if (CraftEventFactory.callEntityTransformEvent(this, mooshroom, org.bukkit.event.entity.EntityTransformEvent.TransformReason.INFECTION).isCancelled()) {
|
||||
+ return false;
|
||||
+ return EnumInteractionResult.PASS;
|
||||
+ }
|
||||
+ if (!new com.destroystokyo.paper.event.entity.EntityTransformedEvent(this.getBukkitEntity(), mooshroom.getBukkitEntity(), com.destroystokyo.paper.event.entity.EntityTransformedEvent.TransformedReason.INFECTED).callEvent()) {
|
||||
+ return false;
|
||||
+ return EnumInteractionResult.PASS;
|
||||
+ }
|
||||
+ this.world.addEntity(mooshroom);
|
||||
+ this.die();
|
||||
@@ -116,7 +108,7 @@ index 723a9fa1e..f56fd7c01 100644
|
||||
+ locX() + random.nextFloat(), locY() + (random.nextFloat() * 2), locZ() + random.nextFloat(), 1,
|
||||
+ random.nextGaussian() * 0.05D, random.nextGaussian() * 0.05D, random.nextGaussian() * 0.05D, 0, true);
|
||||
+ }
|
||||
+ return true;
|
||||
+ return EnumInteractionResult.SUCCESS;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@@ -124,38 +116,34 @@ index 723a9fa1e..f56fd7c01 100644
|
||||
public EntityCow createChild(EntityAgeable entityageable) {
|
||||
return (EntityCow) EntityTypes.COW.a(this.world);
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index a3db0e92d..685538793 100644
|
||||
index 03477c6e9..63cff85af 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -2839,8 +2839,9 @@ public abstract class EntityLiving extends Entity {
|
||||
this.aK = f;
|
||||
}
|
||||
|
||||
- @Override
|
||||
- public void l(float f) {
|
||||
+ public float getRenderYawOffset() { return this.aI; } // Purpur - OBFHELPER
|
||||
+ public void setRenderYawOffset(float f) { this.l(f); } // Purpur - OBFHELPER
|
||||
+ @Override public void l(float f) {
|
||||
this.aI = f;
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public abstract class EntityLiving extends Entity {
|
||||
public int maxNoDamageTicks;
|
||||
public final float aF;
|
||||
public final float aG;
|
||||
- public float aH;
|
||||
+ public float aH; public float getRenderYawOffset() { return this.aH; } public void setRenderYawOffset(float f) { this.aH = f; } // Purpur - OBFHELPER
|
||||
public float aI;
|
||||
public float aJ;
|
||||
public float aK;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 12fbdf65c..091f30727 100644
|
||||
index ec490745b..faddf7c4b 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -145,10 +145,12 @@ public class PurpurWorldConfig {
|
||||
public boolean cowRidable = false;
|
||||
public boolean cowRidableInWater = false;
|
||||
public boolean cowRequireShiftToMount = true;
|
||||
+ public int cowFeedMushrooms = 0;
|
||||
private void cowSettings() {
|
||||
cowRidable = getBoolean("mobs.cow.ridable", cowRidable);
|
||||
cowRidableInWater = getBoolean("mobs.cow.ridable-in-water", cowRidableInWater);
|
||||
cowRequireShiftToMount = getBoolean("mobs.cow.require-shift-to-mount", cowRequireShiftToMount);
|
||||
+ cowFeedMushrooms = getInt("mobs.cow.feed-mushrooms-for-mooshroom", cowFeedMushrooms);
|
||||
@@ -115,6 +115,11 @@ public class PurpurWorldConfig {
|
||||
chickenRetaliate = getBoolean("mobs.chicken.retaliate", chickenRetaliate);
|
||||
}
|
||||
|
||||
public boolean creeperRidable = false;
|
||||
+ public int cowFeedMushrooms = 0;
|
||||
+ private void cowSettings() {
|
||||
+ cowFeedMushrooms = getInt("mobs.cow.feed-mushrooms-for-mooshroom", cowFeedMushrooms);
|
||||
+ }
|
||||
+
|
||||
public double creeperChargedChance = 0.0D;
|
||||
private void creeperSettings() {
|
||||
creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
From bb7737a02a0e52a0c6fceadc31e30de3957cc147 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 3 May 2019 23:53:16 -0500
|
||||
Subject: [PATCH] Fix cow rotation when shearing mooshroom
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityMushroomCow.java | 8 +++++++-
|
||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityMushroomCow.java b/src/main/java/net/minecraft/server/EntityMushroomCow.java
|
||||
index 23ef03306..ecbdc65ec 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityMushroomCow.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityMushroomCow.java
|
||||
@@ -135,7 +135,13 @@ public class EntityMushroomCow extends EntityCow implements IShearable {
|
||||
|
||||
entitycow.setPositionRotation(this.locX(), this.locY(), this.locZ(), this.yaw, this.pitch);
|
||||
entitycow.setHealth(this.getHealth());
|
||||
- entitycow.aH = this.aH;
|
||||
+ // Purpur start - correctly copy rotation
|
||||
+ entitycow.copyPositionRotation(this);
|
||||
+ entitycow.setRenderYawOffset(this.getRenderYawOffset());
|
||||
+ entitycow.setHeadRotation(this.getHeadRotation());
|
||||
+ entitycow.lastYaw = this.lastYaw;
|
||||
+ entitycow.lastPitch = this.lastPitch;
|
||||
+ // Purpur end
|
||||
if (this.hasCustomName()) {
|
||||
entitycow.setCustomName(this.getCustomName());
|
||||
entitycow.setCustomNameVisible(this.getCustomNameVisible());
|
||||
--
|
||||
2.26.2
|
||||
|
||||
52
patches/server/0051-Pigs-give-saddle-back.patch
Normal file
52
patches/server/0051-Pigs-give-saddle-back.patch
Normal file
@@ -0,0 +1,52 @@
|
||||
From e4a7d439a42b6139c1fe3308fdeaf1b5f8857b1a Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 12 May 2019 01:14:46 -0500
|
||||
Subject: [PATCH] Pigs give saddle back
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityPig.java | 12 ++++++++++++
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
||||
2 files changed, 17 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java
|
||||
index cd0a94794..cf2df391a 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPig.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPig.java
|
||||
@@ -109,6 +109,18 @@ public class EntityPig extends EntityAnimal implements ISteerable, ISaddleable {
|
||||
|
||||
if (!flag && this.hasSaddle() && !this.isVehicle()) {
|
||||
if (!this.world.isClientSide) {
|
||||
+ // Purpur start
|
||||
+ if (world.purpurConfig.pigGiveSaddleBack && entityhuman.isSneaking()) {
|
||||
+ this.saddleStorage.setSaddle(false);
|
||||
+ if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
+ ItemStack saddle = new ItemStack(Items.SADDLE);
|
||||
+ if (!entityhuman.inventory.pickup(saddle)) {
|
||||
+ entityhuman.drop(saddle, false);
|
||||
+ }
|
||||
+ }
|
||||
+ return EnumInteractionResult.SUCCESS;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
entityhuman.startRiding(this);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index faddf7c4b..84c025c4a 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -161,6 +161,11 @@ public class PurpurWorldConfig {
|
||||
ironGolemCanSwim = getBoolean("mobs.iron_golem.can-swim", ironGolemCanSwim);
|
||||
}
|
||||
|
||||
+ public boolean pigGiveSaddleBack = false;
|
||||
+ private void pigSettings() {
|
||||
+ pigGiveSaddleBack = getBoolean("mobs.pig.give-saddle-back", pigGiveSaddleBack);
|
||||
+ }
|
||||
+
|
||||
public String polarBearBreedableItemString = "";
|
||||
public Item polarBearBreedableItem = null;
|
||||
private void polarBearSettings() {
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
From 5081aa5658129a710de30dd52ed5053707b0887e Mon Sep 17 00:00:00 2001
|
||||
From 71ef94f480dde9459ce85b48fab104f511800038 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 3 May 2019 23:58:44 -0500
|
||||
Subject: [PATCH] Snowman drop and put back pumpkin
|
||||
|
||||
---
|
||||
.../net/minecraft/server/EntitySnowman.java | 17 +++++++++++++++++
|
||||
.../java/net/pl3x/purpur/PurpurWorldConfig.java | 4 ++++
|
||||
2 files changed, 21 insertions(+)
|
||||
.../java/net/pl3x/purpur/PurpurWorldConfig.java | 7 +++++++
|
||||
2 files changed, 24 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntitySnowman.java b/src/main/java/net/minecraft/server/EntitySnowman.java
|
||||
index 65d746899..3f6f8ad45 100644
|
||||
index 15b886d9b..dfe615814 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntitySnowman.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntitySnowman.java
|
||||
@@ -7,6 +7,7 @@ import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
|
||||
public class EntitySnowman extends EntityGolem implements IRangedEntity {
|
||||
public class EntitySnowman extends EntityGolem implements IShearable, IRangedEntity {
|
||||
|
||||
+ private static final RecipeItemStack PUMPKIN = RecipeItemStack.a(Blocks.PUMPKIN.getItem(), Blocks.CARVED_PUMPKIN.getItem(), Blocks.JACK_O_LANTERN.getItem()); // Purpur
|
||||
private static final DataWatcherObject<Byte> b = DataWatcher.a(EntitySnowman.class, DataWatcherRegistry.a);
|
||||
|
||||
public EntitySnowman(EntityTypes<? extends EntitySnowman> entitytypes, World world) {
|
||||
@@ -142,9 +143,25 @@ public class EntitySnowman extends EntityGolem implements IRangedEntity {
|
||||
@@ -120,9 +121,25 @@ public class EntitySnowman extends EntityGolem implements IShearable, IRangedEnt
|
||||
itemstack.damage(1, entityhuman, (entityhuman1) -> {
|
||||
entityhuman1.broadcastItemBreak(enumhand);
|
||||
});
|
||||
@@ -29,43 +29,41 @@ index 65d746899..3f6f8ad45 100644
|
||||
+ EntityItem pumpkin = new EntityItem(world, locX(), locY(), locZ(), new ItemStack(Blocks.CARVED_PUMPKIN.getItem()));
|
||||
+ pumpkin.pickupDelay = 10;
|
||||
+ world.addEntity(pumpkin);
|
||||
+ return true;
|
||||
+ return EnumInteractionResult.SUCCESS;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
return true;
|
||||
return EnumInteractionResult.a(this.world.isClientSide);
|
||||
+ // Purpur start
|
||||
+ } else if (world.purpurConfig.snowGolemPutPumpkinBack && !hasPumpkin() && PUMPKIN.test(itemstack)) {
|
||||
+ setHasPumpkin(true);
|
||||
+ if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
+ itemstack.subtract(1);
|
||||
+ }
|
||||
+ return true;
|
||||
+ return EnumInteractionResult.SUCCESS;
|
||||
+ // Purpur end
|
||||
} else {
|
||||
return tryRide(entityhuman, enumhand); // Purpur
|
||||
return EnumInteractionResult.PASS;
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index c9b41cebd..56b67c408 100644
|
||||
index 84c025c4a..ce443f9d7 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -540,11 +540,15 @@ public class PurpurWorldConfig {
|
||||
public boolean snowGolemRidableInWater = false;
|
||||
public boolean snowGolemRequireShiftToMount = true;
|
||||
public boolean snowGolemLeaveTrailWhenRidden = false;
|
||||
+ public boolean snowGolemDropsPumpkin = false;
|
||||
+ public boolean snowGolemPutPumpkinBack = false;
|
||||
private void snowGolemSettings() {
|
||||
snowGolemRidable = getBoolean("mobs.snow_golem.ridable", snowGolemRidable);
|
||||
snowGolemRidableInWater = getBoolean("mobs.snow_golem.ridable-in-water", snowGolemRidableInWater);
|
||||
snowGolemRequireShiftToMount = getBoolean("mobs.snow_golem.require-shift-to-mount", snowGolemRequireShiftToMount);
|
||||
snowGolemLeaveTrailWhenRidden = getBoolean("mobs.snow_golem.leave-trail-when-ridden", snowGolemLeaveTrailWhenRidden);
|
||||
+ snowGolemDropsPumpkin = getBoolean("mobs.snow_golem.drop-pumpkin-when-sheared", snowGolemDropsPumpkin);
|
||||
+ snowGolemPutPumpkinBack = getBoolean("mobs.snow_golem.pumpkin-can-be-added-back", snowGolemPutPumpkinBack);
|
||||
@@ -181,6 +181,13 @@ public class PurpurWorldConfig {
|
||||
rabbitNaturalKiller = getDouble("mobs.rabbit.spawn-killer-rabbit-chance", rabbitNaturalKiller);
|
||||
}
|
||||
|
||||
public boolean spiderRidable = false;
|
||||
+ public boolean snowGolemDropsPumpkin = false;
|
||||
+ public boolean snowGolemPutPumpkinBack = false;
|
||||
+ private void snowGolemSettings() {
|
||||
+ snowGolemDropsPumpkin = getBoolean("mobs.snow_golem.drop-pumpkin-when-sheared", snowGolemDropsPumpkin);
|
||||
+ snowGolemPutPumpkinBack = getBoolean("mobs.snow_golem.pumpkin-can-be-added-back", snowGolemPutPumpkinBack);
|
||||
+ }
|
||||
+
|
||||
public int villagerBrainTicks = 1;
|
||||
public boolean villagerUseBrainTicksOnlyWhenLagging = true;
|
||||
private void villagerSettings() {
|
||||
--
|
||||
2.26.2
|
||||
|
||||
42
patches/server/0053-Ender-dragon-always-drop-egg.patch
Normal file
42
patches/server/0053-Ender-dragon-always-drop-egg.patch
Normal file
@@ -0,0 +1,42 @@
|
||||
From cd0557107ef93a0cebc2242260df1d5a841de62d Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Fri, 7 Feb 2020 04:42:57 -0600
|
||||
Subject: [PATCH] Ender dragon always drop egg
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EnderDragonBattle.java | 2 +-
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
||||
2 files changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EnderDragonBattle.java b/src/main/java/net/minecraft/server/EnderDragonBattle.java
|
||||
index 69faefbdb..ecd6af04d 100644
|
||||
--- a/src/main/java/net/minecraft/server/EnderDragonBattle.java
|
||||
+++ b/src/main/java/net/minecraft/server/EnderDragonBattle.java
|
||||
@@ -358,7 +358,7 @@ public class EnderDragonBattle {
|
||||
this.bossBattle.setVisible(false);
|
||||
this.a(true);
|
||||
this.n();
|
||||
- if (!this.previouslyKilled) {
|
||||
+ if (this.world.purpurConfig.enderDragonAlwaysDropsEggBlock || !this.previouslyKilled) { // Purpur - always place dragon egg
|
||||
this.world.setTypeUpdate(this.world.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING, WorldGenEndTrophy.a), Blocks.DRAGON_EGG.getBlockData());
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index ce443f9d7..c76b15bef 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -125,6 +125,11 @@ public class PurpurWorldConfig {
|
||||
creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
|
||||
}
|
||||
|
||||
+ public boolean enderDragonAlwaysDropsEggBlock = false;
|
||||
+ private void enderDragonSettings() {
|
||||
+ enderDragonAlwaysDropsEggBlock = getBoolean("mobs.ender_dragon.always-drop-egg-block", enderDragonAlwaysDropsEggBlock);
|
||||
+ }
|
||||
+
|
||||
public boolean foxTypeChangesWithTulips = false;
|
||||
private void foxSettings() {
|
||||
foxTypeChangesWithTulips = getBoolean("mobs.fox.tulips-change-type", foxTypeChangesWithTulips);
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From fad47974bd2b9b98b527eca3f3f4322f4fe6ba4f Mon Sep 17 00:00:00 2001
|
||||
From f9a625ee7814a6561dbd3793117358008f98d1dd Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 24 Aug 2019 14:42:54 -0500
|
||||
Subject: [PATCH] Ender dragon always drop full exp
|
||||
@@ -9,37 +9,33 @@ Subject: [PATCH] Ender dragon always drop full exp
|
||||
2 files changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
||||
index 54b63395f..e89b96605 100644
|
||||
index 63a759cc1..08fa5a975 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
||||
@@ -641,7 +641,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster {
|
||||
@@ -564,7 +564,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster {
|
||||
boolean flag = this.world.getGameRules().getBoolean(GameRules.DO_MOB_LOOT);
|
||||
short short0 = 500;
|
||||
|
||||
- if (this.bN != null && !this.bN.d()) {
|
||||
+ if (getEnderDragonBattle() != null && (world.purpurConfig.enderDragonAlwaysDropsFullExp || !getEnderDragonBattle().wasPreviouslyKilled())) { // Purpur
|
||||
- if (this.bM != null && !this.bM.isPreviouslyKilled()) {
|
||||
+ if (getEnderDragonBattle() != null && (world.purpurConfig.enderDragonAlwaysDropsFullExp || !getEnderDragonBattle().isPreviouslyKilled())) { // Purpur
|
||||
short0 = 12000;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index cc6f8563b..426e6f18b 100644
|
||||
index c76b15bef..328a0b4fe 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -207,12 +207,14 @@ public class PurpurWorldConfig {
|
||||
public boolean enderDragonRequireShiftToMount = true;
|
||||
public double enderDragonMaxY = 256D;
|
||||
@@ -126,8 +126,10 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
|
||||
public boolean enderDragonAlwaysDropsEggBlock = false;
|
||||
+ public boolean enderDragonAlwaysDropsFullExp = false;
|
||||
private void enderDragonSettings() {
|
||||
enderDragonRidable = getBoolean("mobs.ender_dragon.ridable", enderDragonRidable);
|
||||
enderDragonRidableInWater = getBoolean("mobs.ender_dragon.ridable-in-water", enderDragonRidableInWater);
|
||||
enderDragonRequireShiftToMount = getBoolean("mobs.ender_dragon.require-shift-to-mount", enderDragonRequireShiftToMount);
|
||||
enderDragonMaxY = getDouble("mobs.ender_dragon.ridable-max-y", enderDragonMaxY);
|
||||
enderDragonAlwaysDropsEggBlock = getBoolean("mobs.ender_dragon.always-drop-egg-block", enderDragonAlwaysDropsEggBlock);
|
||||
+ enderDragonAlwaysDropsFullExp = getBoolean("mobs.ender_dragon.always-drop-full-exp", enderDragonAlwaysDropsFullExp);
|
||||
}
|
||||
|
||||
public boolean endermanRidable = false;
|
||||
public boolean foxTypeChangesWithTulips = false;
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
From 9b4138db851b38e9c42ecd40ede122f9b75f2ce1 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 23 Aug 2019 21:56:31 -0500
|
||||
Subject: [PATCH] Option for slimes not pushable
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/BlockPiston.java | 10 ++++++++++
|
||||
src/main/java/net/minecraft/server/BlockSlime.java | 7 +++++++
|
||||
src/main/java/net/pl3x/purpur/PurpurConfig.java | 5 +++++
|
||||
3 files changed, 22 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockPiston.java b/src/main/java/net/minecraft/server/BlockPiston.java
|
||||
index 8312ed779..a1721c63d 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockPiston.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockPiston.java
|
||||
@@ -347,6 +347,16 @@ public class BlockPiston extends BlockDirectional {
|
||||
} else {
|
||||
event = new BlockPistonRetractEvent(bblock, blocks, CraftBlock.notchToBlockFace(enumdirection1));
|
||||
}
|
||||
+ // Purpur start
|
||||
+ if (net.pl3x.purpur.PurpurConfig.slimeBlocksNotPushable) {
|
||||
+ for (org.bukkit.block.Block block : blocks) {
|
||||
+ if (block.getType() == org.bukkit.Material.SLIME_BLOCK) {
|
||||
+ event.setCancelled(true);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end
|
||||
world.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockSlime.java b/src/main/java/net/minecraft/server/BlockSlime.java
|
||||
index 01f32659d..52ab86f0b 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockSlime.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockSlime.java
|
||||
@@ -49,4 +49,11 @@ public class BlockSlime extends BlockHalfTransparent {
|
||||
|
||||
super.stepOn(world, blockposition, entity);
|
||||
}
|
||||
+
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public EnumPistonReaction getPushReaction(IBlockData iblockdata) {
|
||||
+ return net.pl3x.purpur.PurpurConfig.slimeBlocksNotPushable ? EnumPistonReaction.BLOCK : super.getPushReaction(iblockdata);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index ab20fa2fa..72ad9dce7 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -149,6 +149,11 @@ public class PurpurConfig {
|
||||
dontSendUselessEntityPackets = getBoolean("settings.dont-send-useless-entity-packets", dontSendUselessEntityPackets);
|
||||
}
|
||||
|
||||
+ public static boolean slimeBlocksNotPushable = false;
|
||||
+ private static void blockSettings() {
|
||||
+ slimeBlocksNotPushable = getBoolean("settings.blocks.slime.not-movable-by-piston", slimeBlocksNotPushable);
|
||||
+ }
|
||||
+
|
||||
private static void timingsSettings() {
|
||||
getString("settings.timings.url", "https://timings.pl3x.net");
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From ce9eea9c6ac12ed7d3a82601390684864ab5f0c2 Mon Sep 17 00:00:00 2001
|
||||
From ee9e1bedb34e6afdc80e72d7a35ca24a9a5a1aab Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 24 May 2019 02:39:25 -0500
|
||||
Subject: [PATCH] Signs editable on right click
|
||||
@@ -10,7 +10,7 @@ Subject: [PATCH] Signs editable on right click
|
||||
3 files changed, 17 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockSign.java b/src/main/java/net/minecraft/server/BlockSign.java
|
||||
index 8a31054a1..d20849ce2 100644
|
||||
index cfc1da1f5..3a9871dbc 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockSign.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockSign.java
|
||||
@@ -56,6 +56,17 @@ public abstract class BlockSign extends BlockTileEntity implements IBlockWaterlo
|
||||
@@ -32,10 +32,10 @@ index 8a31054a1..d20849ce2 100644
|
||||
} else {
|
||||
return EnumInteractionResult.PASS;
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java
|
||||
index 0e9a90b70..099d98e04 100644
|
||||
index c4b0d8720..e1ab29975 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntitySign.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntitySign.java
|
||||
@@ -109,6 +109,7 @@ public class TileEntitySign extends TileEntity implements ICommandListener { //
|
||||
@@ -113,6 +113,7 @@ public class TileEntitySign extends TileEntity implements ICommandListener { //
|
||||
return this.isEditable;
|
||||
}
|
||||
|
||||
@@ -44,11 +44,11 @@ index 0e9a90b70..099d98e04 100644
|
||||
// Paper start
|
||||
//this.c = entityhuman;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 426e6f18b..f098a36b5 100644
|
||||
index 328a0b4fe..ed6102b40 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -65,6 +65,11 @@ public class PurpurWorldConfig {
|
||||
return PurpurConfig.config.getString("world-settings." + worldName + "." + path, PurpurConfig.config.getString("world-settings.default." + path));
|
||||
@@ -92,6 +92,11 @@ public class PurpurWorldConfig {
|
||||
playerInvulnerableWhileAcceptingResourcePack = getBoolean("gameplay-mechanics.player.invulnerable-while-accepting-resource-pack", playerInvulnerableWhileAcceptingResourcePack);
|
||||
}
|
||||
|
||||
+ public boolean signRightClickEdit = false;
|
||||
@@ -56,9 +56,9 @@ index 426e6f18b..f098a36b5 100644
|
||||
+ signRightClickEdit = getBoolean("blocks.sign.right-click-edit", signRightClickEdit);
|
||||
+ }
|
||||
+
|
||||
public boolean batRidable = false;
|
||||
public boolean batRidableInWater = false;
|
||||
public boolean batRequireShiftToMount = true;
|
||||
public boolean turtleEggsBreakFromExpOrbs = true;
|
||||
public boolean turtleEggsBreakFromItems = true;
|
||||
public boolean turtleEggsBreakFromMinecarts = true;
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,32 +1,45 @@
|
||||
From 724e01f51f459443dd24030bbe0e7d73f142ac3d Mon Sep 17 00:00:00 2001
|
||||
From 1239cbcedd86d3ba666166ac3bc63063ea77188d Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 6 Jun 2019 17:40:30 -0500
|
||||
Subject: [PATCH] Signs allow color codes
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/EntityPlayer.java | 1 +
|
||||
.../net/minecraft/server/PlayerConnection.java | 8 ++++++++
|
||||
.../java/net/minecraft/server/TileEntitySign.java | 15 +++++++++++++++
|
||||
.../java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
4 files changed, 26 insertions(+)
|
||||
.../net/minecraft/server/EntityPlayer.java | 1 +
|
||||
.../minecraft/server/IChatBaseComponent.java | 1 +
|
||||
.../minecraft/server/PlayerConnection.java | 8 +++++++
|
||||
.../net/minecraft/server/TileEntitySign.java | 23 +++++++++++++++++++
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 3 +++
|
||||
5 files changed, 36 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
index 51bae05ec..b781aa3ae 100644
|
||||
index be90231e6..17476e908 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
@@ -1153,6 +1153,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
@Override
|
||||
@@ -1272,6 +1272,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
public void openSign(TileEntitySign tileentitysign) {
|
||||
tileentitysign.a((EntityHuman) this);
|
||||
+ if (world.purpurConfig.signAllowColors) this.playerConnection.sendPacket(tileentitysign.getTranslatedUpdatePacket()); // Purpur
|
||||
this.playerConnection.sendPacket(new PacketPlayOutOpenSignEditor(tileentitysign.getPosition()));
|
||||
+ if (world.purpurConfig.signAllowColors) this.playerConnection.sendPacket(tileentitysign.getTranslatedUpdatePacket()); // Purpur
|
||||
}
|
||||
|
||||
public int nextContainerCounter() { // CraftBukkit - void -> int
|
||||
diff --git a/src/main/java/net/minecraft/server/IChatBaseComponent.java b/src/main/java/net/minecraft/server/IChatBaseComponent.java
|
||||
index fd3e6cda6..750896fc8 100644
|
||||
--- a/src/main/java/net/minecraft/server/IChatBaseComponent.java
|
||||
+++ b/src/main/java/net/minecraft/server/IChatBaseComponent.java
|
||||
@@ -344,6 +344,7 @@ public interface IChatBaseComponent extends Message, IChatFormatted, Iterable<IC
|
||||
return jsonobject;
|
||||
}
|
||||
|
||||
+ public static String toJson(IChatBaseComponent ichatbasecomponent) { return a(ichatbasecomponent); } // Purpur - OBFHELPER
|
||||
public static String a(IChatBaseComponent ichatbasecomponent) {
|
||||
return IChatBaseComponent.ChatSerializer.a.toJson(ichatbasecomponent);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index e0da3a13b..8a5059b4f 100644
|
||||
index d2d96eacc..4c5618892 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -2646,6 +2646,14 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
@@ -2701,6 +2701,14 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
}
|
||||
}
|
||||
// Paper end
|
||||
@@ -42,10 +55,25 @@ index e0da3a13b..8a5059b4f 100644
|
||||
}
|
||||
SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.server.getPlayer(this.player), lines);
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java
|
||||
index 099d98e04..4cdbb6409 100644
|
||||
index e1ab29975..1778c5474 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntitySign.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntitySign.java
|
||||
@@ -89,6 +89,21 @@ public class TileEntitySign extends TileEntity implements ICommandListener { //
|
||||
@@ -1,6 +1,14 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
+import net.md_5.bungee.api.chat.BaseComponent;
|
||||
+import net.md_5.bungee.api.chat.TextComponent;
|
||||
+import net.md_5.bungee.chat.BaseComponentSerializer;
|
||||
+import net.md_5.bungee.chat.ComponentSerializer;
|
||||
+import net.md_5.bungee.chat.TextComponentSerializer;
|
||||
+import org.bukkit.craftbukkit.util.CraftChatMessage;
|
||||
+
|
||||
+import java.util.List;
|
||||
import java.util.UUID;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@@ -93,6 +101,21 @@ public class TileEntitySign extends TileEntity implements ICommandListener { //
|
||||
this.g[i] = null;
|
||||
}
|
||||
|
||||
@@ -53,11 +81,11 @@ index 099d98e04..4cdbb6409 100644
|
||||
+ public PacketPlayOutTileEntityData getTranslatedUpdatePacket() {
|
||||
+ NBTTagCompound nbt = save(new NBTTagCompound());
|
||||
+ for (int i = 0; i < 4; ++i) {
|
||||
+ String line = lines[i].getLegacyString().replace("\u00a7", "&");
|
||||
+ String line = CraftChatMessage.fromComponent(lines[i]).replace("\u00a7", "&");
|
||||
+ if (line.endsWith("&r")) {
|
||||
+ line = line.substring(0, line.length() - 2);
|
||||
+ }
|
||||
+ nbt.setString("Text" + (i + 1), IChatBaseComponent.ChatSerializer.toJson(new ChatMessage(line)));
|
||||
+ nbt.setString("Text" + (i + 1), CraftChatMessage.toJSON(CraftChatMessage.fromString(line)[0]));
|
||||
+ }
|
||||
+ nbt.setString("PurpurEditor", "true");
|
||||
+ return new PacketPlayOutTileEntityData(position, 9, nbt);
|
||||
@@ -68,11 +96,11 @@ index 099d98e04..4cdbb6409 100644
|
||||
@Override
|
||||
public PacketPlayOutTileEntityData getUpdatePacket() {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index f8992136a..94744c78b 100644
|
||||
index ed6102b40..5df442c5b 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -76,8 +76,10 @@ public class PurpurWorldConfig {
|
||||
farmlandGetsMoistFromBelow = getBoolean("blocks.farmland.gets-moist-from-below", farmlandGetsMoistFromBelow);
|
||||
@@ -92,9 +92,12 @@ public class PurpurWorldConfig {
|
||||
playerInvulnerableWhileAcceptingResourcePack = getBoolean("gameplay-mechanics.player.invulnerable-while-accepting-resource-pack", playerInvulnerableWhileAcceptingResourcePack);
|
||||
}
|
||||
|
||||
+ public boolean signAllowColors = false;
|
||||
@@ -80,8 +108,10 @@ index f8992136a..94744c78b 100644
|
||||
private void signSettings() {
|
||||
+ signAllowColors = getBoolean("blocks.sign.allow-colors", signAllowColors);
|
||||
signRightClickEdit = getBoolean("blocks.sign.right-click-edit", signRightClickEdit);
|
||||
+
|
||||
}
|
||||
|
||||
public boolean turtleEggsBreakFromExpOrbs = true;
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,25 +1,18 @@
|
||||
From e011cfd4126e1395968162a6cab6efb62c3eb9f2 Mon Sep 17 00:00:00 2001
|
||||
From fd7bdb9ad22a5333ebfd0c183c09964b952674e5 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 21 Jun 2019 14:37:10 -0500
|
||||
Subject: [PATCH] Allow soil to moisten from water directly under it
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/BlockSoil.java | 20 +++++++------------
|
||||
.../java/net/minecraft/server/BlockSoil.java | 19 +++++++------------
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
||||
2 files changed, 12 insertions(+), 13 deletions(-)
|
||||
2 files changed, 12 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockSoil.java b/src/main/java/net/minecraft/server/BlockSoil.java
|
||||
index b6561f2c7..f2ab3ee01 100644
|
||||
index a315e2628..8dd48669c 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockSoil.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockSoil.java
|
||||
@@ -1,6 +1,5 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
-import java.util.Iterator;
|
||||
import java.util.Random;
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -112,19 +111,14 @@ public class BlockSoil extends Block {
|
||||
@@ -116,19 +116,14 @@ public class BlockSoil extends Block {
|
||||
}
|
||||
|
||||
private static boolean a(IWorldReader iworldreader, BlockPosition blockposition) {
|
||||
@@ -37,7 +30,7 @@ index b6561f2c7..f2ab3ee01 100644
|
||||
}
|
||||
-
|
||||
- blockposition1 = (BlockPosition) iterator.next();
|
||||
- } while (!iworldreader.getFluid(blockposition1).a(TagsFluid.WATER));
|
||||
- } while (!iworldreader.getFluid(blockposition1).a((Tag) TagsFluid.WATER));
|
||||
-
|
||||
- return true;
|
||||
+ }
|
||||
@@ -47,11 +40,11 @@ index b6561f2c7..f2ab3ee01 100644
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index a07781929..e2bda806e 100644
|
||||
index 5df442c5b..c28c241ad 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -65,6 +65,11 @@ public class PurpurWorldConfig {
|
||||
return PurpurConfig.config.getString("world-settings." + worldName + "." + path, PurpurConfig.config.getString("world-settings.default." + path));
|
||||
@@ -92,6 +92,11 @@ public class PurpurWorldConfig {
|
||||
playerInvulnerableWhileAcceptingResourcePack = getBoolean("gameplay-mechanics.player.invulnerable-while-accepting-resource-pack", playerInvulnerableWhileAcceptingResourcePack);
|
||||
}
|
||||
|
||||
+ public boolean farmlandGetsMoistFromBelow = false;
|
||||
@@ -59,9 +52,9 @@ index a07781929..e2bda806e 100644
|
||||
+ farmlandGetsMoistFromBelow = getBoolean("blocks.farmland.gets-moist-from-below", farmlandGetsMoistFromBelow);
|
||||
+ }
|
||||
+
|
||||
public boolean signAllowColors = false;
|
||||
public boolean signRightClickEdit = false;
|
||||
private void signSettings() {
|
||||
signRightClickEdit = getBoolean("blocks.sign.right-click-edit", signRightClickEdit);
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,32 +1,68 @@
|
||||
From 541d671db22a2a086ddeba4f4c5ba8eaf434c54c Mon Sep 17 00:00:00 2001
|
||||
From 250f0664cec36bf8a6d9f0dde52344f3ff47ca2a Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 29 Jun 2019 02:32:40 -0500
|
||||
Subject: [PATCH] Controllable Minecarts
|
||||
|
||||
---
|
||||
.../net/minecraft/server/BlockPosition.java | 6 +++
|
||||
.../java/net/minecraft/server/Entity.java | 1 +
|
||||
.../net/minecraft/server/EntityLiving.java | 6 +--
|
||||
.../server/EntityMinecartAbstract.java | 38 +++++++++++++++++++
|
||||
.../net/minecraft/server/ItemMinecart.java | 8 ++--
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 32 ++++++++++++++++
|
||||
4 files changed, 76 insertions(+), 3 deletions(-)
|
||||
.../net/pl3x/purpur/PurpurWorldConfig.java | 30 +++++++++++++++
|
||||
6 files changed, 83 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
|
||||
index 551ca4471..32757e231 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockPosition.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
|
||||
@@ -33,6 +33,12 @@ public class BlockPosition extends BaseBlockPosition {
|
||||
private static final int l = BlockPosition.h;
|
||||
private static final int m = BlockPosition.h + BlockPosition.g;
|
||||
|
||||
+ // Purpur start
|
||||
+ public BlockPosition(Entity entity) {
|
||||
+ super(entity.locX(), entity.locY(), entity.locZ());
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
public BlockPosition(int i, int j, int k) {
|
||||
super(i, j, k);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index d470c586a..08645bd03 100644
|
||||
index 028f94a88..e72975ff6 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -1531,6 +1531,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@@ -1286,6 +1286,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
this.inLava = true;
|
||||
}
|
||||
|
||||
+ public boolean isInLava() { return aH(); } // Purpur - OBFHELPER
|
||||
public boolean aH() {
|
||||
+ public boolean isInLava() { return aN(); } // Purpur - OBFHELPER
|
||||
public boolean aN() {
|
||||
return this.inLava;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index 63cff85af..cbfb62cd4 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -98,9 +98,9 @@ public abstract class EntityLiving extends Entity {
|
||||
protected int aV; protected int getKillCount() { return this.aV; } // Paper - OBFHELPER
|
||||
public float lastDamage;
|
||||
public boolean jumping; // Paper protected -> public
|
||||
- public float aY;
|
||||
- public float aZ;
|
||||
- public float ba;
|
||||
+ public float aY; public float getStrafe() { return aY; } public void setStrafe(float strafe) { aY = strafe; } // Purpur - OBFHELPER
|
||||
+ public float aZ; public float getVertical() { return aZ; } public void setVertical(float vertical) { aZ = vertical; } // Purpur - OBFHELPER
|
||||
+ public float ba; public float getForward() { return ba; } public void setForward(float forward) { ba = forward; } // Purpur - OBFHELPER
|
||||
protected int bb;
|
||||
protected double bc;
|
||||
protected double bd;
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
|
||||
index 665bbe07f..1f3e5bd28 100644
|
||||
index 6e038905e..cdbe1a32e 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
|
||||
@@ -357,12 +357,50 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
@@ -432,12 +432,50 @@ public abstract class EntityMinecartAbstract extends Entity {
|
||||
|
||||
public void a(int i, int j, int k, boolean flag) {}
|
||||
|
||||
@@ -45,7 +81,7 @@ index 665bbe07f..1f3e5bd28 100644
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
protected void i() {
|
||||
protected void h() {
|
||||
double d0 = this.getMaxSpeed();
|
||||
Vec3D vec3d = this.getMot();
|
||||
|
||||
@@ -78,13 +114,13 @@ index 665bbe07f..1f3e5bd28 100644
|
||||
this.setMot(new Vec3D(this.getMot().x * this.derailedX, this.getMot().y * this.derailedY, this.getMot().z * this.derailedZ));
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemMinecart.java b/src/main/java/net/minecraft/server/ItemMinecart.java
|
||||
index b73e317fb..e1337a9c0 100644
|
||||
index dc7decb06..0da16c200 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemMinecart.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemMinecart.java
|
||||
@@ -103,8 +103,10 @@ public class ItemMinecart extends Item {
|
||||
IBlockData iblockdata = world.getType(blockposition);
|
||||
|
||||
if (!iblockdata.a(TagsBlock.RAILS)) {
|
||||
if (!iblockdata.a((Tag) TagsBlock.RAILS)) {
|
||||
- return EnumInteractionResult.FAIL;
|
||||
- } else {
|
||||
+ // Purpur start - place minecarts anywhere
|
||||
@@ -97,23 +133,25 @@ index b73e317fb..e1337a9c0 100644
|
||||
@@ -131,6 +133,6 @@ public class ItemMinecart extends Item {
|
||||
|
||||
itemstack.subtract(1);
|
||||
return EnumInteractionResult.SUCCESS;
|
||||
return EnumInteractionResult.a(world.isClientSide);
|
||||
- }
|
||||
+ //} // Purpur - place minecarts anywhere
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index e2bda806e..f8992136a 100644
|
||||
index c28c241ad..d3d09d9a4 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -1,10 +1,16 @@
|
||||
@@ -1,6 +1,8 @@
|
||||
package net.pl3x.purpur;
|
||||
|
||||
import com.destroystokyo.paper.PaperWorldConfig;
|
||||
+import net.minecraft.server.Block;
|
||||
+import net.minecraft.server.Blocks;
|
||||
+import net.minecraft.server.IRegistry;
|
||||
+import net.minecraft.server.MinecraftKey;
|
||||
import net.minecraft.server.IRegistry;
|
||||
import net.minecraft.server.Item;
|
||||
import net.minecraft.server.Items;
|
||||
@@ -8,7 +10,9 @@ import net.minecraft.server.MinecraftKey;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.spigotmc.SpigotWorldConfig;
|
||||
|
||||
@@ -123,8 +161,8 @@ index e2bda806e..f8992136a 100644
|
||||
|
||||
import static net.pl3x.purpur.PurpurConfig.log;
|
||||
|
||||
@@ -75,6 +81,32 @@ public class PurpurWorldConfig {
|
||||
signRightClickEdit = getBoolean("blocks.sign.right-click-edit", signRightClickEdit);
|
||||
@@ -74,6 +78,32 @@ public class PurpurWorldConfig {
|
||||
armorstandStepHeight = (float) getDouble("gameplay-mechanics.armorstand.step-height", armorstandStepHeight);
|
||||
}
|
||||
|
||||
+ public boolean controllableMinecarts = false;
|
||||
@@ -133,7 +171,7 @@ index e2bda806e..f8992136a 100644
|
||||
+ public double controllableMinecartsHopBoost = 0.5D;
|
||||
+ public double controllableMinecartsBaseSpeed = 0.1D;
|
||||
+ public Map<Block, Double> controllableMinecartsBlockSpeeds = new HashMap<>();
|
||||
+ private void gameplayMechanicsSettings() {
|
||||
+ private void controllableMinecartsSettings() {
|
||||
+ controllableMinecarts = getBoolean("gameplay-mechanics.controllable-minecarts.enabled", controllableMinecarts);
|
||||
+ controllableMinecartsPlaceAnywhere = getBoolean("gameplay-mechanics.controllable-minecarts.place-anywhere", controllableMinecartsPlaceAnywhere);
|
||||
+ controllableMinecartsStepHeight = (float) getDouble("gameplay-mechanics.controllable-minecarts.step-height", controllableMinecartsStepHeight);
|
||||
@@ -153,9 +191,9 @@ index e2bda806e..f8992136a 100644
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
public boolean batRidable = false;
|
||||
public boolean batRidableInWater = false;
|
||||
public boolean batRequireShiftToMount = true;
|
||||
public boolean idleTimeoutKick = true;
|
||||
public boolean idleTimeoutTickNearbyEntities = true;
|
||||
public boolean idleTimeoutCountAsSleeping = false;
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
From 0052f3bced71e7dbbf3d28cfb11bfb2824596d94 Mon Sep 17 00:00:00 2001
|
||||
From 973be464795e3636e5b966303568ca44dc9d8858 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Wed, 3 Jul 2019 23:58:31 -0500
|
||||
Subject: [PATCH] Disable loot drops on death by cramming
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityLiving.java | 2 ++
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
2 files changed, 4 insertions(+)
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
||||
2 files changed, 7 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index 10af384d6..4e23d6d3a 100644
|
||||
index cbfb62cd4..f570f8955 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -1374,8 +1374,10 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -1484,8 +1484,10 @@ public abstract class EntityLiving extends Entity {
|
||||
this.dropInventory(); // CraftBukkit - from below
|
||||
org.bukkit.event.entity.EntityDeathEvent deathEvent; // Paper
|
||||
if (this.isDropExperience() && this.world.getGameRules().getBoolean(GameRules.DO_MOB_LOOT)) {
|
||||
if (this.cV() && this.world.getGameRules().getBoolean(GameRules.DO_MOB_LOOT)) {
|
||||
+ if (!(damagesource == DamageSource.CRAMMING && world.purpurConfig.disableDropsOnCrammingDeath)) { // Purpur
|
||||
this.a(damagesource, flag);
|
||||
this.dropDeathLoot(damagesource, i, flag);
|
||||
@@ -24,25 +24,21 @@ index 10af384d6..4e23d6d3a 100644
|
||||
deathEvent = CraftEventFactory.callEntityDeathEvent(this, this.drops); // Paper
|
||||
} else {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index d8d95d787..8c84431e5 100644
|
||||
index d3d09d9a4..0e0f59c96 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -112,6 +112,7 @@ public class PurpurWorldConfig {
|
||||
public double controllableMinecartsHopBoost = 0.5D;
|
||||
public double controllableMinecartsBaseSpeed = 0.1D;
|
||||
public Map<Block, Double> controllableMinecartsBlockSpeeds = new HashMap<>();
|
||||
+ public boolean disableDropsOnCrammingDeath = false;
|
||||
private void gameplayMechanicsSettings() {
|
||||
controllableMinecarts = getBoolean("gameplay-mechanics.controllable-minecarts.enabled", controllableMinecarts);
|
||||
controllableMinecartsPlaceAnywhere = getBoolean("gameplay-mechanics.controllable-minecarts.place-anywhere", controllableMinecartsPlaceAnywhere);
|
||||
@@ -130,6 +131,7 @@ public class PurpurWorldConfig {
|
||||
set("gameplay-mechanics.controllable-minecarts.block-speed.grass-block", 0.3D);
|
||||
set("gameplay-mechanics.controllable-minecarts.block-speed.stone", 0.5D);
|
||||
}
|
||||
+ disableDropsOnCrammingDeath = getBoolean("gameplay-mechanics.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);
|
||||
@@ -115,6 +115,11 @@ public class PurpurWorldConfig {
|
||||
idleTimeoutUpdateTabList = getBoolean("gameplay-mechanics.player.idle-timeout.update-tab-list", idleTimeoutUpdateTabList);
|
||||
}
|
||||
|
||||
public boolean batRidable = false;
|
||||
+ public boolean disableDropsOnCrammingDeath = false;
|
||||
+ private void miscGameplayMechanicsSettings() {
|
||||
+ disableDropsOnCrammingDeath = getBoolean("gameplay-mechanics.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);
|
||||
+ }
|
||||
+
|
||||
public int playerSpawnInvulnerableTicks = 60;
|
||||
public boolean playerInvulnerableWhileAcceptingResourcePack = false;
|
||||
private void playerInvulnerabilities() {
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
From 4536501e5239e68ff4e8bebc65bed6fb08b96284 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 6 Oct 2019 12:46:35 -0500
|
||||
Subject: [PATCH] Add option to set armorstand step height
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityArmorStand.java | 2 +-
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
2 files changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java
|
||||
index d4aa9b24f..d65544953 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityArmorStand.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityArmorStand.java
|
||||
@@ -62,7 +62,6 @@ public class EntityArmorStand extends EntityLiving {
|
||||
this.leftLegPose = EntityArmorStand.bv;
|
||||
this.rightLegPose = EntityArmorStand.bw;
|
||||
if (world != null) this.canTick = world.paperConfig.armorStandTick; // Paper - armour stand ticking
|
||||
- this.H = 0.0F;
|
||||
}
|
||||
|
||||
public EntityArmorStand(World world, double d0, double d1, double d2) {
|
||||
@@ -615,6 +614,7 @@ public class EntityArmorStand extends EntityLiving {
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
+ setStepHeight(world.purpurConfig.armorstandStepHeight); // Purpur
|
||||
// Paper start
|
||||
if (!this.canTick) {
|
||||
if (this.noTickPoseDirty) {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 2271d13f1..4bb5ddea4 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -135,6 +135,7 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
|
||||
public boolean boatEjectPlayersOnLand = false;
|
||||
+ public float armorstandStepHeight = 0.0F;
|
||||
public boolean controllableMinecarts = false;
|
||||
public boolean controllableMinecartsPlaceAnywhere = false;
|
||||
public float controllableMinecartsStepHeight = 1.0F;
|
||||
@@ -147,6 +148,7 @@ public class PurpurWorldConfig {
|
||||
public boolean useBetterMending = false;
|
||||
private void gameplayMechanicsSettings() {
|
||||
boatEjectPlayersOnLand = getBoolean("gameplay-mechanics.boat.eject-players-on-land", boatEjectPlayersOnLand);
|
||||
+ armorstandStepHeight = (float) getDouble("gameplay-mechanics.armorstand.step-height", armorstandStepHeight);
|
||||
controllableMinecarts = getBoolean("gameplay-mechanics.controllable-minecarts.enabled", controllableMinecarts);
|
||||
controllableMinecartsPlaceAnywhere = getBoolean("gameplay-mechanics.controllable-minecarts.place-anywhere", controllableMinecartsPlaceAnywhere);
|
||||
controllableMinecartsStepHeight = (float) getDouble("gameplay-mechanics.controllable-minecarts.step-height", controllableMinecartsStepHeight);
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 180a11a08582be6b68f188b6e5b5f7cefbcab4fa Mon Sep 17 00:00:00 2001
|
||||
From 54e723d0928f87ed9cd5be90508fb9b6f07bb40e Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 21 Jul 2019 18:01:46 -0500
|
||||
Subject: [PATCH] Players should not cram to death
|
||||
@@ -8,10 +8,10 @@ Subject: [PATCH] Players should not cram to death
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
index d7ce31284..3e0e49dbb 100644
|
||||
index 17476e908..b54960d25 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
@@ -1126,7 +1126,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
@@ -1246,7 +1246,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
|
||||
@Override
|
||||
public boolean isInvulnerable(DamageSource damagesource) {
|
||||
@@ -1,48 +1,42 @@
|
||||
From 1b2547a4ad9ca6eaa524538e0d6a747cf617a600 Mon Sep 17 00:00:00 2001
|
||||
From b3e7d2a10bc7014139373f7f4d54b8469ecbc14b Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Wed, 10 Jul 2019 20:43:05 -0500
|
||||
Subject: [PATCH] Option to toggle milk curing bad omen
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/ItemMilkBucket.java | 3 +++
|
||||
src/main/java/net/minecraft/server/ItemMilkBucket.java | 2 ++
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
2 files changed, 5 insertions(+)
|
||||
2 files changed, 4 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemMilkBucket.java b/src/main/java/net/minecraft/server/ItemMilkBucket.java
|
||||
index 6b255e09a..e1d3894ab 100644
|
||||
index fcf254bba..79554e18f 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemMilkBucket.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemMilkBucket.java
|
||||
@@ -20,7 +20,10 @@ public class ItemMilkBucket extends Item {
|
||||
@@ -20,7 +20,9 @@ public class ItemMilkBucket extends Item {
|
||||
}
|
||||
|
||||
if (!world.isClientSide) {
|
||||
+ MobEffect badOmen = entityliving.getEffect(MobEffects.BAD_OMEN); // Purpur
|
||||
entityliving.removeAllEffects(org.bukkit.event.entity.EntityPotionEffectEvent.Cause.MILK); // CraftBukkit
|
||||
+ if (!world.purpurConfig.milkCuresBadOmen && badOmen != null) entityliving.addEffect(badOmen); // Purpur
|
||||
+
|
||||
}
|
||||
|
||||
return itemstack.isEmpty() ? new ItemStack(Items.BUCKET) : itemstack;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 41dd1b861..7cbb1df7a 100644
|
||||
index 0e0f59c96..b6bcbd1e6 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -117,6 +117,7 @@ public class PurpurWorldConfig {
|
||||
public double controllableMinecartsBaseSpeed = 0.1D;
|
||||
public Map<Block, Double> controllableMinecartsBlockSpeeds = new HashMap<>();
|
||||
@@ -116,8 +116,10 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
|
||||
public boolean disableDropsOnCrammingDeath = false;
|
||||
+ public boolean milkCuresBadOmen = true;
|
||||
private void gameplayMechanicsSettings() {
|
||||
controllableMinecarts = getBoolean("gameplay-mechanics.controllable-minecarts.enabled", controllableMinecarts);
|
||||
controllableMinecartsPlaceAnywhere = getBoolean("gameplay-mechanics.controllable-minecarts.place-anywhere", controllableMinecartsPlaceAnywhere);
|
||||
@@ -136,6 +137,7 @@ public class PurpurWorldConfig {
|
||||
set("gameplay-mechanics.controllable-minecarts.block-speed.stone", 0.5D);
|
||||
}
|
||||
private void miscGameplayMechanicsSettings() {
|
||||
disableDropsOnCrammingDeath = getBoolean("gameplay-mechanics.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);
|
||||
+ milkCuresBadOmen = getBoolean("gameplay-mechanics.milk-cures-bad-omen", milkCuresBadOmen);
|
||||
}
|
||||
|
||||
public boolean idleTimeoutKick = true;
|
||||
public int playerSpawnInvulnerableTicks = 60;
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 880fd629acbb50e1198acaf479127bfebe3817d6 Mon Sep 17 00:00:00 2001
|
||||
From 2ed2dad2f015763bcf4bf54e56ebadece69521bb Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 21 Mar 2020 18:33:05 -0500
|
||||
Subject: [PATCH] End gateway should check if entity can use portal
|
||||
@@ -8,7 +8,7 @@ Subject: [PATCH] End gateway should check if entity can use portal
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntityEndGateway.java b/src/main/java/net/minecraft/server/TileEntityEndGateway.java
|
||||
index 87aef515c..55294b5df 100644
|
||||
index aebb6b6b2..c6b26f665 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntityEndGateway.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntityEndGateway.java
|
||||
@@ -122,6 +122,7 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick
|
||||
@@ -17,7 +17,7 @@ index 87aef515c..55294b5df 100644
|
||||
if (this.world instanceof WorldServer && !this.f()) {
|
||||
+ if (!entity.canPortal()) return; // Purpur
|
||||
this.c = 100;
|
||||
if (this.exitPortal == null && this.world.worldProvider instanceof WorldProviderTheEnd) {
|
||||
if (this.exitPortal == null && this.world.getDimensionKey() == World.THE_END) {
|
||||
this.a((WorldServer) this.world);
|
||||
--
|
||||
2.26.2
|
||||
@@ -1,4 +1,4 @@
|
||||
From fb61a83a73f9de95c06c77f7f788d4df811c82f4 Mon Sep 17 00:00:00 2001
|
||||
From e7b70b3784621d00d4579121864fa57f4e9c8b8a Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 4 Apr 2020 17:16:30 -0500
|
||||
Subject: [PATCH] Debug stick should not update neighbors
|
||||
@@ -8,10 +8,10 @@ Subject: [PATCH] Debug stick should not update neighbors
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
index d5e0578b2..bc465a47d 100644
|
||||
index 007255297..2b2d914de 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
@@ -186,6 +186,11 @@ public final class ItemStack {
|
||||
@@ -190,6 +190,11 @@ public final class ItemStack {
|
||||
if (this.getItem() == Items.BONE_MEAL) {
|
||||
world.captureTreeGeneration = true;
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
From dc386a10b38cdbe4de2d942d8e70138b7bf593f5 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 5 Jul 2019 18:21:00 -0500
|
||||
Subject: [PATCH] Implement PlayerSetSpawnerTypeWithEggEvent
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/ItemMonsterEgg.java | 14 ++++++++++++++
|
||||
1 file changed, 14 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemMonsterEgg.java b/src/main/java/net/minecraft/server/ItemMonsterEgg.java
|
||||
index 8ef2c3223..237fdeda5 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemMonsterEgg.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemMonsterEgg.java
|
||||
@@ -2,6 +2,11 @@ package net.minecraft.server;
|
||||
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.Maps;
|
||||
+import net.pl3x.purpur.event.PlayerSetSpawnerTypeWithEggEvent;
|
||||
+import org.bukkit.block.CreatureSpawner;
|
||||
+import org.bukkit.entity.EntityType;
|
||||
+import org.bukkit.entity.Player;
|
||||
+
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import javax.annotation.Nullable;
|
||||
@@ -41,6 +46,15 @@ public class ItemMonsterEgg extends Item {
|
||||
MobSpawnerAbstract mobspawnerabstract = ((TileEntityMobSpawner) tileentity).getSpawner();
|
||||
EntityTypes<?> entitytypes = this.b(itemstack.getTag());
|
||||
|
||||
+ // Purpur start
|
||||
+ org.bukkit.block.Block bukkitBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
||||
+ PlayerSetSpawnerTypeWithEggEvent event = new PlayerSetSpawnerTypeWithEggEvent((Player) itemactioncontext.b.getBukkitEntity(), bukkitBlock, (CreatureSpawner) bukkitBlock.getState(), EntityType.fromName(entitytypes.getName()));
|
||||
+ if (!event.callEvent()) {
|
||||
+ return EnumInteractionResult.FAIL;
|
||||
+ }
|
||||
+ entitytypes = EntityTypes.getFromKey(new MinecraftKey(event.getEntityType().getKey().toString()));
|
||||
+ // Purpur end
|
||||
+
|
||||
mobspawnerabstract.setMobName(entitytypes);
|
||||
tileentity.update();
|
||||
world.notify(blockposition, iblockdata, iblockdata, 3);
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 4a8ac41e8b4ea8f138e46d0ef993a5ea6598fc2b Mon Sep 17 00:00:00 2001
|
||||
From cb512084b525bac9346f5a0c4786ed30ecc163d5 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sun, 7 Jun 2020 13:16:02 -0500
|
||||
Subject: [PATCH] Do not strip colors from death messages
|
||||
@@ -8,10 +8,10 @@ Subject: [PATCH] Do not strip colors from death messages
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
index e73b33721..9eeefa1ca 100644
|
||||
index b54960d25..9801d87f0 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
@@ -622,7 +622,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
@@ -665,7 +665,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
|
||||
IChatBaseComponent defaultMessage = this.getCombatTracker().getDeathMessage();
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
From 64163a967be7513c8c46cc26d795e81c41446fb1 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 8 Feb 2020 23:30:17 -0600
|
||||
Subject: [PATCH] Add getPlacementBlockData to World
|
||||
|
||||
---
|
||||
.../net/minecraft/server/BlockMobSpawner.java | 1 +
|
||||
.../net/minecraft/server/ItemSpawner.java | 23 +++++++++++++++++++
|
||||
src/main/java/net/minecraft/server/Items.java | 2 +-
|
||||
.../org/bukkit/craftbukkit/CraftWorld.java | 5 ++++
|
||||
4 files changed, 30 insertions(+), 1 deletion(-)
|
||||
create mode 100644 src/main/java/net/minecraft/server/ItemSpawner.java
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockMobSpawner.java b/src/main/java/net/minecraft/server/BlockMobSpawner.java
|
||||
index 69d04f6cb..901d45f28 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockMobSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockMobSpawner.java
|
||||
@@ -57,6 +57,7 @@ public class BlockMobSpawner extends BlockTileEntity {
|
||||
|
||||
@Override
|
||||
public int getExpDrop(IBlockData iblockdata, World world, BlockPosition blockposition, ItemStack itemstack) {
|
||||
+ if (isSilkTouch(itemstack)) return 0; // Purpur
|
||||
int i = 15 + world.random.nextInt(15) + world.random.nextInt(15);
|
||||
|
||||
return i;
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemSpawner.java b/src/main/java/net/minecraft/server/ItemSpawner.java
|
||||
new file mode 100644
|
||||
index 000000000..7dc68ffe9
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/minecraft/server/ItemSpawner.java
|
||||
@@ -0,0 +1,23 @@
|
||||
+package net.minecraft.server;
|
||||
+
|
||||
+public class ItemSpawner extends ItemBlock {
|
||||
+ public ItemSpawner(Block block, Info info) {
|
||||
+ super(block, info);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ protected boolean a(BlockPosition blockposition, World world, EntityHuman entityhuman, ItemStack itemstack, IBlockData iblockdata) {
|
||||
+ boolean handled = super.a(blockposition, world, entityhuman, itemstack, iblockdata);
|
||||
+ if (entityhuman.getBukkitEntity().hasPermission("purpur.place.spawners")) {
|
||||
+ TileEntity spawner = world.getTileEntity(blockposition);
|
||||
+ if (spawner instanceof TileEntityMobSpawner && itemstack.hasTag()) {
|
||||
+ NBTTagCompound tag = itemstack.getTag();
|
||||
+ if (tag.hasKey("Purpur.mob_type")) {
|
||||
+ EntityTypes.getType(tag.getString("Purpur.mob_type")).ifPresent(type ->
|
||||
+ ((TileEntityMobSpawner) spawner).getSpawner().setMobName(type));
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ return handled;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/Items.java b/src/main/java/net/minecraft/server/Items.java
|
||||
index 9c9b93f28..74a722cce 100644
|
||||
--- a/src/main/java/net/minecraft/server/Items.java
|
||||
+++ b/src/main/java/net/minecraft/server/Items.java
|
||||
@@ -155,7 +155,7 @@ public class Items {
|
||||
public static final Item bU = a(Blocks.PURPUR_BLOCK, CreativeModeTab.b);
|
||||
public static final Item bV = a(Blocks.PURPUR_PILLAR, CreativeModeTab.b);
|
||||
public static final Item bW = a(Blocks.PURPUR_STAIRS, CreativeModeTab.b);
|
||||
- public static final Item bX = a(Blocks.SPAWNER);
|
||||
+ public static final Item bX = a(Blocks.SPAWNER, new ItemSpawner(Blocks.SPAWNER, new Item.Info().a(EnumItemRarity.EPIC))); // Purpur
|
||||
public static final Item bY = a(Blocks.OAK_STAIRS, CreativeModeTab.b);
|
||||
public static final Item bZ = a(Blocks.CHEST, CreativeModeTab.c);
|
||||
public static final Item ca = a(Blocks.DIAMOND_ORE, CreativeModeTab.b);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index e55be5271..8b5003436 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -2483,6 +2483,11 @@ public class CraftWorld implements World {
|
||||
public net.pl3x.purpur.MoonPhase getMoonPhase() {
|
||||
return net.pl3x.purpur.MoonPhase.getPhase(getFullTime() / 24000L);
|
||||
}
|
||||
+
|
||||
+ public BlockData getPlacementBlockData(BlockData blockdata, Location location) {
|
||||
+ IBlockData validData = net.minecraft.server.Block.getValidBlockForPosition(((CraftBlockData) blockdata).getState(), getHandle(), net.minecraft.server.MCUtil.toBlockPosition(location));
|
||||
+ return CraftBlockData.fromData(validData == null ? Blocks.AIR.getBlockData() : validData);
|
||||
+ }
|
||||
// Purpur end
|
||||
|
||||
// Paper start
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From dcebd276461c63a590cd35b73ece127106eb7d6a Mon Sep 17 00:00:00 2001
|
||||
From c16950236ff5a5b2cccdd3cb8c8a6bfd69dc36b0 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Fri, 19 Jun 2020 21:36:16 -0500
|
||||
Subject: [PATCH] Fix reloading paper.yml
|
||||
@@ -8,7 +8,7 @@ Subject: [PATCH] Fix reloading paper.yml
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index ecacb72b9..284ea05dc 100644
|
||||
index e471e7649..09fda504d 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -20,7 +20,7 @@ public class PaperWorldConfig {
|
||||
@@ -1,89 +0,0 @@
|
||||
From bdd2fd8f778a66a3f234c7ad24dba470f2f1d0a3 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 23 May 2019 21:50:37 -0500
|
||||
Subject: [PATCH] Barrels have 6 rows
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/TileEntityBarrel.java | 5 +++--
|
||||
src/main/java/net/pl3x/purpur/PurpurConfig.java | 9 +++++++++
|
||||
.../org/bukkit/craftbukkit/inventory/CraftContainer.java | 4 +++-
|
||||
3 files changed, 15 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntityBarrel.java b/src/main/java/net/minecraft/server/TileEntityBarrel.java
|
||||
index 1e27abbea..ca3b6c9aa 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntityBarrel.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntityBarrel.java
|
||||
@@ -54,7 +54,7 @@ public class TileEntityBarrel extends TileEntityLootable {
|
||||
|
||||
private TileEntityBarrel(TileEntityTypes<?> tileentitytypes) {
|
||||
super(tileentitytypes);
|
||||
- this.items = NonNullList.a(27, ItemStack.a);
|
||||
+ this.items = NonNullList.a(net.pl3x.purpur.PurpurConfig.barrelSixRows ? 54 : 27, ItemStack.a); // Purpur
|
||||
}
|
||||
|
||||
public TileEntityBarrel() {
|
||||
@@ -83,7 +83,7 @@ public class TileEntityBarrel extends TileEntityLootable {
|
||||
|
||||
@Override
|
||||
public int getSize() {
|
||||
- return 27;
|
||||
+ return net.pl3x.purpur.PurpurConfig.barrelSixRows ? 54 : 27; // Purpur
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -103,6 +103,7 @@ public class TileEntityBarrel extends TileEntityLootable {
|
||||
|
||||
@Override
|
||||
protected Container createContainer(int i, PlayerInventory playerinventory) {
|
||||
+ if (net.pl3x.purpur.PurpurConfig.barrelSixRows) return new ContainerChest(Containers.GENERIC_9X6, i, playerinventory, this, 6); // Purpur
|
||||
return ContainerChest.a(i, playerinventory, this);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index ed2a31277..581e8eebe 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -7,6 +7,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.configuration.InvalidConfigurationException;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
+import org.bukkit.event.inventory.InventoryType;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -154,8 +155,16 @@ public class PurpurConfig {
|
||||
dontSendUselessEntityPackets = getBoolean("settings.dont-send-useless-entity-packets", dontSendUselessEntityPackets);
|
||||
}
|
||||
|
||||
+ public static boolean barrelSixRows = false;
|
||||
public static boolean slimeBlocksNotPushable = false;
|
||||
private static void blockSettings() {
|
||||
+ if (version < 3) {
|
||||
+ boolean oldValue = getBoolean("settings.barrel.packed-barrels", true);
|
||||
+ set("settings.blocks.barrel.six-rows", oldValue);
|
||||
+ set("settings.packed-barrels", null);
|
||||
+ }
|
||||
+ barrelSixRows = getBoolean("settings.blocks.barrel.six-rows", barrelSixRows);
|
||||
+ InventoryType.BARREL.setDefaultSize(barrelSixRows ? 54 : 27);
|
||||
slimeBlocksNotPushable = getBoolean("settings.blocks.slime.not-movable-by-piston", slimeBlocksNotPushable);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
|
||||
index 454ec3c76..d295821c5 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
|
||||
@@ -195,8 +195,10 @@ public class CraftContainer extends Container {
|
||||
case PLAYER:
|
||||
case CHEST:
|
||||
case ENDER_CHEST:
|
||||
+ delegate = new ContainerChest(Containers.GENERIC_9X3, windowId, bottom, top, top.getSize() / 9); // Purpur
|
||||
+ break; // Purpur
|
||||
case BARREL:
|
||||
- delegate = new ContainerChest(Containers.GENERIC_9X3, windowId, bottom, top, top.getSize() / 9);
|
||||
+ delegate = new ContainerChest(net.pl3x.purpur.PurpurConfig.barrelSixRows ? Containers.GENERIC_9X6 : Containers.GENERIC_9X3, windowId, bottom, top, top.getSize() / 9); // Purpur
|
||||
break;
|
||||
case DISPENSER:
|
||||
case DROPPER:
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 151f9b4605ac2ec1d7788f860ad5d331e25754a6 Mon Sep 17 00:00:00 2001
|
||||
From c266a969a6ad3581ec51a0815b2eef864c3ac0b7 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Fri, 6 Mar 2020 13:37:26 -0600
|
||||
Subject: [PATCH] Fix the dead lagging the server
|
||||
@@ -9,23 +9,23 @@ Subject: [PATCH] Fix the dead lagging the server
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index a20660a9b..cb6dec517 100644
|
||||
index e72975ff6..a219443b3 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -1592,7 +1592,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@@ -1345,7 +1345,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
this.pitch = MathHelper.a(f1, -90.0F, 90.0F) % 360.0F;
|
||||
this.lastYaw = this.yaw;
|
||||
this.lastPitch = this.pitch;
|
||||
- if (valid) world.getChunkAt((int) Math.floor(this.locX) >> 4, (int) Math.floor(this.locZ) >> 4); // CraftBukkit // Paper
|
||||
+ if (valid && !dead) world.getChunkAt((int) Math.floor(this.locX) >> 4, (int) Math.floor(this.locZ) >> 4); // CraftBukkit // Paper // Purpur
|
||||
- if (valid) world.getChunkAt((int) Math.floor(this.locX()) >> 4, (int) Math.floor(this.locZ()) >> 4); // CraftBukkit // Paper
|
||||
+ if (valid && !dead) world.getChunkAt((int) Math.floor(this.locX()) >> 4, (int) Math.floor(this.locZ()) >> 4); // CraftBukkit // Paper // Purpur
|
||||
}
|
||||
|
||||
public void setPositionRotation(BlockPosition blockposition, float f, float f1) {
|
||||
public void c(Vec3D vec3d) {
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index 387f74fe1..dae35c55e 100644
|
||||
index f570f8955..f86499c87 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -2398,7 +2398,7 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -2468,7 +2468,7 @@ public abstract class EntityLiving extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 67afec34bd04c7397e1079296ef6da3659175aa8 Mon Sep 17 00:00:00 2001
|
||||
From 333eaf6ecdb008426410030c2c27f5ce006d6c35 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 4 Apr 2020 03:07:59 -0500
|
||||
Subject: [PATCH] Skip events if there's no listeners
|
||||
@@ -8,7 +8,7 @@ Subject: [PATCH] Skip events if there's no listeners
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/CommandDispatcher.java b/src/main/java/net/minecraft/server/CommandDispatcher.java
|
||||
index 5aa10d16b..3b61298fa 100644
|
||||
index e59151d01..4ace0e79c 100644
|
||||
--- a/src/main/java/net/minecraft/server/CommandDispatcher.java
|
||||
+++ b/src/main/java/net/minecraft/server/CommandDispatcher.java
|
||||
@@ -275,6 +275,7 @@ public class CommandDispatcher {
|
||||
@@ -1,4 +1,4 @@
|
||||
From 437e55dc3cde421e1c239bd7f834ff858fd3f4fc Mon Sep 17 00:00:00 2001
|
||||
From 606a4d55a58761fdd9882c0da7bf710359c8eb8f Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 28 Dec 2019 04:21:54 -0600
|
||||
Subject: [PATCH] Add permission for F3+N debug
|
||||
@@ -8,10 +8,10 @@ Subject: [PATCH] Add permission for F3+N debug
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
index ab8247eb7..af2cdbf4d 100644
|
||||
index 5807e77da..ec2bbd52c 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
@@ -980,6 +980,7 @@ public abstract class PlayerList {
|
||||
@@ -1023,6 +1023,7 @@ public abstract class PlayerList {
|
||||
} else {
|
||||
b0 = (byte) (24 + i);
|
||||
}
|
||||
@@ -1,18 +1,18 @@
|
||||
From 02fc90e6d67242d23da3b9f79ff650bd100240aa Mon Sep 17 00:00:00 2001
|
||||
From 4f2a4bdb16c57bde9625687d6052f2fc09914ae1 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Tue, 14 Jan 2020 19:43:40 -0600
|
||||
Subject: [PATCH] Add wither skeleton takes wither damage option
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntitySkeletonWither.java | 2 +-
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
||||
2 files changed, 3 insertions(+), 1 deletion(-)
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
||||
2 files changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntitySkeletonWither.java b/src/main/java/net/minecraft/server/EntitySkeletonWither.java
|
||||
index 8aa0a6699..0fd740e71 100644
|
||||
index 1819432e1..f415775ea 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntitySkeletonWither.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntitySkeletonWither.java
|
||||
@@ -108,6 +108,6 @@ public class EntitySkeletonWither extends EntitySkeletonAbstract {
|
||||
@@ -97,6 +97,6 @@ public class EntitySkeletonWither extends EntitySkeletonAbstract {
|
||||
|
||||
@Override
|
||||
public boolean d(MobEffect mobeffect) {
|
||||
@@ -21,22 +21,21 @@ index 8aa0a6699..0fd740e71 100644
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index c238607ac..d4b4dfdd3 100644
|
||||
index b6bcbd1e6..5549a984d 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -844,10 +844,12 @@ public class PurpurWorldConfig {
|
||||
public boolean witherSkeletonRidable = false;
|
||||
public boolean witherSkeletonRidableInWater = false;
|
||||
public boolean witherSkeletonRequireShiftToMount = true;
|
||||
+ public boolean witherSkeletonTakesWitherDamage = false;
|
||||
private void witherSkeletonSettings() {
|
||||
witherSkeletonRidable = getBoolean("mobs.wither_skeleton.ridable", witherSkeletonRidable);
|
||||
witherSkeletonRidableInWater = getBoolean("mobs.wither_skeleton.ridable-in-water", witherSkeletonRidableInWater);
|
||||
witherSkeletonRequireShiftToMount = getBoolean("mobs.wither_skeleton.require-shift-to-mount", witherSkeletonRequireShiftToMount);
|
||||
+ witherSkeletonTakesWitherDamage = getBoolean("mobs.wither_skeleton.takes-wither-damage", witherSkeletonTakesWitherDamage);
|
||||
@@ -252,6 +252,11 @@ public class PurpurWorldConfig {
|
||||
villagerUseBrainTicksOnlyWhenLagging = getBoolean("mobs.villager.use-brain-ticks-only-when-lagging", villagerUseBrainTicksOnlyWhenLagging);
|
||||
}
|
||||
|
||||
public boolean wolfRidable = false;
|
||||
+ public boolean witherSkeletonTakesWitherDamage = false;
|
||||
+ private void witherSkeletonSettings() {
|
||||
+ witherSkeletonTakesWitherDamage = getBoolean("mobs.wither_skeleton.takes-wither-damage", witherSkeletonTakesWitherDamage);
|
||||
+ }
|
||||
+
|
||||
public double zombieHorseSpawnChance = 0.0D;
|
||||
private void zombieHorseSettings() {
|
||||
zombieHorseSpawnChance = getDouble("mobs.zombie_horse.spawn-chance", zombieHorseSpawnChance);
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
From 4f5ad157197bfb5a3447e104eb705317f82b935a Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 19 Oct 2019 00:29:02 -0500
|
||||
Subject: [PATCH] Add more evoker API
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/EntityEvoker.java | 6 ++++--
|
||||
.../org/bukkit/craftbukkit/entity/CraftEvoker.java | 13 +++++++++++++
|
||||
2 files changed, 17 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityEvoker.java b/src/main/java/net/minecraft/server/EntityEvoker.java
|
||||
index 179a26129..e7d0d0f5e 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityEvoker.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityEvoker.java
|
||||
@@ -102,12 +102,14 @@ public class EntityEvoker extends EntityIllagerWizard {
|
||||
return SoundEffects.ENTITY_EVOKER_HURT;
|
||||
}
|
||||
|
||||
+ public void setWololoTarget(@Nullable EntitySheep sheep) { a(sheep); } // Purpur - OBFHELPER
|
||||
private void a(@Nullable EntitySheep entitysheep) {
|
||||
this.bw = entitysheep;
|
||||
}
|
||||
|
||||
- @Nullable
|
||||
- private EntitySheep eK() {
|
||||
+
|
||||
+ @Nullable public EntitySheep getWololoTarget() { return eK(); } // Purpur - OBFHELPER
|
||||
+ @Nullable private EntitySheep eK() {
|
||||
return this.bw;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java
|
||||
index 0636d2647..4ccb93890 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java
|
||||
@@ -36,4 +36,17 @@ public class CraftEvoker extends CraftSpellcaster implements Evoker {
|
||||
public void setCurrentSpell(Evoker.Spell spell) {
|
||||
getHandle().setSpell(spell == null ? EntityIllagerWizard.Spell.NONE : EntityIllagerWizard.Spell.a(spell.ordinal()));
|
||||
}
|
||||
+
|
||||
+ // Purpur start
|
||||
+ @javax.annotation.Nullable
|
||||
+ public org.bukkit.entity.Sheep getWololoTarget() {
|
||||
+ net.minecraft.server.EntitySheep target = getHandle().getWololoTarget();
|
||||
+ return target == null ? null : (org.bukkit.entity.Sheep) target.getBukkitEntity();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setWololoTarget(@javax.annotation.Nullable org.bukkit.entity.Sheep sheep) {
|
||||
+ getHandle().setWololoTarget(sheep == null ? null : (net.minecraft.server.EntitySheep) ((CraftEntity) sheep).getHandle());
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,47 +1,46 @@
|
||||
From 68b264656f252e5a829e2a70024ffe9e74fb8e6c Mon Sep 17 00:00:00 2001
|
||||
From 02da1438e3d0845b34082ffe6a80bf7471790dc9 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 26 Mar 2020 19:06:22 -0500
|
||||
Subject: [PATCH] Configurable TPS Catchup
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/MinecraftServer.java | 7 +++++++
|
||||
src/main/java/net/minecraft/server/MinecraftServer.java | 8 +++++++-
|
||||
src/main/java/net/pl3x/purpur/PurpurConfig.java | 5 +++++
|
||||
2 files changed, 12 insertions(+)
|
||||
2 files changed, 12 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index d91d3a82c..40da7a05c 100644
|
||||
index 822798741..b7915d2ff 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -988,6 +988,13 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -1002,7 +1002,13 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
this.a(this::canSleepForTick);
|
||||
this.methodProfiler.exitEnter("nextTickWait");
|
||||
this.ac = true;
|
||||
this.ab = Math.max(SystemUtils.getMonotonicMillis() + 50L, this.nextTick);
|
||||
this.X = true;
|
||||
- this.W = Math.max(SystemUtils.getMonotonicMillis() + 50L, this.nextTick);
|
||||
+ // Purpur start - tps catchup
|
||||
+ if (net.pl3x.purpur.PurpurConfig.tpsCatchup) {
|
||||
+ this.ab = Math.max(SystemUtils.getMonotonicMillis() + 50L, this.nextTick);
|
||||
+ this.W = Math.max(SystemUtils.getMonotonicMillis() + 50L, this.nextTick);
|
||||
+ } else {
|
||||
+ this.ab = this.nextTick = curTime / 1000000L + 50L;
|
||||
+ this.W = this.nextTick = curTime / 1000000L + 50L;
|
||||
+ }
|
||||
+ // Purpur end - tps catchup
|
||||
this.sleepForTick();
|
||||
this.methodProfiler.exit();
|
||||
this.methodProfiler.b();
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index a729e7d20..7bea36213 100644
|
||||
index e8a0438ec..f7e5d12cf 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -155,6 +155,11 @@ public class PurpurConfig {
|
||||
useUPnP = getBoolean("settings.upnp-port-forwarding", useUPnP);
|
||||
@@ -192,4 +192,9 @@ public class PurpurConfig {
|
||||
loggerSuppressInitLegacyMaterialError = getBoolean("settings.logger.suppress-init-legacy-material-errors", loggerSuppressInitLegacyMaterialError);
|
||||
loggerSuppressIgnoredAdvancementWarnings = getBoolean("settings.logger.suppress-ignored-advancement-warnings", loggerSuppressIgnoredAdvancementWarnings);
|
||||
}
|
||||
|
||||
+
|
||||
+ public static boolean tpsCatchup = true;
|
||||
+ private static void tpsCatchup() {
|
||||
+ tpsCatchup = getBoolean("settings.tps-catchup", tpsCatchup);
|
||||
+ }
|
||||
+
|
||||
public static boolean dontSendUselessEntityPackets = false;
|
||||
private static void dontSendUselessEntityPackets() {
|
||||
dontSendUselessEntityPackets = getBoolean("settings.dont-send-useless-entity-packets", dontSendUselessEntityPackets);
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From f6a2f4d519f4f8b64162fefbfb1de88a8e654c5c Mon Sep 17 00:00:00 2001
|
||||
From fc59b25635b9730071385322ad04b1e168272c12 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 19 Mar 2020 19:39:34 -0500
|
||||
Subject: [PATCH] Add option to allow loyalty on tridents to work in the void
|
||||
@@ -9,38 +9,34 @@ Subject: [PATCH] Add option to allow loyalty on tridents to work in the void
|
||||
2 files changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityThrownTrident.java b/src/main/java/net/minecraft/server/EntityThrownTrident.java
|
||||
index 59bb039ad..b975cc7fb 100644
|
||||
index c68002ffe..9be919986 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityThrownTrident.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityThrownTrident.java
|
||||
@@ -38,7 +38,7 @@ public class EntityThrownTrident extends EntityArrow {
|
||||
|
||||
Entity entity = this.getShooter();
|
||||
|
||||
- if ((this.as || this.v()) && entity != null) {
|
||||
+ if ((this.as || this.v() || (world.purpurConfig.tridentLoyaltyVoidReturnHeight < 0.0D && locY() < world.purpurConfig.tridentLoyaltyVoidReturnHeight)) && entity != null) { // Purpur
|
||||
byte b0 = (Byte) this.datawatcher.get(EntityThrownTrident.ap);
|
||||
- if ((this.ap || this.t()) && entity != null) {
|
||||
+ if ((this.ap || this.t() || (world.purpurConfig.tridentLoyaltyVoidReturnHeight < 0.0D && locY() < world.purpurConfig.tridentLoyaltyVoidReturnHeight)) && entity != null) { // Purpur
|
||||
byte b0 = (Byte) this.datawatcher.get(EntityThrownTrident.g);
|
||||
|
||||
if (b0 > 0 && !this.z()) {
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 53c8782b5..01b8fffe1 100644
|
||||
index 5549a984d..e571b3628 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -189,6 +189,7 @@ public class PurpurWorldConfig {
|
||||
public String playerSleepCondition = "time >= 12541 && time <= 23458";
|
||||
public boolean useBetterMending = false;
|
||||
public boolean saveProjectilesToDisk = true;
|
||||
@@ -117,9 +117,11 @@ public class PurpurWorldConfig {
|
||||
|
||||
public boolean disableDropsOnCrammingDeath = false;
|
||||
public boolean milkCuresBadOmen = true;
|
||||
+ public double tridentLoyaltyVoidReturnHeight = 0.0D;
|
||||
public double voidDamageHeight = -64.0D;
|
||||
private void gameplayMechanicsSettings() {
|
||||
boatEjectPlayersOnLand = getBoolean("gameplay-mechanics.boat.eject-players-on-land", boatEjectPlayersOnLand);
|
||||
@@ -246,6 +247,7 @@ public class PurpurWorldConfig {
|
||||
set("gameplay-mechanics.saveProjectilesToDisk", null);
|
||||
}
|
||||
saveProjectilesToDisk = getBoolean("gameplay-mechanics.save-projectiles-to-disk", saveProjectilesToDisk);
|
||||
private void miscGameplayMechanicsSettings() {
|
||||
disableDropsOnCrammingDeath = getBoolean("gameplay-mechanics.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);
|
||||
milkCuresBadOmen = getBoolean("gameplay-mechanics.milk-cures-bad-omen", milkCuresBadOmen);
|
||||
+ tridentLoyaltyVoidReturnHeight = getDouble("gameplay-mechanics.trident-loyalty-void-return-height", tridentLoyaltyVoidReturnHeight);
|
||||
voidDamageHeight = getDouble("gameplay-mechanics.void-damage-height", voidDamageHeight);
|
||||
}
|
||||
|
||||
public int playerSpawnInvulnerableTicks = 60;
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 1f2cea0e76872e923b9351c848918889ec610af4 Mon Sep 17 00:00:00 2001
|
||||
From cb1c37ea2302e7d0dd55ce91ecbac3e3ebe561fb Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sun, 26 Apr 2020 16:28:38 -0500
|
||||
Subject: [PATCH] Add enderman and creeper griefing controls
|
||||
@@ -6,14 +6,14 @@ Subject: [PATCH] Add enderman and creeper griefing controls
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityCreeper.java | 2 +-
|
||||
src/main/java/net/minecraft/server/EntityEnderman.java | 2 ++
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 4 ++++
|
||||
3 files changed, 7 insertions(+), 1 deletion(-)
|
||||
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 7 +++++++
|
||||
3 files changed, 10 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java
|
||||
index ce366f401..93efc7977 100644
|
||||
index ec5287fa5..848944230 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityCreeper.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityCreeper.java
|
||||
@@ -237,7 +237,7 @@ public class EntityCreeper extends EntityMonster {
|
||||
@@ -204,7 +204,7 @@ public class EntityCreeper extends EntityMonster {
|
||||
|
||||
public void explode() {
|
||||
if (!this.world.isClientSide) {
|
||||
@@ -23,10 +23,10 @@ index ce366f401..93efc7977 100644
|
||||
|
||||
// CraftBukkit start
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java
|
||||
index de30ce483..68165d72d 100644
|
||||
index b61de3351..245fc38de 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityEnderman.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityEnderman.java
|
||||
@@ -354,6 +354,7 @@ public class EntityEnderman extends EntityMonster {
|
||||
@@ -370,6 +370,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable {
|
||||
|
||||
@Override
|
||||
public boolean a() {
|
||||
@@ -34,7 +34,7 @@ index de30ce483..68165d72d 100644
|
||||
return this.enderman.getCarried() != null ? false : (!this.enderman.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? false : this.enderman.getRandom().nextInt(20) == 0);
|
||||
}
|
||||
|
||||
@@ -397,6 +398,7 @@ public class EntityEnderman extends EntityMonster {
|
||||
@@ -413,6 +414,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable {
|
||||
|
||||
@Override
|
||||
public boolean a() {
|
||||
@@ -43,36 +43,32 @@ index de30ce483..68165d72d 100644
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 0347b729c..e6ab2fde4 100644
|
||||
index e571b3628..bd9ac998f 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -394,11 +394,13 @@ public class PurpurWorldConfig {
|
||||
public boolean creeperRidableInWater = false;
|
||||
public boolean creeperRequireShiftToMount = true;
|
||||
public double creeperChargedChance = 0.0D;
|
||||
@@ -172,8 +172,10 @@ public class PurpurWorldConfig {
|
||||
cowFeedMushrooms = getInt("mobs.cow.feed-mushrooms-for-mooshroom", cowFeedMushrooms);
|
||||
}
|
||||
|
||||
+ public boolean creeperAllowGriefing = true;
|
||||
public double creeperChargedChance = 0.0D;
|
||||
private void creeperSettings() {
|
||||
creeperRidable = getBoolean("mobs.creeper.ridable", creeperRidable);
|
||||
creeperRidableInWater = getBoolean("mobs.creeper.ridable-in-water", creeperRidableInWater);
|
||||
creeperRequireShiftToMount = getBoolean("mobs.creeper.require-shift-to-mount", creeperRequireShiftToMount);
|
||||
creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
|
||||
+ creeperAllowGriefing = getBoolean("mobs.creeper.allow-griefing", creeperAllowGriefing);
|
||||
creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
|
||||
}
|
||||
|
||||
@@ -184,6 +186,11 @@ public class PurpurWorldConfig {
|
||||
enderDragonAlwaysDropsFullExp = getBoolean("mobs.ender_dragon.always-drop-full-exp", enderDragonAlwaysDropsFullExp);
|
||||
}
|
||||
|
||||
public boolean dolphinRidable = false;
|
||||
@@ -463,10 +465,12 @@ public class PurpurWorldConfig {
|
||||
public boolean endermanRidable = false;
|
||||
public boolean endermanRidableInWater = false;
|
||||
public boolean endermanRequireShiftToMount = true;
|
||||
+ public boolean endermanAllowGriefing = true;
|
||||
private void endermanSettings() {
|
||||
endermanRidable = getBoolean("mobs.enderman.ridable", endermanRidable);
|
||||
endermanRidableInWater = getBoolean("mobs.enderman.ridable-in-water", endermanRidableInWater);
|
||||
endermanRequireShiftToMount = getBoolean("mobs.enderman.require-shift-to-mount", endermanRequireShiftToMount);
|
||||
+ private void endermanSettings() {
|
||||
+ endermanAllowGriefing = getBoolean("mobs.enderman.allow-griefing", endermanAllowGriefing);
|
||||
}
|
||||
|
||||
public boolean endermiteRidable = false;
|
||||
+ }
|
||||
+
|
||||
public boolean foxTypeChangesWithTulips = false;
|
||||
private void foxSettings() {
|
||||
foxTypeChangesWithTulips = getBoolean("mobs.fox.tulips-change-type", foxTypeChangesWithTulips);
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 02641240d37f617ad72ad74f28ddc87d950e0e7a Mon Sep 17 00:00:00 2001
|
||||
From ed8fe7b9c7b1da77811da03d30016b39f0268a5a Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Fri, 24 Apr 2020 09:33:11 -0500
|
||||
Subject: [PATCH] Entities pick up loot bypass mob-griefing gamerule
|
||||
@@ -9,38 +9,35 @@ Subject: [PATCH] Entities pick up loot bypass mob-griefing gamerule
|
||||
2 files changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
index eb0befb35..4e5b71046 100644
|
||||
index 93714e5d9..b23674625 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
@@ -525,7 +525,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
@@ -542,7 +542,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
public void movementTick() {
|
||||
super.movementTick();
|
||||
this.world.getMethodProfiler().enter("looting");
|
||||
- if (!this.world.isClientSide && this.canPickupLoot() && this.isAlive() && !this.killed && this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) {
|
||||
+ if (!this.world.isClientSide && this.canPickupLoot() && this.isAlive() && !this.killed && (this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) || world.purpurConfig.entitiesPickUpLootBypassMobGriefing)) {
|
||||
+ if (!this.world.isClientSide && this.canPickupLoot() && this.isAlive() && !this.killed && (this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) || world.purpurConfig.entitiesPickUpLootBypassMobGriefing)) { // Purpur
|
||||
List<EntityItem> list = this.world.a(EntityItem.class, this.getBoundingBox().grow(1.0D, 0.0D, 1.0D));
|
||||
Iterator iterator = list.iterator();
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 6962d17b9..e57299f1e 100644
|
||||
index bd9ac998f..7217c07e5 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -200,6 +200,7 @@ public class PurpurWorldConfig {
|
||||
public double controllableMinecartsBaseSpeed = 0.1D;
|
||||
public Map<Block, Double> controllableMinecartsBlockSpeeds = new HashMap<>();
|
||||
@@ -116,10 +116,12 @@ public class PurpurWorldConfig {
|
||||
}
|
||||
|
||||
public boolean disableDropsOnCrammingDeath = false;
|
||||
+ public boolean entitiesPickUpLootBypassMobGriefing = false;
|
||||
public boolean fixClimbingBypassingCrammingRule = false;
|
||||
public boolean itemFloatInLava = false;
|
||||
public List<Item> itemImmuneToExplosion = new ArrayList<>();
|
||||
@@ -235,6 +236,7 @@ public class PurpurWorldConfig {
|
||||
set("gameplay-mechanics.controllable-minecarts.block-speed.stone", 0.5D);
|
||||
}
|
||||
public boolean milkCuresBadOmen = true;
|
||||
public double tridentLoyaltyVoidReturnHeight = 0.0D;
|
||||
private void miscGameplayMechanicsSettings() {
|
||||
disableDropsOnCrammingDeath = getBoolean("gameplay-mechanics.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);
|
||||
+ entitiesPickUpLootBypassMobGriefing = getBoolean("gameplay-mechanics.entities-pick-up-loot-bypass-mob-griefing", entitiesPickUpLootBypassMobGriefing);
|
||||
fixClimbingBypassingCrammingRule = getBoolean("gameplay-mechanics.fix-climbing-bypassing-cramming-rule", fixClimbingBypassingCrammingRule);
|
||||
itemFloatInLava = getBoolean("gameplay-mechanics.item.float-in-lava", itemFloatInLava);
|
||||
getList("gameplay-mechanics.item.immune.explosion", itemImmuneToExplosion).forEach(key -> {
|
||||
milkCuresBadOmen = getBoolean("gameplay-mechanics.milk-cures-bad-omen", milkCuresBadOmen);
|
||||
tridentLoyaltyVoidReturnHeight = getDouble("gameplay-mechanics.trident-loyalty-void-return-height", tridentLoyaltyVoidReturnHeight);
|
||||
}
|
||||
--
|
||||
2.26.2
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user