Examples of PacketSimple


Examples of micdoodle8.mods.galacticraft.core.network.PacketSimple

            }

            List<Object> objList = new ArrayList<Object>();
            objList.add(iArray);

            GalacticraftCore.packetPipeline.sendTo(new PacketSimple(EnumSimplePacket.C_UPDATE_SCHEMATIC_LIST, objList), player);
        }
    }
View Full Code Here

Examples of micdoodle8.mods.galacticraft.core.network.PacketSimple

            count++;
        }

        if (!temp.equals(playerStats.savedPlanetList) || (player.ticksExisted % 5 == 0))
        {
            GalacticraftCore.packetPipeline.sendTo(new PacketSimple(EnumSimplePacket.C_UPDATE_DIMENSION_LIST, new Object[] { player.getGameProfile().getName(), temp }), player);
            playerStats.savedPlanetList = new String(temp);
        }
    }
View Full Code Here

Examples of micdoodle8.mods.galacticraft.core.network.PacketSimple

    protected void sendAirRemainingPacket(EntityPlayerMP player, GCPlayerStats playerStats)
    {
        final float f1 = Float.valueOf(playerStats.tankInSlot1 == null ? 0.0F : playerStats.tankInSlot1.getMaxDamage() / 90.0F);
        final float f2 = Float.valueOf(playerStats.tankInSlot2 == null ? 0.0F : playerStats.tankInSlot2.getMaxDamage() / 90.0F);
        GalacticraftCore.packetPipeline.sendTo(new PacketSimple(EnumSimplePacket.C_AIR_REMAINING, new Object[] { MathHelper.floor_float(playerStats.airRemaining / f1), MathHelper.floor_float(playerStats.airRemaining2 / f2), player.getGameProfile().getName() }), player);
    }
View Full Code Here

Examples of micdoodle8.mods.galacticraft.core.network.PacketSimple

        GalacticraftCore.packetPipeline.sendTo(new PacketSimple(EnumSimplePacket.C_AIR_REMAINING, new Object[] { MathHelper.floor_float(playerStats.airRemaining / f1), MathHelper.floor_float(playerStats.airRemaining2 / f2), player.getGameProfile().getName() }), player);
    }

    protected void sendThermalLevelPacket(EntityPlayerMP player, GCPlayerStats playerStats)
    {
        GalacticraftCore.packetPipeline.sendTo(new PacketSimple(EnumSimplePacket.C_UPDATE_THERMAL_LEVEL, new Object[] { playerStats.thermalLevel }), player);
    }
View Full Code Here

Examples of micdoodle8.mods.galacticraft.core.network.PacketSimple

    public static void sendGearUpdatePacket(EntityPlayerMP player, EnumModelPacket gearType)
    {
      MinecraftServer theServer = FMLCommonHandler.instance().getMinecraftServerInstance();
      if (theServer != null && PlayerUtil.getPlayerForUsernameVanilla(theServer, player.getGameProfile().getName()) != null)
        {
            GalacticraftCore.packetPipeline.sendToAllAround(new PacketSimple(EnumSimplePacket.C_UPDATE_GEAR_SLOT, new Object[] { player.getGameProfile().getName(), gearType.ordinal(), -1 }), new TargetPoint(player.worldObj.provider.dimensionId, player.posX, player.posY, player.posZ, 50.0D));
        }
    }
View Full Code Here

Examples of micdoodle8.mods.galacticraft.core.network.PacketSimple

    public static void sendGearUpdatePacket(EntityPlayerMP player, EnumModelPacket gearType, int subtype)
    {
      MinecraftServer theServer = FMLCommonHandler.instance().getMinecraftServerInstance();
      if (theServer != null && PlayerUtil.getPlayerForUsernameVanilla(theServer, player.getGameProfile().getName()) != null)
        {
            GalacticraftCore.packetPipeline.sendToAllAround(new PacketSimple(EnumSimplePacket.C_UPDATE_GEAR_SLOT, new Object[] { player.getGameProfile().getName(), gearType.ordinal(), subtype }), new TargetPoint(player.worldObj.provider.dimensionId, player.posX, player.posY, player.posZ, 50.0D));
        }
    }
View Full Code Here

Examples of micdoodle8.mods.galacticraft.core.network.PacketSimple

            {
                SpaceRace race = SpaceRaceManager.getSpaceRaceFromPlayer(player.getGameProfile().getName());

                if (race == null || race.getTeamName().equals(SpaceRace.DEFAULT_NAME))
                {
                    GalacticraftCore.packetPipeline.sendTo(new PacketSimple(EnumSimplePacket.C_OPEN_SPACE_RACE_GUI, new Object[] { }), player);
                }

                GCPlayerStats.get(player).openedSpaceRaceManager = true;
            }
        }

        //This will speed things up a little
        final GCPlayerStats GCPlayer = GCPlayerStats.get(player);
        final boolean isInGCDimension = player.worldObj.provider instanceof IGalacticraftWorldProvider;

        if (GCPlayer.cryogenicChamberCooldown > 0)
        {
            GCPlayer.cryogenicChamberCooldown--;
        }

        if (!player.onGround && GCPlayer.lastOnGround)
        {
            GCPlayer.touchedGround = true;
        }

        if (GCPlayer.teleportCooldown > 0)
        {
            GCPlayer.teleportCooldown--;
        }

        if (GCPlayer.chatCooldown > 0)
        {
            GCPlayer.chatCooldown--;
        }

        if (GCPlayer.openPlanetSelectionGuiCooldown > 0)
        {
            GCPlayer.openPlanetSelectionGuiCooldown--;

            if (GCPlayer.openPlanetSelectionGuiCooldown == 1 && !GCPlayer.hasOpenedPlanetSelectionGui)
            {
                WorldUtil.toCelestialSelection(player, GCPlayer, GCPlayer.spaceshipTier);
                GCPlayer.hasOpenedPlanetSelectionGui = true;
            }
        }

        if (GCPlayer.usingParachute)
        {
            if (GCPlayer.lastParachuteInSlot != null)
            {
                player.fallDistance = 0.0F;
            }
            if (player.onGround)
            {
                GCPlayerHandler.setUsingParachute(player, GCPlayer, false);
            }
        }

        this.checkCurrentItem(player);

        if (GCPlayer.usingPlanetSelectionGui)
        {
            this.sendPlanetList(player, GCPlayer);
        }

    /*    if (isInGCDimension || player.usingPlanetSelectionGui)
                {
          player.playerNetServerHandler.ticksForFloatKick = 0;
        } 
    */
        if (GCPlayer.damageCounter > 0)
        {
            GCPlayer.damageCounter--;
        }

        if (isInGCDimension)
        {
            if (tick % 30 == 0)
            {
                this.sendAirRemainingPacket(player, GCPlayer);
                this.sendThermalLevelPacket(player, GCPlayer);
            }

            if (player.ridingEntity instanceof EntityLanderBase)
            {
                GCPlayer.inLander = true;
                GCPlayer.justLanded = false;
            }
            else
            {
                if (GCPlayer.inLander)
                {
                    GCPlayer.justLanded = true;
                }
                GCPlayer.inLander = false;
            }

            if (player.onGround && GCPlayer.justLanded)
            {
                GCPlayer.justLanded = false;

                //Set spawn point here if just descended from a lander for the first time
                if (player.getBedLocation(player.worldObj.provider.dimensionId) == null)
                {
                    int i = 30000000;
                    int j = Math.min(i, Math.max(-i, MathHelper.floor_double(player.posX + 0.5D)));
                    int k = Math.min(256, Math.max(0, MathHelper.floor_double(player.posY + 1.5D)));
                    int l = Math.min(i, Math.max(-i, MathHelper.floor_double(player.posZ + 0.5D)));
                    ChunkCoordinates coords = new ChunkCoordinates(j, k, l);
                    player.setSpawnChunk(coords, true, player.worldObj.provider.dimensionId);
                }

                GalacticraftCore.packetPipeline.sendTo(new PacketSimple(EnumSimplePacket.C_RESET_THIRD_PERSON, new Object[] { }), player);
            }

            if (player.worldObj.provider instanceof WorldProviderOrbit)
            {
                player.fallDistance = 0.0F;
                if (GCPlayer.newInOrbit)
                {
                  ((WorldProviderOrbit) player.worldObj.provider).sendPacketsToClient(player);
                  GCPlayer.newInOrbit = false;
                }
            }
            else
              GCPlayer.newInOrbit = true;
        }
        else
          GCPlayer.newInOrbit = true;


        checkGear(player, GCPlayer, false);

        if (GCPlayer.chestSpawnCooldown > 0)
        {
            GCPlayer.chestSpawnCooldown--;

            if (GCPlayer.chestSpawnCooldown == 180)
            {
                if (GCPlayer.chestSpawnVector != null)
                {
                    EntityParachest chest = new EntityParachest(player.worldObj, GCPlayer.rocketStacks, GCPlayer.fuelLevel);

                    chest.setPosition(GCPlayer.chestSpawnVector.x, GCPlayer.chestSpawnVector.y, GCPlayer.chestSpawnVector.z);

                    if (!player.worldObj.isRemote)
                    {
                        player.worldObj.spawnEntityInWorld(chest);
                    }
                }
            }
        }

        //

        if (GCPlayer.launchAttempts > 0 && player.ridingEntity == null)
        {
            GCPlayer.launchAttempts = 0;
        }

        this.checkThermalStatus(player, GCPlayer);
        this.checkOxygen(player, GCPlayer);

        if (isInGCDimension && (GCPlayer.oxygenSetupValid != GCPlayer.lastOxygenSetupValid || tick % 100 == 0))
        {
            GalacticraftCore.packetPipeline.sendTo(new PacketSimple(EnumSimplePacket.C_UPDATE_OXYGEN_VALIDITY, new Object[] { GCPlayer.oxygenSetupValid }), player);
        }

        this.throwMeteors(player);

        this.updateSchematics(player, GCPlayer);
View Full Code Here

Examples of micdoodle8.mods.galacticraft.core.network.PacketSimple

                    final double var16 = this.y - var13.posY;
                    final double var18 = this.z - var13.posZ;

                    if (var14 * var14 + var16 * var16 + var18 * var18 < 20 * 20)
                    {
                        GalacticraftCore.packetPipeline.sendTo(new PacketSimple(EnumSimplePacket.C_SPAWN_SPARK_PARTICLES, new Object[] { this.x, this.y, this.z }), var13);
                    }
                }
            }
        }
    }
View Full Code Here

Examples of micdoodle8.mods.galacticraft.core.network.PacketSimple

  {
        super.validate();
    if (FMLCommonHandler.instance().getEffectiveSide().isClient())
    {
      this.screen = new DrawGameScreen(1.0F, 1.0F, this);
      GalacticraftCore.packetPipeline.sendToServer(new PacketSimple(EnumSimplePacket.S_UPDATE_VIEWSCREEN_REQUEST, new Object[] { this.worldObj.provider.dimensionId, this.xCoord, this.yCoord, this.zCoord} ));
    }
  }
View Full Code Here

Examples of micdoodle8.mods.galacticraft.core.network.PacketSimple

    int connectedFlags = 0;
        if (this.connectedUp) connectedFlags += 8;
        if (this.connectedDown) connectedFlags += 4;
        if (this.connectedLeft) connectedFlags += 2;
        if (this.connectedRight) connectedFlags += 1;
    GalacticraftCore.packetPipeline.sendToDimension(new PacketSimple(EnumSimplePacket.C_UPDATE_VIEWSCREEN, new Object[] { this.xCoord, this.yCoord, this.zCoord, this.imageType, connectedFlags } ), this.worldObj.provider.dimensionId);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.