private WeakReference<EntityPlayer> createNewPlayer(WorldServer world, int x, int y, int z) {
   EntityPlayer player = FakePlayerFactory.get(world, gameProfile);
   player.posX = x;
   player.posY = y;
   player.posZ = z;
   return new WeakReference<EntityPlayer>(player);
 }
Exemplo n.º 2
0
  public EntityPlayer getBuildCraftPlayer(World world, int x, int y, int z) {
    if (CoreProxy.buildCraftPlayer == null) {
      CoreProxy.buildCraftPlayer = createNewPlayer(world, x, y, z);
    } else {
      CoreProxy.buildCraftPlayer.worldObj = world;
      CoreProxy.buildCraftPlayer.posX = x;
      CoreProxy.buildCraftPlayer.posY = y;
      CoreProxy.buildCraftPlayer.posZ = z;
    }

    return CoreProxy.buildCraftPlayer;
  }
  public void onArmorTick(World world, EntityPlayer player, ItemStack itemstack) {
    if (player != null) {
      if (player.getCurrentArmor(2).getItem() == this) {
        if (player.getEntityData().getBoolean("clankJumped")) {
          double x = player.posX -= 0.15d;

          double z = player.posZ -= 0.15d;

          world.spawnParticle("flame", x, player.posY, z, 0.0D, 0.0D, 0.0D);
        }
      }
    }
  }
Exemplo n.º 4
0
  private EntityPlayer createNewPlayer(World world, int x, int y, int z) {
    EntityPlayer player =
        new EntityPlayer(world, new GameProfile(null, "[BuildCraft]")) {
          @Override
          public void addChatMessage(IChatComponent var1) {}

          @Override
          public boolean canCommandSenderUseCommand(int var1, String var2) {
            return false;
          }

          @Override
          public ChunkCoordinates getPlayerCoordinates() {
            return null;
          }
        };
    player.posX = x;
    player.posY = y;
    player.posZ = z;
    return player;
  }