Enum-Ify ISortSource since it always uses the same enum types
Reactivate JEI integration
This commit is contained in:
@@ -32,7 +32,6 @@ import appeng.client.gui.widgets.GuiScrollbar;
|
||||
import appeng.client.gui.widgets.ISortSource;
|
||||
import appeng.container.implementations.ContainerCraftingCPU;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
@@ -47,7 +46,6 @@ import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
import org.apache.commons.lang3.time.DurationFormatUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
@@ -453,19 +451,19 @@ public class GuiCraftingCPU<T extends ContainerCraftingCPU> extends AEBaseGui<T>
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum getSortBy()
|
||||
public SortOrder getSortBy()
|
||||
{
|
||||
return SortOrder.NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum getSortDir()
|
||||
public SortDir getSortDir()
|
||||
{
|
||||
return SortDir.ASCENDING;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum getSortDisplay()
|
||||
public ViewItems getSortDisplay()
|
||||
{
|
||||
return ViewItems.ALL;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,9 @@ package appeng.client.gui.implementations;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import appeng.api.config.*;
|
||||
import appeng.container.implementations.ContainerCraftingStatus;
|
||||
import appeng.integration.abstraction.JEIFacade;
|
||||
import net.minecraft.client.gui.widget.button.Button;
|
||||
import net.minecraft.client.util.InputMappings;
|
||||
import net.minecraft.inventory.container.Slot;
|
||||
@@ -31,9 +33,6 @@ import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.config.SearchBoxMode;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.TerminalStyle;
|
||||
import appeng.api.implementations.guiobjects.IPortableCell;
|
||||
import appeng.api.implementations.tiles.IMEChest;
|
||||
import appeng.api.implementations.tiles.IViewCellStorage;
|
||||
@@ -54,7 +53,6 @@ import appeng.container.slot.AppEngSlot;
|
||||
import appeng.container.slot.SlotCraftingMatrix;
|
||||
import appeng.container.slot.SlotFakeCraftingMatrix;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
@@ -318,7 +316,7 @@ public class GuiMEMonitorable<T extends ContainerMEMonitorable> extends AEBaseME
|
||||
|
||||
if( isJEIEnabled )
|
||||
{
|
||||
memoryText = null; // FIXME Integrations.jei().getSearchText();
|
||||
memoryText = JEIFacade.instance().getSearchText();
|
||||
}
|
||||
|
||||
if( isKeepFilter && memoryText != null && !memoryText.isEmpty() )
|
||||
@@ -398,20 +396,20 @@ public class GuiMEMonitorable<T extends ContainerMEMonitorable> extends AEBaseME
|
||||
|
||||
this.bindTexture( this.getBackground() );
|
||||
final int x_width = 197;
|
||||
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, x_width, 18, 0 /* FIXME this.zlevel was used */ );
|
||||
GuiUtils.drawTexturedModalRect( offsetX, offsetY, 0, 0, x_width, 18, getBlitOffset() );
|
||||
|
||||
if( this.viewCell || ( this instanceof GuiSecurityStation ) )
|
||||
{
|
||||
GuiUtils.drawTexturedModalRect( offsetX + x_width, offsetY, x_width, 0, 46, 128, 0 /* FIXME this.zlevel was used */ );
|
||||
GuiUtils.drawTexturedModalRect( offsetX + x_width, offsetY, x_width, 0, 46, 128, getBlitOffset() );
|
||||
}
|
||||
|
||||
for( int x = 0; x < this.rows; x++ )
|
||||
{
|
||||
GuiUtils.drawTexturedModalRect( offsetX, offsetY + 18 + x * 18, 0, 18, x_width, 18, 0 /* FIXME this.zlevel was used */ );
|
||||
GuiUtils.drawTexturedModalRect( offsetX, offsetY + 18 + x * 18, 0, 18, x_width, 18, getBlitOffset() );
|
||||
}
|
||||
|
||||
GuiUtils.drawTexturedModalRect( offsetX, offsetY + 16 + this.rows * 18 + this.lowerTextureOffset, 0, 106 - 18 - 18, x_width,
|
||||
99 + this.reservedSpace - this.lowerTextureOffset, 0 /* FIXME this.zlevel was used */ );
|
||||
99 + this.reservedSpace - this.lowerTextureOffset, getBlitOffset() );
|
||||
|
||||
if( this.viewCell )
|
||||
{
|
||||
@@ -523,21 +521,21 @@ public class GuiMEMonitorable<T extends ContainerMEMonitorable> extends AEBaseME
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum getSortBy()
|
||||
public SortOrder getSortBy()
|
||||
{
|
||||
return this.configSrc.getSetting( Settings.SORT_BY );
|
||||
return (SortOrder) this.configSrc.getSetting( Settings.SORT_BY );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum getSortDir()
|
||||
public SortDir getSortDir()
|
||||
{
|
||||
return this.configSrc.getSetting( Settings.SORT_DIRECTION );
|
||||
return (SortDir) this.configSrc.getSetting( Settings.SORT_DIRECTION );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum getSortDisplay()
|
||||
public ViewItems getSortDisplay()
|
||||
{
|
||||
return this.configSrc.getSetting( Settings.VIEW_MODE );
|
||||
return (ViewItems) this.configSrc.getSetting( Settings.VIEW_MODE );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -259,19 +259,19 @@ public class GuiNetworkStatus extends AEBaseGui<ContainerNetworkStatus> implemen
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum getSortBy()
|
||||
public SortOrder getSortBy()
|
||||
{
|
||||
return SortOrder.NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum getSortDir()
|
||||
public SortDir getSortDir()
|
||||
{
|
||||
return SortDir.ASCENDING;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum getSortDisplay()
|
||||
public ViewItems getSortDisplay()
|
||||
{
|
||||
return ViewItems.ALL;
|
||||
}
|
||||
|
||||
@@ -19,17 +19,12 @@
|
||||
package appeng.client.gui.implementations;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.client.gui.widget.button.Button;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.config.SortOrder;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.client.gui.widgets.GuiToggleButton;
|
||||
import appeng.container.implementations.ContainerSecurityStation;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
@@ -101,7 +96,7 @@ public class GuiSecurityStation extends GuiMEMonitorable<ContainerSecurityStatio
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum getSortBy()
|
||||
public SortOrder getSortBy()
|
||||
{
|
||||
return SortOrder.NAME;
|
||||
}
|
||||
|
||||
@@ -20,24 +20,13 @@ package appeng.client.gui.widgets;
|
||||
|
||||
|
||||
import appeng.api.config.SortDir;
|
||||
import appeng.api.config.SortOrder;
|
||||
import appeng.api.config.ViewItems;
|
||||
|
||||
|
||||
public interface ISortSource
|
||||
{
|
||||
|
||||
/**
|
||||
* @return Sor
|
||||
*/
|
||||
Enum getSortBy();
|
||||
|
||||
/**
|
||||
* @return {@link SortDir}
|
||||
*/
|
||||
Enum getSortDir();
|
||||
|
||||
/**
|
||||
* @return {@link ViewItems}
|
||||
*/
|
||||
Enum getSortDisplay();
|
||||
SortOrder getSortBy();
|
||||
SortDir getSortDir();
|
||||
ViewItems getSortDisplay();
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import java.util.regex.Pattern;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import appeng.integration.abstraction.JEIFacade;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
@@ -231,7 +232,7 @@ public class ItemRepo
|
||||
|
||||
private void updateJEI( String filter )
|
||||
{
|
||||
// FIXME Integrations.jei().setSearchText( filter );
|
||||
JEIFacade.instance().setSearchText( filter );
|
||||
}
|
||||
|
||||
public int size()
|
||||
|
||||
@@ -20,6 +20,9 @@ package appeng.fluids.client.gui;
|
||||
|
||||
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.SortDir;
|
||||
import appeng.api.config.SortOrder;
|
||||
import appeng.api.config.ViewItems;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.client.gui.AEBaseMEGui;
|
||||
@@ -307,21 +310,21 @@ public class GuiFluidTerminal extends AEBaseMEGui<ContainerFluidTerminal> implem
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum getSortBy()
|
||||
public SortOrder getSortBy()
|
||||
{
|
||||
return this.configSrc.getSetting( Settings.SORT_BY );
|
||||
return (SortOrder) this.configSrc.getSetting( Settings.SORT_BY );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum getSortDir()
|
||||
public SortDir getSortDir()
|
||||
{
|
||||
return this.configSrc.getSetting( Settings.SORT_DIRECTION );
|
||||
return (SortDir) this.configSrc.getSetting( Settings.SORT_DIRECTION );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum getSortDisplay()
|
||||
public ViewItems getSortDisplay()
|
||||
{
|
||||
return this.configSrc.getSetting( Settings.VIEW_MODE );
|
||||
return (ViewItems) this.configSrc.getSetting( Settings.VIEW_MODE );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package appeng.integration.abstraction;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
public final class JEIFacade {
|
||||
|
||||
private JEIFacade() {
|
||||
}
|
||||
|
||||
private static IJEI instance = new IJEI.Stub();
|
||||
|
||||
public static IJEI instance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static void setInstance(IJEI jei) {
|
||||
instance = Preconditions.checkNotNull(jei);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.integration.modules.jei;
|
||||
|
||||
|
||||
import appeng.integration.abstraction.IJEI;
|
||||
|
||||
|
||||
public class JEIModule implements IJEI
|
||||
{
|
||||
|
||||
private IJEI jei = new IJEI.Stub();
|
||||
|
||||
public void setJei( IJEI jei )
|
||||
{
|
||||
this.jei = jei;
|
||||
}
|
||||
|
||||
public IJEI getJei()
|
||||
{
|
||||
return this.jei;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSearchText()
|
||||
{
|
||||
return this.jei.getSearchText();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSearchText( String searchText )
|
||||
{
|
||||
this.jei.setSearchText( searchText );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled()
|
||||
{
|
||||
return this.jei.isEnabled();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -30,6 +30,7 @@ import appeng.container.implementations.ContainerPatternTerm;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.integration.abstraction.JEIFacade;
|
||||
import appeng.recipes.handlers.GrinderRecipe;
|
||||
import appeng.recipes.handlers.InscriberRecipe;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
@@ -167,7 +168,6 @@ public class JEIPlugin implements IModPlugin
|
||||
@Override
|
||||
public void onRuntimeAvailable( IJeiRuntime jeiRuntime )
|
||||
{
|
||||
// FIXME JEIModule jeiModule = (JEIModule) Integrations.jei();
|
||||
// FIXME jeiModule.setJei( new JeiRuntimeAdapter( jeiRuntime ) );
|
||||
JEIFacade.setInstance(new JeiRuntimeAdapter(jeiRuntime));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ import appeng.core.AELog;
|
||||
import appeng.core.stats.AeStats;
|
||||
import appeng.fluids.util.AEFluidStack;
|
||||
import appeng.hooks.TickHandler;
|
||||
import appeng.integration.abstraction.JEIFacade;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.me.GridNode;
|
||||
import appeng.me.helpers.AENetworkProxy;
|
||||
@@ -317,17 +318,16 @@ public class Platform
|
||||
|
||||
private static boolean isNotValidSetting( final Enum<?> e )
|
||||
{
|
||||
//FIXME, INVENTORY TWEAKS
|
||||
// if( e == SortOrder.INVTWEAKS && !Integrations.invTweaks().isEnabled() )
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
//FIXME, JEI
|
||||
// final boolean isJEI = e == SearchBoxMode.JEI_AUTOSEARCH || e == SearchBoxMode.JEI_AUTOSEARCH_KEEP || e == SearchBoxMode.JEI_MANUAL_SEARCH || e == SearchBoxMode.JEI_MANUAL_SEARCH_KEEP;
|
||||
// if( isJEI && !Integrations.jei().isEnabled() )
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
if( e == SortOrder.INVTWEAKS /* FIXME && !Integrations.invTweaks().isEnabled() */ )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
final boolean isJEI = e == SearchBoxMode.JEI_AUTOSEARCH || e == SearchBoxMode.JEI_AUTOSEARCH_KEEP || e == SearchBoxMode.JEI_MANUAL_SEARCH || e == SearchBoxMode.JEI_MANUAL_SEARCH_KEEP;
|
||||
if( isJEI && !JEIFacade.instance().isEnabled())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user