mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 01:47:42 +01:00
Configs for if Wither/Ender Dragon can ride vehicles
This commit is contained in:
@@ -0,0 +1,79 @@
|
|||||||
|
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/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||||
|
index a2ba87dac005572d2617b6fe2c92f6984665588c..45d29df580feba2d3e88755ff970de59a5ed7d34 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||||
|
@@ -2261,7 +2261,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 8a69e157572d799ce3760d55550cf0c2035da609..76bd201ebb03782c5cf45393269398c47db5baed 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 014de51f9b803cda27e735d30cde5c869947a31b..aee6891c92c9a2c558b9c96ed544be0a54050e25 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/EntityWither.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/EntityWither.java
|
||||||
|
@@ -672,6 +672,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 99853bbf5d5a173bb109bfb863476464cb0bee1f..8b31c09a2913bda69c02f44db292d42d19887f86 100644
|
||||||
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
@@ -773,6 +773,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);
|
||||||
|
@@ -789,6 +790,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;
|
||||||
|
@@ -1729,6 +1731,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);
|
||||||
|
@@ -1746,6 +1749,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;
|
||||||
Reference in New Issue
Block a user