本文整理汇总了Java中net.minecraft.client.gui.GuiScreen类的典型用法代码示例。如果您正苦于以下问题:Java GuiScreen类的具体用法?Java GuiScreen怎么用?Java GuiScreen使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GuiScreen类属于net.minecraft.client.gui包,在下文中一共展示了GuiScreen类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isCorrectModeActive
import net.minecraft.client.gui.GuiScreen; //导入依赖的package包/类
private boolean isCorrectModeActive()
{
switch (mode.toLowerCase())
{
case MODE_SHIFT:
return GuiScreen.isShiftKeyDown();
case MODE_CTRL:
return GuiScreen.isCtrlKeyDown();
case MODE_ALT:
return GuiScreen.isAltKeyDown();
case MODE_NO_SHIFT:
return !GuiScreen.isShiftKeyDown();
case MODE_NO_CTRL:
return !GuiScreen.isCtrlKeyDown();
case MODE_NO_ALT:
return !GuiScreen.isAltKeyDown();
default:
return true;
}
}
示例2: mouseClicked
import net.minecraft.client.gui.GuiScreen; //导入依赖的package包/类
@Override
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
ItemStack programmedItem = te.getIteminProgrammingSlot();
if (nameField.isFocused() && !programmedItem.isEmpty()) {
programmedItem.setStackDisplayName(nameField.getText());
NetworkHandler.sendToServer(new PacketUpdateTextfield(te, 0));
}
super.mouseClicked(mouseX, mouseY, mouseButton);
if (mouseButton == 1 && showingWidgetProgress == 0) {
IProgWidget widget = programmerUnit.getHoveredWidget(mouseX, mouseY);
if (widget != null) {
GuiScreen screen = widget.getOptionWindow(this);
if (screen != null) mc.displayGuiScreen(screen);
}
}
}
示例3: getNotificationScreen
import net.minecraft.client.gui.GuiScreen; //导入依赖的package包/类
public GuiScreenRealmsProxy getNotificationScreen(GuiScreen p_getNotificationScreen_1_)
{
try
{
this.previousScreen = p_getNotificationScreen_1_;
Class<?> oclass = Class.forName("com.mojang.realmsclient.gui.screens.RealmsNotificationsScreen");
Constructor<?> constructor = oclass.getDeclaredConstructor(new Class[] {RealmsScreen.class});
constructor.setAccessible(true);
Object object = constructor.newInstance(new Object[] {this});
return ((RealmsScreen)object).getProxy();
}
catch (ClassNotFoundException var5)
{
LOGGER.error("Realms module missing");
}
catch (Exception exception)
{
LOGGER.error((String)"Failed to load Realms module", (Throwable)exception);
}
return null;
}
示例4: onDrawScreen
import net.minecraft.client.gui.GuiScreen; //导入依赖的package包/类
@Inject(method = "drawScreen", at = @At("HEAD"), cancellable = true)
public void onDrawScreen(int mouseX, int mouseY, float partialTicks, CallbackInfo ci) {
Minecraft mc = Minecraft.getMinecraft();
GuiScreen thisScreen = (GuiScreen) (Object) this;
RenderGuiScreen renderGuiScreen = new RenderGuiScreen(thisScreen);
EventManager.post(renderGuiScreen);
if (renderGuiScreen.isCancelled()) {
if (mc.currentScreen != null && mc.currentScreen != thisScreen) {
mc.currentScreen.drawScreen(mouseX, mouseY, partialTicks);
}
ci.cancel();
}
}
示例5: addInformation
import net.minecraft.client.gui.GuiScreen; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@Override
public void addInformation(ItemStack stack, @Nullable World player, List<String> tooltip, ITooltipFlag advanced) {
if (NBTHelper.hasTag(stack, BrewUtils.BREW_DESC)) {
tooltip.add(TextFormatting.ITALIC + I18n.format(NBTHelper.getString(stack, BrewUtils.BREW_DESC)));
}
if (GuiScreen.isShiftKeyDown()) {
tooltip.add(TextFormatting.DARK_GRAY + "" + TextFormatting.ITALIC + I18n.format("tooltip.brew.data"));
BrewUtils.addBrewTooltip(stack, tooltip);
tooltip.add(TextFormatting.DARK_GRAY + "" + TextFormatting.ITALIC + I18n.format("tooltip.potion.data"));
BrewUtils.addPotionTooltip(stack, tooltip);
} else {
tooltip.add(TextFormatting.DARK_GRAY + "" + TextFormatting.ITALIC + I18n.format("tooltip.shift_for_info"));
}
}
示例6: setDimensionAndSpawnPlayer
import net.minecraft.client.gui.GuiScreen; //导入依赖的package包/类
public void setDimensionAndSpawnPlayer(int dimension)
{
this.world.setInitialSpawnLocation();
this.world.removeAllEntities();
int i = 0;
String s = null;
if (this.player != null)
{
i = this.player.getEntityId();
this.world.removeEntity(this.player);
s = this.player.getServerBrand();
}
this.renderViewEntity = null;
EntityPlayerSP entityplayersp = this.player;
this.player = this.playerController.createClientPlayer(this.world, this.player == null ? new StatisticsManager() : this.player.getStatFileWriter());
this.player.getDataManager().setEntryValues(entityplayersp.getDataManager().getAll());
this.player.dimension = dimension;
this.renderViewEntity = this.player;
this.player.preparePlayerToSpawn();
this.player.setServerBrand(s);
this.world.spawnEntityInWorld(this.player);
this.playerController.flipPlayer(this.player);
this.player.movementInput = new MovementInputFromOptions(this.gameSettings);
this.player.setEntityId(i);
this.playerController.setPlayerCapabilities(this.player);
this.player.setReducedDebug(entityplayersp.hasReducedDebug());
if (this.currentScreen instanceof GuiGameOver)
{
this.displayGuiScreen((GuiScreen)null);
}
}
示例7: NetHandlerPlayClient
import net.minecraft.client.gui.GuiScreen; //导入依赖的package包/类
public NetHandlerPlayClient(Minecraft mcIn, GuiScreen p_i46300_2_, NetworkManager networkManagerIn, GameProfile profileIn)
{
this.gameController = mcIn;
this.guiScreenServer = p_i46300_2_;
this.netManager = networkManagerIn;
this.profile = profileIn;
}
示例8: keyTyped
import net.minecraft.client.gui.GuiScreen; //导入依赖的package包/类
/**
* Fired when a key is typed (except F11 which toggles full screen). This is the equivalent of
* KeyListener.keyTyped(KeyEvent e). Args : character (character on the key), keyCode (lwjgl Keyboard key code)
*/
protected void keyTyped(char typedChar, int keyCode) throws IOException
{
if (keyCode == this.mc.gameSettings.keyBindInventory.getKeyCode())
{
this.mc.displayGuiScreen((GuiScreen)null);
this.mc.setIngameFocus();
}
else
{
super.keyTyped(typedChar, keyCode);
}
}
示例9: GuiAchievements
import net.minecraft.client.gui.GuiScreen; //导入依赖的package包/类
public GuiAchievements(GuiScreen parentScreenIn, StatFileWriter statFileWriterIn)
{
this.parentScreen = parentScreenIn;
this.statFileWriter = statFileWriterIn;
int i = 141;
int j = 141;
this.field_146569_s = this.field_146567_u = this.field_146565_w = (double)(AchievementList.openInventory.displayColumn * 24 - i / 2 - 12);
this.field_146568_t = this.field_146566_v = this.field_146573_x = (double)(AchievementList.openInventory.displayRow * 24 - j / 2);
}
示例10: DrawScreenEvent
import net.minecraft.client.gui.GuiScreen; //导入依赖的package包/类
public DrawScreenEvent(GuiScreen gui, int mouseX, int mouseY, float renderPartialTicks)
{
super(gui);
this.mouseX = mouseX;
this.mouseY = mouseY;
this.renderPartialTicks = renderPartialTicks;
}
示例11: GuiStreamUnavailable
import net.minecraft.client.gui.GuiScreen; //导入依赖的package包/类
public GuiStreamUnavailable(GuiScreen parentScreenIn, GuiStreamUnavailable.Reason p_i46311_2_, List<ChatComponentTranslation> p_i46311_3_)
{
this.field_152324_f = new ChatComponentTranslation("stream.unavailable.title", new Object[0]);
this.field_152323_r = Lists.<String>newArrayList();
this.parentScreen = parentScreenIn;
this.field_152326_h = p_i46311_2_;
this.field_152327_i = p_i46311_3_;
}
示例12: modifyButton
import net.minecraft.client.gui.GuiScreen; //导入依赖的package包/类
private void modifyButton(GuiScreen gui, GuiButton button)
{
if (text != null)
{
button.displayString = text;
}
if (width != Length.ZERO)
{
button.width = width.getLength(gui.width);
}
if (height != Length.ZERO)
{
button.height = height.getLength(gui.height);
}
if (offsetX != Length.ZERO)
{
button.x = getLeft(gui, button.width);
}
if (offsetY != Length.ZERO)
{
button.y = getTop(gui, button.height);
}
}
示例13: GuiConnecting
import net.minecraft.client.gui.GuiScreen; //导入依赖的package包/类
public GuiConnecting(GuiScreen p_i1181_1_, Minecraft mcIn, ServerData p_i1181_3_)
{
this.mc = mcIn;
this.previousGuiScreen = p_i1181_1_;
ServerAddress serveraddress = ServerAddress.func_78860_a(p_i1181_3_.serverIP);
mcIn.loadWorld((WorldClient)null);
mcIn.setServerData(p_i1181_3_);
this.connect(serveraddress.getIP(), serveraddress.getPort());
}
示例14: actionPerformed
import net.minecraft.client.gui.GuiScreen; //导入依赖的package包/类
/**
* Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
*/
protected void actionPerformed(GuiButton button) throws IOException
{
if (button.enabled)
{
if (button.id == 0)
{
this.tileSign.markDirty();
this.mc.displayGuiScreen((GuiScreen)null);
}
}
}
示例15: setDimensionAndSpawnPlayer
import net.minecraft.client.gui.GuiScreen; //导入依赖的package包/类
public void setDimensionAndSpawnPlayer(int dimension)
{
this.theWorld.setInitialSpawnLocation();
this.theWorld.removeAllEntities();
int i = 0;
String s = null;
if (this.thePlayer != null)
{
i = this.thePlayer.getEntityId();
this.theWorld.removeEntity(this.thePlayer);
s = this.thePlayer.getClientBrand();
}
this.renderViewEntity = null;
EntityPlayerSP entityplayersp = this.thePlayer;
this.thePlayer = this.playerController.func_178892_a(this.theWorld, this.thePlayer == null ? new StatFileWriter() : this.thePlayer.getStatFileWriter());
this.thePlayer.getDataWatcher().updateWatchedObjectsFromList(entityplayersp.getDataWatcher().getAllWatched());
this.thePlayer.dimension = dimension;
this.renderViewEntity = this.thePlayer;
this.thePlayer.preparePlayerToSpawn();
this.thePlayer.setClientBrand(s);
this.theWorld.spawnEntityInWorld(this.thePlayer);
this.playerController.flipPlayer(this.thePlayer);
this.thePlayer.movementInput = new MovementInputFromOptions(this.gameSettings);
this.thePlayer.setEntityId(i);
this.playerController.setPlayerCapabilities(this.thePlayer);
this.thePlayer.setReducedDebug(entityplayersp.hasReducedDebug());
if (this.currentScreen instanceof GuiGameOver)
{
this.displayGuiScreen((GuiScreen)null);
}
}