All GUI compile errors fixed, switched to excludes over includes in gradle build and lots, LOTS of more fixes.
This commit is contained in:
@@ -28,7 +28,6 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.exceptions.AppEngException;
|
||||
import appeng.api.features.IWirelessTermHandler;
|
||||
@@ -47,10 +46,9 @@ import appeng.api.storage.ITerminalHost;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.GuiNull;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.ContainerNull;
|
||||
import appeng.container.ContainerOpenContext;
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.implementations.ContainerCellWorkbench;
|
||||
import appeng.container.implementations.ContainerChest;
|
||||
import appeng.container.implementations.ContainerCondenser;
|
||||
@@ -245,7 +243,7 @@ public enum GuiBridge
|
||||
{
|
||||
throw new IllegalStateException( "Unable to find gui class" );
|
||||
}
|
||||
this.guiClass = ReflectionHelper.getClass( this.getClass().getClassLoader(), guiClass );
|
||||
this.guiClass = null; // FIXME ReflectionHelper.getClass( this.getClass().getClassLoader(), guiClass );
|
||||
if( this.guiClass == null )
|
||||
{
|
||||
throw new IllegalStateException( "Cannot Load class: " + guiClass );
|
||||
@@ -262,7 +260,6 @@ public enum GuiBridge
|
||||
this.getGui();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getServerGuiElement( final int ordinal, final PlayerEntity player, final World w, final int x, final int y, final int z )
|
||||
{
|
||||
final AEPartLocation side = AEPartLocation.fromOrdinal( ordinal & 0x07 );
|
||||
@@ -341,13 +338,13 @@ public enum GuiBridge
|
||||
{
|
||||
if( newContainer instanceof AEBaseContainer )
|
||||
{
|
||||
final AEBaseContainer bc = (AEBaseContainer) newContainer;
|
||||
bc.setOpenContext( new ContainerOpenContext( myItem ) );
|
||||
bc.getOpenContext().setWorld( w );
|
||||
bc.getOpenContext().setX( x );
|
||||
bc.getOpenContext().setY( y );
|
||||
bc.getOpenContext().setZ( z );
|
||||
bc.getOpenContext().setSide( side );
|
||||
// FIXME final AEBaseContainer bc = (AEBaseContainer) newContainer;
|
||||
// FIXME bc.setLocator( new ContainerLocator( myItem ) );
|
||||
// FIXME bc.getLocator().setWorld( w );
|
||||
// FIXME bc.getLocator().setX( x );
|
||||
// FIXME bc.getLocator().setY( y );
|
||||
// FIXME bc.getLocator().setZ( z );
|
||||
// FIXME bc.getLocator().setSide( side );
|
||||
}
|
||||
|
||||
return newContainer;
|
||||
@@ -405,7 +402,6 @@ public enum GuiBridge
|
||||
return inventory.getClass().getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getClientGuiElement( final int ordinal, final PlayerEntity player, final World w, final int x, final int y, final int z )
|
||||
{
|
||||
final AEPartLocation side = AEPartLocation.fromOrdinal( ordinal & 0x07 );
|
||||
@@ -448,7 +444,7 @@ public enum GuiBridge
|
||||
}
|
||||
}
|
||||
}
|
||||
return new GuiNull( new ContainerNull() );
|
||||
return null; // FIXME
|
||||
}
|
||||
|
||||
public Object ConstructGui( final PlayerInventory inventory, final AEPartLocation side, final Object tE )
|
||||
|
||||
@@ -20,6 +20,8 @@ package appeng.core.sync.packets;
|
||||
|
||||
|
||||
import appeng.block.networking.BlockCableBus;
|
||||
import appeng.items.tools.ToolNetworkTool;
|
||||
import appeng.items.tools.powered.ToolColorApplicator;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -126,25 +128,25 @@ public class PacketClick extends AppEngPacket
|
||||
{
|
||||
if( !is.isEmpty() )
|
||||
{
|
||||
// FIXME if( is.getItem() instanceof ToolNetworkTool )
|
||||
// FIXME {
|
||||
// FIXME final ToolNetworkTool tnt = (ToolNetworkTool) is.getItem();
|
||||
// FIXME tnt.serverSideToolLogic( is, player, this.hand, player.world, pos, this.side, this.hitX, this.hitY,
|
||||
// FIXME this.hitZ );
|
||||
// FIXME }
|
||||
if( is.getItem() instanceof ToolNetworkTool)
|
||||
{
|
||||
final ToolNetworkTool tnt = (ToolNetworkTool) is.getItem();
|
||||
tnt.serverSideToolLogic( is, player, this.hand, player.world, pos, this.side, this.hitX, this.hitY,
|
||||
this.hitZ );
|
||||
}
|
||||
|
||||
/* FIXME else */ if( maybeMemoryCard.isSameAs( is ) )
|
||||
if( maybeMemoryCard.isSameAs( is ) )
|
||||
{
|
||||
final IMemoryCard mem = (IMemoryCard) is.getItem();
|
||||
mem.notifyUser( player, MemoryCardMessages.SETTINGS_CLEARED );
|
||||
is.setTag( null );
|
||||
}
|
||||
|
||||
// FIXME else if( maybeColorApplicator.isSameAs( is ) )
|
||||
// FIXME {
|
||||
// FIXME final ToolColorApplicator mem = (ToolColorApplicator) is.getItem();
|
||||
// FIXME mem.cycleColors( is, mem.getColor( is ), 1 );
|
||||
// FIXME }
|
||||
else if( maybeColorApplicator.isSameAs( is ) )
|
||||
{
|
||||
final ToolColorApplicator mem = (ToolColorApplicator) is.getItem();
|
||||
mem.cycleColors( is, mem.getColor( is ), 1 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,8 @@ package appeng.core.sync.packets;
|
||||
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.ContainerInscriber;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -32,7 +34,7 @@ import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.crafting.ICraftingGrid;
|
||||
import appeng.api.networking.crafting.ICraftingJob;
|
||||
import appeng.api.networking.security.IActionHost;
|
||||
import appeng.container.ContainerOpenContext;
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.implementations.ContainerCraftAmount;
|
||||
import appeng.container.implementations.ContainerCraftConfirm;
|
||||
import appeng.core.AELog;
|
||||
@@ -96,11 +98,10 @@ public class PacketCraftRequest extends AppEngPacket
|
||||
final ICraftingGrid cg = g.getCache( ICraftingGrid.class );
|
||||
futureJob = cg.beginCraftingJob( cca.getWorld(), cca.getGrid(), cca.getActionSrc(), cca.getItemToCraft(), null );
|
||||
|
||||
final ContainerOpenContext context = cca.getOpenContext();
|
||||
if( context != null )
|
||||
final ContainerLocator locator = cca.getLocator();
|
||||
if( locator != null )
|
||||
{
|
||||
final TileEntity te = context.getTile();
|
||||
// FIXME Platform.openGUI( player, te, cca.getOpenContext().getSide(), GuiBridge.GUI_CRAFTING_CONFIRM );
|
||||
ContainerOpener.openContainer(ContainerCraftConfirm.TYPE, player, locator);
|
||||
|
||||
if( player.openContainer instanceof ContainerCraftConfirm )
|
||||
{
|
||||
|
||||
@@ -21,6 +21,8 @@ package appeng.core.sync.packets;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.ContainerInscriber;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -31,7 +33,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.ContainerOpenContext;
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.implementations.ContainerCraftAmount;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.sync.AppEngPacket;
|
||||
@@ -127,11 +129,10 @@ public class PacketInventoryAction extends AppEngPacket
|
||||
final AEBaseContainer baseContainer = (AEBaseContainer) sender.openContainer;
|
||||
if( this.action == InventoryAction.AUTO_CRAFT )
|
||||
{
|
||||
final ContainerOpenContext context = baseContainer.getOpenContext();
|
||||
if( context != null )
|
||||
final ContainerLocator locator = baseContainer.getLocator();
|
||||
if( locator != null )
|
||||
{
|
||||
final TileEntity te = context.getTile();
|
||||
// FIXME Platform.openGUI( sender, te, baseContainer.getOpenContext().getSide(), GuiBridge.GUI_CRAFTING_AMOUNT );
|
||||
ContainerOpener.openContainer(ContainerCraftAmount.TYPE, player, locator);
|
||||
|
||||
if( sender.openContainer instanceof ContainerCraftAmount )
|
||||
{
|
||||
|
||||
@@ -19,40 +19,43 @@
|
||||
package appeng.core.sync.packets;
|
||||
|
||||
|
||||
import appeng.container.ContainerOpener;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.inventory.container.Container;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.ContainerOpenContext;
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.core.sync.AppEngPacket;
|
||||
|
||||
import appeng.core.sync.network.INetworkInfo;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
|
||||
|
||||
public class PacketSwitchGuis extends AppEngPacket
|
||||
{
|
||||
|
||||
private final GuiBridge newGui;
|
||||
private final ContainerType<?> newGui;
|
||||
|
||||
public PacketSwitchGuis( final PacketBuffer stream )
|
||||
{
|
||||
this.newGui = GuiBridge.values()[stream.readInt()];
|
||||
this.newGui = ForgeRegistries.CONTAINERS.getValue(stream.readResourceLocation());
|
||||
}
|
||||
|
||||
// api
|
||||
public PacketSwitchGuis( final GuiBridge newGui )
|
||||
public PacketSwitchGuis( final ContainerType<?> newGui )
|
||||
{
|
||||
this.newGui = newGui;
|
||||
|
||||
final PacketBuffer data = new PacketBuffer( Unpooled.buffer() );
|
||||
|
||||
data.writeInt( this.getPacketID() );
|
||||
data.writeInt( newGui.ordinal() );
|
||||
data.writeResourceLocation(newGui.getRegistryName());
|
||||
|
||||
this.configureWrite( data );
|
||||
}
|
||||
@@ -64,11 +67,10 @@ public class PacketSwitchGuis extends AppEngPacket
|
||||
if( c instanceof AEBaseContainer )
|
||||
{
|
||||
final AEBaseContainer bc = (AEBaseContainer) c;
|
||||
final ContainerOpenContext context = bc.getOpenContext();
|
||||
if( context != null )
|
||||
final ContainerLocator locator = bc.getLocator();
|
||||
if( locator != null )
|
||||
{
|
||||
final TileEntity te = context.getTile();
|
||||
Platform.openGUI( player, te, context.getSide(), this.newGui );
|
||||
ContainerOpener.openContainer(newGui, player, locator);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.SimpleSound;
|
||||
import net.minecraft.client.particle.Particle;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
@@ -92,21 +93,19 @@ public class PacketTransitionEffect extends AppEngPacket
|
||||
{
|
||||
if( AppEng.proxy.shouldAddParticles( Platform.getRandom() ) )
|
||||
{
|
||||
final EnergyFx fx = new EnergyFx( world, this.x + ( this.mode ? ( Platform
|
||||
.getRandomInt() % 100 ) * 0.01 : ( Platform.getRandomInt() % 100 ) * 0.005 - 0.25 ), this.y + ( this.mode ? ( Platform
|
||||
.getRandomInt() % 100 ) * 0.01 : ( Platform.getRandomInt() % 100 ) * 0.005 - 0.25 ), this.z + ( this.mode ? ( Platform
|
||||
.getRandomInt() % 100 ) * 0.01 : ( Platform.getRandomInt() % 100 ) * 0.005 - 0.25 ), new ItemStack(Items.DIAMOND, 1) );
|
||||
double x = this.x + ( this.mode ? ( Platform.getRandomInt() % 100 ) * 0.01 : ( Platform.getRandomInt() % 100 ) * 0.005 - 0.25 );
|
||||
double y = this.y + ( this.mode ? ( Platform.getRandomInt() % 100 ) * 0.01 : ( Platform.getRandomInt() % 100 ) * 0.005 - 0.25 );
|
||||
double z = this.z + ( this.mode ? ( Platform.getRandomInt() % 100 ) * 0.01 : ( Platform.getRandomInt() % 100 ) * 0.005 - 0.25 );
|
||||
double speedX = -0.1f * this.d.xOffset;
|
||||
double speedY = -0.1f * this.d.yOffset;
|
||||
double speedZ = -0.1f * this.d.zOffset;
|
||||
|
||||
EnergyFx fx = (EnergyFx) Minecraft.getInstance().particles.addParticle(EnergyFx.TYPE, x, y, z, speedX, speedY, speedZ);
|
||||
// FIXME: *sigh* custom particle data for this one thing :|
|
||||
if( !this.mode )
|
||||
{
|
||||
fx.fromItem( this.d );
|
||||
fx.fromItem( this.d );
|
||||
}
|
||||
|
||||
fx.setMotionX( -0.1f * this.d.xOffset );
|
||||
fx.setMotionY( -0.1f * this.d.yOffset );
|
||||
fx.setMotionZ( -0.1f * this.d.zOffset );
|
||||
|
||||
Minecraft.getInstance().particles.addEffect( fx );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,12 +19,36 @@
|
||||
package appeng.core.sync.packets;
|
||||
|
||||
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.api.util.IConfigurableObject;
|
||||
import appeng.client.gui.implementations.GuiCraftingCPU;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.implementations.ContainerCellWorkbench;
|
||||
import appeng.container.implementations.ContainerCraftConfirm;
|
||||
import appeng.container.implementations.ContainerCraftingCPU;
|
||||
import appeng.container.implementations.ContainerCraftingStatus;
|
||||
import appeng.container.implementations.ContainerLevelEmitter;
|
||||
import appeng.container.implementations.ContainerNetworkTool;
|
||||
import appeng.container.implementations.ContainerPatternTerm;
|
||||
import appeng.container.implementations.ContainerPriority;
|
||||
import appeng.container.implementations.ContainerQuartzKnife;
|
||||
import appeng.container.implementations.ContainerSecurityStation;
|
||||
import appeng.container.implementations.ContainerStorageBus;
|
||||
import appeng.core.sync.AppEngPacket;
|
||||
import appeng.core.sync.network.INetworkInfo;
|
||||
import appeng.fluids.container.ContainerFluidLevelEmitter;
|
||||
import appeng.fluids.container.ContainerFluidStorageBus;
|
||||
import appeng.helpers.IMouseWheelItem;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.inventory.container.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.util.Hand;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -43,7 +67,7 @@ public class PacketValueConfig extends AppEngPacket
|
||||
}
|
||||
|
||||
// api
|
||||
public PacketValueConfig( final String name, final String value ) throws IOException
|
||||
public PacketValueConfig( final String name, final String value )
|
||||
{
|
||||
this.Name = name;
|
||||
this.Value = value;
|
||||
@@ -63,172 +87,172 @@ public class PacketValueConfig extends AppEngPacket
|
||||
{
|
||||
final Container c = player.openContainer;
|
||||
|
||||
// FIXME if( this.Name.equals( "Item" ) && ( ( !player.getHeldItem( Hand.MAIN_HAND ).isEmpty() && player.getHeldItem( Hand.MAIN_HAND ).getItem() instanceof IMouseWheelItem ) || ( !player.getHeldItem( Hand.OFF_HAND ).isEmpty() && player.getHeldItem( Hand.OFF_HAND ).getItem() instanceof IMouseWheelItem ) ) )
|
||||
// FIXME {
|
||||
// FIXME final Hand hand;
|
||||
// FIXME if( !player.getHeldItem( Hand.MAIN_HAND ).isEmpty() && player.getHeldItem( Hand.MAIN_HAND ).getItem() instanceof IMouseWheelItem )
|
||||
// FIXME {
|
||||
// FIXME hand = Hand.MAIN_HAND;
|
||||
// FIXME }
|
||||
// FIXME else if( !player.getHeldItem( Hand.OFF_HAND ).isEmpty() && player.getHeldItem( Hand.OFF_HAND ).getItem() instanceof IMouseWheelItem )
|
||||
// FIXME {
|
||||
// FIXME hand = Hand.OFF_HAND;
|
||||
// FIXME }
|
||||
// FIXME else
|
||||
// FIXME {
|
||||
// FIXME return;
|
||||
// FIXME }
|
||||
// FIXME
|
||||
// FIXME final ItemStack is = player.getHeldItem( hand );
|
||||
// FIXME final IMouseWheelItem si = (IMouseWheelItem) is.getItem();
|
||||
// FIXME si.onWheel( is, this.Value.equals( "WheelUp" ) );
|
||||
// FIXME }
|
||||
// FIXME else if( this.Name.equals( "Terminal.Cpu" ) && c instanceof ContainerCraftingStatus )
|
||||
// FIXME {
|
||||
// FIXME final ContainerCraftingStatus qk = (ContainerCraftingStatus) c;
|
||||
// FIXME qk.cycleCpu( this.Value.equals( "Next" ) );
|
||||
// FIXME }
|
||||
// FIXME else if( this.Name.equals( "Terminal.Cpu" ) && c instanceof ContainerCraftConfirm )
|
||||
// FIXME {
|
||||
// FIXME final ContainerCraftConfirm qk = (ContainerCraftConfirm) c;
|
||||
// FIXME qk.cycleCpu( this.Value.equals( "Next" ) );
|
||||
// FIXME }
|
||||
// FIXME else if( this.Name.equals( "Terminal.Start" ) && c instanceof ContainerCraftConfirm )
|
||||
// FIXME {
|
||||
// FIXME final ContainerCraftConfirm qk = (ContainerCraftConfirm) c;
|
||||
// FIXME qk.startJob();
|
||||
// FIXME }
|
||||
// FIXME else if( this.Name.equals( "TileCrafting.Cancel" ) && c instanceof ContainerCraftingCPU )
|
||||
// FIXME {
|
||||
// FIXME final ContainerCraftingCPU qk = (ContainerCraftingCPU) c;
|
||||
// FIXME qk.cancelCrafting();
|
||||
// FIXME }
|
||||
// FIXME else if( this.Name.equals( "QuartzKnife.Name" ) && c instanceof ContainerQuartzKnife )
|
||||
// FIXME {
|
||||
// FIXME final ContainerQuartzKnife qk = (ContainerQuartzKnife) c;
|
||||
// FIXME qk.setName( this.Value );
|
||||
// FIXME }
|
||||
// FIXME else if( this.Name.equals( "TileSecurityStation.ToggleOption" ) && c instanceof ContainerSecurityStation )
|
||||
// FIXME {
|
||||
// FIXME final ContainerSecurityStation sc = (ContainerSecurityStation) c;
|
||||
// FIXME sc.toggleSetting( this.Value, player );
|
||||
// FIXME }
|
||||
// FIXME else if( this.Name.equals( "PriorityHost.Priority" ) && c instanceof ContainerPriority )
|
||||
// FIXME {
|
||||
// FIXME final ContainerPriority pc = (ContainerPriority) c;
|
||||
// FIXME pc.setPriority( Integer.parseInt( this.Value ), player );
|
||||
// FIXME }
|
||||
// FIXME else if( this.Name.equals( "LevelEmitter.Value" ) && c instanceof ContainerLevelEmitter )
|
||||
// FIXME {
|
||||
// FIXME final ContainerLevelEmitter lvc = (ContainerLevelEmitter) c;
|
||||
// FIXME lvc.setLevel( Long.parseLong( this.Value ), player );
|
||||
// FIXME }
|
||||
// FIXME else if( this.Name.equals( "FluidLevelEmitter.Value" ) && c instanceof ContainerFluidLevelEmitter )
|
||||
// FIXME {
|
||||
// FIXME final ContainerFluidLevelEmitter lvc = (ContainerFluidLevelEmitter) c;
|
||||
// FIXME lvc.setLevel( Long.parseLong( this.Value ), player );
|
||||
// FIXME }
|
||||
// FIXME else if( this.Name.startsWith( "PatternTerminal." ) && c instanceof ContainerPatternTerm )
|
||||
// FIXME {
|
||||
// FIXME final ContainerPatternTerm cpt = (ContainerPatternTerm) c;
|
||||
// FIXME if( this.Name.equals( "PatternTerminal.CraftMode" ) )
|
||||
// FIXME {
|
||||
// FIXME cpt.getPatternTerminal().setCraftingRecipe( this.Value.equals( "1" ) );
|
||||
// FIXME }
|
||||
// FIXME else if( this.Name.equals( "PatternTerminal.Encode" ) )
|
||||
// FIXME {
|
||||
// FIXME cpt.encode();
|
||||
// FIXME }
|
||||
// FIXME else if( this.Name.equals( "PatternTerminal.Clear" ) )
|
||||
// FIXME {
|
||||
// FIXME cpt.clear();
|
||||
// FIXME }
|
||||
// FIXME else if( this.Name.equals( "PatternTerminal.Substitute" ) )
|
||||
// FIXME {
|
||||
// FIXME cpt.getPatternTerminal().setSubstitution( this.Value.equals( "1" ) );
|
||||
// FIXME }
|
||||
// FIXME }
|
||||
// FIXME else if( this.Name.startsWith( "StorageBus." ) )
|
||||
// FIXME {
|
||||
// FIXME if( this.Name.equals( "StorageBus.Action" ) )
|
||||
// FIXME {
|
||||
// FIXME if( this.Value.equals( "Partition" ) )
|
||||
// FIXME {
|
||||
// FIXME if( c instanceof ContainerStorageBus )
|
||||
// FIXME {
|
||||
// FIXME ( (ContainerStorageBus) c ).partition();
|
||||
// FIXME }
|
||||
// FIXME else if( c instanceof ContainerFluidStorageBus )
|
||||
// FIXME {
|
||||
// FIXME ( (ContainerFluidStorageBus) c ).partition();
|
||||
// FIXME }
|
||||
// FIXME }
|
||||
// FIXME else if( this.Value.equals( "Clear" ) )
|
||||
// FIXME {
|
||||
// FIXME if( c instanceof ContainerStorageBus )
|
||||
// FIXME {
|
||||
// FIXME ( (ContainerStorageBus) c ).clear();
|
||||
// FIXME }
|
||||
// FIXME else if( c instanceof ContainerFluidStorageBus )
|
||||
// FIXME {
|
||||
// FIXME ( (ContainerFluidStorageBus) c ).clear();
|
||||
// FIXME }
|
||||
// FIXME }
|
||||
// FIXME }
|
||||
// FIXME }
|
||||
// FIXME else if( this.Name.startsWith( "CellWorkbench." ) && c instanceof ContainerCellWorkbench )
|
||||
// FIXME {
|
||||
// FIXME final ContainerCellWorkbench ccw = (ContainerCellWorkbench) c;
|
||||
// FIXME if( this.Name.equals( "CellWorkbench.Action" ) )
|
||||
// FIXME {
|
||||
// FIXME if( this.Value.equals( "CopyMode" ) )
|
||||
// FIXME {
|
||||
// FIXME ccw.nextWorkBenchCopyMode();
|
||||
// FIXME }
|
||||
// FIXME else if( this.Value.equals( "Partition" ) )
|
||||
// FIXME {
|
||||
// FIXME ccw.partition();
|
||||
// FIXME }
|
||||
// FIXME else if( this.Value.equals( "Clear" ) )
|
||||
// FIXME {
|
||||
// FIXME ccw.clear();
|
||||
// FIXME }
|
||||
// FIXME }
|
||||
// FIXME else if( this.Name.equals( "CellWorkbench.Fuzzy" ) )
|
||||
// FIXME {
|
||||
// FIXME ccw.setFuzzy( FuzzyMode.valueOf( this.Value ) );
|
||||
// FIXME }
|
||||
// FIXME }
|
||||
// FIXME else if( c instanceof ContainerNetworkTool )
|
||||
// FIXME {
|
||||
// FIXME if( this.Name.equals( "NetworkTool" ) && this.Value.equals( "Toggle" ) )
|
||||
// FIXME {
|
||||
// FIXME ( (ContainerNetworkTool) c ).toggleFacadeMode();
|
||||
// FIXME }
|
||||
// FIXME }
|
||||
// FIXME else if( c instanceof IConfigurableObject )
|
||||
// FIXME {
|
||||
// FIXME final IConfigManager cm = ( (IConfigurableObject) c ).getConfigManager();
|
||||
// FIXME
|
||||
// FIXME for( final Settings e : cm.getSettings() )
|
||||
// FIXME {
|
||||
// FIXME if( e.name().equals( this.Name ) )
|
||||
// FIXME {
|
||||
// FIXME final Enum<?> def = cm.getSetting( e );
|
||||
// FIXME
|
||||
// FIXME try
|
||||
// FIXME {
|
||||
// FIXME cm.putSetting( e, Enum.valueOf( def.getClass(), this.Value ) );
|
||||
// FIXME }
|
||||
// FIXME catch( final IllegalArgumentException err )
|
||||
// FIXME {
|
||||
// FIXME // :P
|
||||
// FIXME }
|
||||
// FIXME
|
||||
// FIXME break;
|
||||
// FIXME }
|
||||
// FIXME }
|
||||
// FIXME }
|
||||
if( this.Name.equals( "Item" ) && ( ( !player.getHeldItem( Hand.MAIN_HAND ).isEmpty() && player.getHeldItem( Hand.MAIN_HAND ).getItem() instanceof IMouseWheelItem) || ( !player.getHeldItem( Hand.OFF_HAND ).isEmpty() && player.getHeldItem( Hand.OFF_HAND ).getItem() instanceof IMouseWheelItem ) ) )
|
||||
{
|
||||
final Hand hand;
|
||||
if( !player.getHeldItem( Hand.MAIN_HAND ).isEmpty() && player.getHeldItem( Hand.MAIN_HAND ).getItem() instanceof IMouseWheelItem )
|
||||
{
|
||||
hand = Hand.MAIN_HAND;
|
||||
}
|
||||
else if( !player.getHeldItem( Hand.OFF_HAND ).isEmpty() && player.getHeldItem( Hand.OFF_HAND ).getItem() instanceof IMouseWheelItem )
|
||||
{
|
||||
hand = Hand.OFF_HAND;
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final ItemStack is = player.getHeldItem( hand );
|
||||
final IMouseWheelItem si = (IMouseWheelItem) is.getItem();
|
||||
si.onWheel( is, this.Value.equals( "WheelUp" ) );
|
||||
}
|
||||
else if( this.Name.equals( "Terminal.Cpu" ) && c instanceof ContainerCraftingStatus)
|
||||
{
|
||||
final ContainerCraftingStatus qk = (ContainerCraftingStatus) c;
|
||||
qk.cycleCpu( this.Value.equals( "Next" ) );
|
||||
}
|
||||
else if( this.Name.equals( "Terminal.Cpu" ) && c instanceof ContainerCraftConfirm )
|
||||
{
|
||||
final ContainerCraftConfirm qk = (ContainerCraftConfirm) c;
|
||||
qk.cycleCpu( this.Value.equals( "Next" ) );
|
||||
}
|
||||
else if( this.Name.equals( "Terminal.Start" ) && c instanceof ContainerCraftConfirm )
|
||||
{
|
||||
final ContainerCraftConfirm qk = (ContainerCraftConfirm) c;
|
||||
qk.startJob();
|
||||
}
|
||||
else if( this.Name.equals( "TileCrafting.Cancel" ) && c instanceof ContainerCraftingCPU )
|
||||
{
|
||||
final ContainerCraftingCPU qk = (ContainerCraftingCPU) c;
|
||||
qk.cancelCrafting();
|
||||
}
|
||||
else if( this.Name.equals( "QuartzKnife.Name" ) && c instanceof ContainerQuartzKnife )
|
||||
{
|
||||
final ContainerQuartzKnife qk = (ContainerQuartzKnife) c;
|
||||
qk.setName( this.Value );
|
||||
}
|
||||
else if( this.Name.equals( "TileSecurityStation.ToggleOption" ) && c instanceof ContainerSecurityStation )
|
||||
{
|
||||
final ContainerSecurityStation sc = (ContainerSecurityStation) c;
|
||||
sc.toggleSetting( this.Value, player );
|
||||
}
|
||||
else if( this.Name.equals( "PriorityHost.Priority" ) && c instanceof ContainerPriority )
|
||||
{
|
||||
final ContainerPriority pc = (ContainerPriority) c;
|
||||
pc.setPriority( Integer.parseInt( this.Value ), player );
|
||||
}
|
||||
else if( this.Name.equals( "LevelEmitter.Value" ) && c instanceof ContainerLevelEmitter )
|
||||
{
|
||||
final ContainerLevelEmitter lvc = (ContainerLevelEmitter) c;
|
||||
lvc.setLevel( Long.parseLong( this.Value ), player );
|
||||
}
|
||||
else if( this.Name.equals( "FluidLevelEmitter.Value" ) && c instanceof ContainerFluidLevelEmitter)
|
||||
{
|
||||
final ContainerFluidLevelEmitter lvc = (ContainerFluidLevelEmitter) c;
|
||||
lvc.setLevel( Long.parseLong( this.Value ), player );
|
||||
}
|
||||
else if( this.Name.startsWith( "PatternTerminal." ) && c instanceof ContainerPatternTerm )
|
||||
{
|
||||
final ContainerPatternTerm cpt = (ContainerPatternTerm) c;
|
||||
if( this.Name.equals( "PatternTerminal.CraftMode" ) )
|
||||
{
|
||||
cpt.getPatternTerminal().setCraftingRecipe( this.Value.equals( "1" ) );
|
||||
}
|
||||
else if( this.Name.equals( "PatternTerminal.Encode" ) )
|
||||
{
|
||||
cpt.encode();
|
||||
}
|
||||
else if( this.Name.equals( "PatternTerminal.Clear" ) )
|
||||
{
|
||||
cpt.clear();
|
||||
}
|
||||
else if( this.Name.equals( "PatternTerminal.Substitute" ) )
|
||||
{
|
||||
cpt.getPatternTerminal().setSubstitution( this.Value.equals( "1" ) );
|
||||
}
|
||||
}
|
||||
else if( this.Name.startsWith( "StorageBus." ) )
|
||||
{
|
||||
if( this.Name.equals( "StorageBus.Action" ) )
|
||||
{
|
||||
if( this.Value.equals( "Partition" ) )
|
||||
{
|
||||
if( c instanceof ContainerStorageBus )
|
||||
{
|
||||
( (ContainerStorageBus) c ).partition();
|
||||
}
|
||||
else if( c instanceof ContainerFluidStorageBus)
|
||||
{
|
||||
( (ContainerFluidStorageBus) c ).partition();
|
||||
}
|
||||
}
|
||||
else if( this.Value.equals( "Clear" ) )
|
||||
{
|
||||
if( c instanceof ContainerStorageBus )
|
||||
{
|
||||
( (ContainerStorageBus) c ).clear();
|
||||
}
|
||||
else if( c instanceof ContainerFluidStorageBus )
|
||||
{
|
||||
( (ContainerFluidStorageBus) c ).clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if( this.Name.startsWith( "CellWorkbench." ) && c instanceof ContainerCellWorkbench )
|
||||
{
|
||||
final ContainerCellWorkbench ccw = (ContainerCellWorkbench) c;
|
||||
if( this.Name.equals( "CellWorkbench.Action" ) )
|
||||
{
|
||||
if( this.Value.equals( "CopyMode" ) )
|
||||
{
|
||||
ccw.nextWorkBenchCopyMode();
|
||||
}
|
||||
else if( this.Value.equals( "Partition" ) )
|
||||
{
|
||||
ccw.partition();
|
||||
}
|
||||
else if( this.Value.equals( "Clear" ) )
|
||||
{
|
||||
ccw.clear();
|
||||
}
|
||||
}
|
||||
else if( this.Name.equals( "CellWorkbench.Fuzzy" ) )
|
||||
{
|
||||
ccw.setFuzzy( FuzzyMode.valueOf( this.Value ) );
|
||||
}
|
||||
}
|
||||
else if( c instanceof ContainerNetworkTool )
|
||||
{
|
||||
if( this.Name.equals( "NetworkTool" ) && this.Value.equals( "Toggle" ) )
|
||||
{
|
||||
( (ContainerNetworkTool) c ).toggleFacadeMode();
|
||||
}
|
||||
}
|
||||
else if( c instanceof IConfigurableObject)
|
||||
{
|
||||
final IConfigManager cm = ( (IConfigurableObject) c ).getConfigManager();
|
||||
|
||||
for( final Settings e : cm.getSettings() )
|
||||
{
|
||||
if( e.name().equals( this.Name ) )
|
||||
{
|
||||
final Enum<?> def = cm.getSetting( e );
|
||||
|
||||
try
|
||||
{
|
||||
cm.putSetting( e, Enum.valueOf( def.getClass(), this.Value ) );
|
||||
}
|
||||
catch( final IllegalArgumentException err )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -236,44 +260,44 @@ public class PacketValueConfig extends AppEngPacket
|
||||
{
|
||||
final Container c = player.openContainer;
|
||||
|
||||
// FIXME if( this.Name.equals( "CustomName" ) && c instanceof AEBaseContainer )
|
||||
// FIXME {
|
||||
// FIXME ( (AEBaseContainer) c ).setCustomName( this.Value );
|
||||
// FIXME }
|
||||
// FIXME else if( this.Name.startsWith( "SyncDat." ) )
|
||||
// FIXME {
|
||||
// FIXME ( (AEBaseContainer) c ).stringSync( Integer.parseInt( this.Name.substring( 8 ) ), this.Value );
|
||||
// FIXME }
|
||||
// FIXME else if( this.Name.equals( "CraftingStatus" ) && this.Value.equals( "Clear" ) )
|
||||
// FIXME {
|
||||
// FIXME final Screen gs = Minecraft.getInstance().currentScreen;
|
||||
// FIXME if( gs instanceof GuiCraftingCPU )
|
||||
// FIXME {
|
||||
// FIXME ( (GuiCraftingCPU) gs ).clearItems();
|
||||
// FIXME }
|
||||
// FIXME }
|
||||
// FIXME else if( c instanceof IConfigurableObject )
|
||||
// FIXME {
|
||||
// FIXME final IConfigManager cm = ( (IConfigurableObject) c ).getConfigManager();
|
||||
// FIXME
|
||||
// FIXME for( final Settings e : cm.getSettings() )
|
||||
// FIXME {
|
||||
// FIXME if( e.name().equals( this.Name ) )
|
||||
// FIXME {
|
||||
// FIXME final Enum<?> def = cm.getSetting( e );
|
||||
// FIXME
|
||||
// FIXME try
|
||||
// FIXME {
|
||||
// FIXME cm.putSetting( e, Enum.valueOf( def.getClass(), this.Value ) );
|
||||
// FIXME }
|
||||
// FIXME catch( final IllegalArgumentException err )
|
||||
// FIXME {
|
||||
// FIXME // :P
|
||||
// FIXME }
|
||||
// FIXME
|
||||
// FIXME break;
|
||||
// FIXME }
|
||||
// FIXME }
|
||||
// FIXME }
|
||||
if( this.Name.equals( "CustomName" ) && c instanceof AEBaseContainer)
|
||||
{
|
||||
( (AEBaseContainer) c ).setCustomName( this.Value );
|
||||
}
|
||||
else if( this.Name.startsWith( "SyncDat." ) )
|
||||
{
|
||||
( (AEBaseContainer) c ).stringSync( Integer.parseInt( this.Name.substring( 8 ) ), this.Value );
|
||||
}
|
||||
else if( this.Name.equals( "CraftingStatus" ) && this.Value.equals( "Clear" ) )
|
||||
{
|
||||
final Screen gs = Minecraft.getInstance().currentScreen;
|
||||
if( gs instanceof GuiCraftingCPU)
|
||||
{
|
||||
( (GuiCraftingCPU) gs ).clearItems();
|
||||
}
|
||||
}
|
||||
else if( c instanceof IConfigurableObject )
|
||||
{
|
||||
final IConfigManager cm = ( (IConfigurableObject) c ).getConfigManager();
|
||||
|
||||
for( final Settings e : cm.getSettings() )
|
||||
{
|
||||
if( e.name().equals( this.Name ) )
|
||||
{
|
||||
final Enum<?> def = cm.getSetting( e );
|
||||
|
||||
try
|
||||
{
|
||||
cm.putSetting( e, Enum.valueOf( def.getClass(), this.Value ) );
|
||||
}
|
||||
catch( final IllegalArgumentException err )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user