Package net.minecraft.world

Examples of net.minecraft.world.WorldServer.spawnEntityInWorld()


          ChunkCoordinates chunkcoordinates = worldserver1.getSpawnPoint();
          chunkcoordinates.posY = e.worldObj.getTopSolidOrLiquidBlock(chunkcoordinates.posX, chunkcoordinates.posZ);
          entity.setLocationAndAngles((double) chunkcoordinates.posX, (double) chunkcoordinates.posY, (double) chunkcoordinates.posZ, entity.rotationYaw, entity.rotationPitch);
        }

        worldserver1.spawnEntityInWorld(entity);
      }

      e.isDead = true;
      e.worldObj.theProfiler.endSection();
      worldserver.resetUpdateEntityTick();
View Full Code Here


  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);
    }
  }

  public static void spawnTeleportEffects(World world, Entity entity) {
    PacketHandler.INSTANCE.sendToAllAround(new PacketTeleportEffects(entity), new TargetPoint(world.provider.dimensionId, entity.posX, entity.posY,
View Full Code Here

      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;
        }
      }
View Full Code Here

        }
      }
    }
    entity.setPosition(oX, entity.posY, oZ);
    resetForRandomRandomSpawn(entity);
    worldserver.spawnEntityInWorld(entity);
  }

  private void resetForRandomRandomSpawn(Entity entity) {
    CartLinkUtil.breakLinks(transciever.getWorldObj(), entity);
    entity.riddenByEntity = null;
View Full Code Here

      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);
      }
View Full Code Here

    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();
View Full Code Here

      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

        fromDimension = this.mcServer.worldServerForDimension(fromDimensionId);
        entityPlayerMP.dimension = toDimensionId;
        toDimension = this.mcServer.worldServerForDimension(toDimensionId);
        if (fromDimension == toDimension) {
          if (!toDimension.playerEntities.contains(entityPlayerMP)) {
            toDimension.spawnEntityInWorld(entityPlayerMP);
          }
          Log.severe("Can't transfer player to the dimension they are already in! " + entityPlayerMP + ", dimension: " + Log.name(toDimension));
          return;
        }
        entityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet9Respawn(entityPlayerMP.dimension, (byte) entityPlayerMP.worldObj.difficultySetting, toDimension.getWorldInfo().getTerrainType(), toDimension.getHeight(), entityPlayerMP.theItemInWorldManager.getGameType()));
View Full Code Here

        }
        this.transferEntityToWorld(entityPlayerMP, fromDimensionId, fromDimension, toDimension, teleporter);
        entityPlayerMP.setWorld(toDimension);
        toDimension.theChunkProviderServer.loadChunk((int) entityPlayerMP.posX >> 4, (int) entityPlayerMP.posZ >> 4);
        if (!toDimension.playerEntities.contains(entityPlayerMP)) {
          toDimension.spawnEntityInWorld(entityPlayerMP);
        }
        entityPlayerMP.playerNetServerHandler.setPlayerLocation(entityPlayerMP.posX, entityPlayerMP.posY, entityPlayerMP.posZ, entityPlayerMP.rotationYaw, entityPlayerMP.rotationPitch);
        entityPlayerMP.theItemInWorldManager.setWorld(toDimension);
        this.updateTimeAndWeatherForPlayer(entityPlayerMP, toDimension);
        this.syncPlayerInventory(entityPlayerMP);
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.