Files
Purpur/patches/server/0139-Full-netherite-armor-grants-fire-resistance.patch
William Blake Galbreath 69c7c31f9a Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
26c37d99d5 create random seeds for features using SecureRandom
589bf2f1bf Upgrade gson to 2.8.8 (Closes #6370)
0a6103597b Get entity default attributes (#6449)
40057019e0 Correctly inflate villager activation bounding box (#6798)
e5f9241d15 Left handed API (#6775)
40ee63496c Add advancement display API (#6175)
9d570042ed Add ItemFactory#getMonsterEgg API (#6772)
55ca459515 rename method to getSpawnEgg
bb397ba74c Add critical damage API (#6275)
f47aeafe00 Add Horse Animation API (#5599)
7a0886180f AT & Mapping fixes (#6809)
5553432644 docs: Update gradle instructions for Java 16 (#6811) [ci skip]
a1f49e4c60 Fix command suggestion leak (#6592)
9472d38f3c Fix method name for Critical damage (#6813)
2021-10-21 10:58:20 -05:00

52 lines
3.7 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
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/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index f991ed65d27d15a6eb32533f32da0bb9b69f331d..6423f422d4eca56cd8cbdd9c23925ce703b426f5 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -359,6 +359,16 @@ public abstract class Player extends LivingEntity {
this.addEffect(new MobEffectInstance(MobEffects.WATER_BREATHING, 200, 0, false, false, true), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.TURTLE_HELMET); // CraftBukkit
}
+ // Purpur start
+ if (this.level.purpurConfig.playerNetheriteFireResistanceDuration > 0 && this.level.getGameTime() % 20 == 0) {
+ if (itemstack.is(Items.NETHERITE_HELMET)
+ && this.getItemBySlot(EquipmentSlot.CHEST).is(Items.NETHERITE_CHESTPLATE)
+ && this.getItemBySlot(EquipmentSlot.LEGS).is(Items.NETHERITE_LEGGINGS)
+ && this.getItemBySlot(EquipmentSlot.FEET).is(Items.NETHERITE_BOOTS)) {
+ this.addEffect(new MobEffectInstance(MobEffects.FIRE_RESISTANCE, this.level.purpurConfig.playerNetheriteFireResistanceDuration, this.level.purpurConfig.playerNetheriteFireResistanceAmplifier, this.level.purpurConfig.playerNetheriteFireResistanceAmbient, this.level.purpurConfig.playerNetheriteFireResistanceShowParticles, this.level.purpurConfig.playerNetheriteFireResistanceShowIcon), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.NETHERITE_ARMOR);
+ }
+ }
+ // Purpur end
}
protected ItemCooldowns createItemCooldowns() {
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index af48e54639b412feb8dee36705d0aa8980b7ea53..ae252c66d4319fa4a581f1da9ec926de646a5aa0 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -267,6 +267,19 @@ public class PurpurWorldConfig {
villageSiegeSpawning = getBoolean("gameplay-mechanics.mob-spawning.village-sieges", predicate);
}
+ 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 boolean idleTimeoutKick = true;
public boolean idleTimeoutTickNearbyEntities = true;
public boolean idleTimeoutCountAsSleeping = false;