Files
Purpur/patches/server-unmapped/0169-Configs-for-if-Wither-Ender-Dragon-can-ride-vehicles.patch
2021-06-17 03:11:01 -07:00

80 lines
4.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jason Penilla <11360596+jpenilla@users.noreply.github.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 d56ee8483fa1011f303a0afac5130279b6f9a191..7b28e61eee6f65219a11e63dea3728aa36b9a313 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2155,7 +2155,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 ebf682c8ea6eb5feb499815a1dc1bea5715038c7..0ce49a3095472383dbe9362ece186a7bd60939b6 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 5ca2833adc383845c2ea1824a130f17445498f19..9e1b4fb9b9a111e8da7b4b0db9ebee0099705bf2 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;