Skip to content

Commit 73dca00

Browse files
authored
Add yaw and pitch to CommandSourceStack#getBukkitLocation() (#8167)
1 parent a76a1ab commit 73dca00

3 files changed

+8
-7
lines changed

patches/server/0298-Implement-Brigadier-Mojang-API.patch

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ index 6dbac0f93481256dd57e76630ae9eea9d5c56849..e260462933a9f7065b2360e6bf9e4ee5
2222
implementation("org.jline:jline-terminal-jansi:3.21.0")
2323
implementation("net.minecrell:terminalconsoleappender:1.3.0")
2424
diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java
25-
index cd7c33862c7e2e3895efce8a9675aa6a07a8053f..0b8d8b9875acf4c0a6bd47941ff57d01285dd507 100644
25+
index cd7c33862c7e2e3895efce8a9675aa6a07a8053f..08cdd5807237c709accc989718178bc25428eb74 100644
2626
--- a/src/main/java/net/minecraft/commands/CommandSourceStack.java
2727
+++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java
2828
@@ -36,7 +36,7 @@ import net.minecraft.world.phys.Vec2;
@@ -34,7 +34,7 @@ index cd7c33862c7e2e3895efce8a9675aa6a07a8053f..0b8d8b9875acf4c0a6bd47941ff57d01
3434

3535
public static final SimpleCommandExceptionType ERROR_NOT_PLAYER = new SimpleCommandExceptionType(Component.translatable("permissions.requires.player"));
3636
public static final SimpleCommandExceptionType ERROR_NOT_ENTITY = new SimpleCommandExceptionType(Component.translatable("permissions.requires.entity"));
37-
@@ -163,6 +163,25 @@ public class CommandSourceStack implements SharedSuggestionProvider {
37+
@@ -163,6 +163,26 @@ public class CommandSourceStack implements SharedSuggestionProvider {
3838
return this.entity != null ? this.entity.asChatSender() : ChatSender.system(this.getDisplayName());
3939
}
4040

@@ -53,7 +53,8 @@ index cd7c33862c7e2e3895efce8a9675aa6a07a8053f..0b8d8b9875acf4c0a6bd47941ff57d01
5353
+ public org.bukkit.Location getBukkitLocation() {
5454
+ Vec3 pos = getPosition();
5555
+ org.bukkit.World world = getBukkitWorld();
56-
+ return world != null && pos != null ? new org.bukkit.Location(world, pos.x, pos.y, pos.z) : null;
56+
+ Vec2 rot = getRotation();
57+
+ return world != null && pos != null ? new org.bukkit.Location(world, pos.x, pos.y, pos.z, rot != null ? rot.x : 0, rot != null ? rot.y : 0) : null;
5758
+ }
5859
+ // Paper end
5960
+

patches/server/0466-Thread-Safe-Vanilla-Command-permission-checking.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ index a4f97c1df86c574af9b9824a38034a3d76d6e357..d65defd5fc54086a969c568b93dfb05f
2626
}
2727
// CraftBukkit end
2828
diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java
29-
index 0b8d8b9875acf4c0a6bd47941ff57d01285dd507..3ad9f1327cd99e16e8eca86d72cb8a57f28b245e 100644
29+
index 08cdd5807237c709accc989718178bc25428eb74..c948b9387e14d7f8bb2cd6236f513d57286d9301 100644
3030
--- a/src/main/java/net/minecraft/commands/CommandSourceStack.java
3131
+++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java
3232
@@ -55,7 +55,7 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy
@@ -38,7 +38,7 @@ index 0b8d8b9875acf4c0a6bd47941ff57d01285dd507..3ad9f1327cd99e16e8eca86d72cb8a57
3838

3939
public CommandSourceStack(CommandSource output, Vec3 pos, Vec2 rot, ServerLevel world, int level, String name, Component displayName, MinecraftServer server, @Nullable Entity entity) {
4040
this(output, pos, rot, world, level, name, displayName, server, entity, false, (commandcontext, flag, j) -> {
41-
@@ -185,9 +185,11 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy
41+
@@ -186,9 +186,11 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy
4242
@Override
4343
public boolean hasPermission(int level) {
4444
// CraftBukkit start

patches/server/0815-Fix-entity-type-tags-suggestions-in-selectors.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ when if this was fixed on the client, that wouldn't be needed.
1010
Mojira Issue: https://bugs.mojang.com/browse/MC-235045
1111

1212
diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java
13-
index 3ad9f1327cd99e16e8eca86d72cb8a57f28b245e..0148cadbeb41a882a05d982f0b34770b2829a04a 100644
13+
index c948b9387e14d7f8bb2cd6236f513d57286d9301..8762a5d88e80bb68872652a4490e76a669e17c22 100644
1414
--- a/src/main/java/net/minecraft/commands/CommandSourceStack.java
1515
+++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java
16-
@@ -366,4 +366,20 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy
16+
@@ -367,4 +367,20 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy
1717
return this.source.getBukkitSender(this);
1818
}
1919
// CraftBukkit end

0 commit comments

Comments
 (0)