More compile things
This commit is contained in:
@@ -34,10 +34,9 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.ListNBT;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
import net.minecraftforge.fml.hooks.BasicEventHooks;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
@@ -65,6 +64,7 @@ import appeng.api.storage.data.IItemList;
|
||||
import appeng.api.util.WorldCoord;
|
||||
import appeng.container.ContainerNull;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.Api;
|
||||
import appeng.crafting.CraftBranchFailure;
|
||||
import appeng.crafting.CraftingJob;
|
||||
import appeng.crafting.CraftingLink;
|
||||
@@ -390,7 +390,6 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void markDirty()
|
||||
@@ -779,9 +778,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
|
||||
if( details.isCraftable() )
|
||||
{
|
||||
FMLCommonHandler.instance()
|
||||
.firePlayerCraftingEvent( Platform.getPlayer( (WorldServer) this.getWorld() ),
|
||||
details.getOutput( ic, this.getWorld() ), ic );
|
||||
BasicEventHooks.firePlayerCraftingEvent( Platform.getPlayer( (ServerWorld) getWorld() ), details.getOutput( ic, this.getWorld() ), ic );
|
||||
|
||||
for( int x = 0; x < ic.getSizeInventory(); x++ )
|
||||
{
|
||||
@@ -1003,19 +1000,18 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
final int hash = System.identityHashCode( this );
|
||||
final int hmm = this.finalOutput == null ? 0 : this.finalOutput.hashCode();
|
||||
|
||||
return Long.toString( now, Character.MAX_RADIX ) + '-' + Integer.toString( hash, Character.MAX_RADIX ) + '-' + Integer.toString( hmm,
|
||||
Character.MAX_RADIX );
|
||||
return Long.toString( now, Character.MAX_RADIX ) + '-' + Integer.toString( hash, Character.MAX_RADIX ) + '-' + Integer.toString( hmm, Character.MAX_RADIX );
|
||||
}
|
||||
|
||||
private CompoundNBT generateLinkData( final String craftingID, final boolean standalone, final boolean req )
|
||||
{
|
||||
final CompoundNBT tag = new CompoundNBT();
|
||||
|
||||
tag.putString("CraftID", craftingID);
|
||||
tag.putBoolean("canceled", false);
|
||||
tag.putBoolean("done", false);
|
||||
tag.putBoolean("standalone", standalone);
|
||||
tag.putBoolean("req", req);
|
||||
tag.putString( "CraftID", craftingID );
|
||||
tag.putBoolean( "canceled", false );
|
||||
tag.putBoolean( "done", false );
|
||||
tag.putBoolean( "standalone", standalone );
|
||||
tag.putBoolean( "req", req );
|
||||
|
||||
return tag;
|
||||
}
|
||||
@@ -1144,16 +1140,16 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
|
||||
public void writeToNBT( final CompoundNBT data )
|
||||
{
|
||||
data.setTag( "finalOutput", this.writeItem( this.finalOutput ) );
|
||||
data.setTag( "inventory", this.writeList( this.inventory.getItemList() ) );
|
||||
data.putBoolean("waiting", this.waiting);
|
||||
data.putBoolean("isComplete", this.isComplete);
|
||||
data.put( "finalOutput", this.writeItem( this.finalOutput ) );
|
||||
data.put( "inventory", this.writeList( this.inventory.getItemList() ) );
|
||||
data.putBoolean( "waiting", this.waiting );
|
||||
data.putBoolean( "isComplete", this.isComplete );
|
||||
|
||||
if( this.myLastLink != null )
|
||||
{
|
||||
final CompoundNBT link = new CompoundNBT();
|
||||
this.myLastLink.writeToNBT( link );
|
||||
data.setTag( "link", link );
|
||||
data.put( "link", link );
|
||||
}
|
||||
|
||||
final ListNBT list = new ListNBT();
|
||||
@@ -1161,11 +1157,11 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
{
|
||||
final CompoundNBT item = this.writeItem( AEItemStack.fromItemStack( e.getKey().getPattern() ) );
|
||||
item.putLong( "craftingProgress", e.getValue().value );
|
||||
list.appendTag( item );
|
||||
list.add( item );
|
||||
}
|
||||
data.setTag( "tasks", list );
|
||||
data.put( "tasks", list );
|
||||
|
||||
data.setTag( "waitingFor", this.writeList( this.waitingFor ) );
|
||||
data.put( "waitingFor", this.writeList( this.waitingFor ) );
|
||||
|
||||
data.putLong( "elapsedTime", this.getElapsedTime() );
|
||||
data.putLong( "startItemCount", this.getStartItemCount() );
|
||||
@@ -1178,7 +1174,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
|
||||
if( finalOutput2 != null )
|
||||
{
|
||||
finalOutput2.write(out);
|
||||
finalOutput2.writeToNBT( out );
|
||||
}
|
||||
|
||||
return out;
|
||||
@@ -1190,7 +1186,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
|
||||
for( final IAEItemStack ais : myList )
|
||||
{
|
||||
out.appendTag( this.writeItem( ais ) );
|
||||
out.add( this.writeItem( ais ) );
|
||||
}
|
||||
|
||||
return out;
|
||||
@@ -1214,8 +1210,8 @@ 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( (ListNBT) data.getTag( "inventory" ) ) )
|
||||
this.finalOutput = AEItemStack.fromNBT( data.getCompound( "finalOutput" ) );
|
||||
for( final IAEItemStack ais : this.readList( data.getList( "inventory", 10 ) ) )
|
||||
{
|
||||
this.inventory.injectItems( ais, Actionable.MODULATE, this.machineSrc );
|
||||
}
|
||||
@@ -1223,17 +1219,17 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
this.waiting = data.getBoolean( "waiting" );
|
||||
this.isComplete = data.getBoolean( "isComplete" );
|
||||
|
||||
if( data.contains("link") )
|
||||
if( data.contains( "link" ) )
|
||||
{
|
||||
final CompoundNBT link = data.getCompoundTag( "link" );
|
||||
final CompoundNBT link = data.getCompound( "link" );
|
||||
this.myLastLink = new CraftingLink( link, this );
|
||||
this.submitLink( this.myLastLink );
|
||||
}
|
||||
|
||||
final ListNBT list = data.getTagList( "tasks", 10 );
|
||||
for( int x = 0; x < list.tagCount(); x++ )
|
||||
final ListNBT list = data.getList( "tasks", 10 );
|
||||
for( int x = 0; x < list.size(); x++ )
|
||||
{
|
||||
final CompoundNBT item = list.getCompoundTagAt( x );
|
||||
final CompoundNBT item = list.getCompound( x );
|
||||
final IAEItemStack pattern = AEItemStack.fromNBT( item );
|
||||
if( pattern != null && pattern.getItem() instanceof ICraftingPatternItem )
|
||||
{
|
||||
@@ -1248,7 +1244,7 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
}
|
||||
}
|
||||
|
||||
this.waitingFor = this.readList( (ListNBT) data.getTag( "waitingFor" ) );
|
||||
this.waitingFor = this.readList( data.getList( "waitingFor", 10 ) );
|
||||
for( final IAEItemStack is : this.waitingFor )
|
||||
{
|
||||
this.postCraftingStatusChange( is.copy() );
|
||||
@@ -1289,9 +1285,9 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
return out;
|
||||
}
|
||||
|
||||
for( int x = 0; x < tag.tagCount(); x++ )
|
||||
for( int x = 0; x < tag.size(); x++ )
|
||||
{
|
||||
final IAEItemStack ais = AEItemStack.fromNBT( tag.getCompoundTagAt( x ) );
|
||||
final IAEItemStack ais = AEItemStack.fromNBT( tag.getCompound( x ) );
|
||||
if( ais != null )
|
||||
{
|
||||
out.add( ais );
|
||||
|
||||
@@ -28,6 +28,7 @@ import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IBlockDefinition;
|
||||
import appeng.api.definitions.IBlocks;
|
||||
import appeng.api.util.WorldCoord;
|
||||
import appeng.core.Api;
|
||||
import appeng.me.cluster.IAECluster;
|
||||
import appeng.me.cluster.IAEMultiBlock;
|
||||
import appeng.me.cluster.MBCalculator;
|
||||
|
||||
@@ -22,14 +22,13 @@ package appeng.me.cluster.implementations;
|
||||
import java.util.Iterator;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.events.LocatableEventAnnounce;
|
||||
import appeng.api.events.LocatableEventAnnounce.LocatableEvent;
|
||||
import appeng.api.exceptions.FailedConnectionException;
|
||||
@@ -39,6 +38,7 @@ import appeng.api.networking.IGridNode;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.api.util.WorldCoord;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.Api;
|
||||
import appeng.me.cache.helpers.ConnectionWrapper;
|
||||
import appeng.me.cluster.IAECluster;
|
||||
import appeng.tile.qnb.TileQuantumBridge;
|
||||
@@ -156,10 +156,7 @@ public class QuantumCluster implements ILocatable, IAECluster
|
||||
}
|
||||
}
|
||||
|
||||
sideA.connection = sideB.connection = new ConnectionWrapper( Api.INSTANCE
|
||||
.grid()
|
||||
.createGridConnection( sideA.getNode(),
|
||||
sideB.getNode() ) );
|
||||
sideA.connection = sideB.connection = new ConnectionWrapper( Api.INSTANCE.grid().createGridConnection( sideA.getNode(), sideB.getNode() ) );
|
||||
}
|
||||
catch( final FailedConnectionException e )
|
||||
{
|
||||
@@ -196,11 +193,11 @@ public class QuantumCluster implements ILocatable, IAECluster
|
||||
final World theWorld = qc.center.getWorld();
|
||||
if( !qc.isDestroyed )
|
||||
{
|
||||
final Chunk c = theWorld.getChunkFromBlockCoords( qc.center.getPos() );
|
||||
if( c.isLoaded() )
|
||||
ChunkPos cPos = new ChunkPos( qc.center.getPos() );
|
||||
if( theWorld.getChunkProvider().isChunkLoaded( cPos ) )
|
||||
{
|
||||
final int id = theWorld.provider.getDimension();
|
||||
final World cur = DimensionManager.getWorld( id );
|
||||
final DimensionType id = theWorld.dimension.getType();
|
||||
final World cur = theWorld.getServer().getWorld( id );
|
||||
|
||||
final TileEntity te = theWorld.getTileEntity( qc.center.getPos() );
|
||||
return te != qc.center || theWorld != cur;
|
||||
@@ -265,14 +262,12 @@ public class QuantumCluster implements ILocatable, IAECluster
|
||||
@Override
|
||||
public Iterator<IGridHost> getTiles()
|
||||
{
|
||||
return new ChainedIterator<>( this.getRing()[0], this.getRing()[1], this.getRing()[2], this.getRing()[3], this.getRing()[4], this
|
||||
.getRing()[5], this.getRing()[6], this.getRing()[7], this.center );
|
||||
return new ChainedIterator<>( this.getRing()[0], this.getRing()[1], this.getRing()[2], this.getRing()[3], this.getRing()[4], this.getRing()[5], this.getRing()[6], this.getRing()[7], this.center );
|
||||
}
|
||||
|
||||
public boolean isCorner( final TileQuantumBridge tileQuantumBridge )
|
||||
{
|
||||
return this.getRing()[0] == tileQuantumBridge || this.getRing()[2] == tileQuantumBridge || this.getRing()[4] == tileQuantumBridge || this
|
||||
.getRing()[6] == tileQuantumBridge;
|
||||
return this.getRing()[0] == tileQuantumBridge || this.getRing()[2] == tileQuantumBridge || this.getRing()[4] == tileQuantumBridge || this.getRing()[6] == tileQuantumBridge;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user