diff --git a/patches/api/0037-Full-netherite-armor-grants-fire-resistance.patch b/patches/api/0037-Full-netherite-armor-grants-fire-resistance.patch new file mode 100644 index 000000000..4cf6d1a0e --- /dev/null +++ b/patches/api/0037-Full-netherite-armor-grants-fire-resistance.patch @@ -0,0 +1,23 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: BillyGalbreath +Date: Thu, 24 Dec 2020 11:00:04 -0600 +Subject: [PATCH] Full netherite armor grants fire resistance + + +diff --git a/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java b/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java +index 16b5fd279b0cb926900247618bcdb381a93f5a35..d592c62aadb3245396865c098c5979f2a162f868 100644 +--- a/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java ++++ b/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java +@@ -213,6 +213,12 @@ public class EntityPotionEffectEvent extends EntityEvent implements Cancellable + * When all effects are removed due to a bucket of milk. + */ + MILK, ++ // Purpur start ++ /** ++ * When a player wears full netherite armor ++ */ ++ NETHERITE_ARMOR, ++ // Purpur end + /** + * When a player gets bad omen after killing a patrol captain. + */ diff --git a/patches/server/0165-Full-netherite-armor-grants-fire-resistance.patch b/patches/server/0165-Full-netherite-armor-grants-fire-resistance.patch new file mode 100644 index 000000000..8f38ae145 --- /dev/null +++ b/patches/server/0165-Full-netherite-armor-grants-fire-resistance.patch @@ -0,0 +1,51 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: BillyGalbreath +Date: Thu, 24 Dec 2020 11:00:15 -0600 +Subject: [PATCH] Full netherite armor grants fire resistance + + +diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java +index a72ce4ea5a45fce35a47fd5f9c21b9500adbe265..d9d7a5df16ae9854a69103a936de89b2086e9465 100644 +--- a/src/main/java/net/minecraft/server/EntityHuman.java ++++ b/src/main/java/net/minecraft/server/EntityHuman.java +@@ -236,6 +236,16 @@ public abstract class EntityHuman extends EntityLiving { + this.addEffect(new MobEffect(MobEffects.WATER_BREATHING, 200, 0, false, false, true), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.TURTLE_HELMET); // CraftBukkit + } + ++ // Purpur start ++ if (this.world.purpurConfig.playerNetheriteFireResistanceDuration > 0 && this.world.getTime() % 20 == 0) { ++ if (itemstack.getItem() == Items.NETHERITE_HELMET ++ && this.getEquipment(EnumItemSlot.CHEST).getItem() == Items.NETHERITE_CHESTPLATE ++ && this.getEquipment(EnumItemSlot.LEGS).getItem() == Items.NETHERITE_LEGGINGS ++ && this.getEquipment(EnumItemSlot.FEET).getItem() == Items.NETHERITE_BOOTS) { ++ this.addEffect(new MobEffect(MobEffects.FIRE_RESISTANCE, this.world.purpurConfig.playerNetheriteFireResistanceDuration, this.world.purpurConfig.playerNetheriteFireResistanceAmplifier, this.world.purpurConfig.playerNetheriteFireResistanceAmbient, this.world.purpurConfig.playerNetheriteFireResistanceShowParticles, this.world.purpurConfig.playerNetheriteFireResistanceShowIcon), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.NETHERITE_ARMOR); ++ } ++ } ++ // Purpur end + } + + protected ItemCooldown i() { +diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +index 700229347f65d1d61cb47620a939d8fcb52599d8..117020646668e860bc3f42ae54a41eca1830a7ca 100644 +--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java ++++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +@@ -292,6 +292,19 @@ public class PurpurWorldConfig { + playerDeathExpDropMax = getInt("gameplay-mechanics.player.exp-dropped-on-death.maximum", playerDeathExpDropMax); + } + ++ public int playerNetheriteFireResistanceDuration = 0; ++ public int playerNetheriteFireResistanceAmplifier = 0; ++ public boolean playerNetheriteFireResistanceAmbient = false; ++ public boolean playerNetheriteFireResistanceShowParticles = false; ++ public boolean playerNetheriteFireResistanceShowIcon = true; ++ private void playerNetheriteFireResistance() { ++ playerNetheriteFireResistanceDuration = getInt("gameplay-mechanics.player.netherite-fire-resistance.duration", playerNetheriteFireResistanceDuration); ++ playerNetheriteFireResistanceAmplifier = getInt("gameplay-mechanics.player.netherite-fire-resistance.amplifier", playerNetheriteFireResistanceAmplifier); ++ playerNetheriteFireResistanceAmbient = getBoolean("gameplay-mechanics.player.netherite-fire-resistance.ambient", playerNetheriteFireResistanceAmbient); ++ playerNetheriteFireResistanceShowParticles = getBoolean("gameplay-mechanics.player.netherite-fire-resistance.show-particles", playerNetheriteFireResistanceShowParticles); ++ playerNetheriteFireResistanceShowIcon = getBoolean("gameplay-mechanics.player.netherite-fire-resistance.show-icon", playerNetheriteFireResistanceShowIcon); ++ } ++ + public int playerSpawnInvulnerableTicks = 60; + public boolean playerInvulnerableWhileAcceptingResourcePack = false; + private void playerInvulnerabilities() {