Package net.minecraft.server.v1_6_R3

Examples of net.minecraft.server.v1_6_R3.Connection


                break;
        }
    }

    private void sendMetadataPacket() {
        PacketUtils.sendPacketNearby(getPlayer().getLocation(), 64, new Packet40EntityMetadata(this.npc.id,
                getWatcher(), true), getPlayer());
    }
View Full Code Here


    private void updateEquipment() {
        for (int i = 0; i < previousEquipment.length; i++) {
            net.minecraft.server.v1_6_R3.ItemStack previous = previousEquipment[i];
            net.minecraft.server.v1_6_R3.ItemStack current = getEquipment(i);
            if (previous != current) {
                PacketUtils.sendPacketNearby(getBukkitEntity().getLocation(), 64, new Packet5EntityEquipment(id, i,
                        current));
                previousEquipment[i] = current;
            }
        }
    }
View Full Code Here

  public static boolean resetPlayerConnection(Player player) {
    CraftPlayer cp = (CraftPlayer) player;
    CraftServer server = (CraftServer) Bukkit.getServer();

    if (cp.getHandle().playerConnection instanceof SpoutPlayerConnection) {
      PlayerConnection oldHandler = cp.getHandle().playerConnection;
      /*Set<ChunkCoordIntPair> chunkUpdateQueue = ((SpoutPlayerConnection) cp.getHandle().playerConnection).getChunkUpdateQueue();
      for (ChunkCoordIntPair c : chunkUpdateQueue) {
      cp.getHandle().chunkCoordIntPairQueue.add(c);
      }
      ((SpoutPlayerConnection) cp.getHandle().playerConnection).flushUnloadQueue();*/
      cp.getHandle().playerConnection.a();
      Location loc = player.getLocation();
      PlayerConnection handler = new PlayerConnection(MinecraftServer.getServer(), cp.getHandle().playerConnection.networkManager, cp.getHandle());
      handler.a(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch());
      cp.getHandle().playerConnection = handler;
      INetworkManager nm = cp.getHandle().playerConnection.networkManager;
      setPlayerConnection(nm, cp.getHandle().playerConnection);
      oldHandler.disconnected = true;
      return true;
View Full Code Here

  public static boolean updatePlayerConnection(Player player) {
    CraftPlayer cp = (CraftPlayer) player;
    CraftServer server = (CraftServer) Bukkit.getServer();
    if (!(cp.getHandle().playerConnection instanceof SpoutPlayerConnection)) {
      PlayerConnection oldHandler = cp.getHandle().playerConnection;
      Location loc = player.getLocation();
      SpoutPlayerConnection handler = new SpoutPlayerConnection(MinecraftServer.getServer(), cp.getHandle().playerConnection.networkManager, cp.getHandle());
      /*for (Object o : cp.getHandle().playerChunkCoordIntPairs) {
      ChunkCoordIntPair c = (ChunkCoordIntPair) o;
      handler.addActiveChunk(c);
View Full Code Here

            Messaging.log("Null location or world while spawning", name, "UID", UID
                    + ". Is the location unloaded or missing?");
            return null;
        }
        World ws = getWorldServer(loc.getWorld());
        final CraftNPC eh = new CraftNPC(getMinecraftServer(ws.getServer()), ws, name, new PlayerInteractManager(ws));
        eh.setPositionRotation(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch());
        Bukkit.getScheduler().scheduleSyncDelayedTask(Citizens.plugin, new Runnable() {
            @Override
            public void run() {
                eh.aA = loc.getYaw();
View Full Code Here

    public static HumanNPC spawnNPC(final Location loc, CreatureNPCType type) {
        try {
            String name = type.chooseRandomName();
            World ws = getWorldServer(loc.getWorld());
            final CraftNPC eh = type.getEntityConstructor().newInstance(getMinecraftServer(ws.getServer()), ws, name,
                    new PlayerInteractManager(ws));
            eh.setPositionRotation(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch());
            Bukkit.getScheduler().scheduleSyncDelayedTask(Citizens.plugin, new Runnable() {
                @Override
                public void run() {
                    eh.aA = loc.getYaw();
View Full Code Here

      setPlayerConnection(nm, cp.getHandle().playerConnection);
      Field handlerList = null;
      try {
        handlerList = ServerConnection.class.getDeclaredField("c");
        handlerList.setAccessible(true);
        ServerConnection sc = ((DedicatedServer) MinecraftServer.getServer()).ag();
        List rhandlerList = (List) handlerList.get(sc);
        rhandlerList.remove(oldHandler);
        rhandlerList.add(handler);
      } catch (NoSuchFieldException ex) {
        Logger.getLogger(SpoutCraftPlayer.class.getName()).log(Level.SEVERE, null, ex);
View Full Code Here

  @Override
  public void openSignEditGUI(Sign sign) {
    if (sign != null && isSpoutCraftEnabled()) {
      sendPacket(new PacketOpenSignGUI(sign.getX(), sign.getY(), sign.getZ()));
      TileEntitySign tes = (TileEntitySign) ((CraftWorld) (sign.getBlock()).getWorld()).getTileEntityAt(sign.getX(), sign.getY(), sign.getZ()); // Found a hidden trace to The Elder Scrolls. Bethesda's Lawyers are right!
      tes.isEditable = true;
    }
  }
View Full Code Here

        EntityHuman entityhuman = this.world.findNearbyPlayer(this, range);
        return entityhuman != null && isInSight(entityhuman) ? entityhuman : null;
    }

    private Vec3D getPathVector() {
        Vec3D vec3d = path.a(this);
        double length = (this.width * 2.0F);
        while (vec3d != null && vec3d.d(this.locX, vec3d.d, this.locZ) < length * length) {
            this.path.a(); // Increment path index.
            // Is path finished?
            if (this.path.b()) {
                Vec3D.a.release(vec3d);
                vec3d = null;
View Full Code Here

        updateTarget();
        if (this.path != null || this.targetEntity != null) {
            updatePathingState();
        }
        if (this.path != null) {
            Vec3D vector = getPathVector();
            if (vector != null) {
                handleMove(vector);
            }
        }
        if (this.attackTicks > 0)
View Full Code Here

TOP

Related Classes of net.minecraft.server.v1_6_R3.Connection

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.