Updated Upstream (Paper, Tuinity, & Airplane)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
bca97a8f7 replace spaces in world key (touches #5397)
de94f6485 Refactor chat message composition (#5396)
e27f334bb [CI-SKIP] Fix makemcdevsrc.sh for nms relocations (#5389)
ae15e85da Updated Upstream (CraftBukkit)
26fe0ac5a Only set despawnTimer for Wandering Traders spawned by MobSpawnerTrader (#5391)
b748eb7b8 Fix VanillaMobGoalTest#testBukkitMap (#5390)
18dbbb578 [Auto] Updated Upstream (CraftBukkit)
fac9cc5d5 [CI-SKIP] Ignore .gitignore
087aa70e7 Deprecate ItemStack#setLore(List<String>) and ItemStack#getLore, add Component based alternatives
9889c651c apply fixup
c310f0a61 Updated Upstream (Bukkit/CraftBukkit)
f17560ab0 wtf is this t file -jmp
347f3a9b8 fix compile
700e9e6a5 rebase
cf4dc464a Revert de5f4e469...c270abe96
6870db613 script & POM fix
743c6533c Replace ** with * (BSD/macOS)
376d7b097 Don't remove the .java
fcb3fd42a Fix macOS/BSD support
8cfc05249 Link correctly
ba1031ca7 Rename work dir
c8d844ab7 Actually fix preloading this time
e62aa5e3e Fix class preloading
1c03cf898 It's mojang math, not minecraft math
1034873df Apply fixups
39b125771 Use revision file
956150da7 Welcome to 1.16.5-R0.2
ccb217c01 Change cache keys
0d217001c more work
f6d820f07 It compiles
0f78e9525 More work
1718f61bf Updated Upstream (CraftBukkit/Spigot)
b28d46114 Update scripts for NMS repackaging

Tuinity Changes:
9bdcb9b8e Delete work dir when running jar
6351d7ca7 Update Upstream (Paper)
932c199a6 Generate md-dev correctly
bf3e73778 Make packet limiter work from IDE
1686f3861 Fix packet limiter config
f40f7b425 Update README.md styling (#264)
da1c3ace5 GH Actions Changes (#213)
5f325ecf1 Update Upstream (Paper)
0f83fe48d Update Upstream (Paper)

Airplane Changes:
f94d39947 Merge pull request #18 from notOM3GA/upstream/nms-repackage
0fc622631 Force build for Flare update
08439d6a9 Update Upstream (Tuinity)
This commit is contained in:
BillyGalbreath
2021-03-21 21:35:08 -05:00
parent 5bf86159f2
commit 1362f49b24
195 changed files with 17670 additions and 16826 deletions

View File

@@ -6,11 +6,81 @@ Subject: [PATCH] Persistent TileEntity Lore and DisplayName
Makes it so that when a TileEntity is placed in the world and then broken,
the dropped ItemStack retains any original custom display name/lore.
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
index d3026d8911c73e23315a545b9eb0753306c0e825..2c8d7024879392f37e53dfb72cc07971c7b4f27c 100644
--- a/src/main/java/net/minecraft/server/Block.java
+++ b/src/main/java/net/minecraft/server/Block.java
@@ -207,7 +207,7 @@ public class Block extends BlockBase implements IMaterial {
diff --git a/src/main/java/net/minecraft/world/entity/decoration/EntityPainting.java b/src/main/java/net/minecraft/world/entity/decoration/EntityPainting.java
index 9c01ec42342cf0420bf5215604c24fbc89c1361b..3de0f21648ca60bdfcbc078bca896d51bf84e207 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/EntityPainting.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/EntityPainting.java
@@ -15,6 +15,7 @@ import net.minecraft.sounds.SoundEffects;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityTypes;
import net.minecraft.world.entity.player.EntityHuman;
+import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.GameRules;
import net.minecraft.world.level.IMaterial;
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/EntityBoat.java b/src/main/java/net/minecraft/world/entity/vehicle/EntityBoat.java
index 01839c7319e175477ded7001e00e5937734ff516..e5cda8c040c93639211dacbf5b0c7cd6a9df9e6d 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/EntityBoat.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/EntityBoat.java
@@ -34,6 +34,7 @@ import net.minecraft.world.entity.animal.EntityAnimal;
import net.minecraft.world.entity.animal.EntityWaterAnimal;
import net.minecraft.world.entity.player.EntityHuman;
import net.minecraft.world.item.Item;
+import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.GameRules;
import net.minecraft.world.level.IMaterial;
diff --git a/src/main/java/net/minecraft/world/item/ItemBlock.java b/src/main/java/net/minecraft/world/item/ItemBlock.java
index 59d52c252b2e59923b8e513dd4d2e1ec9ce34dc7..4be1c8ee85f411a8b01be50b8cc3dc3835f80a2e 100644
--- a/src/main/java/net/minecraft/world/item/ItemBlock.java
+++ b/src/main/java/net/minecraft/world/item/ItemBlock.java
@@ -119,7 +119,24 @@ public class ItemBlock extends Item {
}
protected boolean a(BlockPosition blockposition, World world, @Nullable EntityHuman entityhuman, ItemStack itemstack, IBlockData iblockdata) {
- return a(world, entityhuman, blockposition, itemstack);
+ // Purpur start
+ boolean handled = a(world, entityhuman, blockposition, itemstack);
+ if (world.purpurConfig.persistentTileEntityDisplayNames && itemstack.hasTag()) {
+ NBTTagCompound display = itemstack.getSubTag("display");
+ if (display != null) {
+ TileEntity tile = world.getTileEntity(blockposition);
+ if (tile != null) {
+ if (display.hasKeyOfType("Name", 8)) {
+ tile.setPersistentDisplayName(display.getString("Name"));
+ }
+ if (display.hasKeyOfType("Lore", 9)) {
+ tile.setPersistentLore(display.getList("Lore", 8));
+ }
+ }
+ }
+ }
+ return handled;
+ // Purpur end
}
@Nullable
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
index 97eb81338207c93125bea082256384946a8305bb..eecb17e887bf0d1680a5fb5198a8b4246c14e548 100644
--- a/src/main/java/net/minecraft/world/level/block/Block.java
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
@@ -15,10 +15,15 @@ import net.minecraft.core.EnumDirection;
import net.minecraft.core.IRegistry;
import net.minecraft.core.NonNullList;
import net.minecraft.core.RegistryBlockID;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.nbt.NBTTagList;
+import net.minecraft.nbt.NBTTagString;
+import net.minecraft.network.chat.IChatBaseComponent;
import net.minecraft.server.level.WorldServer;
import net.minecraft.stats.StatisticList;
import net.minecraft.tags.Tag;
import net.minecraft.tags.TagsBlock;
+import net.minecraft.world.INamableTileEntity;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityExperienceOrb;
import net.minecraft.world.entity.EntityLiving;
@@ -248,7 +253,7 @@ public class Block extends BlockBase implements IMaterial {
public static void a(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition, @Nullable TileEntity tileentity) {
if (generatoraccess instanceof WorldServer) {
a(iblockdata, (WorldServer) generatoraccess, blockposition, tileentity).forEach((itemstack) -> {
@@ -19,7 +89,7 @@ index d3026d8911c73e23315a545b9eb0753306c0e825..2c8d7024879392f37e53dfb72cc07971
});
iblockdata.dropNaturally((WorldServer) generatoraccess, blockposition, ItemStack.b);
}
@@ -216,14 +216,56 @@ public class Block extends BlockBase implements IMaterial {
@@ -257,14 +262,56 @@ public class Block extends BlockBase implements IMaterial {
public static void dropItems(IBlockData iblockdata, World world, BlockPosition blockposition, @Nullable TileEntity tileentity, Entity entity, ItemStack itemstack) {
if (world instanceof WorldServer) {
@@ -78,41 +148,20 @@ index d3026d8911c73e23315a545b9eb0753306c0e825..2c8d7024879392f37e53dfb72cc07971
public static void a(World world, BlockPosition blockposition, ItemStack itemstack) { dropItem(world, blockposition, itemstack); } public static void dropItem(World world, BlockPosition blockposition, ItemStack itemstack) { // Paper - OBFHELPER
if (!world.isClientSide && !itemstack.isEmpty() && world.getGameRules().getBoolean(GameRules.DO_TILE_DROPS)) {
float f = 0.5F;
diff --git a/src/main/java/net/minecraft/server/ItemBlock.java b/src/main/java/net/minecraft/server/ItemBlock.java
index ae2ad70699347e169d941266ec3ad1af4c9b3786..e4aea92040b58a5c87258ac6fd735f21709a45a3 100644
--- a/src/main/java/net/minecraft/server/ItemBlock.java
+++ b/src/main/java/net/minecraft/server/ItemBlock.java
@@ -97,7 +97,24 @@ public class ItemBlock extends Item {
}
protected boolean a(BlockPosition blockposition, World world, @Nullable EntityHuman entityhuman, ItemStack itemstack, IBlockData iblockdata) {
- return a(world, entityhuman, blockposition, itemstack);
+ // Purpur start
+ boolean handled = a(world, entityhuman, blockposition, itemstack);
+ if (world.purpurConfig.persistentTileEntityDisplayNames && itemstack.hasTag()) {
+ NBTTagCompound display = itemstack.getSubTag("display");
+ if (display != null) {
+ TileEntity tile = world.getTileEntity(blockposition);
+ if (tile != null) {
+ if (display.hasKeyOfType("Name", 8)) {
+ tile.setPersistentDisplayName(display.getString("Name"));
+ }
+ if (display.hasKeyOfType("Lore", 9)) {
+ tile.setPersistentLore(display.getList("Lore", 8));
+ }
+ }
+ }
+ }
+ return handled;
+ // Purpur end
}
@Nullable
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
index 060c1206e4b5da6be50fff605894fb2a46f57c1b..c0d465749093b1a18bd5179eb28ae06a00850185 100644
--- a/src/main/java/net/minecraft/server/TileEntity.java
+++ b/src/main/java/net/minecraft/server/TileEntity.java
@@ -93,9 +93,25 @@ public abstract class TileEntity implements KeyedObject { // Paper
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java
index f1e586754396439dfb70a4d63e3b8b34fb36ebf4..8a049d3de8937a6c8afe178ccd134e2511fb3baf 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java
@@ -5,6 +5,8 @@ import net.minecraft.CrashReportSystemDetails;
import net.minecraft.core.BlockPosition;
import net.minecraft.core.IRegistry;
import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.nbt.NBTTagList;
+import net.minecraft.nbt.NBTTagString;
import net.minecraft.network.protocol.game.PacketPlayOutTileEntityData;
import net.minecraft.resources.MinecraftKey;
import net.minecraft.world.level.World;
@@ -104,9 +106,25 @@ public abstract class TileEntity implements net.minecraft.server.KeyedObject { /
this.persistentDataContainer.putAll((NBTTagCompound) persistentDataTag);
}
// CraftBukkit end
@@ -138,7 +187,7 @@ index 060c1206e4b5da6be50fff605894fb2a46f57c1b..c0d465749093b1a18bd5179eb28ae06a
return this.b(nbttagcompound);
}
@@ -256,4 +272,25 @@ public abstract class TileEntity implements KeyedObject { // Paper
@@ -267,4 +285,25 @@ public abstract class TileEntity implements net.minecraft.server.KeyedObject { /
return null;
}
// CraftBukkit end
@@ -165,7 +214,7 @@ index 060c1206e4b5da6be50fff605894fb2a46f57c1b..c0d465749093b1a18bd5179eb28ae06a
+ // Purpur end
}
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 6d0d43e77bbf6f792257eb368e572b1bfade3266..4515c95a195ab962513ddc6868f9cdfd47f61d68 100644
index 22aa4709d1db75eb901a6145b75689bd766bf10b..4843d4a0794e05386d6cdf05a7059598291aafe7 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -200,6 +200,7 @@ public class PurpurWorldConfig {