Java 类net.minecraft.util.TabCompleter 实例源码
项目:Backmemed
文件:GuiEditCommandBlockMinecart.java
/**
* 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()
{
Keyboard.enableRepeatEvents(true);
this.buttonList.clear();
this.doneButton = 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.cancelButton = this.addButton(new GuiButton(1, this.width / 2 + 4, this.height / 4 + 120 + 12, 150, 20, I18n.format("gui.cancel", new Object[0])));
this.outputButton = this.addButton(new GuiButton(4, this.width / 2 + 150 - 20, 150, 20, 20, "O"));
this.commandField = new GuiTextField(2, this.fontRendererObj, this.width / 2 - 150, 50, 300, 20);
this.commandField.setMaxStringLength(32500);
this.commandField.setFocused(true);
this.commandField.setText(this.commandBlockLogic.getCommand());
this.previousEdit = new GuiTextField(3, this.fontRendererObj, this.width / 2 - 150, 150, 276, 20);
this.previousEdit.setMaxStringLength(32500);
this.previousEdit.setEnabled(false);
this.previousEdit.setText("-");
this.trackOutput = this.commandBlockLogic.shouldTrackOutput();
this.updateCommandOutput();
this.doneButton.enabled = !this.commandField.getText().trim().isEmpty();
this.tabCompleter = new TabCompleter(this.commandField, true)
{
@Nullable
public BlockPos getTargetBlockPos()
{
return GuiEditCommandBlockMinecart.this.commandBlockLogic.getPosition();
}
};
}
项目:Backmemed
文件:GuiCommandBlock.java
/**
* 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();
}
};
}
项目:CustomWorldGen
文件:GuiEditCommandBlockMinecart.java
/**
* 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()
{
Keyboard.enableRepeatEvents(true);
this.buttonList.clear();
this.doneButton = 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.cancelButton = this.addButton(new GuiButton(1, this.width / 2 + 4, this.height / 4 + 120 + 12, 150, 20, I18n.format("gui.cancel", new Object[0])));
this.outputButton = this.addButton(new GuiButton(4, this.width / 2 + 150 - 20, 150, 20, 20, "O"));
this.commandField = new GuiTextField(2, this.fontRendererObj, this.width / 2 - 150, 50, 300, 20);
this.commandField.setMaxStringLength(32500);
this.commandField.setFocused(true);
this.commandField.setText(this.commandBlockLogic.getCommand());
this.previousEdit = new GuiTextField(3, this.fontRendererObj, this.width / 2 - 150, 150, 276, 20);
this.previousEdit.setMaxStringLength(32500);
this.previousEdit.setEnabled(false);
this.previousEdit.setText("-");
this.trackOutput = this.commandBlockLogic.shouldTrackOutput();
this.updateCommandOutput();
this.doneButton.enabled = !this.commandField.getText().trim().isEmpty();
this.tabCompleter = new TabCompleter(this.commandField, true)
{
@Nullable
public BlockPos getTargetBlockPos()
{
return GuiEditCommandBlockMinecart.this.commandBlockLogic.getPosition();
}
};
}
项目:CustomWorldGen
文件:GuiCommandBlock.java
/**
* 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();
}
};
}
项目:ExpandedRailsMod
文件:GuiEditCommandBlockMinecart.java
/**
* 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()
{
Keyboard.enableRepeatEvents(true);
this.buttonList.clear();
this.doneButton = 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.cancelButton = 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.outputButton = this.func_189646_b(new GuiButton(4, this.width / 2 + 150 - 20, 150, 20, 20, "O"));
this.commandField = new GuiTextField(2, this.fontRendererObj, this.width / 2 - 150, 50, 300, 20);
this.commandField.setMaxStringLength(32500);
this.commandField.setFocused(true);
this.commandField.setText(this.commandBlockLogic.getCommand());
this.previousEdit = new GuiTextField(3, this.fontRendererObj, this.width / 2 - 150, 150, 276, 20);
this.previousEdit.setMaxStringLength(32500);
this.previousEdit.setEnabled(false);
this.previousEdit.setText("-");
this.trackOutput = this.commandBlockLogic.shouldTrackOutput();
this.updateCommandOutput();
this.doneButton.enabled = !this.commandField.getText().trim().isEmpty();
this.tabCompleter = new TabCompleter(this.commandField, true)
{
@Nullable
public BlockPos getTargetBlockPos()
{
return GuiEditCommandBlockMinecart.this.commandBlockLogic.getPosition();
}
};
}
项目:ExpandedRailsMod
文件:GuiCommandBlock.java
/**
* 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();
}
};
}