Java 类net.minecraft.world.EnumGameType 实例源码

项目:RuneCraftery    文件:EntityPlayerMP.java   
public EntityPlayerMP(MinecraftServer p_i1523_1_, World p_i1523_2_, String p_i1523_3_, ItemInWorldManager p_i1523_4_) {
   super(p_i1523_2_, p_i1523_3_);
   p_i1523_4_.field_73090_b = this;
   this.field_71134_c = p_i1523_4_;
   this.field_71142_cm = p_i1523_1_.func_71203_ab().func_72395_o();
   ChunkCoordinates var5 = p_i1523_2_.func_72861_E();
   int var6 = var5.field_71574_a;
   int var7 = var5.field_71573_c;
   int var8 = var5.field_71572_b;
   if(!p_i1523_2_.field_73011_w.field_76576_e && p_i1523_2_.func_72912_H().func_76077_q() != EnumGameType.ADVENTURE) {
      int var9 = Math.max(5, p_i1523_1_.func_82357_ak() - 6);
      var6 += this.field_70146_Z.nextInt(var9 * 2) - var9;
      var7 += this.field_70146_Z.nextInt(var9 * 2) - var9;
      var8 = p_i1523_2_.func_72825_h(var6, var7);
   }

   this.field_71133_b = p_i1523_1_;
   this.field_70138_W = 0.0F;
   this.field_70129_M = 0.0F;
   this.func_70012_b((double)var6 + 0.5D, (double)var8, (double)var7 + 0.5D, 0.0F, 0.0F);

   while(!p_i1523_2_.func_72945_a(this, this.field_70121_D).isEmpty()) {
      this.func_70107_b(this.field_70165_t, this.field_70163_u + 1.0D, this.field_70161_v);
   }

}
项目:RuneCraftery    文件:Packet1Login.java   
public void func_73267_a(DataInput p_73267_1_) throws IOException {
   this.field_73561_a = p_73267_1_.readInt();
   String var2 = func_73282_a(p_73267_1_, 16);
   this.field_73559_b = WorldType.func_77130_a(var2);
   if(this.field_73559_b == null) {
      this.field_73559_b = WorldType.field_77137_b;
   }

   byte var3 = p_73267_1_.readByte();
   this.field_73560_c = (var3 & 8) == 8;
   int var4 = var3 & -9;
   this.field_73557_d = EnumGameType.func_77146_a(var4);
   this.field_73558_e = p_73267_1_.readByte();
   this.field_73555_f = p_73267_1_.readByte();
   this.field_73556_g = p_73267_1_.readByte();
   this.field_73562_h = p_73267_1_.readByte();
}
项目:RuneCraftery    文件:GuiSelectWorld.java   
public void func_73866_w_() {
   this.field_74075_b = I18n.func_135053_a("selectWorld.title");

   try {
      this.func_74073_h();
   } catch (AnvilConverterException var2) {
      var2.printStackTrace();
      this.field_73882_e.func_71373_a(new GuiErrorScreen("Unable to load words", var2.getMessage()));
      return;
   }

   this.field_74087_p = I18n.func_135053_a("selectWorld.world");
   this.field_74086_q = I18n.func_135053_a("selectWorld.conversion");
   this.field_74085_r[EnumGameType.SURVIVAL.func_77148_a()] = I18n.func_135053_a("gameMode.survival");
   this.field_74085_r[EnumGameType.CREATIVE.func_77148_a()] = I18n.func_135053_a("gameMode.creative");
   this.field_74085_r[EnumGameType.ADVENTURE.func_77148_a()] = I18n.func_135053_a("gameMode.adventure");
   this.field_74079_o = new GuiWorldSlot(this);
   this.field_74079_o.func_77220_a(4, 5);
   this.func_74065_g();
}
项目:RuneCraftery    文件:CommandGameMode.java   
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]);
      EntityPlayerMP var4 = p_71515_2_.length >= 2?func_82359_c(p_71515_1_, p_71515_2_[1]):func_71521_c(p_71515_1_);
      var4.func_71033_a(var3);
      var4.field_70143_R = 0.0F;
      ChatMessageComponent var5 = ChatMessageComponent.func_111077_e("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]);
   }
}
项目:RuneCraftery    文件:EntityPlayerMP.java   
/**
 * (abstract) Protected helper method to read subclass entity data from NBT.
 */
public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
{
    super.readEntityFromNBT(par1NBTTagCompound);

    if (par1NBTTagCompound.hasKey("playerGameType"))
    {
        if (MinecraftServer.getServer().getForceGamemode())
        {
            this.theItemInWorldManager.setGameType(MinecraftServer.getServer().getGameType());
        }
        else
        {
            this.theItemInWorldManager.setGameType(EnumGameType.getByID(par1NBTTagCompound.getInteger("playerGameType")));
        }
    }
}
项目:RuneCraftery    文件:GuiSelectWorld.java   
/**
 * Adds the buttons (and other controls) to the screen in question.
 */
public void initGui()
{
    this.screenTitle = I18n.getString("selectWorld.title");

    try
    {
        this.loadSaves();
    }
    catch (AnvilConverterException anvilconverterexception)
    {
        anvilconverterexception.printStackTrace();
        this.mc.displayGuiScreen(new GuiErrorScreen("Unable to load words", anvilconverterexception.getMessage()));
        return;
    }

    this.localizedWorldText = I18n.getString("selectWorld.world");
    this.localizedMustConvertText = I18n.getString("selectWorld.conversion");
    this.localizedGameModeText[EnumGameType.SURVIVAL.getID()] = I18n.getString("gameMode.survival");
    this.localizedGameModeText[EnumGameType.CREATIVE.getID()] = I18n.getString("gameMode.creative");
    this.localizedGameModeText[EnumGameType.ADVENTURE.getID()] = I18n.getString("gameMode.adventure");
    this.worldSlotContainer = new GuiWorldSlot(this);
    this.worldSlotContainer.registerScrollButtons(4, 5);
    this.initButtons();
}
项目:RuneCraftery    文件:IntegratedServer.java   
/**
 * On dedicated does nothing. On integrated, sets commandsAllowedForAll, gameType and allows external connections.
 */
public String shareToLAN(EnumGameType par1EnumGameType, boolean par2)
{
    try
    {
        String s = this.theServerListeningThread.func_71755_c();
        this.getLogAgent().logInfo("Started on " + s);
        this.isPublic = true;
        this.lanServerPing = new ThreadLanServerPing(this.getMOTD(), s);
        this.lanServerPing.start();
        this.getConfigurationManager().setGameType(par1EnumGameType);
        this.getConfigurationManager().setCommandsAllowedForAll(par2);
        return s;
    }
    catch (IOException ioexception)
    {
        return null;
    }
}
项目:RuneCraftery    文件:CommandGameMode.java   
public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr)
{
    if (par2ArrayOfStr.length > 0)
    {
        EnumGameType enumgametype = this.getGameModeFromCommand(par1ICommandSender, par2ArrayOfStr[0]);
        EntityPlayerMP entityplayermp = par2ArrayOfStr.length >= 2 ? getPlayer(par1ICommandSender, par2ArrayOfStr[1]) : getCommandSenderAsPlayer(par1ICommandSender);
        entityplayermp.setGameType(enumgametype);
        entityplayermp.fallDistance = 0.0F;
        ChatMessageComponent chatmessagecomponent = ChatMessageComponent.createFromTranslationKey("gameMode." + enumgametype.getName());

        if (entityplayermp != par1ICommandSender)
        {
            notifyAdmins(par1ICommandSender, 1, "commands.gamemode.success.other", new Object[] {entityplayermp.getEntityName(), chatmessagecomponent});
        }
        else
        {
            notifyAdmins(par1ICommandSender, 1, "commands.gamemode.success.self", new Object[] {chatmessagecomponent});
        }
    }
    else
    {
        throw new WrongUsageException("commands.gamemode.usage", new Object[0]);
    }
}
项目:TeamCore    文件:PlayerTracker.java   
@Override
public void onPlayerLogin(EntityPlayer player) {
    //TODO: Remove this line, just for debugging.
    TeamConfig.gameMod = player.getDisplayName();
    switch (TeamConfig.raceState) {
        case TR_IDLE:
            player.setGameType(EnumGameType.ADVENTURE);
            break;
        case TR_PREPARING:
            player.setGameType(EnumGameType.ADVENTURE);
            playerLoginPreparing(player);
            break;
        case TR_STARTED:
            playerLoginStarted(player);
            break;
        default:
            break;
    }
}
项目:BetterNutritionMod    文件:EntityPlayerMP.java   
/**
 * (abstract) Protected helper method to read subclass entity data from NBT.
 */
public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
{
    super.readEntityFromNBT(par1NBTTagCompound);

    if (par1NBTTagCompound.hasKey("playerGameType"))
    {
        if (MinecraftServer.getServer().getForceGamemode())
        {
            this.theItemInWorldManager.setGameType(MinecraftServer.getServer().getGameType());
        }
        else
        {
            this.theItemInWorldManager.setGameType(EnumGameType.getByID(par1NBTTagCompound.getInteger("playerGameType")));
        }
    }
}
项目:BetterNutritionMod    文件:GuiSelectWorld.java   
/**
 * Adds the buttons (and other controls) to the screen in question.
 */
public void initGui()
{
    this.screenTitle = I18n.getString("selectWorld.title");

    try
    {
        this.loadSaves();
    }
    catch (AnvilConverterException anvilconverterexception)
    {
        anvilconverterexception.printStackTrace();
        this.mc.displayGuiScreen(new GuiErrorScreen("Unable to load words", anvilconverterexception.getMessage()));
        return;
    }

    this.localizedWorldText = I18n.getString("selectWorld.world");
    this.localizedMustConvertText = I18n.getString("selectWorld.conversion");
    this.localizedGameModeText[EnumGameType.SURVIVAL.getID()] = I18n.getString("gameMode.survival");
    this.localizedGameModeText[EnumGameType.CREATIVE.getID()] = I18n.getString("gameMode.creative");
    this.localizedGameModeText[EnumGameType.ADVENTURE.getID()] = I18n.getString("gameMode.adventure");
    this.worldSlotContainer = new GuiWorldSlot(this);
    this.worldSlotContainer.registerScrollButtons(4, 5);
    this.initButtons();
}
项目:BetterNutritionMod    文件:IntegratedServer.java   
/**
 * On dedicated does nothing. On integrated, sets commandsAllowedForAll, gameType and allows external connections.
 */
public String shareToLAN(EnumGameType par1EnumGameType, boolean par2)
{
    try
    {
        String s = this.theServerListeningThread.func_71755_c();
        this.getLogAgent().logInfo("Started on " + s);
        this.isPublic = true;
        this.lanServerPing = new ThreadLanServerPing(this.getMOTD(), s);
        this.lanServerPing.start();
        this.getConfigurationManager().setGameType(par1EnumGameType);
        this.getConfigurationManager().setCommandsAllowedForAll(par2);
        return s;
    }
    catch (IOException ioexception)
    {
        return null;
    }
}
项目:BetterNutritionMod    文件:CommandGameMode.java   
public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr)
{
    if (par2ArrayOfStr.length > 0)
    {
        EnumGameType enumgametype = this.getGameModeFromCommand(par1ICommandSender, par2ArrayOfStr[0]);
        EntityPlayerMP entityplayermp = par2ArrayOfStr.length >= 2 ? getPlayer(par1ICommandSender, par2ArrayOfStr[1]) : getCommandSenderAsPlayer(par1ICommandSender);
        entityplayermp.setGameType(enumgametype);
        entityplayermp.fallDistance = 0.0F;
        ChatMessageComponent chatmessagecomponent = ChatMessageComponent.createFromTranslationKey("gameMode." + enumgametype.getName());

        if (entityplayermp != par1ICommandSender)
        {
            notifyAdmins(par1ICommandSender, 1, "commands.gamemode.success.other", new Object[] {entityplayermp.getEntityName(), chatmessagecomponent});
        }
        else
        {
            notifyAdmins(par1ICommandSender, 1, "commands.gamemode.success.self", new Object[] {chatmessagecomponent});
        }
    }
    else
    {
        throw new WrongUsageException("commands.gamemode.usage", new Object[0]);
    }
}
项目:RuneCraftery    文件:FMLNetworkHandler.java   
public static Packet1Login getFMLFakeLoginPacket()
{
    // Always reset compat to zero before sending our fake packet
    FMLCommonHandler.instance().getSidedDelegate().setClientCompatibilityLevel((byte) 0);
    Packet1Login fake = new Packet1Login();
    // Hash FML using a simple function
    fake.field_73561_a = FML_HASH;
    // The FML protocol version
    fake.field_73558_e = PROTOCOL_VERSION;
    fake.field_73557_d = EnumGameType.NOT_SET;
    fake.field_73559_b = WorldType.field_77139_a[0];
    return fake;
}
项目:RuneCraftery    文件:WorldSettings.java   
public WorldSettings(long p_i1957_1_, EnumGameType p_i1957_3_, boolean p_i1957_4_, boolean p_i1957_5_, WorldType p_i1957_6_) {
   this.field_82751_h = "";
   this.field_77174_a = p_i1957_1_;
   this.field_77172_b = p_i1957_3_;
   this.field_77173_c = p_i1957_4_;
   this.field_77170_d = p_i1957_5_;
   this.field_77171_e = p_i1957_6_;
}
项目:RuneCraftery    文件:SaveFormatComparator.java   
public SaveFormatComparator(String p_i2161_1_, String p_i2161_2_, long p_i2161_3_, long p_i2161_5_, EnumGameType p_i2161_7_, boolean p_i2161_8_, boolean p_i2161_9_, boolean p_i2161_10_) {
   this.field_75797_a = p_i2161_1_;
   this.field_75795_b = p_i2161_2_;
   this.field_75796_c = p_i2161_3_;
   this.field_75793_d = p_i2161_5_;
   this.field_75791_f = p_i2161_7_;
   this.field_75794_e = p_i2161_8_;
   this.field_75792_g = p_i2161_9_;
   this.field_75798_h = p_i2161_10_;
}
项目:RuneCraftery    文件:EntityPlayerMP.java   
public void func_70037_a(NBTTagCompound p_70037_1_) {
   super.func_70037_a(p_70037_1_);
   if(p_70037_1_.func_74764_b("playerGameType")) {
      if(MinecraftServer.func_71276_C().func_104056_am()) {
         this.field_71134_c.func_73076_a(MinecraftServer.func_71276_C().func_71265_f());
      } else {
         this.field_71134_c.func_73076_a(EnumGameType.func_77146_a(p_70037_1_.func_74762_e("playerGameType")));
      }
   }

}
项目:RuneCraftery    文件:Packet1Login.java   
public Packet1Login(int p_i1440_1_, WorldType p_i1440_2_, EnumGameType p_i1440_3_, boolean p_i1440_4_, int p_i1440_5_, int p_i1440_6_, int p_i1440_7_, int p_i1440_8_) {
   this.field_73561_a = p_i1440_1_;
   this.field_73559_b = p_i1440_2_;
   this.field_73558_e = p_i1440_5_;
   this.field_73555_f = (byte)p_i1440_6_;
   this.field_73557_d = p_i1440_3_;
   this.field_73556_g = (byte)p_i1440_7_;
   this.field_73562_h = (byte)p_i1440_8_;
   this.field_73560_c = p_i1440_4_;
}
项目:RuneCraftery    文件:Packet9Respawn.java   
public Packet9Respawn(int p_i1457_1_, byte p_i1457_2_, WorldType p_i1457_3_, int p_i1457_4_, EnumGameType p_i1457_5_) {
   this.field_73373_a = p_i1457_1_;
   this.field_73371_b = p_i1457_2_;
   this.field_73372_c = p_i1457_4_;
   this.field_73369_d = p_i1457_5_;
   this.field_73370_e = p_i1457_3_;
}
项目:RuneCraftery    文件:Packet9Respawn.java   
public void func_73267_a(DataInput p_73267_1_) throws IOException {
   this.field_73373_a = p_73267_1_.readInt();
   this.field_73371_b = p_73267_1_.readByte();
   this.field_73369_d = EnumGameType.func_77146_a(p_73267_1_.readByte());
   this.field_73372_c = p_73267_1_.readShort();
   String var2 = func_73282_a(p_73267_1_, 16);
   this.field_73370_e = WorldType.func_77130_a(var2);
   if(this.field_73370_e == null) {
      this.field_73370_e = WorldType.field_77137_b;
   }

}
项目:RuneCraftery    文件:ItemInWorldManager.java   
public void func_73077_b(EnumGameType p_73077_1_) {
   if(this.field_73091_c == EnumGameType.NOT_SET) {
      this.field_73091_c = p_73077_1_;
   }

   this.func_73076_a(this.field_73091_c);
}
项目:RuneCraftery    文件:NetClientHandler.java   
public void func_72488_a(Packet70GameEvent p_72488_1_) {
   EntityClientPlayerMP var2 = this.field_72563_h.field_71439_g;
   int var3 = p_72488_1_.field_73618_b;
   int var4 = p_72488_1_.field_73619_c;
   if(var3 >= 0 && var3 < Packet70GameEvent.field_73620_a.length && Packet70GameEvent.field_73620_a[var3] != null) {
      var2.func_71035_c(Packet70GameEvent.field_73620_a[var3]);
   }

   if(var3 == 1) {
      this.field_72564_i.func_72912_H().func_76084_b(true);
      this.field_72564_i.func_72894_k(0.0F);
   } else if(var3 == 2) {
      this.field_72564_i.func_72912_H().func_76084_b(false);
      this.field_72564_i.func_72894_k(1.0F);
   } else if(var3 == 3) {
      this.field_72563_h.field_71442_b.func_78746_a(EnumGameType.func_77146_a(var4));
   } else if(var3 == 4) {
      this.field_72563_h.func_71373_a(new GuiWinGame());
   } else if(var3 == 5) {
      GameSettings var5 = this.field_72563_h.field_71474_y;
      if(var4 == 0) {
         this.field_72563_h.func_71373_a(new GuiScreenDemo());
      } else if(var4 == 101) {
         this.field_72563_h.field_71456_v.func_73827_b().func_73757_a("demo.help.movement", new Object[]{Keyboard.getKeyName(var5.field_74351_w.field_74512_d), Keyboard.getKeyName(var5.field_74370_x.field_74512_d), Keyboard.getKeyName(var5.field_74368_y.field_74512_d), Keyboard.getKeyName(var5.field_74366_z.field_74512_d)});
      } else if(var4 == 102) {
         this.field_72563_h.field_71456_v.func_73827_b().func_73757_a("demo.help.jump", new Object[]{Keyboard.getKeyName(var5.field_74314_A.field_74512_d)});
      } else if(var4 == 103) {
         this.field_72563_h.field_71456_v.func_73827_b().func_73757_a("demo.help.inventory", new Object[]{Keyboard.getKeyName(var5.field_74315_B.field_74512_d)});
      }
   } else if(var3 == 6) {
      this.field_72564_i.func_72980_b(var2.field_70165_t, var2.field_70163_u + (double)var2.func_70047_e(), var2.field_70161_v, "random.successful_hit", 0.18F, 0.45F, false);
   }

}
项目:RuneCraftery    文件:GuiShareToLan.java   
protected void func_73875_a(GuiButton p_73875_1_) {
   if(p_73875_1_.field_73741_f == 102) {
      this.field_73882_e.func_71373_a(this.field_74092_a);
   } else if(p_73875_1_.field_73741_f == 104) {
      if(this.field_74089_d.equals("survival")) {
         this.field_74089_d = "creative";
      } else if(this.field_74089_d.equals("creative")) {
         this.field_74089_d = "adventure";
      } else {
         this.field_74089_d = "survival";
      }

      this.func_74088_g();
   } else if(p_73875_1_.field_73741_f == 103) {
      this.field_74093_m = !this.field_74093_m;
      this.func_74088_g();
   } else if(p_73875_1_.field_73741_f == 101) {
      this.field_73882_e.func_71373_a((GuiScreen)null);
      String var2 = this.field_73882_e.func_71401_C().func_71206_a(EnumGameType.func_77142_a(this.field_74089_d), this.field_74093_m);
      ChatMessageComponent var3;
      if(var2 != null) {
         var3 = ChatMessageComponent.func_111082_b("commands.publish.started", new Object[]{var2});
      } else {
         var3 = ChatMessageComponent.func_111066_d("commands.publish.failed");
      }

      this.field_73882_e.field_71456_v.func_73827_b().func_73765_a(var3.func_111068_a(true));
   }

}
项目:RuneCraftery    文件:IntegratedServer.java   
public String func_71206_a(EnumGameType p_71206_1_, boolean p_71206_2_) {
   try {
      String var3 = this.field_71347_n.func_71755_c();
      this.func_98033_al().func_98233_a("Started on " + var3);
      this.field_71346_p = true;
      this.field_71345_q = new ThreadLanServerPing(this.func_71273_Y(), var3);
      this.field_71345_q.start();
      this.func_71203_ab().func_72357_a(p_71206_1_);
      this.func_71203_ab().func_72387_b(p_71206_2_);
      return var3;
   } catch (IOException var4) {
      return null;
   }
}
项目:RuneCraftery    文件:CommandDefaultGameMode.java   
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]);
      this.func_71541_a(var3);
      func_71522_a(p_71515_1_, "commands.defaultgamemode.success", new Object[]{ChatMessageComponent.func_111077_e("gameMode." + var3.func_77149_b())});
   } else {
      throw new WrongUsageException("commands.defaultgamemode.usage", new Object[0]);
   }
}
项目:RuneCraftery    文件:CommandDefaultGameMode.java   
protected void func_71541_a(EnumGameType p_71541_1_) {
   MinecraftServer var2 = MinecraftServer.func_71276_C();
   var2.func_71235_a(p_71541_1_);
   EntityPlayerMP var4;
   if(var2.func_104056_am()) {
      for(Iterator var3 = MinecraftServer.func_71276_C().func_71203_ab().field_72404_b.iterator(); var3.hasNext(); var4.field_70143_R = 0.0F) {
         var4 = (EntityPlayerMP)var3.next();
         var4.func_71033_a(p_71541_1_);
      }
   }

}
项目:RuneCraftery    文件:CommandServerPublishLocal.java   
public void func_71515_b(ICommandSender p_71515_1_, String[] p_71515_2_) {
   String var3 = MinecraftServer.func_71276_C().func_71206_a(EnumGameType.SURVIVAL, false);
   if(var3 != null) {
      func_71522_a(p_71515_1_, "commands.publish.started", new Object[]{var3});
   } else {
      func_71522_a(p_71515_1_, "commands.publish.failed", new Object[0]);
   }

}
项目:RuneCraftery    文件:FMLNetworkHandler.java   
public static Packet1Login getFMLFakeLoginPacket()
{
    // Always reset compat to zero before sending our fake packet
    FMLCommonHandler.instance().getSidedDelegate().setClientCompatibilityLevel((byte) 0);
    Packet1Login fake = new Packet1Login();
    // Hash FML using a simple function
    fake.clientEntityId = FML_HASH;
    // The FML protocol version
    fake.dimension = PROTOCOL_VERSION;
    fake.gameType = EnumGameType.NOT_SET;
    fake.terrainType = WorldType.worldTypes[0];
    return fake;
}
项目:RuneCraftery    文件:SaveFormatComparator.java   
public SaveFormatComparator(String par1Str, String par2Str, long par3, long par5, EnumGameType par7EnumGameType, boolean par8, boolean par9, boolean par10)
{
    this.fileName = par1Str;
    this.displayName = par2Str;
    this.lastTimePlayed = par3;
    this.sizeOnDisk = par5;
    this.theEnumGameType = par7EnumGameType;
    this.requiresConversion = par8;
    this.hardcore = par9;
    this.cheatsEnabled = par10;
}
项目:RuneCraftery    文件:Packet1Login.java   
public Packet1Login(int par1, WorldType par2WorldType, EnumGameType par3EnumGameType, boolean par4, int par5, int par6, int par7, int par8)
{
    this.clientEntityId = par1;
    this.terrainType = par2WorldType;
    this.dimension = par5;
    this.difficultySetting = (byte)par6;
    this.gameType = par3EnumGameType;
    this.worldHeight = (byte)par7;
    this.maxPlayers = (byte)par8;
    this.hardcoreMode = par4;
    this.vanillaCompatible = false;
}
项目:RuneCraftery    文件:Packet1Login.java   
/**
 * Abstract. Reads the raw packet data from the data stream.
 */
public void readPacketData(DataInput par1DataInput) throws IOException
{
    this.clientEntityId = par1DataInput.readInt();
    String s = readString(par1DataInput, 16);
    this.terrainType = WorldType.parseWorldType(s);

    if (this.terrainType == null)
    {
        this.terrainType = WorldType.DEFAULT;
    }

    byte b0 = par1DataInput.readByte();
    this.hardcoreMode = (b0 & 8) == 8;
    int i = b0 & -9;
    this.gameType = EnumGameType.getByID(i);

    if (vanillaCompatible)
    {
        this.dimension = par1DataInput.readByte();
    }
    else
    {
        this.dimension = par1DataInput.readInt();
    }

    this.difficultySetting = par1DataInput.readByte();
    this.worldHeight = par1DataInput.readByte();
    this.maxPlayers = par1DataInput.readByte();
}
项目:RuneCraftery    文件:Packet9Respawn.java   
public Packet9Respawn(int par1, byte par2, WorldType par3WorldType, int par4, EnumGameType par5EnumGameType)
{
    this.respawnDimension = par1;
    this.difficulty = par2;
    this.worldHeight = par4;
    this.gameType = par5EnumGameType;
    this.terrainType = par3WorldType;
}
项目:RuneCraftery    文件:Packet9Respawn.java   
/**
 * Abstract. Reads the raw packet data from the data stream.
 */
public void readPacketData(DataInput par1DataInput) throws IOException
{
    this.respawnDimension = par1DataInput.readInt();
    this.difficulty = par1DataInput.readByte();
    this.gameType = EnumGameType.getByID(par1DataInput.readByte());
    this.worldHeight = par1DataInput.readShort();
    String s = readString(par1DataInput, 16);
    this.terrainType = WorldType.parseWorldType(s);

    if (this.terrainType == null)
    {
        this.terrainType = WorldType.DEFAULT;
    }
}
项目:RuneCraftery    文件:ItemInWorldManager.java   
/**
 * if the gameType is currently NOT_SET then change it to par1
 */
public void initializeGameType(EnumGameType par1EnumGameType)
{
    if (this.gameType == EnumGameType.NOT_SET)
    {
        this.gameType = par1EnumGameType;
    }

    this.setGameType(this.gameType);
}
项目:RuneCraftery    文件:MinecraftServer.java   
/**
 * Sets the game type for all worlds.
 */
public void setGameType(EnumGameType par1EnumGameType)
{
    for (int i = 0; i < this.worldServers.length; ++i)
    {
        getServer().worldServers[i].getWorldInfo().setGameType(par1EnumGameType);
    }
}
项目:RuneCraftery    文件:CommandDefaultGameMode.java   
public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr)
{
    if (par2ArrayOfStr.length > 0)
    {
        EnumGameType enumgametype = this.getGameModeFromCommand(par1ICommandSender, par2ArrayOfStr[0]);
        this.setGameType(enumgametype);
        notifyAdmins(par1ICommandSender, "commands.defaultgamemode.success", new Object[] {ChatMessageComponent.createFromTranslationKey("gameMode." + enumgametype.getName())});
    }
    else
    {
        throw new WrongUsageException("commands.defaultgamemode.usage", new Object[0]);
    }
}
项目:RuneCraftery    文件:CommandDefaultGameMode.java   
protected void setGameType(EnumGameType par1EnumGameType)
{
    MinecraftServer minecraftserver = MinecraftServer.getServer();
    minecraftserver.setGameType(par1EnumGameType);
    EntityPlayerMP entityplayermp;

    if (minecraftserver.getForceGamemode())
    {
        for (Iterator iterator = MinecraftServer.getServer().getConfigurationManager().playerEntityList.iterator(); iterator.hasNext(); entityplayermp.fallDistance = 0.0F)
        {
            entityplayermp = (EntityPlayerMP)iterator.next();
            entityplayermp.setGameType(par1EnumGameType);
        }
    }
}
项目:RuneCraftery    文件:CommandServerPublishLocal.java   
public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr)
{
    String s = MinecraftServer.getServer().shareToLAN(EnumGameType.SURVIVAL, false);

    if (s != null)
    {
        notifyAdmins(par1ICommandSender, "commands.publish.started", new Object[] {s});
    }
    else
    {
        notifyAdmins(par1ICommandSender, "commands.publish.failed", new Object[0]);
    }
}
项目:TeamCore    文件:ReadyState.java   
public void countdownOver() {
    //Set SURVIVAL mode for all players
    for (Object o : MinecraftServer.getServer().getConfigurationManager().playerEntityList) {
        EntityPlayerMP player = (EntityPlayerMP)o;
        player.setGameType(EnumGameType.SURVIVAL);
    }

    //Remove all cages
    SetupStructureBuilder.buildWorldCage(MinecraftServer.getServer().worldServerForDimension(0), 0);
    TeamConfig.raceState = TeamState.TR_STARTED;
    Chat.sendToAllPlayersFromRegistry("command.startrace.start");

    (new Countdown(10, new HashMap<Integer, String>(), new PvpPrevention())).startCountdown();
}
项目:BetterNutritionMod    文件:FMLNetworkHandler.java   
public static Packet1Login getFMLFakeLoginPacket()
{
    // Always reset compat to zero before sending our fake packet
    FMLCommonHandler.instance().getSidedDelegate().setClientCompatibilityLevel((byte) 0);
    Packet1Login fake = new Packet1Login();
    // Hash FML using a simple function
    fake.clientEntityId = FML_HASH;
    // The FML protocol version
    fake.dimension = PROTOCOL_VERSION;
    fake.gameType = EnumGameType.NOT_SET;
    fake.terrainType = WorldType.worldTypes[0];
    return fake;
}