mirror of
https://github.com/PaperMC/Paper.git
synced 2024-08-19 02:33:04 +02:00
25 lines
1.5 KiB
Diff
25 lines
1.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|
Date: Wed, 15 Sep 2021 14:52:42 -0700
|
|
Subject: [PATCH] config for disabling entity tag tags
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
|
|
index c11e805dc4b77f08cadb0e99d86635036405da3e..9afc81ccb237c3655d64cdbe8a0db9a4d7791043 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
|
|
@@ -492,6 +492,13 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
|
if (world.isClientSide || !entity.onlyOpCanSetNbt() || player != null && minecraftserver.getPlayerList().isOp(player.getGameProfile())) {
|
|
CompoundTag nbttagcompound1 = entity.saveWithoutId(new CompoundTag());
|
|
UUID uuid = entity.getUUID();
|
|
+ // Paper start - filter out protected tags
|
|
+ if (player == null || !player.getBukkitEntity().hasPermission("minecraft.nbt.place")) {
|
|
+ for (net.minecraft.commands.arguments.NbtPathArgument.NbtPath tag : world.paperConfig().entities.spawning.filteredEntityTagNbtPaths) {
|
|
+ tag.remove(itemNbt.getCompound("EntityTag"));
|
|
+ }
|
|
+ }
|
|
+ // Paper end
|
|
|
|
nbttagcompound1.merge(itemNbt.getCompound("EntityTag"));
|
|
entity.setUUID(uuid);
|