13
0
geforkt von Mirrors/Paper

Fix chest relooting mechanics (#8580)

Dieser Commit ist enthalten in:
Amy 2022-11-24 23:21:40 +00:00
Ursprung b6c34550ce
Commit 9cbb983d0d

Datei anzeigen

@ -603,6 +603,24 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
ContainerHelper.loadAllItems(nbt, this.getItemStacks());
}
@@ -0,0 +0,0 @@ public interface ContainerEntity extends Container, MenuProvider {
default void unpackChestVehicleLootTable(@Nullable Player player) {
MinecraftServer minecraftServer = this.getLevel().getServer();
- if (this.getLootTable() != null && minecraftServer != null) {
+ if (this.getLootableData().shouldReplenish(player) && minecraftServer != null) { // Paper
LootTable lootTable = minecraftServer.getLootTables().get(this.getLootTable());
if (player != null) {
CriteriaTriggers.GENERATE_LOOT.trigger((ServerPlayer)player, this.getLootTable());
}
- this.setLootTable((ResourceLocation)null);
+ // this.setLootTable((ResourceLocation)null); // Paper
+ this.getLootableData().processRefill(player); // Paper
+
LootContext.Builder builder = (new LootContext.Builder((ServerLevel)this.getLevel())).withParameter(LootContextParams.ORIGIN, this.position()).withOptionalRandomSeed(this.getLootTableSeed());
if (player != null) {
builder.withLuck(player.getLuck()).withParameter(LootContextParams.THIS_ENTITY, player);
@@ -0,0 +0,0 @@ public interface ContainerEntity extends Container, MenuProvider {
default boolean isChestVehicleStillValid(Player player) {
return !this.isRemoved() && this.position().closerThan(player.position(), 8.0D);