当前位置: 首页>>代码示例>>Java>>正文


Java GuiCommandBlock类代码示例

本文整理汇总了Java中net.minecraft.client.gui.GuiCommandBlock的典型用法代码示例。如果您正苦于以下问题:Java GuiCommandBlock类的具体用法?Java GuiCommandBlock怎么用?Java GuiCommandBlock使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GuiCommandBlock类属于net.minecraft.client.gui包,在下文中一共展示了GuiCommandBlock类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleUpdateTileEntity

import net.minecraft.client.gui.GuiCommandBlock; //导入依赖的package包/类
/**
 * Updates the NBTTagCompound metadata of instances of the following entitytypes: Mob spawners, command blocks,
 * beacons, skulls, flowerpot
 */
public void handleUpdateTileEntity(SPacketUpdateTileEntity packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    if (this.gameController.world.isBlockLoaded(packetIn.getPos()))
    {
        TileEntity tileentity = this.gameController.world.getTileEntity(packetIn.getPos());
        int i = packetIn.getTileEntityType();
        boolean flag = i == 2 && tileentity instanceof TileEntityCommandBlock;

        if (i == 1 && tileentity instanceof TileEntityMobSpawner || flag || i == 3 && tileentity instanceof TileEntityBeacon || i == 4 && tileentity instanceof TileEntitySkull || i == 5 && tileentity instanceof TileEntityFlowerPot || i == 6 && tileentity instanceof TileEntityBanner || i == 7 && tileentity instanceof TileEntityStructure || i == 8 && tileentity instanceof TileEntityEndGateway || i == 9 && tileentity instanceof TileEntitySign || i == 10 && tileentity instanceof TileEntityShulkerBox)
        {
            tileentity.readFromNBT(packetIn.getNbtCompound());
        }

        if (flag && this.gameController.currentScreen instanceof GuiCommandBlock)
        {
            ((GuiCommandBlock)this.gameController.currentScreen).updateGui();
        }
    }
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:26,代码来源:NetHandlerPlayClient.java

示例2: onReceiveClient

import net.minecraft.client.gui.GuiCommandBlock; //导入依赖的package包/类
@Override
public void onReceiveClient(Minecraft client, WorldClient world, EntityPlayerSP player, MessageContext context) {
    BlockSystem blockSystem = BlockSystems.PROXY.getBlockSystemHandler(world).getBlockSystem(this.blockSystem);
    if (blockSystem != null) {
        if (blockSystem.isBlockLoaded(this.pos)) {
            TileEntity blockEntity = blockSystem.getTileEntity(this.pos);
            boolean commandBlock = this.type == 2 && blockEntity instanceof TileEntityCommandBlock;
            if (this.type == 1 && blockEntity instanceof TileEntityMobSpawner || commandBlock || this.type == 3 && blockEntity instanceof TileEntityBeacon || this.type == 4 && blockEntity instanceof TileEntitySkull || this.type == 5 && blockEntity instanceof TileEntityFlowerPot || this.type == 6 && blockEntity instanceof TileEntityBanner || this.type == 7 && blockEntity instanceof TileEntityStructure || this.type == 8 && blockEntity instanceof TileEntityEndGateway || this.type == 9 && blockEntity instanceof TileEntitySign) {
                blockEntity.readFromNBT(this.data);
            } else {
                blockEntity.onDataPacket(client.getConnection().getNetworkManager(), new SPacketUpdateTileEntity(this.pos, this.type, this.data));
            }
            if (commandBlock && client.currentScreen instanceof GuiCommandBlock) {
                ((GuiCommandBlock) client.currentScreen).updateGui();
            }
        }
    }
}
 
开发者ID:gegy1000,项目名称:BlockSystems,代码行数:19,代码来源:UpdateBlockEntityMessage.java

示例3: initGui

import net.minecraft.client.gui.GuiCommandBlock; //导入依赖的package包/类
@Override
   public void initGui()
{
	super.initGui();
	
	buttonList.add(new GuiButton(ColorData.FORMAT_BUTTON_ID, width / 2 - 100, height / 4 + 132 + 20, ColorData.FORMAT_BUTTON_STR));

   	try
   	{
           text = new UnfilteredTextField(2, this.fontRendererObj, this.width / 2 - 150, 60, 300, 20);
           text.setMaxStringLength(32767);
           text.setFocused(true);
           text.setText( cmd.getCustomName() ); // getCommand
           
    	Class c = GuiCommandBlock.class;
    	Field f = c.getDeclaredFields()[ 1 ];
    	f.setAccessible( true );
    	f.set( this, text );
   	}
   	catch ( Exception exception )
   	{
   		exception.printStackTrace();
   	}
}
 
开发者ID:spacechase0,项目名称:TextFormatting,代码行数:25,代码来源:CommandBlockGui.java

示例4: handleUpdateTileEntity

import net.minecraft.client.gui.GuiCommandBlock; //导入依赖的package包/类
/**
 * Updates the NBTTagCompound metadata of instances of the following entitytypes: Mob spawners, command blocks,
 * beacons, skulls, flowerpot
 */
public void handleUpdateTileEntity(SPacketUpdateTileEntity packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    if (this.gameController.theWorld.isBlockLoaded(packetIn.getPos()))
    {
        TileEntity tileentity = this.gameController.theWorld.getTileEntity(packetIn.getPos());
        int i = packetIn.getTileEntityType();
        boolean flag = i == 2 && tileentity instanceof TileEntityCommandBlock;

        if (i == 1 && tileentity instanceof TileEntityMobSpawner || flag || i == 3 && tileentity instanceof TileEntityBeacon || i == 4 && tileentity instanceof TileEntitySkull || i == 5 && tileentity instanceof TileEntityFlowerPot || i == 6 && tileentity instanceof TileEntityBanner || i == 7 && tileentity instanceof TileEntityStructure || i == 8 && tileentity instanceof TileEntityEndGateway || i == 9 && tileentity instanceof TileEntitySign)
        {
            tileentity.readFromNBT(packetIn.getNbtCompound());
        }
        else
        {
            tileentity.onDataPacket(netManager, packetIn);
        }

        if (flag && this.gameController.currentScreen instanceof GuiCommandBlock)
        {
            ((GuiCommandBlock)this.gameController.currentScreen).updateGui();
        }
    }
}
 
开发者ID:BlazeAxtrius,项目名称:ExpandedRailsMod,代码行数:30,代码来源:NetHandlerPlayClient.java

示例5: handleUpdateTileEntity

import net.minecraft.client.gui.GuiCommandBlock; //导入依赖的package包/类
/**
 * Updates the NBTTagCompound metadata of instances of the following entitytypes: Mob spawners, command blocks,
 * beacons, skulls, flowerpot
 */
public void handleUpdateTileEntity(SPacketUpdateTileEntity packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    if (this.gameController.theWorld.isBlockLoaded(packetIn.getPos()))
    {
        TileEntity tileentity = this.gameController.theWorld.getTileEntity(packetIn.getPos());
        int i = packetIn.getTileEntityType();
        boolean flag = i == 2 && tileentity instanceof TileEntityCommandBlock;

        if (i == 1 && tileentity instanceof TileEntityMobSpawner || flag || i == 3 && tileentity instanceof TileEntityBeacon || i == 4 && tileentity instanceof TileEntitySkull || i == 5 && tileentity instanceof TileEntityFlowerPot || i == 6 && tileentity instanceof TileEntityBanner || i == 7 && tileentity instanceof TileEntityStructure || i == 8 && tileentity instanceof TileEntityEndGateway || i == 9 && tileentity instanceof TileEntitySign)
        {
            tileentity.readFromNBT(packetIn.getNbtCompound());
        }
        else
        {
            if(tileentity == null)
            {
                LOGGER.error("Received invalid update packet for null tile entity at {} with data: {}", packetIn.getPos(), packetIn.getNbtCompound());
                return;
            }
            tileentity.onDataPacket(netManager, packetIn);
        }

        if (flag && this.gameController.currentScreen instanceof GuiCommandBlock)
        {
            ((GuiCommandBlock)this.gameController.currentScreen).updateGui();
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:35,代码来源:NetHandlerPlayClient.java

示例6: func_146100_a

import net.minecraft.client.gui.GuiCommandBlock; //导入依赖的package包/类
public void func_146100_a(TileEntity p_146100_1_)
{
    if (p_146100_1_ instanceof TileEntitySign)
    {
        this.mc.displayGuiScreen(new GuiEditSign((TileEntitySign)p_146100_1_));
    }
    else if (p_146100_1_ instanceof TileEntityCommandBlock)
    {
        this.mc.displayGuiScreen(new GuiCommandBlock(((TileEntityCommandBlock)p_146100_1_).func_145993_a()));
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:12,代码来源:EntityPlayerSP.java

示例7: init

import net.minecraft.client.gui.GuiCommandBlock; //导入依赖的package包/类
@EventHandler
public void init(FMLInitializationEvent e) {
	MinecraftForge.EVENT_BUS.register(this);

	GuiReplacementRegistry.getInstance().registerReplacement(GuiCommandBlock.class, GuiNewCommandBlock.class);

	readFromConfig();
}
 
开发者ID:Earthcomputer,项目名称:Easy-Editors,代码行数:9,代码来源:EasyEditors.java

示例8: func_71014_a

import net.minecraft.client.gui.GuiCommandBlock; //导入依赖的package包/类
public void func_71014_a(TileEntity p_71014_1_) {
   if(p_71014_1_ instanceof TileEntitySign) {
      this.field_71159_c.func_71373_a(new GuiEditSign((TileEntitySign)p_71014_1_));
   } else if(p_71014_1_ instanceof TileEntityCommandBlock) {
      this.field_71159_c.func_71373_a(new GuiCommandBlock((TileEntityCommandBlock)p_71014_1_));
   }

}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:9,代码来源:EntityPlayerSP.java

示例9: displayGUIEditSign

import net.minecraft.client.gui.GuiCommandBlock; //导入依赖的package包/类
/**
 * Displays the GUI for editing a sign. Args: tileEntitySign
 */
public void displayGUIEditSign(TileEntity par1TileEntity)
{
    if (par1TileEntity instanceof TileEntitySign)
    {
        this.mc.displayGuiScreen(new GuiEditSign((TileEntitySign)par1TileEntity));
    }
    else if (par1TileEntity instanceof TileEntityCommandBlock)
    {
        this.mc.displayGuiScreen(new GuiCommandBlock((TileEntityCommandBlock)par1TileEntity));
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:15,代码来源:EntityPlayerSP.java

示例10: openEditCommandBlock

import net.minecraft.client.gui.GuiCommandBlock; //导入依赖的package包/类
public void openEditCommandBlock(CommandBlockLogic cmdBlockLogic)
{
    this.mc.displayGuiScreen(new GuiCommandBlock(cmdBlockLogic));
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:EntityPlayerSP.java

示例11: openEditCommandBlock

import net.minecraft.client.gui.GuiCommandBlock; //导入依赖的package包/类
public void openEditCommandBlock(CommandBlockLogic cmdBlockLogic) {
	this.mc.displayGuiScreen(new GuiCommandBlock(cmdBlockLogic));
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:4,代码来源:EntityPlayerSP.java

示例12: displayGuiCommandBlock

import net.minecraft.client.gui.GuiCommandBlock; //导入依赖的package包/类
public void displayGuiCommandBlock(TileEntityCommandBlock commandBlock)
{
    this.mc.displayGuiScreen(new GuiCommandBlock(commandBlock));
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:5,代码来源:EntityPlayerSP.java

示例13: func_146095_a

import net.minecraft.client.gui.GuiCommandBlock; //导入依赖的package包/类
public void func_146095_a(CommandBlockLogic p_146095_1_)
{
    this.mc.displayGuiScreen(new GuiCommandBlock(p_146095_1_));
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:5,代码来源:EntityPlayerSP.java

示例14: GuiNewCommandBlock

import net.minecraft.client.gui.GuiCommandBlock; //导入依赖的package包/类
public GuiNewCommandBlock(GuiCommandBlock old) throws Exception {
	super((TileEntityCommandBlock) commandBlockField.get(old));
	commandBlock = (TileEntityCommandBlock) commandBlockField.get(old);
}
 
开发者ID:Earthcomputer,项目名称:Easy-Editors,代码行数:5,代码来源:GuiNewCommandBlock.java

示例15: displayGuiCommandBlock

import net.minecraft.client.gui.GuiCommandBlock; //导入依赖的package包/类
public void displayGuiCommandBlock(TileEntityCommandBlock p_184824_1_)
{
    this.mc.displayGuiScreen(new GuiCommandBlock(p_184824_1_));
}
 
开发者ID:BlazeAxtrius,项目名称:ExpandedRailsMod,代码行数:5,代码来源:EntityPlayerSP.java


注:本文中的net.minecraft.client.gui.GuiCommandBlock类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。