Package cpw.mods.fml.relauncher

Examples of cpw.mods.fml.relauncher.Side


    private static int langLoad()
    {
        int unofficialLanguages = 0;
        try
        {
            Side side = MinecraftServer.getServer().isDedicatedServer() ? Side.SERVER : Side.CLIENT;
            for (File langFile : ListFilesInMinecraftDir(side, "mods" + File.separator + "ElectricExpansionLanguages"))
            {
                if (langFile.exists())
                {
                    String name = langFile.getName();
View Full Code Here


public class EventHandlerNetwork {
 
  @SubscribeEvent   
  public void playerLoggedInEvent (PlayerEvent.PlayerLoggedInEvent event)    {   
    Side side = FMLCommonHandler.instance().getEffectiveSide();       
    if (side == Side.SERVER)        {
      syncBaubles(event.player);
    }
  }
View Full Code Here

        return NetworkRegistry.INSTANCE.getChannel(channelName, side);
    }

    public static void assignHandler(Object channelKey, ICustomPacketHandler handler) {
        String channelName = channelName(channelKey);
        Side side = handler instanceof IServerPacketHandler ? Side.SERVER : Side.CLIENT;
        FMLEmbeddedChannel channel = getOrCreateChannel(channelName, side);
        channel.attr(cclHandler).get().handlers.put(side, side == Side.SERVER ? new ServerInboundHandler(handler) : new ClientInboundHandler(handler));
    }
View Full Code Here

    }

    @Override
    public void run()
    {
        final Side sideToCheck = FMLCommonHandler.instance().getSide();

        if (sideToCheck == null)
        {
            return;
        }

        while (this.count < 3 && remoteBuildVer == 0)
        {
            try
            {
                final URL url = new URL("http://micdoodle8.com/galacticraft/version.html");
                final HttpURLConnection http = (HttpURLConnection) url.openConnection();
                http.addRequestProperty("User-Agent", "Mozilla/4.76");
                final BufferedReader in = new BufferedReader(new InputStreamReader(http.getInputStream()));
                String str;
                String str2[] = null;

                while ((str = in.readLine()) != null)
                {

                    if (str.contains("Version"))
                    {
                        str = str.replace("Version=", "");

                        str2 = str.split("#");

                        if (str2.length == 3)
                        {
                            remoteMajVer = Integer.parseInt(str2[0]);
                            remoteMinVer = Integer.parseInt(str2[1]);
                            remoteBuildVer = Integer.parseInt(str2[2]);
                        }

                        if (remoteMajVer > Constants.LOCALMAJVERSION || remoteMajVer == Constants.LOCALMAJVERSION && remoteMinVer > Constants.LOCALMINVERSION || remoteMajVer == Constants.LOCALMAJVERSION && remoteMinVer == Constants.LOCALMINVERSION && remoteBuildVer > Constants.LOCALBUILDVERSION)
                        {
                            Thread.sleep(5000);

                            if (sideToCheck.equals(Side.CLIENT))
                            {
                                FMLClientHandler.instance().getClient().thePlayer.addChatMessage(new ChatComponentText(EnumColor.GREY + "New " + EnumColor.DARK_AQUA + "Galacticraft" + EnumColor.GREY + " version available! v" + String.valueOf(remoteMajVer) + "." + String.valueOf(remoteMinVer) + "." + String.valueOf(remoteBuildVer) + EnumColor.DARK_BLUE + " http://micdoodle8.com/"));
                            }
                            else if (sideToCheck.equals(Side.SERVER))
                            {
                                GCLog.severe("New Galacticraft version available! v" + String.valueOf(remoteMajVer) + "." + String.valueOf(remoteMinVer) + "." + String.valueOf(remoteBuildVer) + " http://micdoodle8.com/");
                            }
                        }
                    }
View Full Code Here

 
  public void mountGun(EntityPlayer player, boolean mounting)
  {
    if(player == null)
      return;
    Side side = worldObj.isRemote ? Side.CLIENT : Side.SERVER;
    if(PlayerHandler.getPlayerData(player, side) == null)
      return;
    if(mounting)
    {
      gunner = player;
View Full Code Here

  private static Side getEffectiveSide() {
    Thread thr = Thread.currentThread();
    if(threadSideMap.containsKey(thr)) {
      return threadSideMap.get(thr);
    }
    Side side = getEffectiveSide(thr);
    if(threadSideMap.size() > 50) {
      threadSideMap.clear();
    }
    threadSideMap.put(thr, side);
    return side;
View Full Code Here

         */
    }

    public void recalculateHealth (EntityPlayer player, TPlayerStats stats)
    {
        Side side = FMLCommonHandler.instance().getEffectiveSide();

        if (inventory[4] != null || inventory[5] != null || inventory[6] != null)
        {
            int bonusHP = 0;
            for (int i = 4; i < 7; i++)
View Full Code Here

        if (PHConstruct.keepLevels)
            entityplayer.experienceLevel = stats.level;
        if (PHConstruct.keepHunger)
            entityplayer.getFoodStats().addStats(-1 * (20 - stats.hunger), 0);

        Side side = FMLCommonHandler.instance().getEffectiveSide();
        if (side == Side.CLIENT)
        {
            // TProxyClient.controlInstance.resetControls();
            if (PHConstruct.keepHunger)
                entityplayer.getFoodStats().setFoodLevel(stats.hunger);
View Full Code Here

    volume2 = readManual("/assets/tinker/manuals/materials.xml", dbFactory);
    smelter = readManual("/assets/tinker/manuals/smeltery.xml", dbFactory);*/

    public ManualInfo()
    {
        Side side = FMLCommonHandler.instance().getEffectiveSide();
        beginner = initManual(beginner, "tconstruct.manual.beginner", "\u00a7o" + StatCollector.translateToLocal("manual1.tooltip"), side == Side.CLIENT ? TProxyClient.volume1 : null, "tinker:tinkerbook_diary");
        toolStation = initManual(toolStation, "tconstruct.manual.toolstation", "\u00a7o" + StatCollector.translateToLocal("manual2.tooltip"), side == Side.CLIENT ? TProxyClient.volume2 : null, "tinker:tinkerbook_toolstation");
        smeltery = initManual(smeltery, "tconstruct.manual.smeltery", "\u00a7o" + StatCollector.translateToLocal("manual3.tooltip"), side == Side.CLIENT ? TProxyClient.smelter : null, "tinker:tinkerbook_smeltery");
        diary = initManual(diary, "tconstruct.manual.diary", "\u00a7o" + StatCollector.translateToLocal("manual4.tooltip"), side == Side.CLIENT ? TProxyClient.diary : null, "tinker:tinkerbook_blue");

View Full Code Here

            ctx.write(msg, promise);
            return;
        }

        outboundTarget = ctx.channel().attr(FML_MESSAGETARGET).get();
        Side channelSide = ctx.channel().attr(NetworkRegistry.CHANNEL_SOURCE).get();
        if (outboundTarget != null && outboundTarget.allowed.contains(channelSide))
        {
            args = ctx.channel().attr(FML_MESSAGETARGETARGS).get();
            outboundTarget.validateArgs(args);
        }
View Full Code Here

TOP

Related Classes of cpw.mods.fml.relauncher.Side

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.