mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 10:27:44 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: 5b20df6bf added PlayerNameEntityEvent ff9c82444 Add worldborder events 616b1f3cd consider enchants for destroy speed aaef1d5cc fix file conversion 674d8f7f7 Make discovered maps config work in treasure maps from loot tables too be1687914 stop firing pressure plate EntityInteractEvent for ignored entities (fixes #4962) 7d56f38ed Do not use the bukkit singleton for the GUI (Fixes #5301) 4c9bdf53a Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5299) 8647bd130 Improve ServerGUI fcc6d3359 Throw proper exception on empty JsonList file 17d2e1291 Fix interact event in adventure mode 964e0bf42 MC-29274: Fix Wither hostility towards players 9e24a5213 Fixed furnace cook-speed multiplier losing precision when calculating cook time c7e42faa3 Do not create unnecessary copies of the passenger list 40881ad67 added tnt minecarts to the tnt height nerf 26be708f4 Remove streams from SensorNearest 5b5989b21 fix nullability of playerlist header/footer, closes #5290 45bc531dd Fix Material#getTranslationKey for Block Materials (#5294)
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 8a69e157572d799ce3760d55550cf0c2035da609..76bd201ebb03782c5cf45393269398c47db5baed 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;
|