From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: jmp 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 c27ce317c7acaf7ddd926c982d08e0539e045e28..426bebc5cd67ffcc72ee56d437cc13f6846e109c 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -2277,7 +2277,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 e2377c6e8a98be431953533bf0b2060028caad45..a495c14b9f168884a0bba6b95d28c9ecfa9dfdab 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 27bfef57cfa1386e81c6409be49ea6898057e631..a8cda33da336f7c24a341f67a88681690d5a29a6 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 514bcc4af3b9695c17d6e6c1e01e758eb027ab69..25e5105361a6615da80fe09224f30e14f0e8057b 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -775,6 +775,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); @@ -791,6 +792,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; @@ -1733,6 +1735,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); @@ -1750,6 +1753,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;