mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-22 19:07:44 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: eb11845f8 Fix creating worlds with "invalid" names (Fixes #5331) e4d8a6279 Implement Keyed on World bcb63dab7 [CI-SKIP] [Auto] Rebuild Patches 48342b06c Allow signs that are inside of the spawn protection to be right clicked to use their run_command tag c229f90c1 Add Block#isValidTool 20e709c1d Add recipe to cook events 2dcf8bff4 legacy formatting will be the death of me f597fea0d legacy formatting is worse than walking around in wet socks 7f72c4675 Use implementation-provided legacy serializer for events 27a8d99ec Adventure 4.7.0 e65bd35a1 Respect teams in legacy chat name if configured (#5321) b31089a92 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5325) a52b30814 Fix title swapping fadeIn and stay 54ec85949 Prevent grindstones from overstacking items d7795080c Fix NPE for AIR in meta operations in ItemStack 2e70796c7 [CI-SKIP] Improve documentation of PreCreatureSpawnEvent (#5244) 7bb92e750 [CI-SKIP] Add JavaDoc links to Tag class pointing to custom Paper tags (#5285) 28cd686bf fix per-world difficulty command (#5306) be7cde2c7 [CI-SKIP] Always check PATH for JDK (#5315)
80 lines
4.1 KiB
Diff
80 lines
4.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: jmp <jasonpenilla2@me.com>
|
|
Date: Sat, 20 Feb 2021 14:47:08 -0800
|
|
Subject: [PATCH] Configs for if Wither/Ender Dragon can ride vehicles
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
|
index 9718812a3b5b4fe68c55390a52f7686cd78e44cd..a96b74b99cac14ef83066bafc514d2ff40dc8b4e 100644
|
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
|
@@ -2261,7 +2261,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
|
}
|
|
}
|
|
|
|
- protected boolean n(Entity entity) {
|
|
+ protected boolean n(Entity entity) { // Purpur - canRide
|
|
return !this.isSneaking() && this.j <= 0;
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
|
index fd019a7d8940150ba776e211fe5f7ecb4ffbc89c..9e27d3ccfd6a5ee00cac72c3137189b1be1f81fb 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
|
@@ -1023,6 +1023,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster {
|
|
|
|
@Override
|
|
protected boolean n(Entity entity) {
|
|
+ if (this.world.purpurConfig.enderDragonCanRideVehicles) return this.getRideCooldown() <= 0; // Purpur
|
|
return false;
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java
|
|
index 0b6cb7c3c55f4b0951fde643a898bd67a08e08af..b6663cd71e2e0ec0c4dd27095160298f081c4ec5 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityWither.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityWither.java
|
|
@@ -673,6 +673,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
|
|
|
@Override
|
|
protected boolean n(Entity entity) {
|
|
+ if (this.world.purpurConfig.witherCanRideVehicles) return this.getRideCooldown() <= 0; // Purpur
|
|
return false;
|
|
}
|
|
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index 64657c3c9250d8767702a54bb0ee3a23f43da04a..958b0ee8af21e4176e9d35af88294919c509a2c1 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -773,6 +773,7 @@ public class PurpurWorldConfig {
|
|
public boolean enderDragonAlwaysDropsFullExp = false;
|
|
public boolean enderDragonBypassMobGriefing = false;
|
|
public double enderDragonMaxHealth = 200.0D;
|
|
+ public boolean enderDragonCanRideVehicles = false;
|
|
private void enderDragonSettings() {
|
|
enderDragonRidable = getBoolean("mobs.ender_dragon.ridable", enderDragonRidable);
|
|
enderDragonRidableInWater = getBoolean("mobs.ender_dragon.ridable-in-water", enderDragonRidableInWater);
|
|
@@ -789,6 +790,7 @@ public class PurpurWorldConfig {
|
|
set("mobs.ender_dragon.attributes.max_health", oldValue);
|
|
}
|
|
enderDragonMaxHealth = getDouble("mobs.ender_dragon.attributes.max_health", enderDragonMaxHealth);
|
|
+ enderDragonCanRideVehicles = getBoolean("mobs.ender_dragon.can-ride-vehicles", enderDragonCanRideVehicles);
|
|
}
|
|
|
|
public boolean endermanRidable = false;
|
|
@@ -1731,6 +1733,7 @@ public class PurpurWorldConfig {
|
|
public float witherHealthRegenAmount = 1.0f;
|
|
public int witherHealthRegenDelay = 20;
|
|
public double witherMaxHealth = 300.0D;
|
|
+ public boolean witherCanRideVehicles = false;
|
|
private void witherSettings() {
|
|
witherRidable = getBoolean("mobs.wither.ridable", witherRidable);
|
|
witherRidableInWater = getBoolean("mobs.wither.ridable-in-water", witherRidableInWater);
|
|
@@ -1748,6 +1751,7 @@ public class PurpurWorldConfig {
|
|
set("mobs.wither.attributes.max_health", oldValue);
|
|
}
|
|
witherMaxHealth = getDouble("mobs.wither.attributes.max_health", witherMaxHealth);
|
|
+ witherCanRideVehicles = getBoolean("mobs.wither.can-ride-vehicles", witherCanRideVehicles);
|
|
}
|
|
|
|
public boolean witherSkeletonRidable = false;
|