Add additional tags to ItemMeta obfuscation filtering (#9665)

This commit is contained in:
Md5Lukas 2023-10-14 23:41:15 +02:00 committed by GitHub
parent 3e1c5e3eb0
commit 852c1c236d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 24 additions and 17 deletions

View file

@ -33,7 +33,7 @@ index e8ca93305e8baaee3e72932b630a2d6907444593..65f36454b08d7527aca0d3e667979fd5
} }
} }
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index f8738a28fb30c8fdb52ed3e6f8000144129c1f00..58186adba67a43188784efffd4bc9c8d98ac2848 100644 index f8738a28fb30c8fdb52ed3e6f8000144129c1f00..4dc9647b9c7206b1e98554d2db0f193b0dce0a94 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3196,7 +3196,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3196,7 +3196,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
@ -45,7 +45,7 @@ index f8738a28fb30c8fdb52ed3e6f8000144129c1f00..58186adba67a43188784efffd4bc9c8d
// Paper end // Paper end
switch (enumitemslot.getType()) { switch (enumitemslot.getType()) {
case HAND: case HAND:
@@ -3210,6 +3210,70 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3210,6 +3210,77 @@ public abstract class LivingEntity extends Entity implements Attackable {
((ServerLevel) this.level()).getChunkSource().broadcast(this, new ClientboundSetEquipmentPacket(this.getId(), list)); ((ServerLevel) this.level()).getChunkSource().broadcast(this, new ClientboundSetEquipmentPacket(this.getId(), list));
} }
@ -88,6 +88,8 @@ index f8738a28fb30c8fdb52ed3e6f8000144129c1f00..58186adba67a43188784efffd4bc9c8d
+ tag.put("Enchantments", enchantments); + tag.put("Enchantments", enchantments);
+ } + }
+ tag.remove("AttributeModifiers"); + tag.remove("AttributeModifiers");
+ tag.remove("Unbreakable");
+ tag.remove("PublicBukkitValues"); // Persistent data container1
+ +
+ // Books + // Books
+ tag.remove("author"); + tag.remove("author");
@ -96,6 +98,11 @@ index f8738a28fb30c8fdb52ed3e6f8000144129c1f00..58186adba67a43188784efffd4bc9c8d
+ tag.remove("filtered_pages"); + tag.remove("filtered_pages");
+ tag.remove("title"); + tag.remove("title");
+ tag.remove("generation"); + tag.remove("generation");
+
+ // Filled maps
+ tag.remove("map");
+ tag.remove("map_scale_direction");
+ tag.remove("map_to_lock");
+ } + }
+ } + }
+ +

View file

@ -46,10 +46,10 @@ index da8bd9746a3ddef673230c12370a34c8228aa0c7..a1e795810e7e49acf4959b9c88bed1f9
} catch (Throwable throwable) { } catch (Throwable throwable) {
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 58186adba67a43188784efffd4bc9c8d98ac2848..7c686b6734d52287c3c41bfe0942761656da9e36 100644 index 4dc9647b9c7206b1e98554d2db0f193b0dce0a94..69fc62b95f068f498a0eb77cf951042ae159204f 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3446,7 +3446,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3453,7 +3453,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.level().getProfiler().pop(); this.level().getProfiler().pop();
this.level().getProfiler().push("freezing"); this.level().getProfiler().push("freezing");

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerStopUsingItemEvent
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 7c686b6734d52287c3c41bfe0942761656da9e36..4d7c0063000eb6c0469b837122c881a4a728629a 100644 index 69fc62b95f068f498a0eb77cf951042ae159204f..a483a9558b3f31c3712ea7d8519b8539b0cb0746 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -4019,6 +4019,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -4026,6 +4026,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
public void releaseUsingItem() { public void releaseUsingItem() {
if (!this.useItem.isEmpty()) { if (!this.useItem.isEmpty()) {

View file

@ -24,10 +24,10 @@ index 5803f7b286cd262a8f79d0adb159d897361275a2..42f0ea87dd0bb3be3fbe9e0f7d87582c
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index e25b6a9f50eea2e012315f5a395f369761117de5..34585981d45712d9119a97485ccc611d2c02e452 100644 index 9a82adb03cdb046f950ca63a029f9f3b6e04538c..4ed23c6143a96e75b0e2e060861dd7c702ce6a95 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3672,7 +3672,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3679,7 +3679,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
} }
public void onItemPickup(ItemEntity item) { public void onItemPickup(ItemEntity item) {

View file

@ -46,10 +46,10 @@ index afbc246a2dc55f0f1576c0468118ef80671a034e..1c86eaf44e6c797a51e69f14e08bb9a3
return; return;
} }
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 086626fc52fe22b1a7bdec5186f6801faf456eef..df0f723cd39c05ed8f2d1bbf6e97f3c640134274 100644 index 8b0d715d3adf4694cd93bbf1152dd2e20d3d44de..485b7c3e3a13ad8fdbf0b17fef31e05803f1615e 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3807,6 +3807,11 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3814,6 +3814,11 @@ public abstract class LivingEntity extends Entity implements Attackable {
return ((Byte) this.entityData.get(LivingEntity.DATA_LIVING_ENTITY_FLAGS) & 2) > 0 ? InteractionHand.OFF_HAND : InteractionHand.MAIN_HAND; return ((Byte) this.entityData.get(LivingEntity.DATA_LIVING_ENTITY_FLAGS) & 2) > 0 ? InteractionHand.OFF_HAND : InteractionHand.MAIN_HAND;
} }

View file

@ -30,7 +30,7 @@ index 8f0769d248c7f3cce753130147223403c7923304..97745f0bab8d82d397c6c2a5775aed92
net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = worldserver.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = worldserver.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper
worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index a35b98e92a8afaa1d61e86a614466e64ef6e948f..47e8a6b28960883da868061ed649152ea792c184 100644 index 2858fe182e617429f7dcbd7b5d2d2f5df722d5bb..00b3d8cdf22ef6e1b6b93dc6ba228a9d8c918e6b 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -564,6 +564,17 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -564,6 +564,17 @@ public class ServerLevel extends Level implements WorldGenLevel {
@ -65,10 +65,10 @@ index 618ab9a2903f6d4139acd4aaa2e6db0a26e88ba9..b2c2bd5ec0afd479973f7237a5c610f2
if (this.hasDelayedDestroy) { if (this.hasDelayedDestroy) {
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index df0f723cd39c05ed8f2d1bbf6e97f3c640134274..77a1c7dfbaccc2e74da5c78ce4dfcd1717a7ac65 100644 index 485b7c3e3a13ad8fdbf0b17fef31e05803f1615e..b95f88d5e5b4785ee063695fd81935636a0588d1 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3812,6 +3812,10 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3819,6 +3819,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.getEntityData().resendPossiblyDesyncedDataValues(java.util.List.of(DATA_LIVING_ENTITY_FLAGS), serverPlayer); this.getEntityData().resendPossiblyDesyncedDataValues(java.util.List.of(DATA_LIVING_ENTITY_FLAGS), serverPlayer);
} }
// Paper end // Paper end
@ -79,7 +79,7 @@ index df0f723cd39c05ed8f2d1bbf6e97f3c640134274..77a1c7dfbaccc2e74da5c78ce4dfcd17
private void updatingUsingItem() { private void updatingUsingItem() {
if (this.isUsingItem()) { if (this.isUsingItem()) {
if (ItemStack.isSameItem(this.getItemInHand(this.getUsedItemHand()), this.useItem)) { if (ItemStack.isSameItem(this.getItemInHand(this.getUsedItemHand()), this.useItem)) {
@@ -3830,7 +3834,12 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3837,7 +3841,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.triggerItemUseEffects(stack, 5); this.triggerItemUseEffects(stack, 5);
} }
@ -93,7 +93,7 @@ index df0f723cd39c05ed8f2d1bbf6e97f3c640134274..77a1c7dfbaccc2e74da5c78ce4dfcd17
this.completeUsingItem(); this.completeUsingItem();
} }
@@ -3878,7 +3887,10 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3885,7 +3894,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
if (!itemstack.isEmpty() && !this.isUsingItem() || forceUpdate) { // Paper use override flag if (!itemstack.isEmpty() && !this.isUsingItem() || forceUpdate) { // Paper use override flag
this.useItem = itemstack; this.useItem = itemstack;
@ -105,7 +105,7 @@ index df0f723cd39c05ed8f2d1bbf6e97f3c640134274..77a1c7dfbaccc2e74da5c78ce4dfcd17
if (!this.level().isClientSide) { if (!this.level().isClientSide) {
this.setLivingEntityFlag(1, true); this.setLivingEntityFlag(1, true);
this.setLivingEntityFlag(2, hand == InteractionHand.OFF_HAND); this.setLivingEntityFlag(2, hand == InteractionHand.OFF_HAND);
@@ -3903,7 +3915,10 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3910,7 +3922,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
} }
} else if (!this.isUsingItem() && !this.useItem.isEmpty()) { } else if (!this.isUsingItem() && !this.useItem.isEmpty()) {
this.useItem = ItemStack.EMPTY; this.useItem = ItemStack.EMPTY;
@ -117,7 +117,7 @@ index df0f723cd39c05ed8f2d1bbf6e97f3c640134274..77a1c7dfbaccc2e74da5c78ce4dfcd17
} }
} }
@@ -4038,7 +4053,10 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -4045,7 +4060,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
} }
this.useItem = ItemStack.EMPTY; this.useItem = ItemStack.EMPTY;