Skip to content

Commit

Permalink
spawn_location yaw, steers vehicle NPE fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed May 18, 2022
1 parent bf414b0 commit 80d4a18
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Expand Up @@ -1144,7 +1144,7 @@ public void adjust(Mechanism mechanism) {
// -->
if (mechanism.matches("spawn_location") && mechanism.requireObject(LocationTag.class)) {
LocationTag loc = mechanism.valueAsType(LocationTag.class);
getWorld().setSpawnLocation(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
getWorld().setSpawnLocation(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), loc.getYaw());
}

// <--[mechanism]
Expand Down
Expand Up @@ -43,9 +43,12 @@ public void receivePacket(final Player player, final PacketInResourcePackStatus
public boolean receivePacket(final Player player, final PacketInSteerVehicle steerVehicle, Runnable allow) {
if (PlayerSteersEntityScriptEvent.instance.enabled) {
Runnable process = () -> {
if (!player.isInsideVehicle()) {
return;
}
PlayerSteersEntityScriptEvent event = PlayerSteersEntityScriptEvent.instance;
event.player = PlayerTag.mirrorBukkitPlayer(player);
event.entity = player.isInsideVehicle() ? new EntityTag(player.getVehicle()) : null;
event.entity = new EntityTag(player.getVehicle());
event.sideways = new ElementTag(steerVehicle.getLeftwardInput());
event.forward = new ElementTag(steerVehicle.getForwardInput());
event.jump = new ElementTag(steerVehicle.getJumpInput());
Expand Down

0 comments on commit 80d4a18

Please sign in to comment.