wait, I hadn't amde it to gamemode_id!

oops
This commit is contained in:
Nameless-123 committed 2020-04-21 11:08:40 +02:00
1 parent 2b6a1bf1c5
commit db48a5c061
1 file changed
+4 -4
@@ -893,7 +893,7 @@ public class EntityValue extends Value
throw new InternalExpressionException("'effect' needs either no arguments (clear) or effect name, duration, and optional amplifier, show particles and show icon"); throw new InternalExpressionException("'effect' needs either no arguments (clear) or effect name, duration, and optional amplifier, show particles and show icon");
}); });
put("gamemode", (e,v)->{ put("gamemode_id", (e,v)->{
if(!(e instanceof ServerPlayerEntity)){ if(!(e instanceof ServerPlayerEntity)){
throw new InternalExpressionException("Cannot change the gamemode of non-player entities"); throw new InternalExpressionException("Cannot change the gamemode of non-player entities");
} }
@@ -901,15 +901,15 @@ public class EntityValue extends Value
((ServerPlayerEntity) e).setGameMode(GameMode.SURVIVAL); ((ServerPlayerEntity) e).setGameMode(GameMode.SURVIVAL);
return; return;
} }
if(v.getString()=="creative"){ if(v.readInteger()==0){
((ServerPlayerEntity) e).setGameMode(GameMode.CREATIVE); ((ServerPlayerEntity) e).setGameMode(GameMode.CREATIVE);
return; return;
} }
if(v.getString()=="spectator"){ if(v.readInteger()==0){
((ServerPlayerEntity) e).setGameMode(GameMode.SPECTATOR); ((ServerPlayerEntity) e).setGameMode(GameMode.SPECTATOR);
return; return;
} }
if(v.getString()=="adventure"){ if(v.readInteger()==0){
((ServerPlayerEntity) e).setGameMode(GameMode.ADVENTURE); ((ServerPlayerEntity) e).setGameMode(GameMode.ADVENTURE);
return; return;
} }