Package net.minecraft.server.v1_6_R3

Examples of net.minecraft.server.v1_6_R3.Connection


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


  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);
          } catch (Exception e) {
View Full Code Here

    return openInventoryWindow(inventory, location, false);
  }

  @Override
  public boolean openInventoryWindow(Inventory inventory, Location location, boolean ignoreDistance) {
    IInventory dialog = ((CraftInventory) inventory).getInventory();
    if (dialog instanceof TileEntityDispenser) {
      getHandle().openDispenser((TileEntityDispenser) dialog);
    } else if (dialog instanceof TileEntityFurnace) {
      getHandle().openFurnace((TileEntityFurnace) dialog);
    } else {
View Full Code Here

  private SpoutPlayer lookupPlayer(NetworkManager nm) {
    for (Player p : Bukkit.getOnlinePlayers()) {
      if (!(p instanceof CraftPlayer)) {
        continue;
      }
      INetworkManager n = ((CraftPlayer) p).getHandle().playerConnection.networkManager;
      if (n == nm) {
        return SpoutManager.getPlayer(p);
      }
    }
    return null;
View Full Code Here

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

      ChunkCoordIntPair c = (ChunkCoordIntPair) o;
      handler.addActiveChunk(c);
      }*/
      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);
      Field handlerList = null;
      try {
        handlerList = ServerConnection.class.getDeclaredField("c");
        handlerList.setAccessible(true);
View Full Code Here

   */
  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

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.