mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2026-02-08 03:40:16 +00:00
Start using Java's instanceof pattern matching
Well, not really pattern matching, but it's still an improvement!
This commit is contained in:
@@ -177,9 +177,8 @@ public final class CommandComputerCraft
|
||||
if( world == null || pos == null ) throw TP_NOT_THERE.create();
|
||||
|
||||
Entity entity = context.getSource().getEntityOrException();
|
||||
if( !(entity instanceof ServerPlayer) ) throw TP_NOT_PLAYER.create();
|
||||
if( !(entity instanceof ServerPlayer player) ) throw TP_NOT_PLAYER.create();
|
||||
|
||||
ServerPlayer player = (ServerPlayer) entity;
|
||||
if( player.getCommandSenderWorld() == world )
|
||||
{
|
||||
player.connection.teleport(
|
||||
|
||||
Reference in New Issue
Block a user