2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Zach Brown <zach.brown@destroystokyo.com>
|
|
|
|
Date: Sat, 12 Nov 2016 23:25:22 -0600
|
|
|
|
Subject: [PATCH] Filter bad data from ArmorStand and SpawnEgg items
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
2022-12-07 19:52:24 +01:00
|
|
|
index 561b8d6fcf4d511fb026bcc2c02054e56589d0b7..e7404619877099aa2223da349e15090d2c9be1d0 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
2022-12-07 19:52:24 +01:00
|
|
|
@@ -318,6 +318,18 @@ public class FallingBlockEntity extends Entity {
|
2021-06-11 14:02:28 +02:00
|
|
|
@Override
|
2021-06-12 08:24:50 +02:00
|
|
|
protected void readAdditionalSaveData(CompoundTag nbt) {
|
2022-12-07 19:52:24 +01:00
|
|
|
this.blockState = NbtUtils.readBlockState(this.level.holderLookup(Registries.BLOCK), nbt.getCompound("BlockState"));
|
2021-06-11 14:02:28 +02:00
|
|
|
+ // Paper start - Block FallingBlocks with Command Blocks
|
|
|
|
+ final Block b = this.blockState.getBlock();
|
2022-06-09 10:51:45 +02:00
|
|
|
+ if (this.level.paperConfig().entities.spawning.filterNbtDataFromSpawnEggsAndRelated
|
2021-06-12 08:24:50 +02:00
|
|
|
+ && (b == Blocks.COMMAND_BLOCK
|
|
|
|
+ || b == Blocks.REPEATING_COMMAND_BLOCK
|
|
|
|
+ || b == Blocks.CHAIN_COMMAND_BLOCK
|
|
|
|
+ || b == Blocks.JIGSAW
|
|
|
|
+ || b == Blocks.STRUCTURE_BLOCK
|
|
|
|
+ || b instanceof net.minecraft.world.level.block.GameMasterBlock)) {
|
2021-06-11 14:02:28 +02:00
|
|
|
+ this.blockState = Blocks.STONE.defaultBlockState();
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
2021-06-12 08:24:50 +02:00
|
|
|
this.time = nbt.getInt("Time");
|
|
|
|
if (nbt.contains("HurtEntities", 99)) {
|
|
|
|
this.hurtEntities = nbt.getBoolean("HurtEntities");
|