More compile things
This commit is contained in:
@@ -41,7 +41,7 @@ public class GuiFluidFormationPlane extends GuiUpgradeable
|
||||
final int yo = 23 + 6;
|
||||
|
||||
final IAEFluidTank config = this.plane.getConfig();
|
||||
final ContainerFluidFormationPlane container = (ContainerFluidFormationPlane) this.inventorySlots;
|
||||
final ContainerFluidFormationPlane container = (ContainerFluidFormationPlane) this.container;
|
||||
|
||||
for( int y = 0; y < 7; y++ )
|
||||
{
|
||||
@@ -63,7 +63,7 @@ public class GuiFluidFormationPlane extends GuiUpgradeable
|
||||
@Override
|
||||
protected void addButtons()
|
||||
{
|
||||
this.addButton( this.priority = new GuiTabButton( this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), this.itemRender ) );
|
||||
this.addButton( this.priority = new GuiTabButton( this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), this.itemRenderer ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -51,7 +51,7 @@ public class GuiFluidIO extends GuiUpgradeable
|
||||
{
|
||||
super.init();
|
||||
|
||||
final ContainerFluidIO container = (ContainerFluidIO) this.inventorySlots;
|
||||
final ContainerFluidIO container = (ContainerFluidIO) this.container;
|
||||
final IAEFluidTank inv = this.bus.getConfig();
|
||||
final int y = 40;
|
||||
final int x = 80;
|
||||
|
||||
@@ -68,7 +68,7 @@ public class GuiFluidInterface extends GuiUpgradeable
|
||||
this.guiSlots.add( new GuiFluidSlot( configFluids, i, i, 35 + 18 * i, 35 ) );
|
||||
}
|
||||
|
||||
this.priority = new GuiTabButton( this.getGuiLeft() + 154, this.getGuiTop(), 2 + 4 * 16, GuiText.Priority.getLocal(), this.itemRender );
|
||||
this.priority = new GuiTabButton( this.getGuiLeft() + 154, this.getGuiTop(), 2 + 4 * 16, GuiText.Priority.getLocal(), this.itemRenderer );
|
||||
this.addButton( this.priority );
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
|
||||
package appeng.fluids.client.gui.widgets;
|
||||
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
import net.minecraftforge.fluids.FluidAttributes;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidUtil;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
@@ -44,15 +47,16 @@ public class GuiFluidSlot extends GuiCustomSlot
|
||||
RenderSystem.disableLighting();
|
||||
RenderSystem.disableBlend();
|
||||
final Fluid fluid = fs.getFluid();
|
||||
mc.getTextureManager().bindTexture( TextureMap.LOCATION_BLOCKS_TEXTURE );
|
||||
final TextureAtlasSprite sprite = mc.getTextureMapBlocks().getAtlasSprite( fluid.getStill().toString() );
|
||||
final FluidAttributes attributes = fluid.getAttributes();
|
||||
mc.getTextureManager().bindTexture( AtlasTexture.LOCATION_BLOCKS_TEXTURE );
|
||||
final TextureAtlasSprite sprite = mc.getAtlasSpriteGetter( AtlasTexture.LOCATION_BLOCKS_TEXTURE ).apply( attributes.getStillTexture() );
|
||||
|
||||
// Set color for dynamic fluids
|
||||
// Convert int color to RGB
|
||||
final float red = ( fluid.getColor() >> 16 & 255 ) / 255.0F;
|
||||
final float green = ( fluid.getColor() >> 8 & 255 ) / 255.0F;
|
||||
final float blue = ( fluid.getColor() & 255 ) / 255.0F;
|
||||
RenderSystem.color4f( red, green, blue );
|
||||
final float red = ( attributes.getColor() >> 16 & 255 ) / 255.0F;
|
||||
final float green = ( attributes.getColor() >> 8 & 255 ) / 255.0F;
|
||||
final float blue = ( attributes.getColor() & 255 ) / 255.0F;
|
||||
RenderSystem.color3f( red, green, blue );
|
||||
|
||||
this.drawTexturedModalRect( this.xPos(), this.yPos(), sprite, this.getWidth(), this.getHeight() );
|
||||
}
|
||||
@@ -62,7 +66,7 @@ public class GuiFluidSlot extends GuiCustomSlot
|
||||
public boolean canClick( final PlayerEntity player )
|
||||
{
|
||||
final ItemStack mouseStack = player.inventory.getItemStack();
|
||||
return mouseStack.isEmpty() || mouseStack.hasCapability( CapabilityFluidHandler.FLUID_HANDLER_ITEM_CAPABILITY, null );
|
||||
return mouseStack.isEmpty() || mouseStack.getCapability( CapabilityFluidHandler.FLUID_HANDLER_ITEM_CAPABILITY ).isPresent();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -74,11 +78,10 @@ public class GuiFluidSlot extends GuiCustomSlot
|
||||
}
|
||||
else if( mouseButton == 0 )
|
||||
{
|
||||
final FluidStack fluid = FluidUtil.getFluidContained( clickStack );
|
||||
if( fluid != null )
|
||||
{
|
||||
final LazyOptional<FluidStack> fluidOpt = FluidUtil.getFluidContained( clickStack );
|
||||
fluidOpt.ifPresent( fluid -> {
|
||||
this.setFluidStack( AEFluidStack.fromFluidStack( fluid ) );
|
||||
}
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +91,7 @@ public class GuiFluidSlot extends GuiCustomSlot
|
||||
final IAEFluidStack fluid = this.getFluidStack();
|
||||
if( fluid != null )
|
||||
{
|
||||
return fluid.getFluidStack().getLocalizedName();
|
||||
return I18n.format( fluid.getFluidStack().getTranslationKey() );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -6,8 +6,9 @@ import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.IContainerListener;
|
||||
import net.minecraft.inventory.container.IContainerListener;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidUtil;
|
||||
|
||||
@@ -32,7 +33,7 @@ public abstract class ContainerFluidConfigurable extends ContainerUpgradeable im
|
||||
|
||||
public abstract IAEFluidTank getFluidConfigInventory();
|
||||
|
||||
private FluidSyncHelper getSynchHelper()
|
||||
private FluidSyncHelper getSyncHelper()
|
||||
{
|
||||
if( this.sync == null )
|
||||
{
|
||||
@@ -44,11 +45,11 @@ public abstract class ContainerFluidConfigurable extends ContainerUpgradeable im
|
||||
@Override
|
||||
protected ItemStack transferStackToContainer( ItemStack input )
|
||||
{
|
||||
FluidStack fs = FluidUtil.getFluidContained( input );
|
||||
if( fs != null )
|
||||
LazyOptional<FluidStack> fsOpt = FluidUtil.getFluidContained( input );
|
||||
if( fsOpt.isPresent() )
|
||||
{
|
||||
final IAEFluidTank t = this.getFluidConfigInventory();
|
||||
final IAEFluidStack stack = AEFluidStack.fromFluidStack( fs );
|
||||
final IAEFluidStack stack = AEFluidStack.fromFluidStack( fsOpt.orElse( null ) );
|
||||
for( int i = 0; i < t.getSlots(); ++i )
|
||||
{
|
||||
if( t.getFluidInSlot( i ) == null && this.isValidForConfig( i, stack ) )
|
||||
@@ -86,7 +87,7 @@ public abstract class ContainerFluidConfigurable extends ContainerUpgradeable im
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
this.getSynchHelper().sendDiff( this.listeners );
|
||||
this.getSyncHelper().sendDiff( this.listeners );
|
||||
|
||||
// clear out config items that are no longer valid (eg capacity upgrade removed)
|
||||
final IAEFluidTank t = this.getFluidConfigInventory();
|
||||
@@ -105,13 +106,13 @@ public abstract class ContainerFluidConfigurable extends ContainerUpgradeable im
|
||||
public void addListener( IContainerListener listener )
|
||||
{
|
||||
super.addListener( listener );
|
||||
this.getSynchHelper().sendFull( Collections.singleton( listener ) );
|
||||
this.getSyncHelper().sendFull( Collections.singleton( listener ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveFluidSlots( Map<Integer, IAEFluidStack> fluids )
|
||||
{
|
||||
this.getSynchHelper().readPacket( fluids );
|
||||
this.getSyncHelper().readPacket( fluids );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.IContainerListener;
|
||||
import net.minecraft.inventory.container.IContainerListener;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
|
||||
package appeng.fluids.container;
|
||||
|
||||
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.client.gui.widget.TextFieldWidget;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
@@ -22,7 +21,7 @@ public class ContainerFluidLevelEmitter extends ContainerFluidConfigurable
|
||||
private final PartFluidLevelEmitter lvlEmitter;
|
||||
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
private GuiTextField textField;
|
||||
private TextFieldWidget textField;
|
||||
@GuiSync( 3 )
|
||||
public long EmitterValue = -1;
|
||||
|
||||
@@ -33,7 +32,7 @@ public class ContainerFluidLevelEmitter extends ContainerFluidConfigurable
|
||||
}
|
||||
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
public void setTextField( final GuiTextField level )
|
||||
public void setTextField( final TextFieldWidget level )
|
||||
{
|
||||
this.textField = level;
|
||||
this.textField.setText( String.valueOf( this.EmitterValue ) );
|
||||
|
||||
@@ -36,6 +36,7 @@ import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.container.guisync.GuiSync;
|
||||
import appeng.container.slot.SlotRestrictedInput;
|
||||
import appeng.core.Api;
|
||||
import appeng.fluids.parts.PartFluidStorageBus;
|
||||
import appeng.fluids.util.IAEFluidTank;
|
||||
import appeng.util.Platform;
|
||||
|
||||
@@ -21,19 +21,19 @@ package appeng.fluids.container;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.BufferOverflowException;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.IContainerListener;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.inventory.container.IContainerListener;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidUtil;
|
||||
import net.minecraftforge.fluids.capability.IFluidHandler.FluidAction;
|
||||
import net.minecraftforge.fluids.capability.IFluidHandlerItem;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
import appeng.api.config.Settings;
|
||||
@@ -60,6 +60,7 @@ import appeng.api.util.IConfigurableObject;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.guisync.GuiSync;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.Api;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketMEFluidInventoryUpdate;
|
||||
import appeng.core.sync.packets.PacketTargetFluidStack;
|
||||
@@ -358,12 +359,13 @@ public class ContainerFluidTerminal extends AEBaseContainer implements IConfigMa
|
||||
return;
|
||||
}
|
||||
|
||||
final IFluidHandlerItem fh = FluidUtil.getFluidHandler( held );
|
||||
if( fh == null )
|
||||
final LazyOptional<IFluidHandlerItem> fhOpt = FluidUtil.getFluidHandler( held );
|
||||
if( !fhOpt.isPresent() )
|
||||
{
|
||||
// only fluid handlers items
|
||||
return;
|
||||
}
|
||||
IFluidHandlerItem fh = fhOpt.orElse( null );
|
||||
|
||||
if( action == InventoryAction.FILL_ITEM && this.clientRequestedTargetFluid != null )
|
||||
{
|
||||
@@ -371,7 +373,7 @@ public class ContainerFluidTerminal extends AEBaseContainer implements IConfigMa
|
||||
|
||||
// Check how much we can store in the item
|
||||
stack.setStackSize( Integer.MAX_VALUE );
|
||||
int amountAllowed = fh.fill( stack.getFluidStack(), false );
|
||||
int amountAllowed = fh.fill( stack.getFluidStack(), FluidAction.SIMULATE );
|
||||
stack.setStackSize( amountAllowed );
|
||||
|
||||
// Check if we can pull out of the system
|
||||
@@ -382,7 +384,7 @@ public class ContainerFluidTerminal extends AEBaseContainer implements IConfigMa
|
||||
}
|
||||
|
||||
// How much could fit into the container
|
||||
final int canFill = fh.fill( canPull.getFluidStack(), false );
|
||||
final int canFill = fh.fill( canPull.getFluidStack(), FluidAction.SIMULATE );
|
||||
if( canFill == 0 )
|
||||
{
|
||||
return;
|
||||
@@ -399,7 +401,7 @@ public class ContainerFluidTerminal extends AEBaseContainer implements IConfigMa
|
||||
}
|
||||
|
||||
// Actually fill
|
||||
final int used = fh.fill( pulled.getFluidStack(), true );
|
||||
final int used = fh.fill( pulled.getFluidStack(), FluidAction.EXECUTE );
|
||||
|
||||
if( used != canFill )
|
||||
{
|
||||
@@ -412,37 +414,35 @@ public class ContainerFluidTerminal extends AEBaseContainer implements IConfigMa
|
||||
else if( action == InventoryAction.EMPTY_ITEM )
|
||||
{
|
||||
// See how much we can drain from the item
|
||||
final FluidStack extract = fh.drain( Integer.MAX_VALUE, false );
|
||||
if( extract == null || extract.amount < 1 )
|
||||
final FluidStack extract = fh.drain( Integer.MAX_VALUE, FluidAction.SIMULATE );
|
||||
if( extract == null || extract.getAmount() < 1 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if we can push into the system
|
||||
final IAEFluidStack notStorable = Platform.poweredInsert( this.getPowerSource(), this.monitor, AEFluidStack.fromFluidStack( extract ),
|
||||
this.getActionSource(), Actionable.SIMULATE );
|
||||
final IAEFluidStack notStorable = Platform.poweredInsert( this.getPowerSource(), this.monitor, AEFluidStack.fromFluidStack( extract ), this.getActionSource(), Actionable.SIMULATE );
|
||||
|
||||
if( notStorable != null && notStorable.getStackSize() > 0 )
|
||||
{
|
||||
final int toStore = (int) ( extract.amount - notStorable.getStackSize() );
|
||||
final FluidStack storable = fh.drain( toStore, false );
|
||||
final int toStore = (int) ( extract.getAmount() - notStorable.getStackSize() );
|
||||
final FluidStack storable = fh.drain( toStore, FluidAction.SIMULATE );
|
||||
|
||||
if( storable == null || storable.amount == 0 )
|
||||
if( storable == null || storable.getAmount() == 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
extract.amount = storable.amount;
|
||||
extract.setAmount( storable.getAmount() );
|
||||
}
|
||||
}
|
||||
|
||||
// Actually drain
|
||||
final FluidStack drained = fh.drain( extract, true );
|
||||
extract.amount = drained.amount;
|
||||
final FluidStack drained = fh.drain( extract, FluidAction.EXECUTE );
|
||||
extract.setAmount( drained.getAmount() );
|
||||
|
||||
final IAEFluidStack notInserted = Platform.poweredInsert( this.getPowerSource(), this.monitor, AEFluidStack.fromFluidStack( extract ),
|
||||
this.getActionSource() );
|
||||
final IAEFluidStack notInserted = Platform.poweredInsert( this.getPowerSource(), this.monitor, AEFluidStack.fromFluidStack( extract ), this.getActionSource() );
|
||||
|
||||
if( notInserted != null && notInserted.getStackSize() > 0 )
|
||||
{
|
||||
|
||||
@@ -26,6 +26,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraftforge.fluids.FluidAttributes;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
@@ -57,6 +58,7 @@ import appeng.api.util.AEPartLocation;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.capabilities.Capabilities;
|
||||
import appeng.core.Api;
|
||||
import appeng.core.settings.TickRates;
|
||||
import appeng.fluids.util.AEFluidInventory;
|
||||
import appeng.fluids.util.IAEFluidInventory;
|
||||
@@ -403,7 +405,7 @@ public class DualityFluidInterface implements IGridTickable, IStorageMonitorable
|
||||
|
||||
// make sure strange things didn't happen...
|
||||
final FluidStack canExtract = this.tanks.drain( slot, toStore.getFluidStack(), false );
|
||||
if( canExtract == null || canExtract.amount != toStore.getStackSize() )
|
||||
if( canExtract == null || canExtract.getAmount() != toStore.getStackSize() )
|
||||
{
|
||||
changed = true;
|
||||
}
|
||||
@@ -417,7 +419,7 @@ public class DualityFluidInterface implements IGridTickable, IStorageMonitorable
|
||||
// extract items!
|
||||
changed = true;
|
||||
final FluidStack removed = this.tanks.drain( slot, toStore.getFluidStack(), true );
|
||||
if( removed == null || toStore.getStackSize() != removed.amount )
|
||||
if( removed == null || toStore.getStackSize() != removed.getAmount() )
|
||||
{
|
||||
throw new IllegalStateException( "bad attempt at managing tanks. ( drain )" );
|
||||
}
|
||||
@@ -494,7 +496,7 @@ public class DualityFluidInterface implements IGridTickable, IStorageMonitorable
|
||||
|
||||
public void writeToNBT( final CompoundNBT data )
|
||||
{
|
||||
data.setInteger( "priority", this.priority );
|
||||
data.putInt( "priority", this.priority );
|
||||
this.tanks.writeToNBT( data, "storage" );
|
||||
this.config.writeToNBT( data, "config" );
|
||||
}
|
||||
@@ -503,7 +505,7 @@ public class DualityFluidInterface implements IGridTickable, IStorageMonitorable
|
||||
{
|
||||
this.config.readFromNBT( data, "config" );
|
||||
this.tanks.readFromNBT( data, "storage" );
|
||||
this.priority = data.getInteger( "priority" );
|
||||
this.priority = data.getInt( "priority" );
|
||||
this.readConfig();
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@ import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
import net.minecraftforge.fluids.FluidAttributes;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidUtil;
|
||||
|
||||
@@ -51,13 +53,14 @@ public class FluidCellConfig extends CellConfig
|
||||
{
|
||||
super.insertItem( slot, stack, simulate );
|
||||
}
|
||||
FluidStack fluid = FluidUtil.getFluidContained( stack );
|
||||
if( fluid == null || !Api.INSTANCE.definitions().items().dummyFluidItem().maybeStack( 1 ).isPresent() )
|
||||
LazyOptional<FluidStack> fluidOpt = FluidUtil.getFluidContained( stack );
|
||||
if( !fluidOpt.isPresent() || !Api.INSTANCE.definitions().items().dummyFluidItem().maybeStack( 1 ).isPresent() )
|
||||
{
|
||||
return stack;
|
||||
}
|
||||
FluidStack fluid = fluidOpt.orElse( null );
|
||||
|
||||
fluid.amount = FluidAttributes.BUCKET_VOLUME;
|
||||
fluid.setAmount( FluidAttributes.BUCKET_VOLUME );
|
||||
ItemStack is = Api.INSTANCE.definitions().items().dummyFluidItem().maybeStack( 1 ).get();
|
||||
FluidDummyItem item = (FluidDummyItem) is.getItem();
|
||||
item.setFluidStack( is, fluid );
|
||||
@@ -71,13 +74,14 @@ public class FluidCellConfig extends CellConfig
|
||||
{
|
||||
super.setStackInSlot( slot, stack );
|
||||
}
|
||||
FluidStack fluid = FluidUtil.getFluidContained( stack );
|
||||
if( fluid == null || !Api.INSTANCE.definitions().items().dummyFluidItem().maybeStack( 1 ).isPresent() )
|
||||
LazyOptional<FluidStack> fluidOpt = FluidUtil.getFluidContained( stack );
|
||||
if( !fluidOpt.isPresent() || !Api.INSTANCE.definitions().items().dummyFluidItem().maybeStack( 1 ).isPresent() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
FluidStack fluid = fluidOpt.orElse( null );
|
||||
|
||||
fluid.amount = FluidAttributes.BUCKET_VOLUME;
|
||||
fluid.setAmount( FluidAttributes.BUCKET_VOLUME );
|
||||
ItemStack is = Api.INSTANCE.definitions().items().dummyFluidItem().maybeStack( 1 ).get();
|
||||
FluidDummyItem item = (FluidDummyItem) is.getItem();
|
||||
item.setFluidStack( is, fluid );
|
||||
@@ -91,12 +95,14 @@ public class FluidCellConfig extends CellConfig
|
||||
{
|
||||
super.isItemValid( slot, stack );
|
||||
}
|
||||
FluidStack fluid = FluidUtil.getFluidContained( stack );
|
||||
if( fluid == null || !Api.INSTANCE.definitions().items().dummyFluidItem().maybeStack( 1 ).isPresent() )
|
||||
LazyOptional<FluidStack> fluidOpt = FluidUtil.getFluidContained( stack );
|
||||
if( !fluidOpt.isPresent() || !Api.INSTANCE.definitions().items().dummyFluidItem().maybeStack( 1 ).isPresent() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
fluid.amount = FluidAttributes.BUCKET_VOLUME;
|
||||
FluidStack fluid = fluidOpt.orElse( null );
|
||||
|
||||
fluid.setAmount( FluidAttributes.BUCKET_VOLUME );
|
||||
ItemStack is = Api.INSTANCE.definitions().items().dummyFluidItem().maybeStack( 1 ).get();
|
||||
FluidDummyItem item = (FluidDummyItem) is.getItem();
|
||||
item.setFluidStack( is, fluid );
|
||||
|
||||
@@ -7,7 +7,7 @@ import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.inventory.IContainerListener;
|
||||
import net.minecraft.inventory.container.IContainerListener;
|
||||
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
|
||||
@@ -27,6 +27,7 @@ import appeng.api.AEApi;
|
||||
import appeng.api.storage.IStorageChannel;
|
||||
import appeng.api.storage.channels.IFluidStorageChannel;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.core.Api;
|
||||
import appeng.fluids.helper.FluidCellConfig;
|
||||
import appeng.items.materials.MaterialType;
|
||||
import appeng.items.storage.AbstractStorageCell;
|
||||
@@ -114,4 +115,4 @@ public final class BasicFluidStorageCell extends AbstractStorageCell<IAEFluidSta
|
||||
}
|
||||
} );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,9 +28,7 @@ import java.util.Map;
|
||||
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.capability.IFluidHandler;
|
||||
import net.minecraftforge.fluids.capability.IFluidTankProperties;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.networking.security.IActionSource;
|
||||
import appeng.api.networking.storage.IBaseMonitor;
|
||||
@@ -41,6 +39,7 @@ import appeng.api.storage.IStorageChannel;
|
||||
import appeng.api.storage.channels.IFluidStorageChannel;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.core.Api;
|
||||
import appeng.fluids.util.AEFluidStack;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.me.helpers.IGridProxyable;
|
||||
@@ -75,9 +74,9 @@ public class FluidHandlerAdapter implements IMEInventory<IAEFluidStack>, IBaseMo
|
||||
FluidStack fluidStack = input.getFluidStack();
|
||||
|
||||
// Insert
|
||||
int wasFillled = this.fluidHandler.fill( fluidStack, type != Actionable.SIMULATE );
|
||||
int remaining = fluidStack.amount - wasFillled;
|
||||
if( fluidStack.amount == remaining )
|
||||
int wasFillled = this.fluidHandler.fill( fluidStack, type.getFluidAction() );
|
||||
int remaining = fluidStack.getAmount() - wasFillled;
|
||||
if( fluidStack.getAmount() == remaining )
|
||||
{
|
||||
// The stack was unmodified, target tank is full
|
||||
return input;
|
||||
@@ -95,7 +94,7 @@ public class FluidHandlerAdapter implements IMEInventory<IAEFluidStack>, IBaseMo
|
||||
}
|
||||
}
|
||||
|
||||
fluidStack.amount = remaining;
|
||||
fluidStack.setAmount( remaining );
|
||||
|
||||
return AEFluidStack.fromFluidStack( fluidStack );
|
||||
}
|
||||
@@ -104,10 +103,9 @@ public class FluidHandlerAdapter implements IMEInventory<IAEFluidStack>, IBaseMo
|
||||
public IAEFluidStack extractItems( IAEFluidStack request, Actionable mode, IActionSource src )
|
||||
{
|
||||
FluidStack requestedFluidStack = request.getFluidStack();
|
||||
final boolean doDrain = ( mode == Actionable.MODULATE );
|
||||
|
||||
// Drain the fluid from the tank
|
||||
FluidStack gathered = this.fluidHandler.drain( requestedFluidStack, doDrain );
|
||||
FluidStack gathered = this.fluidHandler.drain( requestedFluidStack, mode.getFluidAction() );
|
||||
if( gathered == null )
|
||||
{
|
||||
// If nothing was pulled from the tank, return null
|
||||
@@ -204,8 +202,7 @@ public class FluidHandlerAdapter implements IMEInventory<IAEFluidStack>, IBaseMo
|
||||
public List<IAEFluidStack> update()
|
||||
{
|
||||
final List<IAEFluidStack> changes = new ArrayList<>();
|
||||
final IFluidTankProperties[] tankProperties = this.fluidHandler.getTankProperties();
|
||||
final int slots = tankProperties.length;
|
||||
final int slots = fluidHandler.getTanks();
|
||||
|
||||
// Make room for new slots
|
||||
if( slots > this.cachedAeStacks.length )
|
||||
@@ -217,7 +214,7 @@ public class FluidHandlerAdapter implements IMEInventory<IAEFluidStack>, IBaseMo
|
||||
{
|
||||
// Save the old stuff
|
||||
final IAEFluidStack oldAEFS = this.cachedAeStacks[slot];
|
||||
final FluidStack newFS = tankProperties[slot].getContents();
|
||||
final FluidStack newFS = fluidHandler.getFluidInTank( slot );
|
||||
|
||||
this.handlePossibleSlotChanges( slot, oldAEFS, newFS, changes );
|
||||
}
|
||||
@@ -263,12 +260,12 @@ public class FluidHandlerAdapter implements IMEInventory<IAEFluidStack>, IBaseMo
|
||||
private void handleStackSizeChanged( int slot, IAEFluidStack oldAeFS, FluidStack newFS, List<IAEFluidStack> changes )
|
||||
{
|
||||
// Still the same fluid, but amount might have changed
|
||||
final long diff = newFS.amount - oldAeFS.getStackSize();
|
||||
final long diff = newFS.getAmount() - oldAeFS.getStackSize();
|
||||
|
||||
if( diff != 0 )
|
||||
{
|
||||
final IAEFluidStack stack = oldAeFS.copy();
|
||||
stack.setStackSize( newFS.amount );
|
||||
stack.setStackSize( newFS.getAmount() );
|
||||
|
||||
this.cachedAeStacks[slot] = stack;
|
||||
|
||||
|
||||
@@ -24,8 +24,10 @@ import javax.annotation.Nonnull;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
import net.minecraftforge.fluids.capability.IFluidHandler;
|
||||
import net.minecraftforge.fluids.capability.IFluidHandler.FluidAction;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
@@ -103,12 +105,16 @@ public class PartFluidExportBus extends PartSharedFluidBus
|
||||
}
|
||||
|
||||
final TileEntity te = this.getConnectedTE();
|
||||
|
||||
if( te != null && te.hasCapability( CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, this.getSide().getFacing().getOpposite() ) )
|
||||
LazyOptional<IFluidHandler> fhOpt = LazyOptional.empty();
|
||||
if( te != null )
|
||||
{
|
||||
te.getCapability( CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, this.getSide().getFacing().getOpposite() );
|
||||
}
|
||||
if( fhOpt.isPresent() )
|
||||
{
|
||||
try
|
||||
{
|
||||
final IFluidHandler fh = te.getCapability( CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, this.getSide().getFacing().getOpposite() );
|
||||
final IFluidHandler fh = fhOpt.orElse( null );
|
||||
final IMEMonitor<IAEFluidStack> inv = this.getProxy().getStorage().getInventory( this.getChannel() );
|
||||
|
||||
if( fh != null )
|
||||
@@ -126,7 +132,7 @@ public class PartFluidExportBus extends PartSharedFluidBus
|
||||
|
||||
if( out != null )
|
||||
{
|
||||
int wasInserted = fh.fill( out.getFluidStack(), true );
|
||||
int wasInserted = fh.fill( out.getFluidStack(), FluidAction.EXECUTE );
|
||||
|
||||
if( wasInserted > 0 )
|
||||
{
|
||||
|
||||
@@ -7,7 +7,6 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockLiquid;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -18,10 +17,11 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraftforge.fluids.FluidAttributes;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
import net.minecraftforge.fluids.FluidUtil;
|
||||
import net.minecraftforge.fluids.IFluidBlock;
|
||||
import net.minecraftforge.fluids.capability.templates.FluidTank;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.AccessRestriction;
|
||||
@@ -40,6 +40,7 @@ import appeng.api.storage.channels.IFluidStorageChannel;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.core.Api;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.fluids.util.AEFluidInventory;
|
||||
import appeng.fluids.util.IAEFluidInventory;
|
||||
@@ -124,10 +125,10 @@ public class PartFluidFormationPlane extends PartAbstractFormationPlane<IAEFluid
|
||||
if( type == Actionable.MODULATE )
|
||||
{
|
||||
final FluidStack fs = input.getFluidStack();
|
||||
fs.amount = FluidAttributes.BUCKET_VOLUME;
|
||||
fs.setAmount( FluidAttributes.BUCKET_VOLUME );
|
||||
|
||||
final FluidTank tank = new FluidTank( fs, FluidAttributes.BUCKET_VOLUME );
|
||||
if( !FluidUtil.tryPlaceFluid( null, w, pos, tank, fs ) )
|
||||
final FluidTank tank = new FluidTank( FluidAttributes.BUCKET_VOLUME, e -> e.isFluidEqual( fs ) );
|
||||
if( !FluidUtil.tryPlaceFluid( null, w, Hand.MAIN_HAND, pos, tank, fs ) )
|
||||
{
|
||||
return input;
|
||||
}
|
||||
|
||||
@@ -24,9 +24,11 @@ import javax.annotation.Nonnull;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
import net.minecraftforge.fluids.capability.IFluidHandler;
|
||||
import net.minecraftforge.fluids.capability.IFluidHandler.FluidAction;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
@@ -98,17 +100,21 @@ public class PartFluidImportBus extends PartSharedFluidBus
|
||||
}
|
||||
|
||||
final TileEntity te = this.getConnectedTE();
|
||||
|
||||
if( te != null && te.hasCapability( CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, this.getSide().getFacing().getOpposite() ) )
|
||||
LazyOptional<IFluidHandler> fhOpt = LazyOptional.empty();
|
||||
if( te != null )
|
||||
{
|
||||
te.getCapability( CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, this.getSide().getFacing().getOpposite() );
|
||||
}
|
||||
if( fhOpt.isPresent() )
|
||||
{
|
||||
try
|
||||
{
|
||||
final IFluidHandler fh = te.getCapability( CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, this.getSide().getFacing().getOpposite() );
|
||||
final IFluidHandler fh = fhOpt.orElse( null );
|
||||
final IMEMonitor<IAEFluidStack> inv = this.getProxy().getStorage().getInventory( this.getChannel() );
|
||||
|
||||
if( fh != null )
|
||||
{
|
||||
final FluidStack fluidStack = fh.drain( this.calculateAmountToSend(), false );
|
||||
final FluidStack fluidStack = fh.drain( this.calculateAmountToSend(), FluidAction.SIMULATE );
|
||||
|
||||
if( this.filterEnabled() && !this.isInFilter( fluidStack ) )
|
||||
{
|
||||
@@ -126,7 +132,7 @@ public class PartFluidImportBus extends PartSharedFluidBus
|
||||
aeFluidStack.decStackSize( notInserted.getStackSize() );
|
||||
}
|
||||
|
||||
fh.drain( aeFluidStack.getFluidStack(), true );
|
||||
fh.drain( aeFluidStack.getFluidStack(), FluidAction.EXECUTE );
|
||||
|
||||
return TickRateModulation.FASTER;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.events.MENetworkChannelsChanged;
|
||||
@@ -49,6 +48,7 @@ import appeng.api.storage.IStorageMonitorable;
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
import appeng.api.util.AECableType;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.core.Api;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.fluids.helper.DualityFluidInterface;
|
||||
|
||||
@@ -7,6 +7,7 @@ import java.util.Random;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.particles.ParticleTypes;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
@@ -37,6 +38,7 @@ import appeng.api.storage.data.IItemList;
|
||||
import appeng.api.util.AECableType;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.core.Api;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.fluids.util.AEFluidInventory;
|
||||
|
||||
@@ -22,7 +22,6 @@ package appeng.fluids.parts;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -33,10 +32,10 @@ import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
import net.minecraftforge.fluids.capability.IFluidHandler;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.AccessRestriction;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.IncludeExclude;
|
||||
@@ -63,6 +62,7 @@ import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.capabilities.Capabilities;
|
||||
import appeng.core.Api;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.settings.TickRates;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
@@ -118,7 +118,7 @@ public class PartFluidStorageBus extends PartSharedStorageBus implements IMEMoni
|
||||
{
|
||||
Direction targetSide = this.getSide().getFacing().getOpposite();
|
||||
// Prioritize a handler to directly link to another ME network
|
||||
IStorageMonitorableAccessor accessor = target.getCapability( Capabilities.STORAGE_MONITORABLE_ACCESSOR, targetSide );
|
||||
IStorageMonitorableAccessor accessor = target.getCapability( Capabilities.STORAGE_MONITORABLE_ACCESSOR, targetSide ).orElse( null );
|
||||
if( accessor != null )
|
||||
{
|
||||
IStorageMonitorable inventory = accessor.getInventory( this.source );
|
||||
@@ -135,7 +135,7 @@ public class PartFluidStorageBus extends PartSharedStorageBus implements IMEMoni
|
||||
}
|
||||
|
||||
// Check via cap for IItemHandler
|
||||
IFluidHandler handlerExt = target.getCapability( CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, targetSide );
|
||||
IFluidHandler handlerExt = target.getCapability( CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, targetSide ).orElse( null );
|
||||
if( handlerExt != null )
|
||||
{
|
||||
return new FluidHandlerAdapter( handlerExt, this );
|
||||
@@ -195,9 +195,7 @@ public class PartFluidStorageBus extends PartSharedStorageBus implements IMEMoni
|
||||
@Override
|
||||
protected void resetCache( final boolean fullReset )
|
||||
{
|
||||
if( this.getHost() == null || this.getHost().getTile() == null || this.getHost().getTile().getWorld() == null || this.getHost()
|
||||
.getTile()
|
||||
.getWorld().isRemote )
|
||||
if( this.getHost() == null || this.getHost().getTile() == null || this.getHost().getTile().getWorld() == null || this.getHost().getTile().getWorld().isRemote )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -267,9 +265,7 @@ public class PartFluidStorageBus extends PartSharedStorageBus implements IMEMoni
|
||||
{
|
||||
if( this.getProxy().isActive() )
|
||||
{
|
||||
this.getProxy()
|
||||
.getStorage()
|
||||
.postAlterationOfStoredItems( Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ), change, this.source );
|
||||
this.getProxy().getStorage().postAlterationOfStoredItems( Api.INSTANCE.storage().getStorageChannel( IFluidStorageChannel.class ), change, this.source );
|
||||
}
|
||||
}
|
||||
catch( final GridAccessException e )
|
||||
@@ -333,8 +329,7 @@ public class PartFluidStorageBus extends PartSharedStorageBus implements IMEMoni
|
||||
|
||||
if( this.getInstalledUpgrades( Upgrades.FUZZY ) > 0 )
|
||||
{
|
||||
this.handler.setPartitionList(
|
||||
new FuzzyPriorityList<IAEFluidStack>( priorityList, (FuzzyMode) this.getConfigManager().getSetting( Settings.FUZZY_MODE ) ) );
|
||||
this.handler.setPartitionList( new FuzzyPriorityList<IAEFluidStack>( priorityList, (FuzzyMode) this.getConfigManager().getSetting( Settings.FUZZY_MODE ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -431,16 +426,17 @@ public class PartFluidStorageBus extends PartSharedStorageBus implements IMEMoni
|
||||
|
||||
final Direction targetSide = this.getSide().getFacing().getOpposite();
|
||||
|
||||
if( target.hasCapability( Capabilities.STORAGE_MONITORABLE_ACCESSOR, targetSide ) )
|
||||
LazyOptional<IStorageMonitorableAccessor> accessorOpt = target.getCapability( Capabilities.STORAGE_MONITORABLE_ACCESSOR, targetSide );
|
||||
if( accessorOpt.isPresent() )
|
||||
{
|
||||
return Objects.hash( target, target.getCapability( Capabilities.STORAGE_MONITORABLE_ACCESSOR, targetSide ) );
|
||||
return Objects.hash( target, accessorOpt.orElse( null ) );
|
||||
}
|
||||
|
||||
final IFluidHandler fluidHandler = target.getCapability( CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, targetSide );
|
||||
final IFluidHandler fluidHandler = target.getCapability( CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, targetSide ).orElse( null );
|
||||
|
||||
if( fluidHandler != null )
|
||||
{
|
||||
return Objects.hash( target, fluidHandler, fluidHandler.getTankProperties().length );
|
||||
return Objects.hash( target, fluidHandler, fluidHandler.getTanks() );
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -25,12 +25,12 @@ import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.RedstoneMode;
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.networking.ticking.IGridTickable;
|
||||
@@ -38,6 +38,7 @@ import appeng.api.networking.ticking.TickRateModulation;
|
||||
import appeng.api.parts.IPartCollisionHelper;
|
||||
import appeng.api.storage.channels.IFluidStorageChannel;
|
||||
import appeng.api.util.AECableType;
|
||||
import appeng.core.Api;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.fluids.util.AEFluidInventory;
|
||||
import appeng.fluids.util.IAEFluidTank;
|
||||
@@ -130,7 +131,7 @@ public abstract class PartSharedFluidBus extends PartUpgradeable implements IGri
|
||||
{
|
||||
final World w = self.getWorld();
|
||||
|
||||
if( w.getChunkProvider().getLoadedChunk( pos.getX() >> 4, pos.getZ() >> 4 ) != null )
|
||||
if( w.getChunkProvider().isChunkLoaded( new ChunkPos( pos ) ) )
|
||||
{
|
||||
return w.getTileEntity( pos );
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.implementations.tiles.IChestOrDrive;
|
||||
import appeng.api.storage.ICellGuiHandler;
|
||||
import appeng.api.storage.ICellHandler;
|
||||
@@ -32,6 +31,7 @@ import appeng.api.storage.IStorageChannel;
|
||||
import appeng.api.storage.channels.IFluidStorageChannel;
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.core.Api;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ import appeng.api.util.AECableType;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.core.Api;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.fluids.helper.DualityFluidInterface;
|
||||
import appeng.fluids.helper.IFluidInterfaceHost;
|
||||
|
||||
Reference in New Issue
Block a user