mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-22 10:57:43 +01:00
Stonecutter damage
This commit is contained in:
committed by
granny
parent
bc307f6750
commit
26189d0fde
@@ -1,12 +1,16 @@
|
||||
--- a/net/minecraft/world/damagesource/CombatTracker.java
|
||||
+++ b/net/minecraft/world/damagesource/CombatTracker.java
|
||||
@@ -98,6 +_,11 @@
|
||||
@@ -98,6 +_,15 @@
|
||||
Component component = ComponentUtils.wrapInSquareBrackets(Component.translatable(string + ".link")).withStyle(INTENTIONAL_GAME_DESIGN_STYLE);
|
||||
return Component.translatable(string + ".message", this.mob.getDisplayName(), component);
|
||||
} else {
|
||||
+ // Purpur start - Dont run with scissors!
|
||||
+ if (damageSource.isScissors()) {
|
||||
+ return damageSource.getLocalizedDeathMessage(org.purpurmc.purpur.PurpurConfig.deathMsgRunWithScissors, this.mob);
|
||||
+ // Purpur start - Stonecutter damage
|
||||
+ } else if (damageSource.isStonecutter()) {
|
||||
+ return damageSource.getLocalizedDeathMessage(org.purpurmc.purpur.PurpurConfig.deathMsgStonecutter, this.mob);
|
||||
+ // Purpur end - Stonecutter damage
|
||||
+ }
|
||||
+ // Purpur end - Dont run with scissors!
|
||||
return damageSource.getLocalizedDeathMessage(this.mob);
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
--- a/net/minecraft/world/damagesource/DamageSource.java
|
||||
+++ b/net/minecraft/world/damagesource/DamageSource.java
|
||||
@@ -28,6 +_,7 @@
|
||||
@@ -28,6 +_,8 @@
|
||||
private boolean sweep = false;
|
||||
private boolean melting = false;
|
||||
private boolean poison = false;
|
||||
+ private boolean scissors = false; // Purpur - Dont run with scissors!
|
||||
+ private boolean stonecutter = false; // Purpur - Stonecutter damage
|
||||
@Nullable
|
||||
private Entity customEventDamager = null; // This field is a helper for when causing entity damage is not set by vanilla // Paper - fix DamageSource API
|
||||
|
||||
@@ -58,6 +_,17 @@
|
||||
@@ -58,6 +_,27 @@
|
||||
return this.poison;
|
||||
}
|
||||
|
||||
@@ -22,15 +23,26 @@
|
||||
+ return this.scissors;
|
||||
+ }
|
||||
+ // Purpur end - Dont run with scissors!
|
||||
+ // Purpur start - - Stonecutter damage
|
||||
+ public DamageSource stonecutter() {
|
||||
+ this.stonecutter = true;
|
||||
+ return this;
|
||||
+ }
|
||||
+
|
||||
+ public boolean isStonecutter() {
|
||||
+ return this.stonecutter;
|
||||
+ }
|
||||
+ // Purpur end - Stonecutter damage
|
||||
+
|
||||
// Paper start - fix DamageSource API
|
||||
@Nullable
|
||||
public Entity getCustomEventDamager() {
|
||||
@@ -116,6 +_,7 @@
|
||||
@@ -116,6 +_,8 @@
|
||||
damageSource.sweep = this.isSweep();
|
||||
damageSource.poison = this.isPoison();
|
||||
damageSource.melting = this.isMelting();
|
||||
+ damageSource.scissors = this.isScissors(); // Purpur - Dont run with scissors!
|
||||
+ damageSource.stonecutter = this.isStonecutter(); // Purpur - Stonecutter damage
|
||||
return damageSource;
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -1,29 +1,36 @@
|
||||
--- a/net/minecraft/world/damagesource/DamageSources.java
|
||||
+++ b/net/minecraft/world/damagesource/DamageSources.java
|
||||
@@ -45,11 +_,13 @@
|
||||
@@ -45,11 +_,15 @@
|
||||
// CraftBukkit start
|
||||
private final DamageSource melting;
|
||||
private final DamageSource poison;
|
||||
+ private final DamageSource scissors; // Purpur - Dont run with scissors!
|
||||
+ private final DamageSource stonecutter; // Purpur - Stonecutter damage
|
||||
|
||||
public DamageSources(RegistryAccess registry) {
|
||||
this.damageTypes = registry.lookupOrThrow(Registries.DAMAGE_TYPE);
|
||||
this.melting = this.source(DamageTypes.ON_FIRE).melting();
|
||||
this.poison = this.source(DamageTypes.MAGIC).poison();
|
||||
+ this.scissors = this.source(DamageTypes.MAGIC).scissors(); // Purpur - Dont run with scissors!
|
||||
+ this.stonecutter = this.source(DamageTypes.MAGIC).stonecutter(); // Purpur - Stonecutter damage
|
||||
// CraftBukkit end
|
||||
this.inFire = this.source(DamageTypes.IN_FIRE);
|
||||
this.campfire = this.source(DamageTypes.CAMPFIRE);
|
||||
@@ -99,6 +_,12 @@
|
||||
return this.poison;
|
||||
@@ -100,6 +_,17 @@
|
||||
}
|
||||
// CraftBukkit end
|
||||
+
|
||||
|
||||
+ // Purpur start - Dont run with scissors!
|
||||
+ public DamageSource scissors() {
|
||||
+ return this.scissors;
|
||||
+ }
|
||||
+ // Purpur end - Dont run with scissors!
|
||||
|
||||
+
|
||||
+ // Purpur start - Stonecutter damage
|
||||
+ public DamageSource stonecutter() {
|
||||
+ return this.stonecutter;
|
||||
+ }
|
||||
+ // Purpur end - Stonecutter damage
|
||||
public DamageSource inFire() {
|
||||
return this.inFire;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user