Package net.minecraft.server.v1_6_R3

Examples of net.minecraft.server.v1_6_R3.Connection


    }
    Thread t = Thread.currentThread();
    if (!clazz.isInstance(t)) {
      return false;
    }
    NetworkManager nm = null;
    try {
      nm = (NetworkManager) a.get(t);
    } catch (Exception e) {
    }
    if (nm == null) {
View Full Code Here


    public CraftNPC(MinecraftServer minecraftserver, World world, String s, PlayerInteractManager iteminworldmanager) {
        super(minecraftserver, world, s, iteminworldmanager);
        iteminworldmanager.setGameMode(EnumGamemode.SURVIVAL);

        NPCSocket socket = new NPCSocket();
        NetworkManager netMgr;
        try {
            netMgr = new NPCNetworkManager(server.getLogger(), socket, "npc mgr", new Connection() {
                @Override
                public boolean a() {
                    return false;
                }
            }, server.H().getPrivate());
            this.playerConnection = new NPCNetHandler(minecraftserver, this, netMgr);
            netMgr.a(this.playerConnection);
        } catch (IOException e) {
            e.printStackTrace();
        }
        try {
            socket.close();
View Full Code Here

      Class<? extends Packet> packetClass = (Class<? extends Packet>) packets[packetId];
      if (packetClass == null) {
        return null;
      }
      Constructor<? extends Packet> c = packetClass.getConstructor(new Class[]{});
      Packet r = c.newInstance(blank);

      return newInstance(packetId, r);
    } catch (SecurityException e) {
      throw new RuntimeException(e);
    } catch (NoSuchMethodException e) {
View Full Code Here

    syncFlushPacketQueue(packetWrappers);
  }

  public void syncFlushPacketQueue(MCCraftPacket[] packetWrappers) {
    while (!resyncQueue.isEmpty()) {
      Packet p = resyncQueue.pollFirst();
      if (p != null) {
        syncedSendPacket(p, packetWrappers);
      }
    }
  }
View Full Code Here

                getWatcher(), true), getPlayer());
    }

    private void sleep() {
        Location loc = getPlayer().getLocation();
        Packet17EntityLocationAction packet17 = new Packet17EntityLocationAction(npc, 0, loc.getBlockX(),
                loc.getBlockY(), loc.getBlockZ());

        // getPlayer().teleport(loc);
        PacketUtils.sendPacketNearby(getPlayer().getLocation(), 64, packet17, getPlayer());
    }
View Full Code Here

  public static Spout getInstance() {
    return instance;
  }

  public void authenticate(Player player) {
      Packet18ArmAnimation packet = new Packet18ArmAnimation();
      packet.a = -42;
      ((SpoutCraftPlayer) SpoutCraftPlayer.getPlayer(player)).getPlayerConnection().sendImmediatePacket(packet);
  }
View Full Code Here

    private void actHurt() {
        PacketUtils.sendPacketNearby(getPlayer().getLocation(), 64, getArmAnimationPacket(2), getPlayer());
    }

    private Packet18ArmAnimation getArmAnimationPacket(int data) {
        return new Packet18ArmAnimation(this.npc, data);
    }
View Full Code Here

    private void swingArm() {
        PacketUtils.sendPacketNearby(getPlayer().getLocation(), 64, getArmAnimationPacket(1), getPlayer());
    }

    private void unsleep() {
        PacketUtils.sendPacketNearby(getPlayer().getLocation(), 64, new Packet18ArmAnimation(this.npc, 3),
                getPlayer());
    }
View Full Code Here

    }

    @Override
    protected void handlePacketAdd(Object o, Player owner) {
        if (o instanceof Packet20NamedEntitySpawn) {
            final Packet20NamedEntitySpawn packet = ((Packet20NamedEntitySpawn) o);
            final TagInfo info = this.handler.getNameForPacket20((String) null, packet.a, packet.b, owner);
            if (info != null) {
                packet.b = info.getName();
            }
        }
View Full Code Here

    public static void despawnNPC(HumanNPC npc, NPCRemoveReason reason) {
        if (getWorldServer(npc.getWorld()).getEntity(npc.getPlayer().getEntityId()) != npc.getHandle()
                || npc.getHandle().dead)
            return;
        Bukkit.getServer().getPluginManager().callEvent(new NPCRemoveEvent(npc, reason));
        PacketUtils.sendPacketToOnline(new Packet29DestroyEntity(npc.getHandle().id), null);
        npc.getHandle().die();
    }
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.