aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower/net/minecraft/world/damagesource/DamageSource.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower/net/minecraft/world/damagesource/DamageSource.java.patch')
-rw-r--r--patch-remap/mache-spigotflower/net/minecraft/world/damagesource/DamageSource.java.patch151
1 files changed, 151 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower/net/minecraft/world/damagesource/DamageSource.java.patch b/patch-remap/mache-spigotflower/net/minecraft/world/damagesource/DamageSource.java.patch
new file mode 100644
index 0000000000..13387c1b1c
--- /dev/null
+++ b/patch-remap/mache-spigotflower/net/minecraft/world/damagesource/DamageSource.java.patch
@@ -0,0 +1,151 @@
+--- a/net/minecraft/world/damagesource/DamageSource.java
++++ b/net/minecraft/world/damagesource/DamageSource.java
+@@ -20,8 +20,39 @@
+ private final Entity directEntity;
+ @Nullable
+ private final Vec3 damageSourcePosition;
++ // CraftBukkit start
++ private boolean sweep;
++ private boolean melting;
++ private boolean poison;
+
+- @Override
++ public boolean isSweep() {
++ return sweep;
++ }
++
++ public DamageSource sweep() {
++ this.sweep = true;
++ return this;
++ }
++
++ public boolean isMelting() {
++ return melting;
++ }
++
++ public DamageSource melting() {
++ this.melting = true;
++ return this;
++ }
++
++ public boolean isPoison() {
++ return poison;
++ }
++
++ public DamageSource poison() {
++ this.poison = true;
++ return this;
++ }
++ // CraftBukkit end
++
+ public String toString() {
+ return "DamageSource (" + this.type().msgId() + ")";
+ }
+@@ -34,27 +65,27 @@
+ return this.causingEntity != this.directEntity;
+ }
+
+- private DamageSource(Holder<DamageType> holder, @Nullable Entity entity, @Nullable Entity entity1, @Nullable Vec3 vec3) {
+- this.type = holder;
+- this.causingEntity = entity1;
+- this.directEntity = entity;
+- this.damageSourcePosition = vec3;
++ private DamageSource(Holder<DamageType> type, @Nullable Entity directEntity, @Nullable Entity causingEntity, @Nullable Vec3 damageSourcePosition) {
++ this.type = type;
++ this.causingEntity = causingEntity;
++ this.directEntity = directEntity;
++ this.damageSourcePosition = damageSourcePosition;
+ }
+
+- public DamageSource(Holder<DamageType> holder, @Nullable Entity entity, @Nullable Entity entity1) {
+- this(holder, entity, entity1, (Vec3) null);
++ public DamageSource(Holder<DamageType> type, @Nullable Entity directEntity, @Nullable Entity causingEntity) {
++ this(type, directEntity, causingEntity, (Vec3) null);
+ }
+
+- public DamageSource(Holder<DamageType> holder, Vec3 vec3) {
+- this(holder, (Entity) null, (Entity) null, vec3);
++ public DamageSource(Holder<DamageType> type, Vec3 damageSourcePosition) {
++ this(type, (Entity) null, (Entity) null, damageSourcePosition);
+ }
+
+- public DamageSource(Holder<DamageType> holder, @Nullable Entity entity) {
+- this(holder, entity, entity);
++ public DamageSource(Holder<DamageType> type, @Nullable Entity entity) {
++ this(type, entity, entity);
+ }
+
+- public DamageSource(Holder<DamageType> holder) {
+- this(holder, (Entity) null, (Entity) null, (Vec3) null);
++ public DamageSource(Holder<DamageType> type) {
++ this(type, (Entity) null, (Entity) null, (Vec3) null);
+ }
+
+ @Nullable
+@@ -67,30 +98,30 @@
+ return this.causingEntity;
+ }
+
+- public Component getLocalizedDeathMessage(LivingEntity livingentity) {
++ public Component getLocalizedDeathMessage(LivingEntity livingEntity) {
+ String s = "death.attack." + this.type().msgId();
+
+ if (this.causingEntity == null && this.directEntity == null) {
+- LivingEntity livingentity1 = livingentity.getKillCredit();
++ LivingEntity entityliving1 = livingEntity.getKillCredit();
+ String s1 = s + ".player";
+
+- return livingentity1 != null ? Component.translatable(s1, livingentity.getDisplayName(), livingentity1.getDisplayName()) : Component.translatable(s, livingentity.getDisplayName());
++ return entityliving1 != null ? Component.translatable(s1, livingEntity.getDisplayName(), entityliving1.getDisplayName()) : Component.translatable(s, livingEntity.getDisplayName());
+ } else {
+- Component component = this.causingEntity == null ? this.directEntity.getDisplayName() : this.causingEntity.getDisplayName();
++ Component ichatbasecomponent = this.causingEntity == null ? this.directEntity.getDisplayName() : this.causingEntity.getDisplayName();
+ Entity entity = this.causingEntity;
+ ItemStack itemstack;
+
+ if (entity instanceof LivingEntity) {
+- LivingEntity livingentity2 = (LivingEntity) entity;
++ LivingEntity entityliving2 = (LivingEntity) entity;
+
+- itemstack = livingentity2.getMainHandItem();
++ itemstack = entityliving2.getMainHandItem();
+ } else {
+ itemstack = ItemStack.EMPTY;
+ }
+
+ ItemStack itemstack1 = itemstack;
+
+- return !itemstack1.isEmpty() && itemstack1.hasCustomHoverName() ? Component.translatable(s + ".item", livingentity.getDisplayName(), component, itemstack1.getDisplayName()) : Component.translatable(s, livingentity.getDisplayName(), component);
++ return !itemstack1.isEmpty() && itemstack1.hasCustomHoverName() ? Component.translatable(s + ".item", livingEntity.getDisplayName(), ichatbasecomponent, itemstack1.getDisplayName()) : Component.translatable(s, livingEntity.getDisplayName(), ichatbasecomponent);
+ }
+ }
+
+@@ -123,9 +154,9 @@
+ boolean flag;
+
+ if (entity instanceof Player) {
+- Player player = (Player) entity;
++ Player entityhuman = (Player) entity;
+
+- if (player.getAbilities().instabuild) {
++ if (entityhuman.getAbilities().instabuild) {
+ flag = true;
+ return flag;
+ }
+@@ -145,12 +176,12 @@
+ return this.damageSourcePosition;
+ }
+
+- public boolean is(TagKey<DamageType> tagkey) {
+- return this.type.is(tagkey);
++ public boolean is(TagKey<DamageType> damageTypeKey) {
++ return this.type.is(damageTypeKey);
+ }
+
+- public boolean is(ResourceKey<DamageType> resourcekey) {
+- return this.type.is(resourcekey);
++ public boolean is(ResourceKey<DamageType> damageTypeKey) {
++ return this.type.is(damageTypeKey);
+ }
+
+ public DamageType type() {