mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Full netherite armor grants fire resistance
This commit is contained in:
committed by
granny
parent
54eca0d36a
commit
8d2e08854c
@@ -1,23 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
||||||
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 8fdfcbc7d20fe0af6b220ab94516247093637621..f6a8928408e11a5ae723366e4ea1280dfcc6111e 100644
|
|
||||||
--- a/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java
|
|
||||||
+++ b/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java
|
|
||||||
@@ -216,6 +216,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.
|
|
||||||
*
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
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/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java
|
|
||||||
index fee0ffaaf94c484c9272d3b5743b90bb70e0d08d..fc0e571b62a9bd40df2d3d066cf374e12004a6d8 100644
|
|
||||||
--- a/net/minecraft/world/entity/player/Player.java
|
|
||||||
+++ b/net/minecraft/world/entity/player/Player.java
|
|
||||||
@@ -356,6 +356,17 @@ public abstract class Player extends LivingEntity {
|
|
||||||
this.turtleHelmetTick();
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // Purpur start
|
|
||||||
+ if (this.level().purpurConfig.playerNetheriteFireResistanceDuration > 0 && this.level().getGameTime() % 20 == 0) {
|
|
||||||
+ if (this.getItemBySlot(EquipmentSlot.HEAD).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
|
|
||||||
+
|
|
||||||
this.cooldowns.tick();
|
|
||||||
this.updatePlayerPose();
|
|
||||||
if (this.currentImpulseContextResetGraceTime > 0) {
|
|
||||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
||||||
index c0b9a7a7cd1e4acf151b12d308627d4ff2202018..19c6572a82de81b5a3aacad4bd77878d6c21ddc8 100644
|
|
||||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
||||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
||||||
@@ -285,6 +285,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;
|
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
--- a/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java
|
||||||
|
+++ b/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java
|
||||||
|
@@ -216,6 +_,12 @@
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
@@ -14,6 +14,24 @@
|
|||||||
@Override
|
@Override
|
||||||
public org.bukkit.craftbukkit.entity.CraftHumanEntity getBukkitEntity() {
|
public org.bukkit.craftbukkit.entity.CraftHumanEntity getBukkitEntity() {
|
||||||
return (org.bukkit.craftbukkit.entity.CraftHumanEntity) super.getBukkitEntity();
|
return (org.bukkit.craftbukkit.entity.CraftHumanEntity) super.getBukkitEntity();
|
||||||
|
@@ -340,6 +_,17 @@
|
||||||
|
this.turtleHelmetTick();
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // Purpur start - Full netherite armor grants fire resistance
|
||||||
|
+ if (this.level().purpurConfig.playerNetheriteFireResistanceDuration > 0 && this.level().getGameTime() % 20 == 0) {
|
||||||
|
+ if (this.getItemBySlot(EquipmentSlot.HEAD).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 - Full netherite armor grants fire resistance
|
||||||
|
+
|
||||||
|
this.cooldowns.tick();
|
||||||
|
this.updatePlayerPose();
|
||||||
|
if (this.currentImpulseContextResetGraceTime > 0) {
|
||||||
@@ -1877,7 +_,23 @@
|
@@ -1877,7 +_,23 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -277,6 +277,19 @@ public class PurpurWorldConfig {
|
|||||||
villageSiegeSpawning = getBoolean("gameplay-mechanics.mob-spawning.village-sieges", predicate);
|
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 idleTimeoutKick = true;
|
||||||
public boolean idleTimeoutTickNearbyEntities = true;
|
public boolean idleTimeoutTickNearbyEntities = true;
|
||||||
public boolean idleTimeoutCountAsSleeping = false;
|
public boolean idleTimeoutCountAsSleeping = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user