本文整理汇总了Java中net.minecraft.tileentity.CommandBlockBaseLogic类的典型用法代码示例。如果您正苦于以下问题:Java CommandBlockBaseLogic类的具体用法?Java CommandBlockBaseLogic怎么用?Java CommandBlockBaseLogic使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CommandBlockBaseLogic类属于net.minecraft.tileentity包,在下文中一共展示了CommandBlockBaseLogic类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateGui
import net.minecraft.tileentity.CommandBlockBaseLogic; //导入依赖的package包/类
public void updateGui()
{
CommandBlockBaseLogic commandblockbaselogic = this.commandBlock.getCommandBlockLogic();
this.commandTextField.setText(commandblockbaselogic.getCommand());
this.trackOutput = commandblockbaselogic.shouldTrackOutput();
this.commandBlockMode = this.commandBlock.getMode();
this.conditional = this.commandBlock.isConditional();
this.automatic = this.commandBlock.isAuto();
this.updateCmdOutput();
this.updateMode();
this.updateConditional();
this.updateAutoExec();
this.doneBtn.enabled = true;
this.outputBtn.enabled = true;
this.modeBtn.enabled = true;
this.conditionalBtn.enabled = true;
this.autoExecBtn.enabled = true;
}
示例2: updateCmdOutput
import net.minecraft.tileentity.CommandBlockBaseLogic; //导入依赖的package包/类
private void updateCmdOutput()
{
CommandBlockBaseLogic commandblockbaselogic = this.commandBlock.getCommandBlockLogic();
if (commandblockbaselogic.shouldTrackOutput())
{
this.outputBtn.displayString = "O";
if (commandblockbaselogic.getLastOutput() != null)
{
this.previousOutputTextField.setText(commandblockbaselogic.getLastOutput().getUnformattedText());
}
}
else
{
this.outputBtn.displayString = "X";
this.previousOutputTextField.setText("-");
}
}
示例3: displayGuiEditCommandCart
import net.minecraft.tileentity.CommandBlockBaseLogic; //导入依赖的package包/类
@Override
public void displayGuiEditCommandCart(CommandBlockBaseLogic commandBlock) {
if (m_realPlayer == null) {
super.displayGuiEditCommandCart(commandBlock);
} else {
syncToRealPlayer();
m_realPlayer.displayGuiEditCommandCart(commandBlock);
syncPublicFieldsFromReal();
}
}
示例4: displayGuiEditCommandCart
import net.minecraft.tileentity.CommandBlockBaseLogic; //导入依赖的package包/类
@Override
public void displayGuiEditCommandCart(CommandBlockBaseLogic commandBlock) {
if (m_realPlayer == null) {
super.displayGuiEditCommandCart(commandBlock);
} else {
m_realPlayer.displayGuiEditCommandCart(commandBlock);
}
}
示例5: onBlockPlacedBy
import net.minecraft.tileentity.CommandBlockBaseLogic; //导入依赖的package包/类
/**
* Called by ItemBlocks after a block is set in the world, to allow post-place logic
*/
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
{
TileEntity tileentity = worldIn.getTileEntity(pos);
if (tileentity instanceof TileEntityCommandBlock)
{
TileEntityCommandBlock tileentitycommandblock = (TileEntityCommandBlock)tileentity;
CommandBlockBaseLogic commandblockbaselogic = tileentitycommandblock.getCommandBlockLogic();
if (stack.hasDisplayName())
{
commandblockbaselogic.setName(stack.getDisplayName());
}
if (!worldIn.isRemote)
{
NBTTagCompound nbttagcompound = stack.getTagCompound();
if (nbttagcompound == null || !nbttagcompound.hasKey("BlockEntityTag", 10))
{
commandblockbaselogic.setTrackOutput(worldIn.getGameRules().getBoolean("sendCommandFeedback"));
tileentitycommandblock.setAuto(this == Blocks.CHAIN_COMMAND_BLOCK);
}
if (tileentitycommandblock.getMode() == TileEntityCommandBlock.Mode.SEQUENCE)
{
boolean flag = worldIn.isBlockPowered(pos);
tileentitycommandblock.setPowered(flag);
}
}
}
}
示例6: initGui
import net.minecraft.tileentity.CommandBlockBaseLogic; //导入依赖的package包/类
/**
* Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
* window resizes, the buttonList is cleared beforehand.
*/
public void initGui()
{
final CommandBlockBaseLogic commandblockbaselogic = this.commandBlock.getCommandBlockLogic();
Keyboard.enableRepeatEvents(true);
this.buttonList.clear();
this.doneBtn = this.addButton(new GuiButton(0, this.width / 2 - 4 - 150, this.height / 4 + 120 + 12, 150, 20, I18n.format("gui.done", new Object[0])));
this.cancelBtn = this.addButton(new GuiButton(1, this.width / 2 + 4, this.height / 4 + 120 + 12, 150, 20, I18n.format("gui.cancel", new Object[0])));
this.outputBtn = this.addButton(new GuiButton(4, this.width / 2 + 150 - 20, 135, 20, 20, "O"));
this.modeBtn = this.addButton(new GuiButton(5, this.width / 2 - 50 - 100 - 4, 165, 100, 20, I18n.format("advMode.mode.sequence", new Object[0])));
this.conditionalBtn = this.addButton(new GuiButton(6, this.width / 2 - 50, 165, 100, 20, I18n.format("advMode.mode.unconditional", new Object[0])));
this.autoExecBtn = this.addButton(new GuiButton(7, this.width / 2 + 50 + 4, 165, 100, 20, I18n.format("advMode.mode.redstoneTriggered", new Object[0])));
this.commandTextField = new GuiTextField(2, this.fontRendererObj, this.width / 2 - 150, 50, 300, 20);
this.commandTextField.setMaxStringLength(32500);
this.commandTextField.setFocused(true);
this.previousOutputTextField = new GuiTextField(3, this.fontRendererObj, this.width / 2 - 150, 135, 276, 20);
this.previousOutputTextField.setMaxStringLength(32500);
this.previousOutputTextField.setEnabled(false);
this.previousOutputTextField.setText("-");
this.doneBtn.enabled = false;
this.outputBtn.enabled = false;
this.modeBtn.enabled = false;
this.conditionalBtn.enabled = false;
this.autoExecBtn.enabled = false;
this.tabCompleter = new TabCompleter(this.commandTextField, true)
{
@Nullable
public BlockPos getTargetBlockPos()
{
return commandblockbaselogic.getPosition();
}
};
}
示例7: updateCmdOutput
import net.minecraft.tileentity.CommandBlockBaseLogic; //导入依赖的package包/类
private void updateCmdOutput() {
CommandBlockBaseLogic logic = commandBlock.getCommandBlockLogic();
if (logic.shouldTrackOutput()) {
outputBtn.displayString = Translate.GUI_COMMANDBLOCK_TRACKINGOUTPUT;
// Previous output text field text already set by superclass
} else {
outputBtn.displayString = Translate.GUI_COMMANDBLOCK_IGNORINGOUTPUT;
previousOutputTextField.setText(Translate.GUI_COMMANDBLOCK_NOOUTPUT);
}
}
示例8: initGui
import net.minecraft.tileentity.CommandBlockBaseLogic; //导入依赖的package包/类
/**
* Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
* window resizes, the buttonList is cleared beforehand.
*/
public void initGui()
{
final CommandBlockBaseLogic commandblockbaselogic = this.commandBlock.getCommandBlockLogic();
Keyboard.enableRepeatEvents(true);
this.buttonList.clear();
this.doneBtn = this.func_189646_b(new GuiButton(0, this.width / 2 - 4 - 150, this.height / 4 + 120 + 12, 150, 20, I18n.format("gui.done", new Object[0])));
this.cancelBtn = this.func_189646_b(new GuiButton(1, this.width / 2 + 4, this.height / 4 + 120 + 12, 150, 20, I18n.format("gui.cancel", new Object[0])));
this.outputBtn = this.func_189646_b(new GuiButton(4, this.width / 2 + 150 - 20, 135, 20, 20, "O"));
this.modeBtn = this.func_189646_b(new GuiButton(5, this.width / 2 - 50 - 100 - 4, 165, 100, 20, I18n.format("advMode.mode.sequence", new Object[0])));
this.conditionalBtn = this.func_189646_b(new GuiButton(6, this.width / 2 - 50, 165, 100, 20, I18n.format("advMode.mode.unconditional", new Object[0])));
this.autoExecBtn = this.func_189646_b(new GuiButton(7, this.width / 2 + 50 + 4, 165, 100, 20, I18n.format("advMode.mode.redstoneTriggered", new Object[0])));
this.commandTextField = new GuiTextField(2, this.fontRendererObj, this.width / 2 - 150, 50, 300, 20);
this.commandTextField.setMaxStringLength(32500);
this.commandTextField.setFocused(true);
this.previousOutputTextField = new GuiTextField(3, this.fontRendererObj, this.width / 2 - 150, 135, 276, 20);
this.previousOutputTextField.setMaxStringLength(32500);
this.previousOutputTextField.setEnabled(false);
this.previousOutputTextField.setText("-");
this.doneBtn.enabled = false;
this.outputBtn.enabled = false;
this.modeBtn.enabled = false;
this.conditionalBtn.enabled = false;
this.autoExecBtn.enabled = false;
this.tabCompleter = new TabCompleter(this.commandTextField, true)
{
@Nullable
public BlockPos getTargetBlockPos()
{
return commandblockbaselogic.getPosition();
}
};
}
示例9: displayGuiEditCommandCart
import net.minecraft.tileentity.CommandBlockBaseLogic; //导入依赖的package包/类
public void displayGuiEditCommandCart(CommandBlockBaseLogic commandBlock)
{
}
示例10: displayGuiEditCommandCart
import net.minecraft.tileentity.CommandBlockBaseLogic; //导入依赖的package包/类
public void displayGuiEditCommandCart(CommandBlockBaseLogic commandBlock)
{
this.mc.displayGuiScreen(new GuiEditCommandBlockMinecart(commandBlock));
}
示例11: getCommandBlockLogic
import net.minecraft.tileentity.CommandBlockBaseLogic; //导入依赖的package包/类
public CommandBlockBaseLogic getCommandBlockLogic()
{
return this.commandBlockLogic;
}
示例12: updateTick
import net.minecraft.tileentity.CommandBlockBaseLogic; //导入依赖的package包/类
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
{
if (!worldIn.isRemote)
{
TileEntity tileentity = worldIn.getTileEntity(pos);
if (tileentity instanceof TileEntityCommandBlock)
{
TileEntityCommandBlock tileentitycommandblock = (TileEntityCommandBlock)tileentity;
CommandBlockBaseLogic commandblockbaselogic = tileentitycommandblock.getCommandBlockLogic();
boolean flag = !StringUtils.isNullOrEmpty(commandblockbaselogic.getCommand());
TileEntityCommandBlock.Mode tileentitycommandblock$mode = tileentitycommandblock.getMode();
boolean flag1 = !tileentitycommandblock.isConditional() || this.isNextToSuccessfulCommandBlock(worldIn, pos, state);
boolean flag2 = tileentitycommandblock.isConditionMet();
boolean flag3 = false;
if (tileentitycommandblock$mode != TileEntityCommandBlock.Mode.SEQUENCE && flag2 && flag)
{
commandblockbaselogic.trigger(worldIn);
flag3 = true;
}
if (tileentitycommandblock.isPowered() || tileentitycommandblock.isAuto())
{
if (tileentitycommandblock$mode == TileEntityCommandBlock.Mode.SEQUENCE && flag1 && flag)
{
commandblockbaselogic.trigger(worldIn);
flag3 = true;
}
if (tileentitycommandblock$mode == TileEntityCommandBlock.Mode.AUTO)
{
worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn));
if (flag1)
{
this.propagateUpdate(worldIn, pos);
}
}
}
if (!flag3)
{
commandblockbaselogic.setSuccessCount(0);
}
tileentitycommandblock.setConditionMet(flag1);
worldIn.updateComparatorOutputLevel(pos, this);
}
}
}
示例13: GuiEditCommandBlockMinecart
import net.minecraft.tileentity.CommandBlockBaseLogic; //导入依赖的package包/类
public GuiEditCommandBlockMinecart(CommandBlockBaseLogic p_i46595_1_)
{
this.commandBlockLogic = p_i46595_1_;
}
示例14: actionPerformed
import net.minecraft.tileentity.CommandBlockBaseLogic; //导入依赖的package包/类
/**
* Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
*/
protected void actionPerformed(GuiButton button) throws IOException
{
if (button.enabled)
{
CommandBlockBaseLogic commandblockbaselogic = this.commandBlock.getCommandBlockLogic();
if (button.id == 1)
{
commandblockbaselogic.setTrackOutput(this.trackOutput);
this.mc.displayGuiScreen((GuiScreen)null);
}
else if (button.id == 0)
{
PacketBuffer packetbuffer = new PacketBuffer(Unpooled.buffer());
commandblockbaselogic.fillInInfo(packetbuffer);
packetbuffer.writeString(this.commandTextField.getText());
packetbuffer.writeBoolean(commandblockbaselogic.shouldTrackOutput());
packetbuffer.writeString(this.commandBlockMode.name());
packetbuffer.writeBoolean(this.conditional);
packetbuffer.writeBoolean(this.automatic);
this.mc.getConnection().sendPacket(new CPacketCustomPayload("MC|AutoCmd", packetbuffer));
if (!commandblockbaselogic.shouldTrackOutput())
{
commandblockbaselogic.setLastOutput((ITextComponent)null);
}
this.mc.displayGuiScreen((GuiScreen)null);
}
else if (button.id == 4)
{
commandblockbaselogic.setTrackOutput(!commandblockbaselogic.shouldTrackOutput());
this.updateCmdOutput();
}
else if (button.id == 5)
{
this.nextMode();
this.updateMode();
}
else if (button.id == 6)
{
this.conditional = !this.conditional;
this.updateConditional();
}
else if (button.id == 7)
{
this.automatic = !this.automatic;
this.updateAutoExec();
}
}
}
示例15: notifyListener
import net.minecraft.tileentity.CommandBlockBaseLogic; //导入依赖的package包/类
/**
* Send an informative message to the server operators
*/
public void notifyListener(ICommandSender sender, ICommand command, int flags, String translationKey, Object... translationArgs)
{
boolean flag = true;
MinecraftServer minecraftserver = this.server;
if (!sender.sendCommandFeedback())
{
flag = false;
}
ITextComponent itextcomponent = new TextComponentTranslation("chat.type.admin", new Object[] {sender.getName(), new TextComponentTranslation(translationKey, translationArgs)});
itextcomponent.getStyle().setColor(TextFormatting.GRAY);
itextcomponent.getStyle().setItalic(Boolean.valueOf(true));
if (flag)
{
for (EntityPlayer entityplayer : minecraftserver.getPlayerList().getPlayerList())
{
if (entityplayer != sender && minecraftserver.getPlayerList().canSendCommands(entityplayer.getGameProfile()) && command.checkPermission(this.server, sender))
{
boolean flag1 = sender instanceof MinecraftServer && this.server.shouldBroadcastConsoleToOps();
boolean flag2 = sender instanceof RConConsoleSource && this.server.shouldBroadcastRconToOps();
if (flag1 || flag2 || !(sender instanceof RConConsoleSource) && !(sender instanceof MinecraftServer))
{
entityplayer.addChatMessage(itextcomponent);
}
}
}
}
if (sender != minecraftserver && minecraftserver.worldServers[0].getGameRules().getBoolean("logAdminCommands"))
{
minecraftserver.addChatMessage(itextcomponent);
}
boolean flag3 = minecraftserver.worldServers[0].getGameRules().getBoolean("sendCommandFeedback");
if (sender instanceof CommandBlockBaseLogic)
{
flag3 = ((CommandBlockBaseLogic)sender).shouldTrackOutput();
}
if ((flags & 1) != 1 && flag3 || sender instanceof MinecraftServer)
{
sender.addChatMessage(new TextComponentTranslation(translationKey, translationArgs));
}
}