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/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java index 66754d478fac391dd16d1f9506720cd295d17f9c..666f5a2e5fe82a283dfcb1f25ed58d0a971c73d3 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -2432,7 +2432,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne } } - 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/world/entity/boss/enderdragon/EntityEnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java index 0614483830336f3bbd348319ca3eed8767568852..d27f61959e924e1ce6c7d76c905d98a762823e91 100644 --- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java +++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java @@ -1073,6 +1073,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/world/entity/boss/wither/EntityWither.java b/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java index 4d201127c6718883fd8b5a3a2202cf62a098fc33..92f22271c76ed01b1c82608b1ff32c17cdb2145f 100644 --- a/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java +++ b/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java @@ -728,6 +728,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 23f7a3af8f92fd6e89601b0e1b4b2d1635dfe0b0..b2d7e4ee4ecef476d633278c960130110c862520 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -833,6 +833,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); @@ -849,6 +850,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; @@ -1793,6 +1795,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); @@ -1810,6 +1813,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;