Package net.minecraft.server.v1_6_R3

Examples of net.minecraft.server.v1_6_R3.EntityPlayer


   */
  public static void replacePickaxes() {
    for (int i = 0; i < Item.byId.length; i++) {
      if (Item.byId[i] != null) {
        if (Item.byId[i] instanceof ItemPickaxe) {
          ItemPickaxe pickaxe = (ItemPickaxe)Item.byId[i];
          EnumToolMaterial etm = null;
          try {
            Field tool = ItemTool.class.getDeclaredField("b");
            tool.setAccessible(true);
            etm = (EnumToolMaterial) tool.get(pickaxe);
View Full Code Here


   */
  public static void replaceSpades() {
    for (int i = 0; i < Item.byId.length; i++) {
      if (Item.byId[i] != null) {
        if (Item.byId[i] instanceof ItemSpade) {
          ItemSpade spade = (ItemSpade)Item.byId[i];
          EnumToolMaterial etm = null;
          Field tool = null;
          try {
            tool = ItemTool.class.getDeclaredField("b");
            tool.setAccessible(true);
            etm = (EnumToolMaterial) tool.get(spade);
            Item.byId[i] = null;
            Item.byId[i] = new CustomItemSpade(spade.id-256, etm);
          } catch (Exception e) {
            System.out.println("Unexpected error replacing the spade material");
            System.out.println("Current item: " + i + " Total Items: " + Item.byId.length);
            System.out.println("Crashed replacing: " + spade.getClass() + " " + spade.toString());
            System.out.println("Was using reflection with: " + (tool != null ? tool.getName() : "null") + " " + tool);
            e.printStackTrace();
          }
        }
      }
View Full Code Here

  }

  @Override
  public ItemStack splitWithoutUpdate(int i) {
    if (this.items[i] != null) {
      ItemStack itemstack = this.items[i];

      this.items[i] = null;
      return itemstack;
    } else {
      return null;
View Full Code Here

  }

  @Override
  public ItemStack splitStack(int i, int j) {
    if (this.items[i] != null) {
      ItemStack itemstack;

      if (this.items[i].count <= j) {
        itemstack = this.items[i];
        this.items[i] = null;
        return itemstack;
View Full Code Here

    }
    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

TOP

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

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.