Revert using internal API
This commit is contained in:
@@ -23,7 +23,6 @@ import java.io.IOException;
|
||||
import java.util.Optional;
|
||||
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.core.Api;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
@@ -33,6 +32,7 @@ import net.minecraft.util.Direction;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.implementations.tiles.IColorableTile;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.util.AEColor;
|
||||
@@ -196,7 +196,7 @@ public class TileCraftingMonitorTile extends TileCraftingTile implements IColora
|
||||
@Override
|
||||
protected ItemStack getItemFromTile( final Object obj )
|
||||
{
|
||||
final Optional<ItemStack> is = Api.INSTANCE.definitions().blocks().craftingMonitor().maybeStack( 1 );
|
||||
final Optional<ItemStack> is = AEApi.instance().definitions().blocks().craftingMonitor().maybeStack( 1 );
|
||||
|
||||
return is.orElseGet( () -> super.getItemFromTile( obj ) );
|
||||
}
|
||||
|
||||
@@ -21,9 +21,9 @@ package appeng.tile.crafting;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import appeng.core.Api;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IBlocks;
|
||||
import appeng.block.crafting.AbstractCraftingUnitBlock;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
@@ -40,7 +40,7 @@ public class TileCraftingStorageTile extends TileCraftingTile
|
||||
@Override
|
||||
protected ItemStack getItemFromTile( final Object obj )
|
||||
{
|
||||
final IBlocks blocks = Api.INSTANCE.definitions().blocks();
|
||||
final IBlocks blocks = AEApi.instance().definitions().blocks();
|
||||
final int storage = ( (TileCraftingTile) obj ).getStorageBytes() / KILO_SCALAR;
|
||||
|
||||
Optional<ItemStack> is;
|
||||
|
||||
@@ -26,7 +26,6 @@ import java.util.LinkedList;
|
||||
import java.util.Optional;
|
||||
|
||||
import appeng.client.render.crafting.CraftingCubeState;
|
||||
import appeng.core.Api;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
@@ -34,6 +33,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.implementations.IPowerChannelState;
|
||||
import appeng.api.networking.GridFlags;
|
||||
@@ -95,11 +95,11 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP
|
||||
|
||||
if( ( (TileCraftingTile) obj ).isAccelerator() )
|
||||
{
|
||||
is = Api.INSTANCE.definitions().blocks().craftingAccelerator().maybeStack( 1 );
|
||||
is = AEApi.instance().definitions().blocks().craftingAccelerator().maybeStack( 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
is = Api.INSTANCE.definitions().blocks().craftingUnit().maybeStack( 1 );
|
||||
is = AEApi.instance().definitions().blocks().craftingUnit().maybeStack( 1 );
|
||||
}
|
||||
|
||||
return is.orElseGet( () -> super.getItemFromTile( obj ) );
|
||||
@@ -331,7 +331,7 @@ public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IP
|
||||
throw new IllegalStateException( this.cluster + " does not contain any kind of blocks, which were destroyed." );
|
||||
}
|
||||
|
||||
for( IAEItemStack ais : inv.getAvailableItems( Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createList() ) )
|
||||
for( IAEItemStack ais : inv.getAvailableItems( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList() ) )
|
||||
{
|
||||
ais = ais.copy();
|
||||
ais.setStackSize( ais.getDefinition().getMaxStackSize() );
|
||||
|
||||
@@ -22,7 +22,6 @@ package appeng.tile.crafting;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import appeng.core.Api;
|
||||
import appeng.core.sync.network.TargetPoint;
|
||||
import net.minecraft.inventory.CraftingInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -37,6 +36,7 @@ import net.minecraft.world.server.ServerWorld;
|
||||
import net.minecraftforge.fml.hooks.BasicEventHooks;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
import appeng.api.config.RedstoneMode;
|
||||
@@ -99,7 +99,7 @@ public class TileMolecularAssembler extends AENetworkInvTile implements IUpgrade
|
||||
|
||||
public TileMolecularAssembler(TileEntityType<?> tileEntityTypeIn) {
|
||||
super(tileEntityTypeIn);
|
||||
final ITileDefinition assembler = Api.INSTANCE.definitions().blocks().molecularAssembler();
|
||||
final ITileDefinition assembler = AEApi.instance().definitions().blocks().molecularAssembler();
|
||||
|
||||
this.settings = new ConfigManager( this );
|
||||
this.settings.registerSetting( Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE );
|
||||
|
||||
@@ -22,7 +22,6 @@ package appeng.tile.grindstone;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import appeng.core.Api;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
@@ -97,7 +96,7 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable
|
||||
continue;
|
||||
}
|
||||
|
||||
final IGrinderRecipe r = Api.INSTANCE.registries().grinder().getRecipeForInput( item );
|
||||
final IGrinderRecipe r = AEApi.instance().registries().grinder().getRecipeForInput( item );
|
||||
if( r != null )
|
||||
{
|
||||
if( item.getCount() >= r.getInput().getCount() )
|
||||
@@ -133,7 +132,7 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable
|
||||
this.points++;
|
||||
|
||||
final ItemStack processing = this.inv.getStackInSlot( 6 );
|
||||
final IGrinderRecipe r = Api.INSTANCE.registries().grinder().getRecipeForInput( processing );
|
||||
final IGrinderRecipe r = AEApi.instance().registries().grinder().getRecipeForInput( processing );
|
||||
if( r != null )
|
||||
{
|
||||
if( r.getRequiredTurns() > this.points )
|
||||
@@ -204,7 +203,7 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable
|
||||
@Override
|
||||
public boolean allowInsert( IItemHandler inv, int slotIndex, ItemStack stack )
|
||||
{
|
||||
if( Api.INSTANCE.registries().grinder().getRecipeForInput( stack ) == null )
|
||||
if( AEApi.instance().registries().grinder().getRecipeForInput( stack ) == null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ import java.util.Iterator;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import appeng.core.Api;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraftforge.items.IItemHandlerModifiable;
|
||||
@@ -178,7 +177,7 @@ public class AppEngInternalAEInventory implements IItemHandlerModifiable, Iterab
|
||||
{
|
||||
if( existing.isEmpty() )
|
||||
{
|
||||
this.inv[slot] = Api.INSTANCE
|
||||
this.inv[slot] = AEApi.instance()
|
||||
.storage()
|
||||
.getStorageChannel( IItemStorageChannel.class )
|
||||
.createStack(
|
||||
@@ -227,7 +226,7 @@ public class AppEngInternalAEInventory implements IItemHandlerModifiable, Iterab
|
||||
public void setStackInSlot( final int slot, final ItemStack newItemStack )
|
||||
{
|
||||
ItemStack oldStack = this.getStackInSlot( slot ).copy();
|
||||
this.inv[slot] = Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ).createStack( newItemStack );
|
||||
this.inv[slot] = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createStack( newItemStack );
|
||||
|
||||
if( this.te != null && Platform.isServer() )
|
||||
{
|
||||
|
||||
@@ -23,7 +23,6 @@ import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import appeng.core.Api;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
@@ -105,7 +104,7 @@ class CondenserItemInventory implements IMEMonitor<IAEItemStack>, ITickingMonito
|
||||
@Override
|
||||
public IStorageChannel<IAEItemStack> getChannel()
|
||||
{
|
||||
return Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class );
|
||||
return AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,7 +24,6 @@ import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import appeng.core.Api;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
@@ -32,6 +31,7 @@ import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
import appeng.api.config.PowerUnits;
|
||||
@@ -129,7 +129,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IGrid
|
||||
final ItemStack myItem = this.inv.getStackInSlot( 0 );
|
||||
if( this.getInternalCurrentPower() > POWER_THRESHOLD )
|
||||
{
|
||||
final IMaterials materials = Api.INSTANCE.definitions().materials();
|
||||
final IMaterials materials = AEApi.instance().definitions().materials();
|
||||
|
||||
if( materials.certusQuartzCrystal().isSameAs( myItem ) )
|
||||
{
|
||||
@@ -179,7 +179,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IGrid
|
||||
{
|
||||
ItemStack held = player.inventory.getCurrentItem();
|
||||
|
||||
if( Api.INSTANCE.definitions().materials().certusQuartzCrystal().isSameAs( held ) || Platform.isChargeable( held ) )
|
||||
if( AEApi.instance().definitions().materials().certusQuartzCrystal().isSameAs( held ) || Platform.isChargeable( held ) )
|
||||
{
|
||||
held = player.inventory.decrStackSize( player.inventory.currentItem, 1 );
|
||||
this.inv.setStackInSlot( 0, held );
|
||||
@@ -213,7 +213,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IGrid
|
||||
|
||||
if( !myItem.isEmpty() )
|
||||
{
|
||||
final IMaterials materials = Api.INSTANCE.definitions().materials();
|
||||
final IMaterials materials = AEApi.instance().definitions().materials();
|
||||
|
||||
if( Platform.isChargeable( myItem ) )
|
||||
{
|
||||
@@ -221,7 +221,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IGrid
|
||||
|
||||
if( ps.getAEMaxPower( myItem ) > ps.getAECurrentPower( myItem ) )
|
||||
{
|
||||
final double chargeRate = Api.INSTANCE.registries().charger().getChargeRate( myItem.getItem() );
|
||||
final double chargeRate = AEApi.instance().registries().charger().getChargeRate( myItem.getItem() );
|
||||
|
||||
double extractedAmount = this.extractAEPower( chargeRate, Actionable.MODULATE, PowerMultiplier.CONFIG );
|
||||
|
||||
@@ -292,7 +292,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IGrid
|
||||
@Override
|
||||
public boolean allowInsert( IItemHandler inv, final int i, final ItemStack itemstack )
|
||||
{
|
||||
final IItemDefinition cert = Api.INSTANCE.definitions().materials().certusQuartzCrystal();
|
||||
final IItemDefinition cert = AEApi.instance().definitions().materials().certusQuartzCrystal();
|
||||
|
||||
return Platform.isChargeable( itemstack ) || cert.isSameAs( itemstack );
|
||||
}
|
||||
@@ -311,7 +311,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IGrid
|
||||
}
|
||||
}
|
||||
|
||||
return Api.INSTANCE.definitions().materials().certusQuartzCrystalCharged().isSameAs( extractedItem );
|
||||
return AEApi.instance().definitions().materials().certusQuartzCrystalCharged().isSameAs( extractedItem );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ package appeng.tile.misc;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import appeng.core.Api;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
@@ -167,7 +166,7 @@ public class TileCondenser extends AEBaseInvTile implements IConfigManagerHost,
|
||||
|
||||
private ItemStack getOutput()
|
||||
{
|
||||
final IMaterials materials = Api.INSTANCE.definitions().materials();
|
||||
final IMaterials materials = AEApi.instance().definitions().materials();
|
||||
|
||||
switch( (CondenserOutput) this.cm.getSetting( Settings.CONDENSER_OUTPUT ) )
|
||||
{
|
||||
@@ -325,7 +324,7 @@ public class TileCondenser extends AEBaseInvTile implements IConfigManagerHost,
|
||||
public int fill(FluidStack resource, FluidAction action) {
|
||||
if( action == FluidAction.EXECUTE )
|
||||
{
|
||||
final IStorageChannel<IAEFluidStack> chan = Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class );
|
||||
final IStorageChannel<IAEFluidStack> chan = AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class );
|
||||
TileCondenser.this.addPower( ( resource == null ? 0.0 : (double) resource.getAmount() ) / chan.transferFactor() );
|
||||
}
|
||||
|
||||
@@ -392,7 +391,7 @@ public class TileCondenser extends AEBaseInvTile implements IConfigManagerHost,
|
||||
@Override
|
||||
public <T extends IAEStack<T>> IMEMonitor<T> getInventory( IStorageChannel<T> channel )
|
||||
{
|
||||
if( channel == Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ) )
|
||||
if( channel == AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) )
|
||||
{
|
||||
return (IMEMonitor<T>) this.itemInventory;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ import java.util.List;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import appeng.core.Api;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -39,6 +38,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.items.IItemHandlerModifiable;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
import appeng.api.config.Upgrades;
|
||||
@@ -110,7 +110,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
|
||||
this.getProxy().setIdlePowerUsage( 0 );
|
||||
this.settings = new ConfigManager( this );
|
||||
|
||||
final ITileDefinition inscriberDefinition = Api.INSTANCE.definitions().blocks().inscriber();
|
||||
final ITileDefinition inscriberDefinition = AEApi.instance().definitions().blocks().inscriber();
|
||||
this.upgrades = new DefinitionUpgradeInventory( inscriberDefinition, this, this.getUpgradeSlots() );
|
||||
|
||||
this.sideItemHandler.setMaxStackSize( 1, 64 );
|
||||
@@ -306,7 +306,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
|
||||
return null;
|
||||
}
|
||||
|
||||
final IComparableDefinition namePress = Api.INSTANCE.definitions().materials().namePress();
|
||||
final IComparableDefinition namePress = AEApi.instance().definitions().materials().namePress();
|
||||
final boolean isNameA = namePress.isSameAs( plateA );
|
||||
final boolean isNameB = namePress.isSameAs( plateB );
|
||||
|
||||
@@ -319,7 +319,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
|
||||
return this.makeNamePressRecipe( input, plateB, plateA );
|
||||
}
|
||||
|
||||
for( final IInscriberRecipe recipe : Api.INSTANCE.registries().inscriber().getRecipes() )
|
||||
for( final IInscriberRecipe recipe : AEApi.instance().registries().inscriber().getRecipes() )
|
||||
{
|
||||
|
||||
final boolean matchA = ( plateA.isEmpty() && !recipe.getTopOptional().isPresent() ) || ( Platform.itemComparisons()
|
||||
@@ -559,7 +559,7 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
|
||||
final List<ItemStack> inputs = Lists.newArrayList( startingItem );
|
||||
final InscriberProcessType type = InscriberProcessType.INSCRIBE;
|
||||
|
||||
final IInscriberRecipeBuilder builder = Api.INSTANCE.registries().inscriber().builder();
|
||||
final IInscriberRecipeBuilder builder = AEApi.instance().registries().inscriber().builder();
|
||||
builder.withInputs( inputs ).withOutput( renamedItem ).withProcessType( type );
|
||||
|
||||
if( !plateA.isEmpty() )
|
||||
@@ -609,11 +609,11 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
|
||||
|
||||
if( inv == TileInscriber.this.topItemHandler || inv == TileInscriber.this.bottomItemHandler )
|
||||
{
|
||||
if( Api.INSTANCE.definitions().materials().namePress().isSameAs( stack ) )
|
||||
if( AEApi.instance().definitions().materials().namePress().isSameAs( stack ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
for( final ItemStack optionals : Api.INSTANCE.registries().inscriber().getOptionals() )
|
||||
for( final ItemStack optionals : AEApi.instance().registries().inscriber().getOptionals() )
|
||||
{
|
||||
if( Platform.itemComparisons().isSameItem( stack, optionals ) )
|
||||
{
|
||||
|
||||
@@ -26,7 +26,6 @@ import java.util.List;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import appeng.container.implementations.ContainerInterface;
|
||||
import appeng.core.Api;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import net.minecraft.inventory.CraftingInventory;
|
||||
@@ -43,6 +42,7 @@ import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.networking.IGridNode;
|
||||
@@ -359,7 +359,7 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, II
|
||||
@Override
|
||||
public ItemStack getItemStackRepresentation()
|
||||
{
|
||||
return Api.INSTANCE.definitions().blocks().iface().maybeStack( 1 ).orElse( ItemStack.EMPTY );
|
||||
return AEApi.instance().definitions().blocks().iface().maybeStack( 1 ).orElse( ItemStack.EMPTY );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,7 +24,6 @@ import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import appeng.core.Api;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -38,6 +37,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.SortDir;
|
||||
@@ -278,7 +278,7 @@ public class TileSecurityStation extends AENetworkTile implements ITerminalHost,
|
||||
@Override
|
||||
public <T extends IAEStack<T>> IMEMonitor<T> getInventory( IStorageChannel<T> channel )
|
||||
{
|
||||
if( channel == Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ) )
|
||||
if( channel == AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) )
|
||||
{
|
||||
return (IMEMonitor<T>) this.securityMonitor;
|
||||
}
|
||||
@@ -318,7 +318,7 @@ public class TileSecurityStation extends AENetworkTile implements ITerminalHost,
|
||||
@Override
|
||||
public void readPermissions( final Map<Integer, EnumSet<SecurityPermissions>> playerPerms )
|
||||
{
|
||||
final IPlayerRegistry pr = Api.INSTANCE.registries().players();
|
||||
final IPlayerRegistry pr = AEApi.instance().registries().players();
|
||||
|
||||
// read permissions
|
||||
for( final IAEItemStack ais : this.inventory.getStoredItems() )
|
||||
|
||||
@@ -22,13 +22,13 @@ package appeng.tile.networking;
|
||||
import java.io.IOException;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import appeng.core.Api;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.implementations.IPowerChannelState;
|
||||
import appeng.api.implementations.tiles.IWirelessAccessPoint;
|
||||
import appeng.api.networking.GridFlags;
|
||||
@@ -60,7 +60,7 @@ public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoi
|
||||
|
||||
public TileWireless(TileEntityType<?> tileEntityTypeIn) {
|
||||
super(tileEntityTypeIn);
|
||||
this.inv.setFilter( new AEItemDefinitionFilter( Api.INSTANCE.definitions().materials().wirelessBooster() ) );
|
||||
this.inv.setFilter( new AEItemDefinitionFilter( AEApi.instance().definitions().materials().wirelessBooster() ) );
|
||||
this.getProxy().setFlags( GridFlags.REQUIRE_CHANNEL );
|
||||
this.getProxy().setValidSides( EnumSet.noneOf( Direction.class ) );
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ import java.util.EnumSet;
|
||||
import java.util.Optional;
|
||||
|
||||
import appeng.block.qnb.QnbFormedState;
|
||||
import appeng.core.Api;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
@@ -39,6 +38,7 @@ import net.minecraftforge.client.model.data.ModelProperty;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.items.wrapper.EmptyHandler;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IBlockDefinition;
|
||||
import appeng.api.networking.GridFlags;
|
||||
import appeng.api.networking.events.MENetworkEventSubscribe;
|
||||
@@ -150,7 +150,7 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock
|
||||
|
||||
private boolean isCenter()
|
||||
{
|
||||
return Api.INSTANCE
|
||||
return AEApi.instance()
|
||||
.definitions()
|
||||
.blocks()
|
||||
.quantumLink()
|
||||
@@ -177,7 +177,7 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock
|
||||
{
|
||||
super.onReady();
|
||||
|
||||
final IBlockDefinition quantumRing = Api.INSTANCE.definitions().blocks().quantumRing();
|
||||
final IBlockDefinition quantumRing = AEApi.instance().definitions().blocks().quantumRing();
|
||||
final Optional<Block> maybeLinkBlock = quantumRing.maybeBlock();
|
||||
final Optional<ItemStack> maybeLinkStack = quantumRing.maybeStack( 1 );
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ import javax.annotation.Nullable;
|
||||
import appeng.block.storage.BlockChest;
|
||||
import appeng.block.storage.DriveSlotState;
|
||||
import appeng.container.implementations.ContainerMEMonitorable;
|
||||
import appeng.core.Api;
|
||||
import appeng.fluids.container.ContainerFluidTerminal;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -50,6 +49,7 @@ import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
import net.minecraftforge.fluids.capability.IFluidHandler;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.AccessRestriction;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
@@ -228,12 +228,12 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, ITerminal
|
||||
if( !is.isEmpty() )
|
||||
{
|
||||
this.isCached = true;
|
||||
ICellHandler cellHandler = Api.INSTANCE.registries().cell().getHandler( is );
|
||||
ICellHandler cellHandler = AEApi.instance().registries().cell().getHandler( is );
|
||||
if( cellHandler != null )
|
||||
{
|
||||
double power = 1.0;
|
||||
|
||||
for( IStorageChannel channel : Api.INSTANCE.storage().storageChannels() )
|
||||
for( IStorageChannel channel : AEApi.instance().storage().storageChannels() )
|
||||
{
|
||||
final ICellInventoryHandler<IAEItemStack> newCell = cellHandler.getCellInventory( is, this, channel );
|
||||
if( newCell != null )
|
||||
@@ -248,7 +248,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, ITerminal
|
||||
this.accessor = new Accessor();
|
||||
|
||||
if( this.cellHandler != null && this.cellHandler
|
||||
.getChannel() == Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ) )
|
||||
.getChannel() == AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ) )
|
||||
{
|
||||
this.fluidHandler = new FluidHandler();
|
||||
}
|
||||
@@ -284,7 +284,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, ITerminal
|
||||
this.updateHandler();
|
||||
|
||||
final ItemStack cell = this.getCell();
|
||||
final ICellHandler ch = Api.INSTANCE.registries().cell().getHandler( cell );
|
||||
final ICellHandler ch = AEApi.instance().registries().cell().getHandler( cell );
|
||||
|
||||
if( this.cellHandler != null && ch != null )
|
||||
{
|
||||
@@ -541,7 +541,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, ITerminal
|
||||
{
|
||||
this.updateHandler();
|
||||
|
||||
if( this.cellHandler != null && this.cellHandler.getChannel() == Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ) )
|
||||
if( this.cellHandler != null && this.cellHandler.getChannel() == AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) )
|
||||
{
|
||||
final IAEItemStack returns = Platform.poweredInsert( this, this.cellHandler,
|
||||
AEItemStack.fromItemStack( this.inputInventory.getStackInSlot( 0 ) ), this.mySrc );
|
||||
@@ -628,11 +628,11 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, ITerminal
|
||||
this.updateHandler();
|
||||
if( this.cellHandler != null )
|
||||
{
|
||||
final ICellHandler ch = Api.INSTANCE.registries().cell().getHandler( this.getCell() );
|
||||
final ICellHandler ch = AEApi.instance().registries().cell().getHandler( this.getCell() );
|
||||
|
||||
if( ch != null )
|
||||
{
|
||||
final ICellGuiHandler chg = Api.INSTANCE.registries().cell().getGuiHandler( this.cellHandler.getChannel(), this.getCell() );
|
||||
final ICellGuiHandler chg = AEApi.instance().registries().cell().getGuiHandler( this.cellHandler.getChannel(), this.getCell() );
|
||||
if( chg != null )
|
||||
{
|
||||
chg.openChestGui( p, this, ch, this.cellHandler, this.getCell(), this.cellHandler.getChannel() );
|
||||
@@ -831,7 +831,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, ITerminal
|
||||
{
|
||||
|
||||
private boolean canAcceptLiquids() {
|
||||
return TileChest.this.cellHandler != null && TileChest.this.cellHandler.getChannel() == Api.INSTANCE.storage().getStorageChannel(IFluidStorageChannel.class);
|
||||
return TileChest.this.cellHandler != null && TileChest.this.cellHandler.getChannel() == AEApi.instance().storage().getStorageChannel(IFluidStorageChannel.class);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -921,7 +921,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, ITerminal
|
||||
{
|
||||
TileChest.this.updateHandler();
|
||||
return TileChest.this.cellHandler != null && TileChest.this.cellHandler
|
||||
.getChannel() == Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class );
|
||||
.getChannel() == AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -939,7 +939,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, ITerminal
|
||||
@Override
|
||||
public boolean allowInsert( IItemHandler inv, int slot, ItemStack stack )
|
||||
{
|
||||
return Api.INSTANCE.registries().cell().getHandler( stack ) != null;
|
||||
return AEApi.instance().registries().cell().getHandler( stack ) != null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -947,7 +947,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, ITerminal
|
||||
@Override
|
||||
public ItemStack getItemStackRepresentation()
|
||||
{
|
||||
return Api.INSTANCE.definitions().blocks().chest().maybeStack( 1 ).orElse( ItemStack.EMPTY );
|
||||
return AEApi.instance().definitions().blocks().chest().maybeStack( 1 ).orElse( ItemStack.EMPTY );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -956,11 +956,11 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, ITerminal
|
||||
this.updateHandler();
|
||||
if( this.cellHandler != null )
|
||||
{
|
||||
if( this.cellHandler.getChannel() == Api.INSTANCE.storage().getStorageChannel( IItemStorageChannel.class ) )
|
||||
if( this.cellHandler.getChannel() == AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) )
|
||||
{
|
||||
return ContainerMEMonitorable.TYPE;
|
||||
}
|
||||
if( this.cellHandler.getChannel() == Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ) )
|
||||
if( this.cellHandler.getChannel() == AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ) )
|
||||
{
|
||||
return ContainerFluidTerminal.TYPE;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,6 @@ import java.util.Map;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.block.storage.DriveSlotsState;
|
||||
import appeng.container.implementations.ContainerDrive;
|
||||
import appeng.core.Api;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
@@ -41,6 +40,7 @@ import net.minecraftforge.client.model.data.ModelDataMap;
|
||||
import net.minecraftforge.client.model.data.ModelProperty;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.implementations.tiles.IChestOrDrive;
|
||||
import appeng.api.networking.GridFlags;
|
||||
import appeng.api.networking.events.MENetworkCellArrayUpdate;
|
||||
@@ -290,7 +290,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
|
||||
{
|
||||
if( !this.isCached )
|
||||
{
|
||||
final Collection<IStorageChannel<? extends IAEStack<?>>> storageChannels = Api.INSTANCE.storage().storageChannels();
|
||||
final Collection<IStorageChannel<? extends IAEStack<?>>> storageChannels = AEApi.instance().storage().storageChannels();
|
||||
storageChannels.forEach( channel -> this.inventoryHandlers.put( channel, new ArrayList<>( 10 ) ) );
|
||||
|
||||
double power = 2.0;
|
||||
@@ -303,7 +303,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
|
||||
|
||||
if( !is.isEmpty() )
|
||||
{
|
||||
this.handlersBySlot[x] = Api.INSTANCE.registries().cell().getHandler( is );
|
||||
this.handlersBySlot[x] = AEApi.instance().registries().cell().getHandler( is );
|
||||
|
||||
if( this.handlersBySlot[x] != null )
|
||||
{
|
||||
@@ -405,7 +405,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
|
||||
@Override
|
||||
public boolean allowInsert( IItemHandler inv, int slot, ItemStack stack )
|
||||
{
|
||||
return !stack.isEmpty() && Api.INSTANCE.registries().cell().isCellHandled( stack );
|
||||
return !stack.isEmpty() && AEApi.instance().registries().cell().isCellHandled( stack );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -413,7 +413,7 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
|
||||
@Override
|
||||
public ItemStack getItemStackRepresentation()
|
||||
{
|
||||
return Api.INSTANCE.definitions().blocks().drive().maybeStack( 1 ).orElse( ItemStack.EMPTY );
|
||||
return AEApi.instance().definitions().blocks().drive().maybeStack( 1 ).orElse( ItemStack.EMPTY );
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -23,7 +23,6 @@ import java.util.IdentityHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import appeng.core.Api;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
@@ -107,7 +106,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
this.mySrc = new MachineSource( this );
|
||||
this.lastRedstoneState = YesNo.UNDECIDED;
|
||||
|
||||
final Block ioPortBlock = Api.INSTANCE.definitions().blocks().iOPort().maybeBlock().get();
|
||||
final Block ioPortBlock = AEApi.instance().definitions().blocks().iOPort().maybeBlock().get();
|
||||
this.upgrades = new BlockUpgradeInventory( ioPortBlock, this, NUMBER_OF_UPGRADE_SLOTS );
|
||||
}
|
||||
|
||||
@@ -305,7 +304,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
{
|
||||
boolean shouldMove = true;
|
||||
|
||||
for( IStorageChannel<? extends IAEStack<?>> c : Api.INSTANCE.storage().storageChannels() )
|
||||
for( IStorageChannel<? extends IAEStack<?>> c : AEApi.instance().storage().storageChannels() )
|
||||
{
|
||||
if( itemsToMove > 0 )
|
||||
{
|
||||
@@ -372,9 +371,9 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
|
||||
this.currentCell = is;
|
||||
this.cachedInventories = new IdentityHashMap<>();
|
||||
|
||||
for( IStorageChannel<? extends IAEStack<?>> c : Api.INSTANCE.storage().storageChannels() )
|
||||
for( IStorageChannel<? extends IAEStack<?>> c : AEApi.instance().storage().storageChannels() )
|
||||
{
|
||||
this.cachedInventories.put( c, Api.INSTANCE.registries().cell().getCellInventory( is, null, c ) );
|
||||
this.cachedInventories.put( c, AEApi.instance().registries().cell().getCellInventory( is, null, c ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user