mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 06:50:12 +01:00
Readd dropped ServerScoreboard hunk
This commit is contained in:
parent
e99a9b5e4a
commit
b69631ba21
2 changed files with 29 additions and 13 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue