Work on GUIs (specifically to get SkyChest GUI)

This commit is contained in:
Sebastian Hartte
2020-06-02 02:14:09 +02:00
parent 271e8889a1
commit 9f63859769
109 changed files with 1133 additions and 1301 deletions
+1
View File
@@ -36,6 +36,7 @@ import appeng.api.networking.IMachineSet;
import appeng.api.networking.events.MENetworkEvent;
import appeng.api.networking.events.MENetworkPostCacheConstruction;
import appeng.api.util.IReadOnlyCollection;
import appeng.core.Api;
import appeng.core.worlddata.WorldData;
import appeng.hooks.TickHandler;
import appeng.util.ReadOnlyCollection;
+1 -1
View File
@@ -121,7 +121,7 @@ public class GridStorage implements IGridStorage
return this.internalGrid == null ? null : this.internalGrid.get();
}
void setGrid( final Grid grid )
void setGrid( final IGrid grid )
{
this.internalGrid = new WeakReference<>( grid );
}
@@ -32,7 +32,7 @@ import com.google.common.collect.ImmutableList;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.nbt.ListNBT;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import net.minecraftforge.fml.common.FMLCommonHandler;
@@ -1156,7 +1156,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
data.setTag( "link", link );
}
final NBTTagList list = new NBTTagList();
final ListNBT list = new ListNBT();
for( final Entry<ICraftingPatternDetails, TaskProgress> e : this.tasks.entrySet() )
{
final CompoundNBT item = this.writeItem( AEItemStack.fromItemStack( e.getKey().getPattern() ) );
@@ -1184,9 +1184,9 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
return out;
}
private NBTTagList writeList( final IItemList<IAEItemStack> myList )
private ListNBT writeList( final IItemList<IAEItemStack> myList )
{
final NBTTagList out = new NBTTagList();
final ListNBT out = new ListNBT();
for( final IAEItemStack ais : myList )
{
@@ -1215,7 +1215,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
public void readFromNBT( final CompoundNBT data )
{
this.finalOutput = AEItemStack.fromNBT( (CompoundNBT) data.getTag( "finalOutput" ) );
for( final IAEItemStack ais : this.readList( (NBTTagList) data.getTag( "inventory" ) ) )
for( final IAEItemStack ais : this.readList( (ListNBT) data.getTag( "inventory" ) ) )
{
this.inventory.injectItems( ais, Actionable.MODULATE, this.machineSrc );
}
@@ -1230,7 +1230,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
this.submitLink( this.myLastLink );
}
final NBTTagList list = data.getTagList( "tasks", 10 );
final ListNBT list = data.getTagList( "tasks", 10 );
for( int x = 0; x < list.tagCount(); x++ )
{
final CompoundNBT item = list.getCompoundTagAt( x );
@@ -1248,7 +1248,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
}
}
this.waitingFor = this.readList( (NBTTagList) data.getTag( "waitingFor" ) );
this.waitingFor = this.readList( (ListNBT) data.getTag( "waitingFor" ) );
for( final IAEItemStack is : this.waitingFor )
{
this.postCraftingStatusChange( is.copy() );
@@ -1280,7 +1280,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
}
}
private IItemList<IAEItemStack> readList( final NBTTagList tag )
private IItemList<IAEItemStack> readList( final ListNBT tag )
{
final IItemList<IAEItemStack> out = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList();
@@ -22,6 +22,8 @@ package appeng.me.helpers;
import java.util.Collections;
import java.util.EnumSet;
import appeng.core.Api;
import appeng.core.worlddata.WorldData;
import com.mojang.authlib.GameProfile;
import net.minecraft.entity.player.PlayerEntity;
@@ -45,11 +47,7 @@ import appeng.api.networking.ticking.ITickManager;
import appeng.api.util.AEColor;
import appeng.api.util.DimensionalCoord;
import appeng.api.util.IOrientable;
import appeng.core.worlddata.WorldData;
import appeng.hooks.TickHandler;
import appeng.me.GridAccessException;
import appeng.me.cache.P2PCache;
import appeng.parts.networking.PartCable;
import appeng.tile.AEBaseTile;
import appeng.util.Platform;
@@ -105,7 +103,8 @@ public class AENetworkProxy implements IGridBlock
{
if( this.gp instanceof AEBaseTile )
{
TickHandler.INSTANCE.addInit( (AEBaseTile) this.gp );
throw new IllegalStateException(); // FIXME just here to remember for sure
// FIXME TickHandler.INSTANCE.addInit( (AEBaseTile) this.gp );
}
}
@@ -241,23 +240,23 @@ public class AENetworkProxy implements IGridBlock
return pg;
}
public P2PCache getP2P() throws GridAccessException
{
final IGrid grid = this.getGrid();
if( grid == null )
{
throw new GridAccessException();
}
final P2PCache pg = grid.getCache( P2PCache.class );
if( pg == null )
{
throw new GridAccessException();
}
return pg;
}
// FIXME public P2PCache getP2P() throws GridAccessException
// FIXME {
// FIXME final IGrid grid = this.getGrid();
// FIXME if( grid == null )
// FIXME {
// FIXME throw new GridAccessException();
// FIXME }
// FIXME
// FIXME final P2PCache pg = grid.getCache( P2PCache.class );
// FIXME
// FIXME if( pg == null )
// FIXME {
// FIXME throw new GridAccessException();
// FIXME }
// FIXME
// FIXME return pg;
// FIXME }
public ISecurityGrid getSecurity() throws GridAccessException
{
@@ -328,10 +327,10 @@ public class AENetworkProxy implements IGridBlock
@Override
public void onGridNotification( final GridNotification notification )
{
if( this.gp instanceof PartCable )
{
( (PartCable) this.gp ).markForUpdate();
}
// FIXME if( this.gp instanceof PartCable )
// FIXME {
// FIXME ( (PartCable) this.gp ).markForUpdate();
// FIXME }
}
@Override