mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-16 01:54:59 +00:00
creative tabs
This commit is contained in:
1 parent
8cd24b9a3b
commit
3c128450b5
19 files changed
+79
-42
No files matched your search
@@ -30,13 +30,9 @@ import appeng.util.IConfigManagerHost;
|
||||
import appeng.util.Platform;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.container.FCBaseMonitorContain;
|
||||
import com.glodblock.github.client.gui.container.FCBasePartContainer;
|
||||
import com.glodblock.github.common.parts.PartFluidPatternTerminal;
|
||||
import com.glodblock.github.common.parts.PartFluidPatternTerminalEx;
|
||||
import com.glodblock.github.network.CPacketInventoryAction;
|
||||
import com.glodblock.github.util.Ae2ReflectClient;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -80,11 +76,6 @@ public class GuiFCBaseMonitor extends AEBaseMEGui implements ISortSource, IConfi
|
||||
private GuiImgButton terminalStyleBox;
|
||||
private GuiImgButton searchStringSave;
|
||||
|
||||
public GuiFCBaseMonitor(final InventoryPlayer inventoryPlayer, final ITerminalHost te )
|
||||
{
|
||||
this( inventoryPlayer, te, new FCBasePartContainer( inventoryPlayer, te ) );
|
||||
}
|
||||
|
||||
public GuiFCBaseMonitor( final InventoryPlayer inventoryPlayer, final ITerminalHost te, final FCBaseMonitorContain c )
|
||||
{
|
||||
|
||||
@@ -144,8 +135,8 @@ public class GuiFCBaseMonitor extends AEBaseMEGui implements ISortSource, IConfi
|
||||
final GuiImgButton iBtn = (GuiImgButton) btn;
|
||||
if( iBtn.getSetting() != Settings.ACTIONS )
|
||||
{
|
||||
final Enum cv = iBtn.getCurrentValue();
|
||||
final Enum next = Platform.rotateEnum( cv, backwards, iBtn.getSetting().getPossibleValues() );
|
||||
final Enum<?> cv = iBtn.getCurrentValue();
|
||||
final Enum<?> next = Platform.rotateEnum( cv, backwards, iBtn.getSetting().getPossibleValues() );
|
||||
|
||||
if( btn == this.terminalStyleBox )
|
||||
{
|
||||
@@ -188,6 +179,7 @@ public class GuiFCBaseMonitor extends AEBaseMEGui implements ISortSource, IConfi
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void initGui()
|
||||
{
|
||||
Keyboard.enableRepeatEvents( true );
|
||||
@@ -203,7 +195,7 @@ public class GuiFCBaseMonitor extends AEBaseMEGui implements ISortSource, IConfi
|
||||
final int magicNumber = 114 + 1;
|
||||
final int extraSpace = this.height - magicNumber - NEI - top - this.reservedSpace;
|
||||
|
||||
this.rows = (int) Math.floor( extraSpace / 18 );
|
||||
this.rows = (int) Math.floor( extraSpace / 18.0 );
|
||||
if( this.rows > this.maxRows )
|
||||
{
|
||||
top += ( this.rows - this.maxRows ) * 18 / 2;
|
||||
@@ -292,7 +284,7 @@ public class GuiFCBaseMonitor extends AEBaseMEGui implements ISortSource, IConfi
|
||||
}
|
||||
|
||||
// Enum setting = AEConfig.INSTANCE.getSetting( "Terminal", SearchBoxMode.class, SearchBoxMode.AUTOSEARCH );
|
||||
final Enum setting = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE );
|
||||
final Enum<?> setting = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE );
|
||||
this.searchField.setFocused( SearchBoxMode.AUTOSEARCH == setting || SearchBoxMode.NEI_AUTOSEARCH == setting );
|
||||
|
||||
if (ModAndClassUtil.isSearchBar && (AEConfig.instance.preserveSearchBar || this.isSubGui()))
|
||||
@@ -354,7 +346,7 @@ public class GuiFCBaseMonitor extends AEBaseMEGui implements ISortSource, IConfi
|
||||
@Override
|
||||
protected void mouseClicked( final int xCoord, final int yCoord, final int btn )
|
||||
{
|
||||
final Enum searchMode = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE );
|
||||
final Enum<?> searchMode = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE );
|
||||
|
||||
if( searchMode != SearchBoxMode.AUTOSEARCH && searchMode != SearchBoxMode.NEI_AUTOSEARCH )
|
||||
{
|
||||
@@ -421,7 +413,7 @@ public class GuiFCBaseMonitor extends AEBaseMEGui implements ISortSource, IConfi
|
||||
return; // prevent weird double clicks..
|
||||
}
|
||||
|
||||
InventoryAction action = null;
|
||||
InventoryAction action;
|
||||
if( isShiftKeyDown() )
|
||||
{
|
||||
action = InventoryAction.CRAFT_SHIFT;
|
||||
@@ -681,19 +673,19 @@ public class GuiFCBaseMonitor extends AEBaseMEGui implements ISortSource, IConfi
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum getSortBy()
|
||||
public Enum<?> getSortBy()
|
||||
{
|
||||
return this.configSrc.getSetting( Settings.SORT_BY );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum getSortDir()
|
||||
public Enum<?> getSortDir()
|
||||
{
|
||||
return this.configSrc.getSetting( Settings.SORT_DIRECTION );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum getSortDisplay()
|
||||
public Enum<?> getSortDisplay()
|
||||
{
|
||||
return this.configSrc.getSetting( Settings.VIEW_MODE );
|
||||
}
|
||||
@@ -734,7 +726,7 @@ public class GuiFCBaseMonitor extends AEBaseMEGui implements ISortSource, IConfi
|
||||
return this.customSortOrder;
|
||||
}
|
||||
|
||||
void setCustomSortOrder( final boolean customSortOrder )
|
||||
public void setCustomSortOrder( final boolean customSortOrder )
|
||||
{
|
||||
this.customSortOrder = customSortOrder;
|
||||
}
|
||||
@@ -744,7 +736,7 @@ public class GuiFCBaseMonitor extends AEBaseMEGui implements ISortSource, IConfi
|
||||
return this.standardSize;
|
||||
}
|
||||
|
||||
void setStandardSize( final int standardSize )
|
||||
public void setStandardSize( final int standardSize )
|
||||
{
|
||||
this.standardSize = standardSize;
|
||||
}
|
||||
|
||||
@@ -2,8 +2,10 @@ package com.glodblock.github.client.render;
|
||||
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.RenderUtil;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -22,12 +24,12 @@ public class ItemPacketRender implements IItemRenderer {
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
return type == ItemRenderType.INVENTORY;
|
||||
return type != ItemRenderType.FIRST_PERSON_MAP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||
return false;
|
||||
return type == ItemRenderType.ENTITY;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -50,18 +52,11 @@ public class ItemPacketRender implements IItemRenderer {
|
||||
GL11.glColor3f((RGB >> 16 & 0xFF) / 255.0F, (RGB >> 8 & 0xFF) / 255.0F, (RGB & 0xFF) / 255.0F);
|
||||
}
|
||||
|
||||
Tessellator tess = Tessellator.instance;
|
||||
tess.startDrawingQuads();
|
||||
// draw a simple rectangle for the inventory icon
|
||||
final float x_min = icon.getMinU();
|
||||
final float x_max = icon.getMaxU();
|
||||
final float y_min = icon.getMinV();
|
||||
final float y_max = icon.getMaxV();
|
||||
tess.addVertexWithUV( 0, 16, 0, x_min, y_max);
|
||||
tess.addVertexWithUV(16, 16, 0, x_max, y_max);
|
||||
tess.addVertexWithUV(16, 0, 0, x_max, y_min);
|
||||
tess.addVertexWithUV( 0, 0, 0, x_min, y_min);
|
||||
tess.draw();
|
||||
if (type.equals(ItemRenderType.INVENTORY)) {
|
||||
RenderUtil.renderItemIcon(icon, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F);
|
||||
} else {
|
||||
ItemRenderer.renderItemIn2D(Tessellator.instance, icon.getMaxU(), icon.getMinV(), icon.getMinU(), icon.getMaxV(), icon.getIconWidth(), icon.getIconHeight(), 0.0625F);
|
||||
}
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
|
||||
Reference in new issue
Block a user