mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 17:01:56 +01:00
more fixes
This commit is contained in:
parent
36445ba659
commit
1bcdad0118
2 changed files with 25 additions and 1 deletions
22
patches/server/Fix-shield-disable-inconsistency.patch
Normal file
22
patches/server/Fix-shield-disable-inconsistency.patch
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||||||
|
Date: Fri, 26 Apr 2024 19:08:37 -0700
|
||||||
|
Subject: [PATCH] Fix shield disable inconsistency
|
||||||
|
|
||||||
|
In vanilla, if the damage source is tagged as a projectile,
|
||||||
|
it will not disable the shield if the attacker is holding
|
||||||
|
an axe item.
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
|
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||||
|
this.hurtCurrentlyUsedShield((float) -event.getDamage(DamageModifier.BLOCKING));
|
||||||
|
Entity entity = damagesource.getDirectEntity();
|
||||||
|
|
||||||
|
- if (entity instanceof LivingEntity && entity.distanceToSqr(this) <= (200.0D * 200.0D)) { // Paper - Improve boat collision performance
|
||||||
|
+ if (!damagesource.is(DamageTypeTags.IS_PROJECTILE) && entity instanceof LivingEntity && entity.distanceToSqr(this) <= (200.0D * 200.0D)) { // Paper - Improve boat collision performance
|
||||||
|
this.blockUsingShield((LivingEntity) entity);
|
||||||
|
}
|
||||||
|
}
|
|
@ -18,10 +18,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
}
|
}
|
||||||
return itemstack;
|
return itemstack;
|
||||||
@@ -0,0 +0,0 @@ public final class ItemStack implements DataComponentHolder {
|
@@ -0,0 +0,0 @@ public final class ItemStack implements DataComponentHolder {
|
||||||
|
} else {
|
||||||
registryfriendlybytebuf.writeVarInt(itemstack.getCount());
|
registryfriendlybytebuf.writeVarInt(itemstack.getCount());
|
||||||
// Spigot start - filter
|
// Spigot start - filter
|
||||||
itemstack = itemstack.copy();
|
- itemstack = itemstack.copy();
|
||||||
- CraftItemStack.setItemMeta(itemstack, CraftItemStack.getItemMeta(itemstack));
|
- CraftItemStack.setItemMeta(itemstack, CraftItemStack.getItemMeta(itemstack));
|
||||||
|
+ // itemstack = itemstack.copy();
|
||||||
+ // CraftItemStack.setItemMeta(itemstack, CraftItemStack.getItemMeta(itemstack)); // Paper - This is no longer with raw NBT being handled in metadata
|
+ // CraftItemStack.setItemMeta(itemstack, CraftItemStack.getItemMeta(itemstack)); // Paper - This is no longer with raw NBT being handled in metadata
|
||||||
// Spigot end
|
// Spigot end
|
||||||
ITEM_STREAM_CODEC.encode(registryfriendlybytebuf, itemstack.getItemHolder()); // CraftBukkit - decompile error
|
ITEM_STREAM_CODEC.encode(registryfriendlybytebuf, itemstack.getItemHolder()); // CraftBukkit - decompile error
|
||||||
|
|
Loading…
Reference in a new issue