Moved Sorting Config Into the World.
This commit is contained in:
@@ -23,7 +23,7 @@ import appeng.api.networking.security.IActionHost;
|
||||
import appeng.api.networking.security.ISecurityGrid;
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.parts.IPartHost;
|
||||
import appeng.api.storage.IStorageMonitorable;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.client.gui.GuiNull;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.ContainerNull;
|
||||
@@ -82,7 +82,7 @@ public enum GuiBridge implements IGuiHandler
|
||||
|
||||
GUI_WIRELESS(ContainerWireless.class, TileWireless.class, false, SecurityPermissions.BUILD),
|
||||
|
||||
GUI_ME(ContainerMEMonitorable.class, IStorageMonitorable.class, false, null),
|
||||
GUI_ME(ContainerMEMonitorable.class, ITerminalHost.class, false, null),
|
||||
|
||||
GUI_PORTABLE_CELL(ContainerMEPortableCell.class, IPortableCell.class, true, null),
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ import java.io.IOException;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.api.util.IConfigureableObject;
|
||||
import appeng.container.implementations.ContainerCellWorkbench;
|
||||
import appeng.container.implementations.ContainerLevelEmitter;
|
||||
import appeng.container.implementations.ContainerPriority;
|
||||
@@ -75,6 +77,60 @@ public class PacketValueConfig extends AppEngPacket
|
||||
ccw.setFuzzy( FuzzyMode.valueOf( Value ) );
|
||||
}
|
||||
}
|
||||
else if ( c instanceof IConfigureableObject )
|
||||
{
|
||||
IConfigManager cm = ((IConfigureableObject) c).getConfigManager();
|
||||
|
||||
for (Enum e : cm.getSettings())
|
||||
{
|
||||
if ( e.name().equals( Name ) )
|
||||
{
|
||||
Enum def = cm.getSetting( e );
|
||||
|
||||
try
|
||||
{
|
||||
cm.putSetting( e, Enum.valueOf( def.getClass(), Value ) );
|
||||
}
|
||||
catch (IllegalArgumentException err)
|
||||
{
|
||||
// :P
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clientPacketData(INetworkInfo network, AppEngPacket packet, EntityPlayer player)
|
||||
{
|
||||
Container c = player.openContainer;
|
||||
|
||||
if ( c instanceof IConfigureableObject )
|
||||
{
|
||||
IConfigManager cm = ((IConfigureableObject) c).getConfigManager();
|
||||
|
||||
for (Enum e : cm.getSettings())
|
||||
{
|
||||
if ( e.name().equals( Name ) )
|
||||
{
|
||||
Enum def = cm.getSetting( e );
|
||||
|
||||
try
|
||||
{
|
||||
cm.putSetting( e, Enum.valueOf( def.getClass(), Value ) );
|
||||
}
|
||||
catch (IllegalArgumentException err)
|
||||
{
|
||||
// :P
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user