Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d3dd137570 | |||
| 78e1126c38 | |||
| ebe3ff045d | |||
| 6291a545c3 | |||
| 99fd5a9d53 | |||
| 416c7d2683 |
@@ -29,5 +29,5 @@ package appeng.api.implementations.items;
|
||||
*/
|
||||
public enum MemoryCardMessages
|
||||
{
|
||||
INVALID_MACHINE, SETTINGS_LOADED, SETTINGS_SAVED, SETTINGS_CLEARED
|
||||
INVALID_MACHINE, SETTINGS_LOADED, SETTINGS_SAVED, SETTINGS_RESET, SETTINGS_CLEARED
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ public enum PlayerMessages
|
||||
InvalidMachine,
|
||||
LoadedSettings,
|
||||
SavedSettings,
|
||||
ResetSettings,
|
||||
MachineNotPowered,
|
||||
|
||||
isNowLocked,
|
||||
|
||||
@@ -17,10 +17,10 @@ public class AEFluidInventory implements IAEFluidTank
|
||||
{
|
||||
private final IAEFluidStack[] fluids;
|
||||
private final IAEFluidInventory handler;
|
||||
private final long capacity;
|
||||
private final int capacity;
|
||||
private IFluidTankProperties[] props = null;
|
||||
|
||||
public AEFluidInventory( final IAEFluidInventory handler, final int slots, final long capcity )
|
||||
public AEFluidInventory( final IAEFluidInventory handler, final int slots, final int capcity )
|
||||
{
|
||||
this.fluids = new IAEFluidStack[slots];
|
||||
this.handler = handler;
|
||||
@@ -29,7 +29,7 @@ public class AEFluidInventory implements IAEFluidTank
|
||||
|
||||
public AEFluidInventory( final IAEFluidInventory handler, final int slots )
|
||||
{
|
||||
this( handler, slots, Long.MAX_VALUE );
|
||||
this( handler, slots, Integer.MAX_VALUE );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -110,45 +110,34 @@ public class AEFluidInventory implements IAEFluidTank
|
||||
|
||||
final IAEFluidStack fluid = this.fluids[slot];
|
||||
|
||||
if( !doFill )
|
||||
{
|
||||
if( fluid == null )
|
||||
{
|
||||
return resource.amount;
|
||||
}
|
||||
|
||||
if( !fluid.equals( resource ) )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (int) Math.min( Math.min( this.capacity - fluid.getStackSize(), resource.amount ), Integer.MAX_VALUE );
|
||||
}
|
||||
|
||||
if( fluid == null )
|
||||
{
|
||||
this.setFluidInSlot( slot, AEFluidStack.fromFluidStack( resource ) );
|
||||
return resource.amount;
|
||||
}
|
||||
|
||||
if( !fluid.equals( resource ) )
|
||||
if( fluid != null && !fluid.equals( resource ) )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
long filled = this.capacity - fluid.getStackSize();
|
||||
|
||||
if( resource.amount < filled )
|
||||
int amountToStore = this.capacity;
|
||||
|
||||
if( fluid != null )
|
||||
{
|
||||
fluid.setStackSize( fluid.getStackSize() + resource.amount );
|
||||
filled = resource.amount;
|
||||
}
|
||||
else
|
||||
{
|
||||
fluid.setStackSize( this.capacity );
|
||||
amountToStore -= fluid.getStackSize();
|
||||
}
|
||||
|
||||
this.onContentChanged( slot );
|
||||
return (int) filled;
|
||||
amountToStore = Math.min( amountToStore, resource.amount );
|
||||
|
||||
if( doFill )
|
||||
{
|
||||
if( fluid == null )
|
||||
{
|
||||
this.setFluidInSlot( slot, AEFluidStack.fromFluidStack( resource ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
fluid.setStackSize( fluid.getStackSize() + amountToStore );
|
||||
this.onContentChanged( slot );
|
||||
}
|
||||
}
|
||||
|
||||
return amountToStore;
|
||||
}
|
||||
|
||||
public FluidStack drain( final int slot, final FluidStack resource, final boolean doDrain )
|
||||
@@ -363,7 +352,7 @@ public class AEFluidInventory implements IAEFluidTank
|
||||
@Override
|
||||
public int getCapacity()
|
||||
{
|
||||
return (int) Math.min( AEFluidInventory.this.capacity, Integer.MAX_VALUE );
|
||||
return Math.min( AEFluidInventory.this.capacity, Integer.MAX_VALUE );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -49,37 +49,41 @@ import appeng.util.item.AEStack;
|
||||
public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFluidStack, Comparable<AEFluidStack>
|
||||
{
|
||||
|
||||
private final int myHash;
|
||||
private final Fluid fluid;
|
||||
private NBTTagCompound tagCompound;
|
||||
|
||||
private AEFluidStack( final AEFluidStack is )
|
||||
private AEFluidStack( final AEFluidStack fluidStack )
|
||||
{
|
||||
|
||||
this.fluid = is.fluid;
|
||||
this.setStackSize( is.getStackSize() );
|
||||
this.fluid = fluidStack.fluid;
|
||||
this.setStackSize( fluidStack.getStackSize() );
|
||||
|
||||
// priority = is.priority;
|
||||
this.setCraftable( is.isCraftable() );
|
||||
this.setCountRequestable( is.getCountRequestable() );
|
||||
this.setCraftable( fluidStack.isCraftable() );
|
||||
this.setCountRequestable( fluidStack.getCountRequestable() );
|
||||
|
||||
this.myHash = is.myHash;
|
||||
if( fluidStack.hasTagCompound() )
|
||||
{
|
||||
this.tagCompound = fluidStack.tagCompound.copy();
|
||||
}
|
||||
}
|
||||
|
||||
private AEFluidStack( @Nonnull final FluidStack is )
|
||||
private AEFluidStack( @Nonnull final FluidStack fluidStack )
|
||||
{
|
||||
this.fluid = is.getFluid();
|
||||
this.fluid = fluidStack.getFluid();
|
||||
|
||||
if( this.fluid == null )
|
||||
{
|
||||
throw new IllegalArgumentException( "Fluid is null." );
|
||||
}
|
||||
|
||||
this.setStackSize( is.amount );
|
||||
this.setStackSize( fluidStack.amount );
|
||||
this.setCraftable( false );
|
||||
this.setCountRequestable( 0 );
|
||||
|
||||
this.myHash = this.fluid.hashCode() ^ ( this.tagCompound == null ? 0 : System.identityHashCode( this.tagCompound ) );
|
||||
if( fluidStack.tag != null )
|
||||
{
|
||||
this.tagCompound = fluidStack.tag.copy();
|
||||
}
|
||||
}
|
||||
|
||||
public static AEFluidStack fromFluidStack( final FluidStack input )
|
||||
@@ -92,9 +96,9 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
return new AEFluidStack( input );
|
||||
}
|
||||
|
||||
public static IAEFluidStack fromNBT( final NBTTagCompound i )
|
||||
public static IAEFluidStack fromNBT( final NBTTagCompound data )
|
||||
{
|
||||
final FluidStack fluidStack = FluidStack.loadFluidStackFromNBT( i );
|
||||
final FluidStack fluidStack = FluidStack.loadFluidStackFromNBT( data );
|
||||
|
||||
if( fluidStack == null )
|
||||
{
|
||||
@@ -102,15 +106,21 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
}
|
||||
|
||||
final AEFluidStack fluid = AEFluidStack.fromFluidStack( fluidStack );
|
||||
fluid.setStackSize( i.getLong( "Cnt" ) );
|
||||
fluid.setCountRequestable( i.getLong( "Req" ) );
|
||||
fluid.setCraftable( i.getBoolean( "Craft" ) );
|
||||
fluid.setStackSize( data.getLong( "Cnt" ) );
|
||||
fluid.setCountRequestable( data.getLong( "Req" ) );
|
||||
fluid.setCraftable( data.getBoolean( "Craft" ) );
|
||||
|
||||
if( fluid.hasTagCompound() )
|
||||
{
|
||||
fluid.tagCompound = fluid.tagCompound.copy();
|
||||
}
|
||||
|
||||
return fluid;
|
||||
}
|
||||
|
||||
public static IAEFluidStack fromPacket( final ByteBuf data ) throws IOException
|
||||
public static IAEFluidStack fromPacket( final ByteBuf buffer ) throws IOException
|
||||
{
|
||||
final byte mask = data.readByte();
|
||||
final byte mask = buffer.readByte();
|
||||
final byte stackType = (byte) ( ( mask & 0x0C ) >> 2 );
|
||||
final byte countReqType = (byte) ( ( mask & 0x30 ) >> 4 );
|
||||
final boolean isCraftable = ( mask & 0x40 ) > 0;
|
||||
@@ -119,26 +129,26 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
// don't send this...
|
||||
final NBTTagCompound d = new NBTTagCompound();
|
||||
|
||||
final byte len2 = data.readByte();
|
||||
final byte len2 = buffer.readByte();
|
||||
final byte[] name = new byte[len2];
|
||||
data.readBytes( name, 0, len2 );
|
||||
buffer.readBytes( name, 0, len2 );
|
||||
|
||||
d.setString( "FluidName", new String( name, "UTF-8" ) );
|
||||
d.setByte( "Count", (byte) 0 );
|
||||
|
||||
if( hasTagCompound )
|
||||
{
|
||||
final int len = data.readInt();
|
||||
final int len = buffer.readInt();
|
||||
|
||||
final byte[] bd = new byte[len];
|
||||
data.readBytes( bd );
|
||||
buffer.readBytes( bd );
|
||||
|
||||
final DataInputStream di = new DataInputStream( new ByteArrayInputStream( bd ) );
|
||||
d.setTag( "tag", CompressedStreamTools.read( di ) );
|
||||
d.setTag( "Tag", CompressedStreamTools.read( di ) );
|
||||
}
|
||||
|
||||
final long stackSize = getPacketValue( stackType, data );
|
||||
final long countRequestable = getPacketValue( countReqType, data );
|
||||
final long stackSize = getPacketValue( stackType, buffer );
|
||||
final long countRequestable = getPacketValue( countReqType, buffer );
|
||||
|
||||
final FluidStack fluidStack = FluidStack.loadFluidStackFromNBT( d );
|
||||
|
||||
@@ -168,51 +178,21 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( final NBTTagCompound i )
|
||||
public void writeToNBT( final NBTTagCompound data )
|
||||
{
|
||||
/*
|
||||
* Mojang Fucked this over ; GC Optimization - Ugly Yes, but it saves a lot in the memory department.
|
||||
*/
|
||||
data.setString( "FluidName", this.fluid.getName() );
|
||||
data.setByte( "Count", (byte) 0 );
|
||||
data.setLong( "Cnt", this.getStackSize() );
|
||||
data.setLong( "Req", this.getCountRequestable() );
|
||||
data.setBoolean( "Craft", this.isCraftable() );
|
||||
|
||||
/*
|
||||
* NBTBase FluidName = i.getTag( "FluidName" ); NBTBase Count = i.getTag( "Count" ); NBTBase Cnt = i.getTag(
|
||||
* "Cnt" ); NBTBase Req = i.getTag( "Req" ); NBTBase Craft = i.getTag( "Craft" );
|
||||
*/
|
||||
|
||||
/*
|
||||
* if ( FluidName != null && FluidName instanceof NBTTagString ) ((NBTTagString) FluidName).data = (String)
|
||||
* this.fluid.getName(); else
|
||||
*/
|
||||
i.setString( "FluidName", this.fluid.getName() );
|
||||
|
||||
/*
|
||||
* if ( Count != null && Count instanceof NBTTagByte ) ((NBTTagByte) Count).data = (byte) 0; else
|
||||
*/
|
||||
i.setByte( "Count", (byte) 0 );
|
||||
|
||||
/*
|
||||
* if ( Cnt != null && Cnt instanceof NBTTagLong ) ((NBTTagLong) Cnt).data = this.stackSize; else
|
||||
*/
|
||||
i.setLong( "Cnt", this.getStackSize() );
|
||||
|
||||
/*
|
||||
* if ( Req != null && Req instanceof NBTTagLong ) ((NBTTagLong) Req).data = this.stackSize; else
|
||||
*/
|
||||
i.setLong( "Req", this.getCountRequestable() );
|
||||
|
||||
/*
|
||||
* if ( Craft != null && Craft instanceof NBTTagByte ) ((NBTTagByte) Craft).data = (byte) (this.isCraftable() ?
|
||||
* 1 : 0); else
|
||||
*/
|
||||
i.setBoolean( "Craft", this.isCraftable() );
|
||||
|
||||
if( this.tagCompound != null )
|
||||
if( this.hasTagCompound() )
|
||||
{
|
||||
i.setTag( "tag", this.tagCompound );
|
||||
data.setTag( "Tag", this.tagCompound );
|
||||
}
|
||||
else
|
||||
{
|
||||
i.removeTag( "tag" );
|
||||
data.removeTag( "Tag" );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,29 +235,43 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo( final AEFluidStack b )
|
||||
public int compareTo( final AEFluidStack other )
|
||||
{
|
||||
final int diff = this.hashCode() - b.hashCode();
|
||||
return diff > 0 ? 1 : ( diff < 0 ? -1 : 0 );
|
||||
if( this.fluid != other.fluid )
|
||||
{
|
||||
return this.fluid.getName().compareTo( other.fluid.getName() );
|
||||
}
|
||||
|
||||
if( Platform.itemComparisons().isNbtTagEqual( this.tagCompound, other.tagCompound ) )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return this.tagCompound.hashCode() - other.tagCompound.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return this.myHash;
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ( ( this.fluid == null ) ? 0 : this.fluid.hashCode() );
|
||||
result = prime * result + ( ( this.tagCompound == null ) ? 0 : this.tagCompound.hashCode() );
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals( final Object ia )
|
||||
public boolean equals( final Object other )
|
||||
{
|
||||
if( ia instanceof AEFluidStack )
|
||||
if( other instanceof AEFluidStack )
|
||||
{
|
||||
final AEFluidStack is = (AEFluidStack) ia;
|
||||
final AEFluidStack is = (AEFluidStack) other;
|
||||
return is.fluid == this.fluid && Platform.itemComparisons().isNbtTagEqual( this.tagCompound, is.tagCompound );
|
||||
}
|
||||
else if( ia instanceof FluidStack )
|
||||
else if( other instanceof FluidStack )
|
||||
{
|
||||
final FluidStack is = (FluidStack) ia;
|
||||
final FluidStack is = (FluidStack) other;
|
||||
return is.getFluid() == this.fluid && Platform.itemComparisons().isNbtTagEqual( this.tagCompound, is.tag );
|
||||
}
|
||||
return false;
|
||||
@@ -286,7 +280,7 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return this.getFluidStack().toString();
|
||||
return this.getStackSize() + "x" + this.getFluidStack().getFluid().getName() + " " + this.tagCompound;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -298,11 +292,8 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
@Override
|
||||
public FluidStack getFluidStack()
|
||||
{
|
||||
final FluidStack is = new FluidStack( this.fluid, (int) Math.min( Integer.MAX_VALUE, this.getStackSize() ) );
|
||||
if( this.tagCompound != null )
|
||||
{
|
||||
is.tag = this.tagCompound.copy();
|
||||
}
|
||||
final int amount = (int) Math.min( Integer.MAX_VALUE, this.getStackSize() );
|
||||
final FluidStack is = new FluidStack( this.fluid, amount, this.tagCompound );
|
||||
|
||||
return is;
|
||||
}
|
||||
@@ -327,24 +318,24 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToPacket( final ByteBuf i ) throws IOException
|
||||
public void writeToPacket( final ByteBuf buffer ) throws IOException
|
||||
{
|
||||
final byte mask = (byte) ( ( this.getType( this.getStackSize() ) << 2 ) | ( this
|
||||
.getType( this.getCountRequestable() ) << 4 ) | ( (byte) ( this.isCraftable() ? 1 : 0 ) << 6 ) | ( this.hasTagCompound() ? 1 : 0 ) << 7 );
|
||||
|
||||
i.writeByte( mask );
|
||||
buffer.writeByte( mask );
|
||||
|
||||
this.writeToStream( i );
|
||||
this.writeToStream( buffer );
|
||||
|
||||
this.putPacketValue( i, this.getStackSize() );
|
||||
this.putPacketValue( i, this.getCountRequestable() );
|
||||
this.putPacketValue( buffer, this.getStackSize() );
|
||||
this.putPacketValue( buffer, this.getCountRequestable() );
|
||||
}
|
||||
|
||||
private void writeToStream( final ByteBuf i ) throws IOException
|
||||
private void writeToStream( final ByteBuf buffer ) throws IOException
|
||||
{
|
||||
final byte[] name = this.fluid.getName().getBytes( "UTF-8" );
|
||||
i.writeByte( (byte) name.length );
|
||||
i.writeBytes( name );
|
||||
buffer.writeByte( (byte) name.length );
|
||||
buffer.writeBytes( name );
|
||||
if( this.hasTagCompound() )
|
||||
{
|
||||
final ByteArrayOutputStream bytes = new ByteArrayOutputStream();
|
||||
@@ -355,8 +346,8 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
|
||||
final byte[] tagBytes = bytes.toByteArray();
|
||||
final int size = tagBytes.length;
|
||||
|
||||
i.writeInt( size );
|
||||
i.writeBytes( tagBytes );
|
||||
buffer.writeInt( size );
|
||||
buffer.writeBytes( tagBytes );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
@@ -174,6 +175,9 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard
|
||||
case SETTINGS_SAVED:
|
||||
player.sendMessage( PlayerMessages.SavedSettings.get() );
|
||||
break;
|
||||
case SETTINGS_RESET:
|
||||
player.sendMessage( PlayerMessages.ResetSettings.get() );
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
@@ -185,9 +189,7 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard
|
||||
{
|
||||
if( !w.isRemote )
|
||||
{
|
||||
final IMemoryCard mem = (IMemoryCard) player.getHeldItem( hand ).getItem();
|
||||
mem.notifyUser( player, MemoryCardMessages.SETTINGS_CLEARED );
|
||||
player.getHeldItem( hand ).setTagCompound( null );
|
||||
this.clearCard( player, w, hand );
|
||||
}
|
||||
return EnumActionResult.SUCCESS;
|
||||
}
|
||||
@@ -197,9 +199,31 @@ public class ToolMemoryCard extends AEBaseItem implements IMemoryCard
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick( World w, EntityPlayer player, EnumHand hand )
|
||||
{
|
||||
if( player.isSneaking() )
|
||||
{
|
||||
if( !w.isRemote )
|
||||
{
|
||||
this.clearCard( player, w, hand );
|
||||
}
|
||||
}
|
||||
|
||||
return super.onItemRightClick( w, player, hand );
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesSneakBypassUse( final ItemStack itemstack, final IBlockAccess world, final BlockPos pos, final EntityPlayer player )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
private void clearCard( final EntityPlayer player, final World w, final EnumHand hand )
|
||||
{
|
||||
final IMemoryCard mem = (IMemoryCard) player.getHeldItem( hand ).getItem();
|
||||
mem.notifyUser( player, MemoryCardMessages.SETTINGS_CLEARED );
|
||||
player.getHeldItem( hand ).setTagCompound( null );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -336,15 +336,18 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
}
|
||||
|
||||
final IMemoryCard mc = (IMemoryCard) is.getItem();
|
||||
final NBTTagCompound data = new NBTTagCompound();
|
||||
final NBTTagCompound data = mc.getData( is );
|
||||
final short storedFrequency = data.getShort( "freq" );
|
||||
|
||||
short newFreq = this.getFrequency();
|
||||
final boolean wasOutput = this.isOutput();
|
||||
this.setOutput( false );
|
||||
|
||||
final boolean needsNewFrequency = wasOutput || this.getFrequency() == 0 || storedFrequency == newFreq;
|
||||
|
||||
try
|
||||
{
|
||||
if( wasOutput || this.getFrequency() == 0 )
|
||||
if( needsNewFrequency )
|
||||
{
|
||||
newFreq = this.getProxy().getP2P().newFrequency();
|
||||
}
|
||||
@@ -373,7 +376,14 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
data.setIntArray( "colorCode", colorCode );
|
||||
|
||||
mc.setMemoryCardContents( is, type + ".name", data );
|
||||
mc.notifyUser( player, MemoryCardMessages.SETTINGS_SAVED );
|
||||
if( needsNewFrequency )
|
||||
{
|
||||
mc.notifyUser( player, MemoryCardMessages.SETTINGS_RESET );
|
||||
}
|
||||
else
|
||||
{
|
||||
mc.notifyUser( player, MemoryCardMessages.SETTINGS_SAVED );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -20,15 +20,18 @@ package appeng.tile.crafting;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Optional;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.implementations.tiles.IColorableTile;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.util.AEColor;
|
||||
@@ -183,4 +186,12 @@ public class TileCraftingMonitorTile extends TileCraftingTile implements IColora
|
||||
{
|
||||
this.updateList = updateList;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ItemStack getItemFromTile( final Object obj )
|
||||
{
|
||||
final Optional<ItemStack> is = AEApi.instance().definitions().blocks().craftingMonitor().maybeStack( 1 );
|
||||
|
||||
return is.orElseGet( () -> super.getItemFromTile( obj ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,9 @@ public class TileCraftingStorageTile extends TileCraftingTile
|
||||
|
||||
switch( storage )
|
||||
{
|
||||
case 1:
|
||||
is = blocks.craftingStorage1k().maybeStack( 1 );
|
||||
break;
|
||||
case 4:
|
||||
is = blocks.craftingStorage4k().maybeStack( 1 );
|
||||
break;
|
||||
|
||||
@@ -85,6 +85,10 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP
|
||||
{
|
||||
is = AEApi.instance().definitions().blocks().craftingAccelerator().maybeStack( 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
is = AEApi.instance().definitions().blocks().craftingUnit().maybeStack( 1 );
|
||||
}
|
||||
|
||||
return is.orElseGet( () -> super.getItemFromTile( obj ) );
|
||||
}
|
||||
|
||||
@@ -266,7 +266,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
@Override
|
||||
public TickingRequest getTickingRequest( final IGridNode node )
|
||||
{
|
||||
return new TickingRequest( TickRates.IOPort.getMin(), TickRates.IOPort.getMax(), this.hasWork(), false );
|
||||
return new TickingRequest( TickRates.IOPort.getMin(), TickRates.IOPort.getMax(), !this.hasWork(), false );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -84,7 +84,8 @@ chat.appliedenergistics2.DeviceNotLinked=Device is not linked.
|
||||
chat.appliedenergistics2.StationCanNotBeLocated=Station can not be located.
|
||||
chat.appliedenergistics2.MachineNotPowered=Machine is not powered.
|
||||
chat.appliedenergistics2.CommunicationError=Error Communicating with Network.
|
||||
chat.appliedenergistics2.SavedSettings=Copied device configuration to memory card.
|
||||
chat.appliedenergistics2.SavedSettings=Copied current device configuration to memory card.
|
||||
chat.appliedenergistics2.ResetSettings=New device configuration created and copied to memory card.
|
||||
chat.appliedenergistics2.AmmoDepleted=Ammo Depleted.
|
||||
chat.appliedenergistics2.isNowLocked=Monitor is now Locked.
|
||||
chat.appliedenergistics2.isNowUnlocked=Monitor is now Unlocked.
|
||||
|
||||
Reference in New Issue
Block a user