1
0
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:
Jonathan Coates
2021-08-08 12:44:56 +01:00
parent e4ced551eb
commit aa857c1be3
40 changed files with 83 additions and 141 deletions

View File

@@ -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(