本文整理汇总了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();
}
}
}
示例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();
}
}
}
}
示例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();
}
}
示例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();
}
}
}
示例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();
}
}
}
示例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()));
}
}
示例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();
}
示例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_));
}
}
示例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));
}
}
示例10: openEditCommandBlock
import net.minecraft.client.gui.GuiCommandBlock; //导入依赖的package包/类
public void openEditCommandBlock(CommandBlockLogic cmdBlockLogic)
{
this.mc.displayGuiScreen(new GuiCommandBlock(cmdBlockLogic));
}
示例11: openEditCommandBlock
import net.minecraft.client.gui.GuiCommandBlock; //导入依赖的package包/类
public void openEditCommandBlock(CommandBlockLogic cmdBlockLogic) {
this.mc.displayGuiScreen(new GuiCommandBlock(cmdBlockLogic));
}
示例12: displayGuiCommandBlock
import net.minecraft.client.gui.GuiCommandBlock; //导入依赖的package包/类
public void displayGuiCommandBlock(TileEntityCommandBlock commandBlock)
{
this.mc.displayGuiScreen(new GuiCommandBlock(commandBlock));
}
示例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_));
}
示例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);
}
示例15: displayGuiCommandBlock
import net.minecraft.client.gui.GuiCommandBlock; //导入依赖的package包/类
public void displayGuiCommandBlock(TileEntityCommandBlock p_184824_1_)
{
this.mc.displayGuiScreen(new GuiCommandBlock(p_184824_1_));
}