Readd dropped ServerScoreboard hunk

This commit is contained in:
Nassim Jahnke 2024-12-15 14:29:01 +01:00
parent e99a9b5e4a
commit b69631ba21
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F
2 changed files with 29 additions and 13 deletions

View File

@ -47,10 +47,27 @@
} else {
this.startTrackingObjective(objective);
}
@@ -114,14 +_,42 @@
}
}
@@ -104,24 +_,50 @@
@Override
public boolean addPlayerToTeam(String playerName, PlayerTeam team) {
if (super.addPlayerToTeam(playerName, team)) {
- this.server
- .getPlayerList()
- .broadcastAll(ClientboundSetPlayerTeamPacket.createPlayerPacket(team, playerName, ClientboundSetPlayerTeamPacket.Action.ADD));
- this.setDirty();
- return true;
- } else {
- return false;
- }
- }
+ this.broadcastAll(ClientboundSetPlayerTeamPacket.createPlayerPacket(team, playerName, ClientboundSetPlayerTeamPacket.Action.ADD)); // CraftBukkit
+ this.setDirty();
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ // Paper start - Multiple Entries with Scoreboards
+ public boolean addPlayersToTeam(java.util.Collection<String> players, PlayerTeam team) {
+ boolean anyAdded = false;
@ -69,7 +86,7 @@
+ }
+ }
+ // Paper end - Multiple Entries with Scoreboards
+
@Override
public void removePlayerFromTeam(String username, PlayerTeam playerTeam) {
super.removePlayerFromTeam(username, playerTeam);

View File

@ -1,16 +1,15 @@
--- a/net/minecraft/world/entity/ai/behavior/InteractWithDoor.java
+++ b/net/minecraft/world/entity/ai/behavior/InteractWithDoor.java
@@ -58,6 +_,13 @@
@@ -58,6 +_,12 @@
if (blockState.is(BlockTags.MOB_INTERACTABLE_DOORS, state -> state.getBlock() instanceof DoorBlock)) {
DoorBlock doorBlock = (DoorBlock)blockState.getBlock();
if (!doorBlock.isOpen(blockState)) {
+ // CraftBukkit start - entities opening doors
+ org.bukkit.event.entity.EntityInteractEvent event = new org.bukkit.event.entity.EntityInteractEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(entity.level(), blockPos));
+ entity.level().getCraftServer().getPluginManager().callEvent(event);
+ if (event.isCancelled()) {
+ return false;
+ }
+ // CraftBukkit end
+ // CraftBukkit start - entities opening doors
+ org.bukkit.event.entity.EntityInteractEvent event = new org.bukkit.event.entity.EntityInteractEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(entity.level(), blockPos));
+ if (!event.callEvent()) {
+ return false;
+ }
+ // CraftBukkit end
doorBlock.setOpen(entity, level, blockState, blockPos, true);
}