Java 类net.minecraft.client.gui.GuiScreenBook 实例源码

项目:Minecoprocessors    文件:GuiMinecoprocessor.java   
@Override
protected void actionPerformed(GuiButton button) {
  if (button == buttonReset) {
    Minecoprocessors.NETWORK.sendToServer(new MessageProcessorAction(minecoprocessor.getPos(), Action.RESET));
  }
  if (button == buttonPause) {
    Minecoprocessors.NETWORK.sendToServer(new MessageProcessorAction(minecoprocessor.getPos(), Action.PAUSE));
  }
  if (button == buttonStep) {
    Minecoprocessors.NETWORK.sendToServer(new MessageProcessorAction(minecoprocessor.getPos(), Action.STEP));
  }
  if (button == buttonHelp) {
    // TODO override the book GUI so that it returns the processor GUI when closed
    this.mc.displayGuiScreen(new GuiScreenBook(mc.player, BookCreator.manual, false));
  }
}
项目:TextFormatting    文件:BookGui.java   
public String getBookTitle()
{
    try
    {
    Class c = GuiScreenBook.class;
    Field f = c.getDeclaredFields()[ 13 ];
    f.setAccessible( true );
    return ( String ) f.get( this );
    }
    catch ( Exception exception )
    {
        exception.printStackTrace();
    }

    return "";
}
项目:RuneCraftery    文件:GuiButtonNextPage.java   
public void func_73737_a(Minecraft p_73737_1_, int p_73737_2_, int p_73737_3_) {
   if(this.field_73748_h) {
      boolean var4 = p_73737_2_ >= this.field_73746_c && p_73737_3_ >= this.field_73743_d && p_73737_2_ < this.field_73746_c + this.field_73747_a && p_73737_3_ < this.field_73743_d + this.field_73745_b;
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      p_73737_1_.func_110434_K().func_110577_a(GuiScreenBook.func_110404_g());
      int var5 = 0;
      int var6 = 192;
      if(var4) {
         var5 += 23;
      }

      if(!this.field_73755_j) {
         var6 += 13;
      }

      this.func_73729_b(this.field_73746_c, this.field_73743_d, var5, var6, 23, 13);
   }
}
项目:Geolosys    文件:ItemFieldManual.java   
@Override
@SideOnly(Side.CLIENT)
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand)
{
    Minecraft.getMinecraft().displayGuiScreen(new GuiScreenBook(player, getBook(new Book(getNumEntries())), false));
    return new ActionResult<>(EnumActionResult.SUCCESS, player.getHeldItem(hand));
}
项目:DecompiledMinecraft    文件:EntityPlayerSP.java   
/**
 * Displays the GUI for interacting with a book.
 */
public void displayGUIBook(ItemStack bookStack)
{
    Item item = bookStack.getItem();

    if (item == Items.writable_book)
    {
        this.mc.displayGuiScreen(new GuiScreenBook(this, bookStack, true));
    }
}
项目:BaseClient    文件:EntityPlayerSP.java   
/**
 * Displays the GUI for interacting with a book.
 */
public void displayGUIBook(ItemStack bookStack)
{
    Item item = bookStack.getItem();

    if (item == Items.writable_book)
    {
        this.mc.displayGuiScreen(new GuiScreenBook(this, bookStack, true));
    }
}
项目:BaseClient    文件:EntityPlayerSP.java   
/**
 * Displays the GUI for interacting with a book.
 */
public void displayGUIBook(ItemStack bookStack) {
    Item item = bookStack.getItem();

    if (item == Items.writable_book) {
        this.mc.displayGuiScreen(new GuiScreenBook(this, bookStack, true));
    }
}
项目:BaseClient    文件:NetHandlerPlayClient.java   
/**
 * Handles packets that have room for a channel specification. Vanilla
 * implemented channels are "MC|TrList" to acquire a MerchantRecipeList trades
 * for a villager merchant, "MC|Brand" which sets the server brand? on the
 * player instance and finally "MC|RPack" which the server uses to communicate
 * the identifier of the default server resourcepack for the client to load.
 */
public void handleCustomPayload(S3FPacketCustomPayload packetIn) {
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    if ("MC|TrList".equals(packetIn.getChannelName())) {
        PacketBuffer packetbuffer = packetIn.getBufferData();

        try {
            int i = packetbuffer.readInt();
            GuiScreen guiscreen = this.gameController.currentScreen;

            if (guiscreen != null && guiscreen instanceof GuiMerchant
                    && i == this.gameController.thePlayer.openContainer.windowId) {
                IMerchant imerchant = ((GuiMerchant) guiscreen).getMerchant();
                MerchantRecipeList merchantrecipelist = MerchantRecipeList.readFromBuf(packetbuffer);
                imerchant.setRecipes(merchantrecipelist);
            }
        } catch (IOException ioexception) {
            logger.error((String) "Couldn\'t load trade info", (Throwable) ioexception);
        } finally {
            packetbuffer.release();
        }
    } else if ("MC|Brand".equals(packetIn.getChannelName())) {
        this.gameController.thePlayer.setClientBrand(packetIn.getBufferData().readStringFromBuffer(32767));
    } else if ("MC|BOpen".equals(packetIn.getChannelName())) {
        ItemStack itemstack = this.gameController.thePlayer.getCurrentEquippedItem();

        if (itemstack != null && itemstack.getItem() == Items.written_book) {
            this.gameController
                    .displayGuiScreen(new GuiScreenBook(this.gameController.thePlayer, itemstack, false));
        }
    }
}
项目:Zombe-Modpack    文件:EntityPlayerSP.java   
public void openBook(ItemStack stack, EnumHand hand)
{
    Item item = stack.getItem();

    if (item == Items.WRITABLE_BOOK)
    {
        this.mc.displayGuiScreen(new GuiScreenBook(this, stack, true));
    }
}
项目:Backmemed    文件:EntityPlayerSP.java   
public void openBook(ItemStack stack, EnumHand hand)
{
    Item item = stack.getItem();

    if (item == Items.WRITABLE_BOOK)
    {
        this.mc.displayGuiScreen(new GuiScreenBook(this, stack, true));
    }
}
项目:CustomWorldGen    文件:EntityPlayerSP.java   
public void openBook(ItemStack stack, EnumHand hand)
{
    Item item = stack.getItem();

    if (item == Items.WRITABLE_BOOK)
    {
        this.mc.displayGuiScreen(new GuiScreenBook(this, stack, true));
    }
}
项目:Resilience-Client-Source    文件:EntityPlayerSP.java   
/**
 * Displays the GUI for interacting with a book.
 */
public void displayGUIBook(ItemStack par1ItemStack)
{
    Item var2 = par1ItemStack.getItem();

    if (var2 == Items.written_book)
    {
        this.mc.displayGuiScreen(new GuiScreenBook(this, par1ItemStack, false));
    }
    else if (var2 == Items.writable_book)
    {
        this.mc.displayGuiScreen(new GuiScreenBook(this, par1ItemStack, true));
    }
}
项目:ExpandedRailsMod    文件:EntityPlayerSP.java   
public void openBook(ItemStack stack, EnumHand hand)
{
    Item item = stack.getItem();

    if (item == Items.WRITABLE_BOOK)
    {
        this.mc.displayGuiScreen(new GuiScreenBook(this, stack, true));
    }
}
项目:Quantum-Anomalies    文件:DiscoveryListenerClient.java   
@SubscribeEvent
public void guiButton(GuiScreenEvent.ActionPerformedEvent.Pre event) {
    if (event.gui instanceof GuiScreenBook && FMLCommonHandler.instance().getSide() == Side.CLIENT) {
        if (event.button.id == 3)
            NetworkHandler.wrapper.sendToServer(new MessageDiscoveryItem(QADiscoveries.Item.SHELF.get().getKey(), false));
    }
}
项目:Cauldron    文件:EntityPlayerSP.java   
public void displayGUIBook(ItemStack p_71048_1_)
{
    Item item = p_71048_1_.getItem();

    if (item == Items.written_book)
    {
        this.mc.displayGuiScreen(new GuiScreenBook(this, p_71048_1_, false));
    }
    else if (item == Items.writable_book)
    {
        this.mc.displayGuiScreen(new GuiScreenBook(this, p_71048_1_, true));
    }
}
项目:Cauldron    文件:EntityPlayerSP.java   
public void displayGUIBook(ItemStack p_71048_1_)
{
    Item item = p_71048_1_.getItem();

    if (item == Items.written_book)
    {
        this.mc.displayGuiScreen(new GuiScreenBook(this, p_71048_1_, false));
    }
    else if (item == Items.writable_book)
    {
        this.mc.displayGuiScreen(new GuiScreenBook(this, p_71048_1_, true));
    }
}
项目:RuneCraftery    文件:EntityPlayerSP.java   
public void func_71048_c(ItemStack p_71048_1_) {
   Item var2 = p_71048_1_.func_77973_b();
   if(var2 == Item.field_77823_bG) {
      this.field_71159_c.func_71373_a(new GuiScreenBook(this, p_71048_1_, false));
   } else if(var2 == Item.field_77821_bF) {
      this.field_71159_c.func_71373_a(new GuiScreenBook(this, p_71048_1_, true));
   }

}
项目:RuneCraftery    文件:EntityPlayerSP.java   
/**
 * Displays the GUI for interacting with a book.
 */
public void displayGUIBook(ItemStack par1ItemStack)
{
    Item item = par1ItemStack.getItem();

    if (item == Item.writtenBook)
    {
        this.mc.displayGuiScreen(new GuiScreenBook(this, par1ItemStack, false));
    }
    else if (item == Item.writableBook)
    {
        this.mc.displayGuiScreen(new GuiScreenBook(this, par1ItemStack, true));
    }
}
项目:IceAndShadow2    文件:IaSItemGuidebook.java   
@Override
public boolean onItemUse(ItemStack is, EntityPlayer ep, World w, int x, int y, int z, int side, float subX,
        float subY, float subZ) {
    if (!w.isRemote)
        return false;
    final ItemStack wb = new ItemStack(Items.written_book);
    // TODO: Get text.
    Minecraft.getMinecraft().displayGuiScreen(new GuiScreenBook(ep, wb, false));
    return false;
}
项目:BetterNutritionMod    文件:EntityPlayerSP.java   
/**
 * Displays the GUI for interacting with a book.
 */
public void displayGUIBook(ItemStack par1ItemStack)
{
    Item item = par1ItemStack.getItem();

    if (item == Item.writtenBook)
    {
        this.mc.displayGuiScreen(new GuiScreenBook(this, par1ItemStack, false));
    }
    else if (item == Item.writableBook)
    {
        this.mc.displayGuiScreen(new GuiScreenBook(this, par1ItemStack, true));
    }
}
项目:ForgeHax    文件:BookBot.java   
@Override
public void run() {
    try {
        while (!stopped) {
            // check to see if we've finished the book
            if(!parser.hasNext()) {
                this.status = Status.FINISHED;
                break;
            }

            sleep();

            // wait for screen
            if (MC.currentScreen != null) {
                this.status = Status.AWAITING_GUI_CLOSE;
                continue;
            }

            // search for empty book
            int slot = -1;
            ItemStack selected = null;
            for (int i = 0; i < InventoryPlayer.getHotbarSize(); i++) {
                ItemStack stack = getLocalPlayer().inventory.getStackInSlot(i);
                if (stack != null
                        && !stack.equals(ItemStack.EMPTY)
                        && stack.getItem() instanceof ItemWritableBook) {
                    slot = i;
                    selected = stack;
                    break;
                }
            }

            // make sure we found a book
            if (slot == -1) {
                this.status = Status.NEED_EMPTY_BOOKS_IN_HOTBAR;
                continue;
            }

            // set selected item to that slot
            while(getLocalPlayer().inventory.currentItem != slot) {
                getLocalPlayer().inventory.currentItem = slot;
                this.status = Status.CHANGING_HELD_ITEM;
                sleep();
            }

            final ItemStack item = selected;

            // open the book gui screen
            this.status = Status.OPENING_BOOK;
            MC.addScheduledTask(() -> getLocalPlayer().openBook(item, EnumHand.MAIN_HAND));

            // wait for gui to open
            while(!(MC.currentScreen instanceof GuiScreenBook)) sleep();

            // send book to server
            this.status = Status.WRITING_BOOK;
            MC.addScheduledTask(() -> {
                sendBook(item);
                MC.displayGuiScreen(null);
            });

            // wait for screen to close
            while (MC.currentScreen != null) sleep();
        }
    } catch (Throwable t) {
        this.status = Status.ERROR;
    } finally {
        if(finalListener != null) {
            finalListener.accept(this);
            finalListener = null;
        }

        // set stopped to true
        this.stopped = true;

        if(!this.status.equals(Status.FINISHED) && !this.status.equals(Status.ERROR))
            this.status = Status.STOPPED;
    }
}
项目:DecompiledMinecraft    文件:NetHandlerPlayClient.java   
/**
 * Handles packets that have room for a channel specification. Vanilla implemented channels are "MC|TrList" to
 * acquire a MerchantRecipeList trades for a villager merchant, "MC|Brand" which sets the server brand? on the
 * player instance and finally "MC|RPack" which the server uses to communicate the identifier of the default server
 * resourcepack for the client to load.
 */
public void handleCustomPayload(S3FPacketCustomPayload packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    if ("MC|TrList".equals(packetIn.getChannelName()))
    {
        PacketBuffer packetbuffer = packetIn.getBufferData();

        try
        {
            int i = packetbuffer.readInt();
            GuiScreen guiscreen = this.gameController.currentScreen;

            if (guiscreen != null && guiscreen instanceof GuiMerchant && i == this.gameController.thePlayer.openContainer.windowId)
            {
                IMerchant imerchant = ((GuiMerchant)guiscreen).getMerchant();
                MerchantRecipeList merchantrecipelist = MerchantRecipeList.readFromBuf(packetbuffer);
                imerchant.setRecipes(merchantrecipelist);
            }
        }
        catch (IOException ioexception)
        {
            logger.error((String)"Couldn\'t load trade info", (Throwable)ioexception);
        }
        finally
        {
            packetbuffer.release();
        }
    }
    else if ("MC|Brand".equals(packetIn.getChannelName()))
    {
        this.gameController.thePlayer.setClientBrand(packetIn.getBufferData().readStringFromBuffer(32767));
    }
    else if ("MC|BOpen".equals(packetIn.getChannelName()))
    {
        ItemStack itemstack = this.gameController.thePlayer.getCurrentEquippedItem();

        if (itemstack != null && itemstack.getItem() == Items.written_book)
        {
            this.gameController.displayGuiScreen(new GuiScreenBook(this.gameController.thePlayer, itemstack, false));
        }
    }
}
项目:Wurst-MC-1.12    文件:GuiBookHack.java   
public GuiBookHack(GuiScreenBook prevScreen)
{
    this.prevScreen = prevScreen;
}
项目:BaseClient    文件:NetHandlerPlayClient.java   
/**
 * Handles packets that have room for a channel specification. Vanilla implemented channels are "MC|TrList" to
 * acquire a MerchantRecipeList trades for a villager merchant, "MC|Brand" which sets the server brand? on the
 * player instance and finally "MC|RPack" which the server uses to communicate the identifier of the default server
 * resourcepack for the client to load.
 */
public void handleCustomPayload(S3FPacketCustomPayload packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    if ("MC|TrList".equals(packetIn.getChannelName()))
    {
        PacketBuffer packetbuffer = packetIn.getBufferData();

        try
        {
            int i = packetbuffer.readInt();
            GuiScreen guiscreen = this.gameController.currentScreen;

            if (guiscreen != null && guiscreen instanceof GuiMerchant && i == this.gameController.thePlayer.openContainer.windowId)
            {
                IMerchant imerchant = ((GuiMerchant)guiscreen).getMerchant();
                MerchantRecipeList merchantrecipelist = MerchantRecipeList.readFromBuf(packetbuffer);
                imerchant.setRecipes(merchantrecipelist);
            }
        }
        catch (IOException ioexception)
        {
            logger.error((String)"Couldn\'t load trade info", (Throwable)ioexception);
        }
        finally
        {
            packetbuffer.release();
        }
    }
    else if ("MC|Brand".equals(packetIn.getChannelName()))
    {
        this.gameController.thePlayer.setClientBrand(packetIn.getBufferData().readStringFromBuffer(32767));
    }
    else if ("MC|BOpen".equals(packetIn.getChannelName()))
    {
        ItemStack itemstack = this.gameController.thePlayer.getCurrentEquippedItem();

        if (itemstack != null && itemstack.getItem() == Items.written_book)
        {
            this.gameController.displayGuiScreen(new GuiScreenBook(this.gameController.thePlayer, itemstack, false));
        }
    }
}
项目:Zombe-Modpack    文件:NetHandlerPlayClient.java   
/**
 * Handles packets that have room for a channel specification. Vanilla implemented channels are "MC|TrList" to
 * acquire a MerchantRecipeList trades for a villager merchant, "MC|Brand" which sets the server brand? on the
 * player instance and finally "MC|RPack" which the server uses to communicate the identifier of the default server
 * resourcepack for the client to load.
 */
public void handleCustomPayload(SPacketCustomPayload packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    if ("MC|TrList".equals(packetIn.getChannelName()))
    {
        PacketBuffer packetbuffer = packetIn.getBufferData();

        try
        {
            int i = packetbuffer.readInt();
            GuiScreen guiscreen = this.gameController.currentScreen;

            if (guiscreen != null && guiscreen instanceof GuiMerchant && i == this.gameController.player.openContainer.windowId)
            {
                IMerchant imerchant = ((GuiMerchant)guiscreen).getMerchant();
                MerchantRecipeList merchantrecipelist = MerchantRecipeList.readFromBuf(packetbuffer);
                imerchant.setRecipes(merchantrecipelist);
            }
        }
        catch (IOException ioexception)
        {
            LOGGER.error((String)"Couldn\'t load trade info", (Throwable)ioexception);
        }
        finally
        {
            packetbuffer.release();
        }
    }
    else if ("MC|Brand".equals(packetIn.getChannelName()))
    {
        this.gameController.player.setServerBrand(packetIn.getBufferData().readStringFromBuffer(32767));
    }
    else if ("MC|BOpen".equals(packetIn.getChannelName()))
    {
        EnumHand enumhand = (EnumHand)packetIn.getBufferData().readEnumValue(EnumHand.class);
        ItemStack itemstack = enumhand == EnumHand.OFF_HAND ? this.gameController.player.getHeldItemOffhand() : this.gameController.player.getHeldItemMainhand();

        if (itemstack.getItem() == Items.WRITTEN_BOOK)
        {
            this.gameController.displayGuiScreen(new GuiScreenBook(this.gameController.player, itemstack, false));
        }
    }
    else if ("MC|DebugPath".equals(packetIn.getChannelName()))
    {
        PacketBuffer packetbuffer1 = packetIn.getBufferData();
        int j = packetbuffer1.readInt();
        float f = packetbuffer1.readFloat();
        Path path = Path.read(packetbuffer1);
        ((DebugRendererPathfinding)this.gameController.debugRenderer.debugRendererPathfinding).addPath(j, path, f);
    }
    else if ("MC|StopSound".equals(packetIn.getChannelName()))
    {
        PacketBuffer packetbuffer2 = packetIn.getBufferData();
        String s = packetbuffer2.readStringFromBuffer(32767);
        String s1 = packetbuffer2.readStringFromBuffer(256);
        this.gameController.getSoundHandler().stop(s1, SoundCategory.getByName(s));
    }
}
项目:Backmemed    文件:NetHandlerPlayClient.java   
/**
 * Handles packets that have room for a channel specification. Vanilla implemented channels are "MC|TrList" to
 * acquire a MerchantRecipeList trades for a villager merchant, "MC|Brand" which sets the server brand? on the
 * player instance and finally "MC|RPack" which the server uses to communicate the identifier of the default server
 * resourcepack for the client to load.
 */
public void handleCustomPayload(SPacketCustomPayload packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    if ("MC|TrList".equals(packetIn.getChannelName()))
    {
        PacketBuffer packetbuffer = packetIn.getBufferData();

        try
        {
            int i = packetbuffer.readInt();
            GuiScreen guiscreen = this.gameController.currentScreen;

            if (guiscreen != null && guiscreen instanceof GuiMerchant && i == this.gameController.player.openContainer.windowId)
            {
                IMerchant imerchant = ((GuiMerchant)guiscreen).getMerchant();
                MerchantRecipeList merchantrecipelist = MerchantRecipeList.readFromBuf(packetbuffer);
                imerchant.setRecipes(merchantrecipelist);
            }
        }
        catch (IOException ioexception)
        {
            LOGGER.error((String)"Couldn\'t load trade info", (Throwable)ioexception);
        }
        finally
        {
            packetbuffer.release();
        }
    }
    else if ("MC|Brand".equals(packetIn.getChannelName()))
    {
        this.gameController.player.setServerBrand(packetIn.getBufferData().readStringFromBuffer(32767));
    }
    else if ("MC|BOpen".equals(packetIn.getChannelName()))
    {
        EnumHand enumhand = (EnumHand)packetIn.getBufferData().readEnumValue(EnumHand.class);
        ItemStack itemstack = enumhand == EnumHand.OFF_HAND ? this.gameController.player.getHeldItemOffhand() : this.gameController.player.getHeldItemMainhand();

        if (itemstack.getItem() == Items.WRITTEN_BOOK)
        {
            this.gameController.displayGuiScreen(new GuiScreenBook(this.gameController.player, itemstack, false));
        }
    }
    else if ("MC|DebugPath".equals(packetIn.getChannelName()))
    {
        PacketBuffer packetbuffer1 = packetIn.getBufferData();
        int j = packetbuffer1.readInt();
        float f = packetbuffer1.readFloat();
        Path path = Path.read(packetbuffer1);
        ((DebugRendererPathfinding)this.gameController.debugRenderer.debugRendererPathfinding).addPath(j, path, f);
    }
    else if ("MC|DebugNeighborsUpdate".equals(packetIn.getChannelName()))
    {
        PacketBuffer packetbuffer2 = packetIn.getBufferData();
        long k = packetbuffer2.readVarLong();
        BlockPos blockpos = packetbuffer2.readBlockPos();
        ((DebugRendererNeighborsUpdate)this.gameController.debugRenderer.field_191557_f).func_191553_a(k, blockpos);
    }
    else if ("MC|StopSound".equals(packetIn.getChannelName()))
    {
        PacketBuffer packetbuffer3 = packetIn.getBufferData();
        String s = packetbuffer3.readStringFromBuffer(32767);
        String s1 = packetbuffer3.readStringFromBuffer(256);
        this.gameController.getSoundHandler().stop(s1, SoundCategory.getByName(s));
    }
}
项目:CustomWorldGen    文件:NetHandlerPlayClient.java   
/**
 * Handles packets that have room for a channel specification. Vanilla implemented channels are "MC|TrList" to
 * acquire a MerchantRecipeList trades for a villager merchant, "MC|Brand" which sets the server brand? on the
 * player instance and finally "MC|RPack" which the server uses to communicate the identifier of the default server
 * resourcepack for the client to load.
 */
public void handleCustomPayload(SPacketCustomPayload packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    if ("MC|TrList".equals(packetIn.getChannelName()))
    {
        PacketBuffer packetbuffer = packetIn.getBufferData();

        try
        {
            int i = packetbuffer.readInt();
            GuiScreen guiscreen = this.gameController.currentScreen;

            if (guiscreen != null && guiscreen instanceof GuiMerchant && i == this.gameController.thePlayer.openContainer.windowId)
            {
                IMerchant imerchant = ((GuiMerchant)guiscreen).getMerchant();
                MerchantRecipeList merchantrecipelist = MerchantRecipeList.readFromBuf(packetbuffer);
                imerchant.setRecipes(merchantrecipelist);
            }
        }
        catch (IOException ioexception)
        {
            LOGGER.error((String)"Couldn\'t load trade info", (Throwable)ioexception);
        }
        finally
        {
            packetbuffer.release();
        }
    }
    else if ("MC|Brand".equals(packetIn.getChannelName()))
    {
        this.gameController.thePlayer.setServerBrand(packetIn.getBufferData().readStringFromBuffer(32767));
    }
    else if ("MC|BOpen".equals(packetIn.getChannelName()))
    {
        EnumHand enumhand = (EnumHand)packetIn.getBufferData().readEnumValue(EnumHand.class);
        ItemStack itemstack = enumhand == EnumHand.OFF_HAND ? this.gameController.thePlayer.getHeldItemOffhand() : this.gameController.thePlayer.getHeldItemMainhand();

        if (itemstack != null && itemstack.getItem() == Items.WRITTEN_BOOK)
        {
            this.gameController.displayGuiScreen(new GuiScreenBook(this.gameController.thePlayer, itemstack, false));
        }
    }
    else if ("MC|DebugPath".equals(packetIn.getChannelName()))
    {
        PacketBuffer packetbuffer1 = packetIn.getBufferData();
        int j = packetbuffer1.readInt();
        float f = packetbuffer1.readFloat();
        Path path = Path.read(packetbuffer1);
        ((DebugRendererPathfinding)this.gameController.debugRenderer.debugRendererPathfinding).addPath(j, path, f);
    }
    else if ("MC|StopSound".equals(packetIn.getChannelName()))
    {
        PacketBuffer packetbuffer2 = packetIn.getBufferData();
        String s = packetbuffer2.readStringFromBuffer(32767);
        String s1 = packetbuffer2.readStringFromBuffer(256);
        this.gameController.getSoundHandler().stop(s1, SoundCategory.getByName(s));
    }
}
项目:EvenWurse    文件:GuiBookHack.java   
public GuiBookHack(GuiScreenBook prevMenu) {
    this.prevMenu = prevMenu;
}
项目:HardcoreWither    文件:GuiHelper.java   
public static void doBookGui(EntityPlayer player, ItemStack itemStack, boolean par3)
{
   Minecraft.getMinecraft().displayGuiScreen(new GuiScreenBook(player, itemStack, par3));
}
项目:MoreDimensions    文件:GuiHelper.java   
public static void doBookGui(EntityPlayer player, ItemStack itemStack, boolean par3) {
    Minecraft.getMinecraft().displayGuiScreen(new GuiScreenBook(player, itemStack, par3));
}
项目:Modpack-Tweaks    文件:GuiHelper.java   
public static void doBookGUI(EntityPlayer player, ItemStack stack, boolean par3)
{
    Minecraft.getMinecraft().displayGuiScreen(new GuiScreenBook(player, stack, par3));
}
项目:ExpandedRailsMod    文件:NetHandlerPlayClient.java   
/**
 * Handles packets that have room for a channel specification. Vanilla implemented channels are "MC|TrList" to
 * acquire a MerchantRecipeList trades for a villager merchant, "MC|Brand" which sets the server brand? on the
 * player instance and finally "MC|RPack" which the server uses to communicate the identifier of the default server
 * resourcepack for the client to load.
 */
public void handleCustomPayload(SPacketCustomPayload packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    if ("MC|TrList".equals(packetIn.getChannelName()))
    {
        PacketBuffer packetbuffer = packetIn.getBufferData();

        try
        {
            int i = packetbuffer.readInt();
            GuiScreen guiscreen = this.gameController.currentScreen;

            if (guiscreen != null && guiscreen instanceof GuiMerchant && i == this.gameController.thePlayer.openContainer.windowId)
            {
                IMerchant imerchant = ((GuiMerchant)guiscreen).getMerchant();
                MerchantRecipeList merchantrecipelist = MerchantRecipeList.readFromBuf(packetbuffer);
                imerchant.setRecipes(merchantrecipelist);
            }
        }
        catch (IOException ioexception)
        {
            LOGGER.error((String)"Couldn\'t load trade info", (Throwable)ioexception);
        }
        finally
        {
            packetbuffer.release();
        }
    }
    else if ("MC|Brand".equals(packetIn.getChannelName()))
    {
        this.gameController.thePlayer.setServerBrand(packetIn.getBufferData().readStringFromBuffer(32767));
    }
    else if ("MC|BOpen".equals(packetIn.getChannelName()))
    {
        EnumHand enumhand = (EnumHand)packetIn.getBufferData().readEnumValue(EnumHand.class);
        ItemStack itemstack = enumhand == EnumHand.OFF_HAND ? this.gameController.thePlayer.getHeldItemOffhand() : this.gameController.thePlayer.getHeldItemMainhand();

        if (itemstack != null && itemstack.getItem() == Items.WRITTEN_BOOK)
        {
            this.gameController.displayGuiScreen(new GuiScreenBook(this.gameController.thePlayer, itemstack, false));
        }
    }
    else if ("MC|DebugPath".equals(packetIn.getChannelName()))
    {
        PacketBuffer packetbuffer1 = packetIn.getBufferData();
        int j = packetbuffer1.readInt();
        float f = packetbuffer1.readFloat();
        Path path = Path.read(packetbuffer1);
        ((DebugRendererPathfinding)this.gameController.debugRenderer.debugRendererPathfinding).addPath(j, path, f);
    }
    else if ("MC|StopSound".equals(packetIn.getChannelName()))
    {
        PacketBuffer packetbuffer2 = packetIn.getBufferData();
        String s = packetbuffer2.readStringFromBuffer(32767);
        String s1 = packetbuffer2.readStringFromBuffer(256);
        this.gameController.getSoundHandler().stop(s1, SoundCategory.getByName(s));
    }
}