mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes : 2db85c5 fix: origin world can be unknown while knowing location 903fa9a Enable chunk load for feature search by default
80 lines
4.3 KiB
Diff
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 0a22cf78940e5257af6a924ef8c3c163add06c68..71b694449c5605db6ff140f139b1feb1ec48bf80 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -2407,7 +2407,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 fea99134e77d7cbc77c89318753e7294d3f6a15a..1a764ba0a7402ce71038635f48d4b578457cc255 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;
|