forked from JorelAli/CommandAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make NativeProxyCommandSender extend CraftBukkit class ProxiedNativeC…
…ommandSender so VanillaCommandWrapper can handle it Fixes JorelAli#477
- Loading branch information
1 parent
5e546d7
commit 72de966
Showing
23 changed files
with
409 additions
and
365 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...api-bukkit-1.15/src/main/java/dev/jorel/commandapi/nms/NativeProxyCommandSender_1_15.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package dev.jorel.commandapi.nms; | ||
|
||
import dev.jorel.commandapi.CommandAPIBukkit; | ||
import dev.jorel.commandapi.wrappers.NativeProxyCommandSender; | ||
import net.minecraft.server.v1_15_R1.CommandListenerWrapper; | ||
import net.minecraft.server.v1_15_R1.Vec2F; | ||
import net.minecraft.server.v1_15_R1.Vec3D; | ||
import org.bukkit.Location; | ||
import org.bukkit.World; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.craftbukkit.v1_15_R1.command.ProxiedNativeCommandSender; | ||
|
||
public class NativeProxyCommandSender_1_15 extends ProxiedNativeCommandSender implements NativeProxyCommandSender { | ||
private final World world; | ||
private final Location location; | ||
|
||
public NativeProxyCommandSender_1_15(CommandListenerWrapper clw, CommandSender caller, CommandSender callee) { | ||
super(clw, caller, callee); | ||
|
||
Vec3D pos = clw.getPosition(); | ||
Vec2F rot = clw.i(); | ||
this.world = CommandAPIBukkit.get().getWorldForCSS(clw); | ||
this.location = new Location(this.world, pos.getX(), pos.getY(), pos.getZ(), rot.j, rot.i); | ||
} | ||
|
||
@Override | ||
public Location getLocation() { | ||
return location; | ||
} | ||
|
||
@Override | ||
public World getWorld() { | ||
return world; | ||
} | ||
} |
Oops, something went wrong.