mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 11:27:35 +01:00
Readd dropped ServerScoreboard hunk
This commit is contained in:
parent
e99a9b5e4a
commit
b69631ba21
@ -47,10 +47,27 @@
|
|||||||
} else {
|
} else {
|
||||||
this.startTrackingObjective(objective);
|
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
|
+ // Paper start - Multiple Entries with Scoreboards
|
||||||
+ public boolean addPlayersToTeam(java.util.Collection<String> players, PlayerTeam team) {
|
+ public boolean addPlayersToTeam(java.util.Collection<String> players, PlayerTeam team) {
|
||||||
+ boolean anyAdded = false;
|
+ boolean anyAdded = false;
|
||||||
@ -69,7 +86,7 @@
|
|||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end - Multiple Entries with Scoreboards
|
+ // Paper end - Multiple Entries with Scoreboards
|
||||||
+
|
|
||||||
@Override
|
@Override
|
||||||
public void removePlayerFromTeam(String username, PlayerTeam playerTeam) {
|
public void removePlayerFromTeam(String username, PlayerTeam playerTeam) {
|
||||||
super.removePlayerFromTeam(username, playerTeam);
|
super.removePlayerFromTeam(username, playerTeam);
|
||||||
|
@ -1,16 +1,15 @@
|
|||||||
--- a/net/minecraft/world/entity/ai/behavior/InteractWithDoor.java
|
--- a/net/minecraft/world/entity/ai/behavior/InteractWithDoor.java
|
||||||
+++ b/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)) {
|
if (blockState.is(BlockTags.MOB_INTERACTABLE_DOORS, state -> state.getBlock() instanceof DoorBlock)) {
|
||||||
DoorBlock doorBlock = (DoorBlock)blockState.getBlock();
|
DoorBlock doorBlock = (DoorBlock)blockState.getBlock();
|
||||||
if (!doorBlock.isOpen(blockState)) {
|
if (!doorBlock.isOpen(blockState)) {
|
||||||
+ // CraftBukkit start - entities opening doors
|
+ // 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));
|
+ 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.callEvent()) {
|
||||||
+ if (event.isCancelled()) {
|
+ return false;
|
||||||
+ return false;
|
+ }
|
||||||
+ }
|
+ // CraftBukkit end
|
||||||
+ // CraftBukkit end
|
|
||||||
doorBlock.setOpen(entity, level, blockState, blockPos, true);
|
doorBlock.setOpen(entity, level, blockState, blockPos, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user