mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 08:57:44 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: 821ce25d9 Significantly improve performance of the end generation 2b2e4fd65 Add Wandering Trader spawn rate config options 7263cbca7 [CI-SKIP] [Auto] Rebuild Patches 1c63aff6d Villager resetOffers API 8d8d74a5f Patch 2 references an invalid variable e6d7bdca1 [CI-SKIP] fixed sed -i for bsd sed (#4782) 7ae47d4eb [CI-SKIP] Remove Waving banner fix (#4786)
44 lines
2.0 KiB
Diff
44 lines
2.0 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Jason Bierque <bierquejason@gmail.com>
|
|
Date: Wed, 1 Jul 2020 22:36:06 +0200
|
|
Subject: [PATCH] Customizable EnderDragon Health
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
|
index a5a218245..d2fcd0bc1 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
|
@@ -62,6 +62,16 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster {
|
|
this.bG = new DragonControllerManager(this);
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ @Override
|
|
+ public void initAttributes(World world) {
|
|
+ if (world != null) {
|
|
+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(world.purpurConfig.enderDragonMaxHealth);
|
|
+ setHealth(getMaxHealth());
|
|
+ }
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
public static AttributeProvider.Builder m() {
|
|
return EntityInsentient.p().a(GenericAttributes.MAX_HEALTH, 200.0D);
|
|
}
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index bb6c24347..32a233ceb 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -279,9 +279,11 @@ public class PurpurWorldConfig {
|
|
|
|
public boolean enderDragonAlwaysDropsEggBlock = false;
|
|
public boolean enderDragonAlwaysDropsFullExp = false;
|
|
+ public double enderDragonMaxHealth = 200.0D;
|
|
private void enderDragonSettings() {
|
|
enderDragonAlwaysDropsEggBlock = getBoolean("mobs.ender_dragon.always-drop-egg-block", enderDragonAlwaysDropsEggBlock);
|
|
enderDragonAlwaysDropsFullExp = getBoolean("mobs.ender_dragon.always-drop-full-exp", enderDragonAlwaysDropsFullExp);
|
|
+ enderDragonMaxHealth = getDouble("mobs.ender_dragon.max-health", enderDragonMaxHealth);
|
|
}
|
|
|
|
public boolean endermanAllowGriefing = true;
|