Yatopia/patches/Purpur/patches/server/0169-Configs-for-if-Wither-...

80 lines
4.3 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/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 6cbd6b38ac77dac8ecde224849f74a6f5a4f9d98..e915905af690124f17407876c0fb854750f5db71 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2400,7 +2400,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 9a152b7cd351380e696640a51e5f8b64225f25f0..e34e25d62bd677fc7373e73b4118898a4f7f4d26 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;