Examples of WorldServer


Examples of net.minecraft.world.WorldServer

        cont.setInventorySlotContents(i, null);
      }
    }

    MinecraftServer minecraftserver = MinecraftServer.getServer();
    WorldServer worldserver = minecraftserver.worldServerForDimension(world.provider.dimensionId);

    Entity passenger = cart.riddenByEntity;
    if(passenger != null && !(passenger instanceof EntityPlayer)) {
      worldserver.removeEntity(passenger);
      passenger.isDead = true;
    }
    worldserver.removeEntity(cart);
    cart.isDead = true;

  }
View Full Code Here

Examples of net.minecraft.world.WorldServer

  }

  public static void spawn(World world, Entity entity) {
    if(entity != null) {
      MinecraftServer minecraftserver = MinecraftServer.getServer();
      WorldServer worldserver = minecraftserver.worldServerForDimension(world.provider.dimensionId);
      worldserver.spawnEntityInWorld(entity);
    }
  }
View Full Code Here

Examples of net.minecraft.world.WorldServer

    }
    double oX = entity.posX;
    double oZ = entity.posZ;
    World world = transciever.getWorldObj();
    MinecraftServer minecraftserver = MinecraftServer.getServer();
    WorldServer worldserver = minecraftserver.worldServerForDimension(world.provider.dimensionId);
    for (int i = 0; i < 4; i++) {
      int x = transciever.xCoord + randOffset(2);
      int y = transciever.yCoord + 1;
      int z = transciever.zCoord + randOffset(2);
      Block b = world.getBlock(x, y, z);
      entity.setPosition(x + 0.5, entity.posY, z + 0.5);
      if(world.canPlaceEntityOnSide(b, x, y, z, false, ForgeDirection.UP.ordinal(), entity, null)) {
        resetForRandomRandomSpawn(entity);
        if(worldserver.spawnEntityInWorld(entity)) {
          //entity.onUpdate();
          worldserver.updateEntity(entity);
          return;
        }
      }
    }
    entity.setPosition(oX, entity.posY, oZ);
    resetForRandomRandomSpawn(entity);
    worldserver.spawnEntityInWorld(entity);
  }
View Full Code Here

Examples of net.minecraft.world.WorldServer

  public void teleportPlayerTo(EntityPlayerMP player, Coord4D coord, TileEntityTeleporter teleporter)
  {
    if(player.dimension != coord.dimensionId)
    {
      int id = player.dimension;
      WorldServer oldWorld = server.worldServerForDimension(player.dimension);
      player.dimension = coord.dimensionId;
      WorldServer newWorld = server.worldServerForDimension(player.dimension);
      player.playerNetServerHandler.sendPacket(new S07PacketRespawn(player.dimension, player.worldObj.difficultySetting, newWorld.getWorldInfo().getTerrainType(), player.theItemInWorldManager.getGameType()));
      oldWorld.removePlayerEntityDangerously(player);
      player.isDead = false;

      if(player.isEntityAlive())
      {
        newWorld.spawnEntityInWorld(player);
        player.setLocationAndAngles(coord.xCoord+0.5, coord.yCoord+1, coord.zCoord+0.5, player.rotationYaw, player.rotationPitch);
        newWorld.updateEntityWithOptionalForce(player, false);
        player.setWorld(newWorld);
      }

      server.getConfigurationManager().func_72375_a(player, oldWorld);
      player.playerNetServerHandler.setPlayerLocation(coord.xCoord+0.5, coord.yCoord+1, coord.zCoord+0.5, player.rotationYaw, player.rotationPitch);
View Full Code Here

Examples of net.minecraft.world.WorldServer

    }
  }

  public void teleportEntityTo(Entity entity, Coord4D coord, TileEntityTeleporter teleporter)
  {
    WorldServer world = server.worldServerForDimension(coord.dimensionId);

    if(entity.worldObj.provider.dimensionId != coord.dimensionId)
    {
      entity.worldObj.removeEntity(entity);
      entity.isDead = false;

      world.spawnEntityInWorld(entity);
      entity.setLocationAndAngles(coord.xCoord+0.5, coord.yCoord+1, coord.zCoord+0.5, entity.rotationYaw, entity.rotationPitch);
      world.updateEntityWithOptionalForce(entity, false);
      entity.setWorld(world);
      world.resetUpdateEntityTick();

      Entity e = EntityList.createEntityByName(EntityList.getEntityString(entity), world);

      if(e != null)
      {
        e.copyDataFrom(entity, true);
        world.spawnEntityInWorld(e);
        teleporter.didTeleport.add(e);
      }

      entity.isDead = true;
    }
View Full Code Here

Examples of net.minecraft.world.WorldServer

            WorldServer[] servers = FMLCommonHandler.instance().getMinecraftServerInstance().worldServers;

            worldLoop:
            for (int i = 0; i < servers.length; i++)
            {
                WorldServer world = servers[i];

                for (TileEntity tile2 : new ArrayList<TileEntity>(world.loadedTileEntityList))
                {
                    if (this != tile2)
                    {
                        tile2 = world.getTileEntity(tile2.xCoord, tile2.yCoord, tile2.zCoord);
                        if (tile2 == null)
                            continue;

                        if (tile2 instanceof TileEntityLaunchController)
                        {
View Full Code Here

Examples of net.minecraft.world.WorldServer

            if (this.destFrequency >= 0)
            {
                WorldServer[] servers = FMLCommonHandler.instance().getMinecraftServerInstance().worldServers;
              for (int i = 0; i < servers.length; i++)
                {
                    WorldServer world = servers[i];

                    for (TileEntity tile2 : new ArrayList<TileEntity>(world.loadedTileEntityList))
                    {
                        if (this != tile2)
                        {
                            tile2 = world.getTileEntity(tile2.xCoord, tile2.yCoord, tile2.zCoord);
                            if (tile2 == null)
                                continue;

                            if (tile2 instanceof TileEntityLaunchController)
                            {
View Full Code Here

Examples of net.minecraft.world.WorldServer

        if (this.targetVec != null)
        {
            if (this.targetDimension != this.worldObj.provider.dimensionId)
            {
                WorldServer worldServer = FMLCommonHandler.instance().getMinecraftServerInstance().worldServerForDimension(this.targetDimension);

                if (!this.worldObj.isRemote && worldServer != null)
                {
                    this.setPosition(this.targetVec.x + 0.5F, this.targetVec.y + 800, this.targetVec.z + 0.5F);
                    Entity e = WorldUtil.transferEntityToDimension(this, this.targetDimension, worldServer, false, null);
View Full Code Here

Examples of net.minecraft.world.WorldServer

            ShortRangeTelepadHandler.TelepadEntry addressResult = ShortRangeTelepadHandler.getLocationFromAddress(this.targetAddress);
            TileEntityShortRangeTelepad foundTelepad = null;

            if (addressResult != null)
            {
                WorldServer world = FMLCommonHandler.instance().getMinecraftServerInstance().worldServerForDimension(addressResult.dimensionID);

                TileEntity tile2 = addressResult.position.getTileEntity(world);

                if (tile2 == null)
                {
View Full Code Here

Examples of net.minecraft.world.WorldServer

            {
                WorldServer[] worlds = FMLCommonHandler.instance().getMinecraftServerInstance().worldServers;

                for (int i = 0; i < worlds.length; i++)
                {
                    WorldServer world = worlds[i];
                    ChunkProviderServer chunkProviderServer = world.theChunkProviderServer;

                    Map<Long, List<Footprint>> footprintMap = TickHandlerServer.serverFootprintMap.get(world.provider.dimensionId);

                    if (footprintMap != null)
                    {
                        boolean mapChanged = false;

                        if (chunkProviderServer != null)
                        {
                            Iterator iterator = chunkProviderServer.loadedChunks.iterator();

                            while (iterator.hasNext())
                            {
                                Chunk chunk = (Chunk) iterator.next();
                                long chunkKey = ChunkCoordIntPair.chunkXZ2Int(chunk.xPosition, chunk.zPosition);

                                List<Footprint> footprints = footprintMap.get(chunkKey);

                                if (footprints != null)
                                {
                                    List<Footprint> toRemove = new ArrayList<Footprint>();

                                    for (int j = 0; j < footprints.size(); j++)
                                    {
                                        footprints.get(j).age += 100;

                                        if (footprints.get(j).age >= Footprint.MAX_AGE)
                                        {
                                            toRemove.add(footprints.get(j));
                                        }
                                    }

                                    if (!toRemove.isEmpty())
                                    {
                                        footprints.removeAll(toRemove);
                                    }

                                    footprintMap.put(chunkKey, footprints);
                                    mapChanged = true;

                                    GalacticraftCore.packetPipeline.sendToDimension(new PacketSimple(EnumSimplePacket.C_UPDATE_FOOTPRINT_LIST, new Object[] { chunkKey, footprints.toArray(new Footprint[footprints.size()]) }), worlds[i].provider.dimensionId);
                                }
                            }
                        }

                        if (mapChanged)
                        {
                            TickHandlerServer.serverFootprintMap.put(world.provider.dimensionId, footprintMap);
                        }
                    }
                }
            }
            else if (!footprintRefreshList.isEmpty())
            {
                for (NetworkRegistry.TargetPoint targetPoint : footprintRefreshList)
                {
                    WorldServer[] worlds = FMLCommonHandler.instance().getMinecraftServerInstance().worldServers;

                    for (int i = 0; i < worlds.length; i++)
                    {
                        WorldServer world = worlds[i];

                        if (world.provider.dimensionId == targetPoint.dimension)
                        {
                            long chunkKey = ChunkCoordIntPair.chunkXZ2Int((int)targetPoint.x >> 4, (int)targetPoint.z >> 4);
                            Map<Long, List<Footprint>> footprintMap = TickHandlerServer.serverFootprintMap.get(world.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.