2021-08-06 22:37:38 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|
|
|
Date: Wed, 19 May 2021 18:59:10 -0700
|
|
|
|
Subject: [PATCH] Add PlayerSetSpawnEvent
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/commands/SetSpawnCommand.java b/src/main/java/net/minecraft/server/commands/SetSpawnCommand.java
|
2024-01-19 13:22:30 +01:00
|
|
|
index a2d0699e8427b2262a2396495111125eccafbb66..15db9368227dbc29d07d74e85bd126b345b526b6 100644
|
2021-08-06 22:37:38 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/commands/SetSpawnCommand.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/commands/SetSpawnCommand.java
|
2023-06-08 21:00:58 +02:00
|
|
|
@@ -38,24 +38,34 @@ public class SetSpawnCommand {
|
2023-05-12 13:10:08 +02:00
|
|
|
ResourceKey<Level> resourcekey = source.getLevel().dimension();
|
|
|
|
Iterator iterator = targets.iterator();
|
2021-08-06 22:37:38 +02:00
|
|
|
|
2024-01-19 13:22:30 +01:00
|
|
|
+ final Collection<ServerPlayer> actualTargets = new java.util.ArrayList<>(); // Paper - Add PlayerSetSpawnEvent
|
2023-05-12 13:10:08 +02:00
|
|
|
while (iterator.hasNext()) {
|
|
|
|
ServerPlayer entityplayer = (ServerPlayer) iterator.next();
|
|
|
|
|
|
|
|
- entityplayer.setRespawnPosition(resourcekey, pos, angle, true, false, org.bukkit.event.player.PlayerSpawnChangeEvent.Cause.COMMAND); // CraftBukkit
|
2024-01-19 13:22:30 +01:00
|
|
|
+ // Paper start - Add PlayerSetSpawnEvent
|
2023-05-12 13:10:08 +02:00
|
|
|
+ if (entityplayer.setRespawnPosition(resourcekey, pos, angle, true, false, com.destroystokyo.paper.event.player.PlayerSetSpawnEvent.Cause.COMMAND)) {
|
|
|
|
+ actualTargets.add(entityplayer);
|
2022-04-30 22:24:47 +02:00
|
|
|
+ }
|
2024-01-19 13:22:30 +01:00
|
|
|
+ // Paper end - Add PlayerSetSpawnEvent
|
2021-08-06 22:37:38 +02:00
|
|
|
}
|
2024-01-19 13:22:30 +01:00
|
|
|
+ // Paper start - Add PlayerSetSpawnEvent
|
2022-04-30 22:24:47 +02:00
|
|
|
+ if (actualTargets.isEmpty()) {
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
2024-01-19 13:22:30 +01:00
|
|
|
+ // Paper end - Add PlayerSetSpawnEvent
|
2021-08-06 22:37:38 +02:00
|
|
|
|
2023-05-12 13:10:08 +02:00
|
|
|
String s = resourcekey.location().toString();
|
|
|
|
|
2023-06-08 21:00:58 +02:00
|
|
|
- if (targets.size() == 1) {
|
2024-01-19 13:22:30 +01:00
|
|
|
+ if (actualTargets.size() == 1) { // Paper - Add PlayerSetSpawnEvent
|
2023-06-08 21:00:58 +02:00
|
|
|
source.sendSuccess(() -> {
|
|
|
|
- return Component.translatable("commands.spawnpoint.success.single", pos.getX(), pos.getY(), pos.getZ(), angle, s, ((ServerPlayer) targets.iterator().next()).getDisplayName());
|
2024-01-19 13:22:30 +01:00
|
|
|
+ return Component.translatable("commands.spawnpoint.success.single", pos.getX(), pos.getY(), pos.getZ(), angle, s, ((ServerPlayer) actualTargets.iterator().next()).getDisplayName()); // Paper - Add PlayerSetSpawnEvent
|
2023-06-08 21:00:58 +02:00
|
|
|
}, true);
|
|
|
|
} else {
|
|
|
|
source.sendSuccess(() -> {
|
|
|
|
- return Component.translatable("commands.spawnpoint.success.multiple", pos.getX(), pos.getY(), pos.getZ(), angle, s, targets.size());
|
2024-01-19 13:22:30 +01:00
|
|
|
+ return Component.translatable("commands.spawnpoint.success.multiple", pos.getX(), pos.getY(), pos.getZ(), angle, s, actualTargets.size()); // Paper - Add PlayerSetSpawnEvent
|
2023-06-08 21:00:58 +02:00
|
|
|
}, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
- return targets.size();
|
2024-01-19 13:22:30 +01:00
|
|
|
+ return actualTargets.size(); // Paper - Add PlayerSetSpawnEvent
|
2023-06-08 21:00:58 +02:00
|
|
|
}
|
|
|
|
}
|
2021-08-06 22:37:38 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
Updated Upstream (Bukkit/CraftBukkit) (#10242)
* Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
a6a9d2a4 Remove some old ApiStatus.Experimental annotations
be72314c SPIGOT-7300, PR-829: Add new DamageSource API providing enhanced information about entity damage
b252cf05 SPIGOT-7576, PR-970: Add methods in MushroomCow to change stew effects
b1c689bd PR-902: Add Server#isLoggingIPs to get log-ips configuration
08f86d1c PR-971: Add Player methods for client-side potion effects
2e3024a9 PR-963: Add API for in-world structures
a23292a7 SPIGOT-7530, PR-948: Improve Resource Pack API with new 1.20.3 functionality
1851857b SPIGOT-3071, PR-969: Add entity spawn method with spawn reason
cde4c52a SPIGOT-5553, PR-964: Add EntityKnockbackEvent
CraftBukkit Changes:
38fd4bd50 Fix accidentally renamed internal damage method
80f0ce4be SPIGOT-7300, PR-1180: Add new DamageSource API providing enhanced information about entity damage
7e43f3b16 SPIGOT-7581: Fix typo in BlockMushroom
ea14b7d90 SPIGOT-7576, PR-1347: Add methods in MushroomCow to change stew effects
4c687f243 PR-1259: Add Server#isLoggingIPs to get log-ips configuration
22a541a29 Improve support for per-world game rules
cb7dccce2 PR-1348: Add Player methods for client-side potion effects
b8d6109f0 PR-1335: Add API for in-world structures
4398a1b5b SPIGOT-7577: Make CraftWindCharge#explode discard the entity
e74107678 Fix Crafter maximum stack size
0bb0f4f6a SPIGOT-7530, PR-1314: Improve Resource Pack API with new 1.20.3 functionality
4949f556d SPIGOT-3071, PR-1345: Add entity spawn method with spawn reason
20ac73ca2 PR-1353: Fix Structure#place not working as documented with 0 palette
3c1b77871 SPIGOT-6911, PR-1349: Change max book length in CraftMetaBook
333701839 SPIGOT-7572: Bee nests generated without bees
f48f4174c SPIGOT-5553, PR-1336: Add EntityKnockbackEvent
2024-02-11 22:28:00 +01:00
|
|
|
index 751216261df86402c23d3f0d73944ae51e849caa..fb86824192f1fc850a55905757c65cafec1edb6a 100644
|
2021-08-06 22:37:38 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
2024-01-24 22:13:08 +01:00
|
|
|
@@ -1307,7 +1307,7 @@ public class ServerPlayer extends Player {
|
2021-08-06 22:37:38 +02:00
|
|
|
} else if (this.bedBlocked(blockposition, enumdirection)) {
|
|
|
|
return Either.left(Player.BedSleepingProblem.OBSTRUCTED);
|
|
|
|
} else {
|
2023-06-08 04:04:01 +02:00
|
|
|
- this.setRespawnPosition(this.level().dimension(), blockposition, this.getYRot(), false, true, PlayerSpawnChangeEvent.Cause.BED); // CraftBukkit
|
2024-01-19 13:22:30 +01:00
|
|
|
+ this.setRespawnPosition(this.level().dimension(), blockposition, this.getYRot(), false, true, com.destroystokyo.paper.event.player.PlayerSetSpawnEvent.Cause.BED); // Paper - Add PlayerSetSpawnEvent
|
2023-06-08 04:04:01 +02:00
|
|
|
if (this.level().isDay()) {
|
2021-08-06 22:37:38 +02:00
|
|
|
return Either.left(Player.BedSleepingProblem.NOT_POSSIBLE_NOW);
|
|
|
|
} else {
|
2024-01-24 22:13:08 +01:00
|
|
|
@@ -2262,44 +2262,50 @@ public class ServerPlayer extends Player {
|
2021-08-06 22:37:38 +02:00
|
|
|
return this.respawnForced;
|
|
|
|
}
|
|
|
|
|
2024-01-19 13:22:30 +01:00
|
|
|
+ @Deprecated // Paper - Add PlayerSetSpawnEvent
|
2021-11-25 00:46:26 +01:00
|
|
|
public void setRespawnPosition(ResourceKey<Level> dimension, @Nullable BlockPos pos, float angle, boolean forced, boolean sendMessage) {
|
2023-05-12 13:10:08 +02:00
|
|
|
- // CraftBukkit start
|
|
|
|
- this.setRespawnPosition(dimension, pos, angle, forced, sendMessage, PlayerSpawnChangeEvent.Cause.UNKNOWN);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public void setRespawnPosition(ResourceKey<Level> resourcekey, @Nullable BlockPos blockposition, float f, boolean flag, boolean flag1, PlayerSpawnChangeEvent.Cause cause) {
|
|
|
|
- ServerLevel newWorld = this.server.getLevel(resourcekey);
|
|
|
|
- Location newSpawn = (blockposition != null) ? CraftLocation.toBukkit(blockposition, newWorld.getWorld(), f, 0) : null;
|
|
|
|
-
|
|
|
|
- PlayerSpawnChangeEvent event = new PlayerSpawnChangeEvent(this.getBukkitEntity(), newSpawn, flag, cause);
|
|
|
|
- Bukkit.getServer().getPluginManager().callEvent(event);
|
|
|
|
- if (event.isCancelled()) {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- newSpawn = event.getNewSpawn();
|
|
|
|
- flag = event.isForced();
|
|
|
|
-
|
|
|
|
- if (newSpawn != null) {
|
|
|
|
- resourcekey = ((CraftWorld) newSpawn.getWorld()).getHandle().dimension();
|
|
|
|
- blockposition = BlockPos.containing(newSpawn.getX(), newSpawn.getY(), newSpawn.getZ());
|
|
|
|
- f = newSpawn.getYaw();
|
|
|
|
- } else {
|
|
|
|
- resourcekey = Level.OVERWORLD;
|
|
|
|
- blockposition = null;
|
|
|
|
- f = 0.0F;
|
2024-01-19 13:22:30 +01:00
|
|
|
+ // Paper start - Add PlayerSetSpawnEvent
|
2021-11-25 00:46:26 +01:00
|
|
|
+ this.setRespawnPosition(dimension, pos, angle, forced, sendMessage, com.destroystokyo.paper.event.player.PlayerSetSpawnEvent.Cause.UNKNOWN);
|
2021-08-06 22:37:38 +02:00
|
|
|
+ }
|
2023-05-12 13:10:08 +02:00
|
|
|
+ @Deprecated
|
|
|
|
+ public boolean setRespawnPosition(ResourceKey<Level> dimension, @Nullable BlockPos pos, float angle, boolean forced, boolean sendMessage, PlayerSpawnChangeEvent.Cause cause) {
|
|
|
|
+ return this.setRespawnPosition(dimension, pos, angle, forced, sendMessage, cause == PlayerSpawnChangeEvent.Cause.RESET ?
|
|
|
|
+ com.destroystokyo.paper.event.player.PlayerSetSpawnEvent.Cause.PLAYER_RESPAWN : com.destroystokyo.paper.event.player.PlayerSetSpawnEvent.Cause.valueOf(cause.name()));
|
|
|
|
+ }
|
2022-04-30 22:24:47 +02:00
|
|
|
+ public boolean setRespawnPosition(ResourceKey<Level> dimension, @Nullable BlockPos pos, float angle, boolean forced, boolean sendMessage, com.destroystokyo.paper.event.player.PlayerSetSpawnEvent.Cause cause) {
|
2021-08-06 22:37:38 +02:00
|
|
|
+ Location spawnLoc = null;
|
|
|
|
+ boolean willNotify = false;
|
2023-05-12 13:10:08 +02:00
|
|
|
+ if (pos != null) {
|
|
|
|
+ boolean flag2 = pos.equals(this.respawnPosition) && dimension.equals(this.respawnDimension);
|
2022-10-24 21:43:46 +02:00
|
|
|
+ spawnLoc = io.papermc.paper.util.MCUtil.toLocation(this.getServer().getLevel(dimension), pos);
|
2021-08-06 22:37:38 +02:00
|
|
|
+ spawnLoc.setYaw(angle);
|
|
|
|
+ willNotify = sendMessage && !flag2;
|
|
|
|
+ }
|
2023-05-12 13:10:08 +02:00
|
|
|
+
|
|
|
|
+ PlayerSpawnChangeEvent dumbEvent = new PlayerSpawnChangeEvent(this.getBukkitEntity(), spawnLoc, forced,
|
|
|
|
+ cause == com.destroystokyo.paper.event.player.PlayerSetSpawnEvent.Cause.PLAYER_RESPAWN ? PlayerSpawnChangeEvent.Cause.RESET : PlayerSpawnChangeEvent.Cause.valueOf(cause.name()));
|
|
|
|
+ dumbEvent.callEvent();
|
|
|
|
+
|
|
|
|
+ com.destroystokyo.paper.event.player.PlayerSetSpawnEvent event = new com.destroystokyo.paper.event.player.PlayerSetSpawnEvent(this.getBukkitEntity(), cause, dumbEvent.getNewSpawn(), dumbEvent.isForced(), willNotify, willNotify ? net.kyori.adventure.text.Component.translatable("block.minecraft.set_spawn") : null);
|
|
|
|
+ event.setCancelled(dumbEvent.isCancelled());
|
2021-08-06 22:37:38 +02:00
|
|
|
+ if (!event.callEvent()) {
|
2022-04-30 22:24:47 +02:00
|
|
|
+ return false;
|
2023-05-12 13:10:08 +02:00
|
|
|
}
|
|
|
|
- // CraftBukkit end
|
|
|
|
- if (blockposition != null) {
|
|
|
|
- boolean flag2 = blockposition.equals(this.respawnPosition) && resourcekey.equals(this.respawnDimension);
|
2021-08-06 22:37:38 +02:00
|
|
|
+ if (event.getLocation() != null) {
|
|
|
|
+ dimension = event.getLocation().getWorld() != null ? ((CraftWorld) event.getLocation().getWorld()).getHandle().dimension() : dimension;
|
2022-10-24 21:43:46 +02:00
|
|
|
+ pos = io.papermc.paper.util.MCUtil.toBlockPosition(event.getLocation());
|
2023-05-12 13:10:08 +02:00
|
|
|
+ angle = event.getLocation().getYaw();
|
2021-11-25 00:46:26 +01:00
|
|
|
+ forced = event.isForced();
|
2024-01-19 13:22:30 +01:00
|
|
|
+ // Paper end - Add PlayerSetSpawnEvent
|
2021-08-06 22:37:38 +02:00
|
|
|
|
2023-05-12 13:10:08 +02:00
|
|
|
- if (flag1 && !flag2) {
|
2022-06-08 11:31:06 +02:00
|
|
|
- this.sendSystemMessage(Component.translatable("block.minecraft.set_spawn"));
|
2024-01-19 13:22:30 +01:00
|
|
|
+ if (event.willNotifyPlayer() && event.getNotification() != null) { // Paper - Add PlayerSetSpawnEvent
|
|
|
|
+ this.sendSystemMessage(PaperAdventure.asVanilla(event.getNotification())); // Paper - Add PlayerSetSpawnEvent
|
2021-08-06 22:37:38 +02:00
|
|
|
}
|
|
|
|
|
2023-05-12 13:10:08 +02:00
|
|
|
- this.respawnPosition = blockposition;
|
|
|
|
- this.respawnDimension = resourcekey;
|
|
|
|
- this.respawnAngle = f;
|
|
|
|
- this.respawnForced = flag;
|
|
|
|
+ this.respawnPosition = pos;
|
|
|
|
+ this.respawnDimension = dimension;
|
|
|
|
+ this.respawnAngle = angle;
|
|
|
|
+ this.respawnForced = forced;
|
|
|
|
} else {
|
|
|
|
this.respawnPosition = null;
|
|
|
|
this.respawnDimension = Level.OVERWORLD;
|
2024-01-24 22:13:08 +01:00
|
|
|
@@ -2307,6 +2313,7 @@ public class ServerPlayer extends Player {
|
2022-04-30 22:24:47 +02:00
|
|
|
this.respawnForced = false;
|
|
|
|
}
|
|
|
|
|
2024-01-19 13:22:30 +01:00
|
|
|
+ return true; // Paper - Add PlayerSetSpawnEvent
|
2022-04-30 22:24:47 +02:00
|
|
|
}
|
|
|
|
|
2023-09-22 14:22:24 +02:00
|
|
|
public SectionPos getLastSectionPos() {
|
2021-08-06 22:37:38 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01:00
|
|
|
index 57e7ce227666a2e273c9e61a102152efd2c0ebd9..7cd6d91fe154d29ec0b0fc0a5a50713bbc2c1c83 100644
|
2021-08-06 22:37:38 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01:00
|
|
|
@@ -871,7 +871,7 @@ public abstract class PlayerList {
|
2023-05-12 13:10:08 +02:00
|
|
|
location = CraftLocation.toBukkit(vec3d, worldserver1.getWorld(), f1, 0.0F);
|
2022-04-30 22:24:47 +02:00
|
|
|
} else if (blockposition != null) {
|
|
|
|
entityplayer1.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.NO_RESPAWN_BLOCK_AVAILABLE, 0.0F));
|
2023-05-12 13:10:08 +02:00
|
|
|
- entityplayer1.setRespawnPosition(null, null, 0f, false, false, PlayerSpawnChangeEvent.Cause.RESET); // CraftBukkit - SPIGOT-5988: Clear respawn location when obstructed
|
2024-01-19 13:22:30 +01:00
|
|
|
+ entityplayer1.setRespawnPosition(null, null, 0f, false, false, com.destroystokyo.paper.event.player.PlayerSetSpawnEvent.Cause.PLAYER_RESPAWN); // CraftBukkit - SPIGOT-5988: Clear respawn location when obstructed // Paper - Add PlayerSetSpawnEvent
|
2022-04-30 22:24:47 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-06 22:37:38 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
2024-01-19 13:22:30 +01:00
|
|
|
index ecaa7f0b2bf795f16187f11fa27f6d5d435ccbfe..acd5ec218b8d4c096f44ae2eec1379eeaf30ddc5 100644
|
2021-08-06 22:37:38 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
2023-12-06 04:57:46 +01:00
|
|
|
@@ -87,9 +87,14 @@ public class RespawnAnchorBlock extends Block {
|
2023-05-12 13:10:08 +02:00
|
|
|
ServerPlayer entityplayer = (ServerPlayer) player;
|
|
|
|
|
|
|
|
if (entityplayer.getRespawnDimension() != world.dimension() || !pos.equals(entityplayer.getRespawnPosition())) {
|
|
|
|
- entityplayer.setRespawnPosition(world.dimension(), pos, 0.0F, false, true, org.bukkit.event.player.PlayerSpawnChangeEvent.Cause.RESPAWN_ANCHOR); // CraftBukkit
|
2024-01-19 13:22:30 +01:00
|
|
|
+ if (entityplayer.setRespawnPosition(world.dimension(), pos, 0.0F, false, true, com.destroystokyo.paper.event.player.PlayerSetSpawnEvent.Cause.RESPAWN_ANCHOR)) { // Paper - Add PlayerSetSpawnEvent
|
2023-05-12 13:10:08 +02:00
|
|
|
world.playSound((Player) null, (double) pos.getX() + 0.5D, (double) pos.getY() + 0.5D, (double) pos.getZ() + 0.5D, SoundEvents.RESPAWN_ANCHOR_SET_SPAWN, SoundSource.BLOCKS, 1.0F, 1.0F);
|
2021-08-06 22:37:38 +02:00
|
|
|
return InteractionResult.SUCCESS;
|
2024-01-19 13:22:30 +01:00
|
|
|
+ // Paper start - Add PlayerSetSpawnEvent
|
2022-04-30 22:24:47 +02:00
|
|
|
+ } else {
|
|
|
|
+ return InteractionResult.FAIL;
|
|
|
|
+ }
|
2024-01-19 13:22:30 +01:00
|
|
|
+ // Paper end - Add PlayerSetSpawnEvent
|
2021-08-06 22:37:38 +02:00
|
|
|
}
|
2022-04-30 22:24:47 +02:00
|
|
|
}
|
|
|
|
|
2021-08-06 22:37:38 +02:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01:00
|
|
|
index bc6c973ca53e1fa0275875296a2f2da6a004825e..3c0be3eb7eb79fd2e62845d516f5d9a3c0f8403f 100644
|
2021-08-06 22:37:38 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
Updated Upstream (Bukkit/CraftBukkit) (#10242)
* Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
a6a9d2a4 Remove some old ApiStatus.Experimental annotations
be72314c SPIGOT-7300, PR-829: Add new DamageSource API providing enhanced information about entity damage
b252cf05 SPIGOT-7576, PR-970: Add methods in MushroomCow to change stew effects
b1c689bd PR-902: Add Server#isLoggingIPs to get log-ips configuration
08f86d1c PR-971: Add Player methods for client-side potion effects
2e3024a9 PR-963: Add API for in-world structures
a23292a7 SPIGOT-7530, PR-948: Improve Resource Pack API with new 1.20.3 functionality
1851857b SPIGOT-3071, PR-969: Add entity spawn method with spawn reason
cde4c52a SPIGOT-5553, PR-964: Add EntityKnockbackEvent
CraftBukkit Changes:
38fd4bd50 Fix accidentally renamed internal damage method
80f0ce4be SPIGOT-7300, PR-1180: Add new DamageSource API providing enhanced information about entity damage
7e43f3b16 SPIGOT-7581: Fix typo in BlockMushroom
ea14b7d90 SPIGOT-7576, PR-1347: Add methods in MushroomCow to change stew effects
4c687f243 PR-1259: Add Server#isLoggingIPs to get log-ips configuration
22a541a29 Improve support for per-world game rules
cb7dccce2 PR-1348: Add Player methods for client-side potion effects
b8d6109f0 PR-1335: Add API for in-world structures
4398a1b5b SPIGOT-7577: Make CraftWindCharge#explode discard the entity
e74107678 Fix Crafter maximum stack size
0bb0f4f6a SPIGOT-7530, PR-1314: Improve Resource Pack API with new 1.20.3 functionality
4949f556d SPIGOT-3071, PR-1345: Add entity spawn method with spawn reason
20ac73ca2 PR-1353: Fix Structure#place not working as documented with 0 palette
3c1b77871 SPIGOT-6911, PR-1349: Change max book length in CraftMetaBook
333701839 SPIGOT-7572: Bee nests generated without bees
f48f4174c SPIGOT-5553, PR-1336: Add EntityKnockbackEvent
2024-02-11 22:28:00 +01:00
|
|
|
@@ -1321,9 +1321,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
2021-08-06 22:37:38 +02:00
|
|
|
@Override
|
2024-01-26 20:17:06 +01:00
|
|
|
public void setRespawnLocation(Location location, boolean override) {
|
2021-08-06 22:37:38 +02:00
|
|
|
if (location == null) {
|
2023-05-12 13:10:08 +02:00
|
|
|
- this.getHandle().setRespawnPosition(null, null, 0.0F, override, false, PlayerSpawnChangeEvent.Cause.PLUGIN);
|
2024-01-19 13:22:30 +01:00
|
|
|
+ this.getHandle().setRespawnPosition(null, null, 0.0F, override, false, com.destroystokyo.paper.event.player.PlayerSetSpawnEvent.Cause.PLUGIN); // Paper - Add PlayerSetSpawnEvent
|
2021-08-06 22:37:38 +02:00
|
|
|
} else {
|
2023-05-12 13:10:08 +02:00
|
|
|
- this.getHandle().setRespawnPosition(((CraftWorld) location.getWorld()).getHandle().dimension(), CraftLocation.toBlockPosition(location), location.getYaw(), override, false, PlayerSpawnChangeEvent.Cause.PLUGIN);
|
2024-01-19 13:22:30 +01:00
|
|
|
+ this.getHandle().setRespawnPosition(((CraftWorld) location.getWorld()).getHandle().dimension(), CraftLocation.toBlockPosition(location), location.getYaw(), override, false, com.destroystokyo.paper.event.player.PlayerSetSpawnEvent.Cause.PLUGIN); // Paper - Add PlayerSetSpawnEvent
|
2021-08-06 22:37:38 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|