use of net.minecraft.client.gui.GuiScreen in project RecurrentComplex by Ivorforce.
the class GuiHider method reopenGUI.
public static boolean reopenGUI() {
if (!canReopen())
return false;
GuiScreen hiddenGUI = GuiHider.hiddenGUI;
GuiHider.hiddenGUI = null;
Minecraft mc = Minecraft.getMinecraft();
mc.displayGuiScreen(hiddenGUI);
if (mc.currentScreen == null) {
GuiHider.hiddenGUI = hiddenGUI;
return false;
}
return true;
}
use of net.minecraft.client.gui.GuiScreen in project BetterStorage by copygirl.
the class PlayerUtils method openGui.
@SideOnly(Side.CLIENT)
public static void openGui(EntityPlayer player, String name, int columns, int rows, String title) {
GuiScreen gui = createGuiFromName(player, name, columns, rows, title);
Minecraft.getMinecraft().displayGuiScreen(gui);
}
use of net.minecraft.client.gui.GuiScreen in project BluePower by Qmunity.
the class ContainerCircuitTable method updateProgressBar.
@Override
@SideOnly(Side.CLIENT)
public void updateProgressBar(int p_75137_1_, int p_75137_2_) {
circuitTable.slotsScrolled = p_75137_2_;
GuiScreen gui = Minecraft.getMinecraft().currentScreen;
if (gui instanceof GuiCircuitTable) {
((GuiCircuitTable) gui).updateScrollbar(circuitTable.slotsScrolled);
}
}
use of net.minecraft.client.gui.GuiScreen in project BluePower by Qmunity.
the class GateBase method renderItem.
@Override
@SideOnly(Side.CLIENT)
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
if (this instanceof ISilkyRemovable) {
if (this instanceof IAdvancedSilkyRemovable) {
((IAdvancedSilkyRemovable) this).readSilkyData(null, 0, 0, 0, item.hasTagCompound() ? item.getTagCompound().getCompoundTag("tileData") : new NBTTagCompound());
} else {
readFromNBT(item.hasTagCompound() ? item.getTagCompound().getCompoundTag("tileData") : new NBTTagCompound());
}
}
GL11.glPushMatrix();
{
RenderHelper rh = RenderHelper.instance;
rh.reset();
if (type == ItemRenderType.EQUIPPED_FIRST_PERSON) {
GL11.glTranslated(-0.25, 0.75, 0.25);
}
if (type == ItemRenderType.ENTITY && item.getItemFrame() != null) {
GL11.glTranslated(19 / 32D, 8 / 16D, 1);
GL11.glRotated(-90, 0, 0, 1);
GL11.glRotated(90, 0, 1, 0);
}
if (type == ItemRenderType.INVENTORY && BluePower.proxy.isSneakingInGui()) {
GuiScreen gui = Minecraft.getMinecraft().currentScreen;
if (gui != null && gui instanceof GuiContainer) {
GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-45F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-210F, 1.0F, 0.0F, 0.0F);
GL11.glScaled(1.5, 1.5, 1.5);
GL11.glTranslated(-0.5, 0, 0);
GL11.glTranslated(0, -0.5, 0);
GL11.glRotated(-90, 1, 0, 0);
GL11.glTranslated(0, 0.5, 0);
}
}
Tessellator.instance.startDrawingQuads();
if (shouldRenderOnPass(0))
renderStatic(new Vec3i(0, 0, 0), rh, RenderBlocks.getInstance(), 0);
rh.reset();
if (shouldRenderOnPass(1))
renderStatic(new Vec3i(0, 0, 0), rh, RenderBlocks.getInstance(), 1);
rh.reset();
Tessellator.instance.draw();
if (shouldRenderOnPass(0))
renderDynamic(new Vec3d(0, 0, 0), 0, 0);
if (shouldRenderOnPass(1))
renderDynamic(new Vec3d(0, 0, 0), 0, 1);
}
GL11.glPopMatrix();
}
use of net.minecraft.client.gui.GuiScreen in project PneumaticCraft by MineMaarten.
the class ClientEventHandler method onItemTooltip.
@SubscribeEvent
public void onItemTooltip(ItemTooltipEvent event) {
if (event.itemStack.getItem() instanceof IProgrammable) {
IProgrammable programmable = (IProgrammable) event.itemStack.getItem();
if (programmable.canProgram(event.itemStack) && programmable.showProgramTooltip()) {
boolean hasInvalidPrograms = false;
List<String> addedEntries = new ArrayList<String>();
Map<String, Integer> widgetMap = getPuzzleSummary(TileEntityProgrammer.getProgWidgets(event.itemStack));
for (Map.Entry<String, Integer> entry : widgetMap.entrySet()) {
IProgWidget widget = ItemProgrammingPuzzle.getWidgetForName(entry.getKey());
String prefix = "";
GuiScreen curScreen = Minecraft.getMinecraft().currentScreen;
if (curScreen instanceof IGuiDrone) {
if (!((IGuiDrone) curScreen).getDrone().isProgramApplicable(widget)) {
prefix = EnumChatFormatting.RED + "";
hasInvalidPrograms = true;
}
}
addedEntries.add(prefix + "-" + entry.getValue() + "x " + I18n.format("programmingPuzzle." + entry.getKey() + ".name"));
}
if (hasInvalidPrograms) {
event.toolTip.add(EnumChatFormatting.RED + I18n.format("gui.tooltip.programmable.invalidPieces"));
}
Collections.sort(addedEntries);
event.toolTip.addAll(addedEntries);
}
}
}
Aggregations