-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow anvil destroy item entities and disable vault blacklist (#364)
* Allow anvil destroy item entities * Disable vault blacklist
- Loading branch information
Showing
4 changed files
with
66 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
patches/server/0134-Allow-anvil-destroy-item-entities.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: huanli233 <392352840@qq.com> | ||
Date: Sat, 26 Oct 2024 19:53:17 +0800 | ||
Subject: [PATCH] Allow anvil destroy item entities | ||
|
||
|
||
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java | ||
index e38f588e3043320a9c135e03f506a00924ed58b8..5e91b222f9e6e908071d7b21a3fb782fa52eddab 100644 | ||
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java | ||
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java | ||
@@ -275,7 +275,7 @@ public class FallingBlockEntity extends Entity { | ||
if (i < 0) { | ||
return false; | ||
} else { | ||
- Predicate<Entity> predicate = EntitySelector.NO_CREATIVE_OR_SPECTATOR.and(EntitySelector.LIVING_ENTITY_STILL_ALIVE); | ||
+ Predicate<Entity> predicate = org.leavesmc.leaves.LeavesConfig.allowAnvilDestroyItemEntities ? EntitySelector.NO_CREATIVE_OR_SPECTATOR : EntitySelector.NO_CREATIVE_OR_SPECTATOR.and(EntitySelector.LIVING_ENTITY_STILL_ALIVE); // Leaves - Allow anvil destroy item entities | ||
Block block = this.blockState.getBlock(); | ||
DamageSource damagesource1; | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: huanli233 <392352840@qq.com> | ||
Date: Sun, 27 Oct 2024 15:57:37 +0800 | ||
Subject: [PATCH] Disable vault blacklist | ||
|
||
|
||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/vault/VaultServerData.java b/src/main/java/net/minecraft/world/level/block/entity/vault/VaultServerData.java | ||
index 30544783d959fbdf4b6fd53c10bd3806e718a066..0a7cd5fad1eb0cc5770a4dd14349168fe7933721 100644 | ||
--- a/src/main/java/net/minecraft/world/level/block/entity/vault/VaultServerData.java | ||
+++ b/src/main/java/net/minecraft/world/level/block/entity/vault/VaultServerData.java | ||
@@ -57,11 +57,12 @@ public class VaultServerData { | ||
} | ||
|
||
boolean hasRewardedPlayer(Player player) { | ||
- return this.rewardedPlayers.contains(player.getUUID()); | ||
+ return !org.leavesmc.leaves.LeavesConfig.disableVaultBlacklist && this.rewardedPlayers.contains(player.getUUID()); // Leaves - disable vault blacklist | ||
} | ||
|
||
@VisibleForTesting | ||
public void addToRewardedPlayers(Player player) { | ||
+ if (org.leavesmc.leaves.LeavesConfig.disableVaultBlacklist) return; // Leaves - disable vault blacklist | ||
this.rewardedPlayers.add(player.getUUID()); | ||
if (this.rewardedPlayers.size() > 128) { | ||
Iterator<UUID> iterator = this.rewardedPlayers.iterator(); | ||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/vault/VaultSharedData.java b/src/main/java/net/minecraft/world/level/block/entity/vault/VaultSharedData.java | ||
index f09ce717869741bb2f027ab1216fad9d86425683..b113f44e7e6a1f5303392bff09914f0260bd3bc6 100644 | ||
--- a/src/main/java/net/minecraft/world/level/block/entity/vault/VaultSharedData.java | ||
+++ b/src/main/java/net/minecraft/world/level/block/entity/vault/VaultSharedData.java | ||
@@ -68,8 +68,8 @@ public class VaultSharedData { | ||
Set<UUID> set = config.playerDetector() | ||
.detect(world, config.entitySelector(), pos, radius, false) | ||
.stream() | ||
- .filter(uuid -> !serverData.getRewardedPlayers().contains(uuid)) | ||
- .collect(Collectors.toSet()); | ||
+ .filter(uuid -> org.leavesmc.leaves.LeavesConfig.disableVaultBlacklist || !serverData.getRewardedPlayers().contains(uuid)) | ||
+ .collect(Collectors.toSet()); // Leaves - disable vault blacklist | ||
if (!this.connectedPlayers.equals(set)) { | ||
this.connectedPlayers = set; | ||
this.markDirty(); |