public void func_71515_b(ICommandSender p_71515_1_, String[] p_71515_2_) { if (p_71515_2_.length > 0) { EnumGameType var3 = this.func_71539_b(p_71515_1_, p_71515_2_[0]); EntityPlayer var4 = p_71515_2_.length >= 2 ? this.func_71540_a(p_71515_2_[1]) : func_71521_c(p_71515_1_); var4.func_71033_a(var3); String var5 = StatCollector.func_74838_a("gameMode." + var3.func_77149_b()); if (var4 != p_71515_1_) { func_71524_a( p_71515_1_, 1, "commands.gamemode.success.other", new Object[] {var4.func_70023_ak(), var5}); } else { func_71524_a(p_71515_1_, 1, "commands.gamemode.success.self", new Object[] {var5}); } } else { throw new WrongUsageException("commands.gamemode.usage", new Object[0]); } }
protected EnumGameType func_71539_b(ICommandSender p_71539_1_, String p_71539_2_) { return !p_71539_2_.equalsIgnoreCase(EnumGameType.SURVIVAL.func_77149_b()) && !p_71539_2_.equalsIgnoreCase("s") ? (!p_71539_2_.equalsIgnoreCase(EnumGameType.CREATIVE.func_77149_b()) && !p_71539_2_.equalsIgnoreCase("c") ? (!p_71539_2_.equalsIgnoreCase(EnumGameType.ADVENTURE.func_77149_b()) && !p_71539_2_.equalsIgnoreCase("a") ? WorldSettings.func_77161_a( func_71532_a(p_71539_1_, p_71539_2_, 0, EnumGameType.values().length - 2)) : EnumGameType.ADVENTURE) : EnumGameType.CREATIVE) : EnumGameType.SURVIVAL; }
public WorldInfo(NBTTagCompound p_i3914_1_) { this.field_76098_b = WorldType.field_77137_b; this.field_82576_c = ""; this.field_82577_x = new GameRules(); this.field_76100_a = p_i3914_1_.func_74763_f("RandomSeed"); if (p_i3914_1_.func_74764_b("generatorName")) { String var2 = p_i3914_1_.func_74779_i("generatorName"); this.field_76098_b = WorldType.func_77130_a(var2); if (this.field_76098_b == null) { this.field_76098_b = WorldType.field_77137_b; } else if (this.field_76098_b.func_77125_e()) { int var3 = 0; if (p_i3914_1_.func_74764_b("generatorVersion")) { var3 = p_i3914_1_.func_74762_e("generatorVersion"); } this.field_76098_b = this.field_76098_b.func_77132_a(var3); } if (p_i3914_1_.func_74764_b("generatorOptions")) { this.field_82576_c = p_i3914_1_.func_74779_i("generatorOptions"); } } this.field_76113_q = EnumGameType.func_77146_a(p_i3914_1_.func_74762_e("GameType")); if (p_i3914_1_.func_74764_b("MapFeatures")) { this.field_76112_r = p_i3914_1_.func_74767_n("MapFeatures"); } else { this.field_76112_r = true; } this.field_76099_c = p_i3914_1_.func_74762_e("SpawnX"); this.field_76096_d = p_i3914_1_.func_74762_e("SpawnY"); this.field_76097_e = p_i3914_1_.func_74762_e("SpawnZ"); this.field_82575_g = p_i3914_1_.func_74763_f("Time"); if (p_i3914_1_.func_74764_b("DayTime")) { this.field_76094_f = p_i3914_1_.func_74763_f("DayTime"); } else { this.field_76094_f = this.field_82575_g; } this.field_76095_g = p_i3914_1_.func_74763_f("LastPlayed"); this.field_76107_h = p_i3914_1_.func_74763_f("SizeOnDisk"); this.field_76106_k = p_i3914_1_.func_74779_i("LevelName"); this.field_76103_l = p_i3914_1_.func_74762_e("version"); this.field_76101_n = p_i3914_1_.func_74762_e("rainTime"); this.field_76104_m = p_i3914_1_.func_74767_n("raining"); this.field_76114_p = p_i3914_1_.func_74762_e("thunderTime"); this.field_76102_o = p_i3914_1_.func_74767_n("thundering"); this.field_76111_s = p_i3914_1_.func_74767_n("hardcore"); if (p_i3914_1_.func_74764_b("initialized")) { this.field_76109_u = p_i3914_1_.func_74767_n("initialized"); } else { this.field_76109_u = true; } if (p_i3914_1_.func_74764_b("allowCommands")) { this.field_76110_t = p_i3914_1_.func_74767_n("allowCommands"); } else { this.field_76110_t = this.field_76113_q == EnumGameType.CREATIVE; } if (p_i3914_1_.func_74764_b("Player")) { this.field_76108_i = p_i3914_1_.func_74775_l("Player"); this.field_76105_j = this.field_76108_i.func_74762_e("Dimension"); } if (p_i3914_1_.func_74764_b("GameRules")) { this.field_82577_x.func_82768_a(p_i3914_1_.func_74775_l("GameRules")); } }