Search in sources :

Example 6 with AWGuiContainerBase

use of com.codetaylor.mc.artisanworktables.modules.worktables.gui.AWGuiContainerBase in project artisan-worktables by codetaylor.

the class GuiElementButtonCreative method elementClicked.

@Override
public void elementClicked(int mouseX, int mouseY, int mouseButton) {
    super.elementClicked(mouseX, mouseY, mouseButton);
    AWGuiContainerBase gui = (AWGuiContainerBase) this.guiBase;
    TileEntityBase tileEntity = gui.getTileEntity();
    ModuleWorktables.PACKET_SERVICE.sendToServer(new CSPacketWorktableCreativeToggle(tileEntity.getPos()));
}
Also used : AWGuiContainerBase(com.codetaylor.mc.artisanworktables.modules.worktables.gui.AWGuiContainerBase) CSPacketWorktableCreativeToggle(com.codetaylor.mc.artisanworktables.modules.worktables.network.CSPacketWorktableCreativeToggle) TileEntityBase(com.codetaylor.mc.artisanworktables.modules.worktables.tile.spi.TileEntityBase)

Example 7 with AWGuiContainerBase

use of com.codetaylor.mc.artisanworktables.modules.worktables.gui.AWGuiContainerBase in project artisan-worktables by codetaylor.

the class GuiElementButtonCreative method tooltipTextGet.

@Override
public List<String> tooltipTextGet(List<String> tooltip) {
    AWGuiContainerBase gui = (AWGuiContainerBase) this.guiBase;
    TileEntityBase tileEntity = gui.getTileEntity();
    if (tileEntity.isCreative()) {
        tooltip.add(I18n.translateToLocal("gui.artisanworktables.tooltip.button.creative.enabled"));
    } else {
        tooltip.add(I18n.translateToLocal("gui.artisanworktables.tooltip.button.creative.disabled"));
    }
    return tooltip;
}
Also used : AWGuiContainerBase(com.codetaylor.mc.artisanworktables.modules.worktables.gui.AWGuiContainerBase) TileEntityBase(com.codetaylor.mc.artisanworktables.modules.worktables.tile.spi.TileEntityBase)

Example 8 with AWGuiContainerBase

use of com.codetaylor.mc.artisanworktables.modules.worktables.gui.AWGuiContainerBase in project artisan-worktables by codetaylor.

the class GuiElementButtonExportShapeless method elementClicked.

@Override
public void elementClicked(int mouseX, int mouseY, int mouseButton) {
    super.elementClicked(mouseX, mouseY, mouseButton);
    AWGuiContainerBase gui = (AWGuiContainerBase) this.guiBase;
    TileEntityBase tileEntity = gui.getTileEntity();
    try {
        String data = ZSRecipeExport.getExportString((AWContainer) gui.inventorySlots, tileEntity, false);
        StringSelection contents = new StringSelection(data);
        Toolkit defaultToolkit = Toolkit.getDefaultToolkit();
        Clipboard systemClipboard = defaultToolkit.getSystemClipboard();
        systemClipboard.setContents(contents, null);
        Minecraft.getMinecraft().player.sendMessage(new TextComponentTranslation("chat.artisanworktables.message.recipe.copy.success"));
    } catch (Exception e) {
        Minecraft.getMinecraft().player.sendMessage(new TextComponentTranslation("chat.artisanworktables.message.recipe.copy.error"));
        ModuleWorktables.LOG.error("", e);
    }
}
Also used : AWGuiContainerBase(com.codetaylor.mc.artisanworktables.modules.worktables.gui.AWGuiContainerBase) TextComponentTranslation(net.minecraft.util.text.TextComponentTranslation) TileEntityBase(com.codetaylor.mc.artisanworktables.modules.worktables.tile.spi.TileEntityBase) Clipboard(java.awt.datatransfer.Clipboard) StringSelection(java.awt.datatransfer.StringSelection)

Example 9 with AWGuiContainerBase

use of com.codetaylor.mc.artisanworktables.modules.worktables.gui.AWGuiContainerBase in project artisan-worktables by codetaylor.

the class GuiElementButtonOredictLink method isOreDictLinked.

public boolean isOreDictLinked() {
    AWGuiContainerBase gui = (AWGuiContainerBase) this.guiBase;
    TileEntityBase tileEntity = gui.getTileEntity();
    return tileEntity.isOreDictLinked();
}
Also used : AWGuiContainerBase(com.codetaylor.mc.artisanworktables.modules.worktables.gui.AWGuiContainerBase) TileEntityBase(com.codetaylor.mc.artisanworktables.modules.worktables.tile.spi.TileEntityBase)

Example 10 with AWGuiContainerBase

use of com.codetaylor.mc.artisanworktables.modules.worktables.gui.AWGuiContainerBase in project artisan-worktables by codetaylor.

the class GuiElementButtonOredictLink method elementIsVisible.

@Override
public boolean elementIsVisible(int mouseX, int mouseY) {
    AWGuiContainerBase gui = (AWGuiContainerBase) this.guiBase;
    TileEntityBase tileEntity = gui.getTileEntity();
    return tileEntity.isCreative();
}
Also used : AWGuiContainerBase(com.codetaylor.mc.artisanworktables.modules.worktables.gui.AWGuiContainerBase) TileEntityBase(com.codetaylor.mc.artisanworktables.modules.worktables.tile.spi.TileEntityBase)

Aggregations

AWGuiContainerBase (com.codetaylor.mc.artisanworktables.modules.worktables.gui.AWGuiContainerBase)17 TileEntityBase (com.codetaylor.mc.artisanworktables.modules.worktables.tile.spi.TileEntityBase)17 Clipboard (java.awt.datatransfer.Clipboard)2 StringSelection (java.awt.datatransfer.StringSelection)2 TextComponentTranslation (net.minecraft.util.text.TextComponentTranslation)2 CSPacketWorktableClear (com.codetaylor.mc.artisanworktables.modules.worktables.network.CSPacketWorktableClear)1 CSPacketWorktableCreativeToggle (com.codetaylor.mc.artisanworktables.modules.worktables.network.CSPacketWorktableCreativeToggle)1 CSPacketWorktableLockedModeToggle (com.codetaylor.mc.artisanworktables.modules.worktables.network.CSPacketWorktableLockedModeToggle)1