Lots of compile fixes
This commit is contained in:
@@ -4,15 +4,29 @@ package appeng.fluids.parts;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import appeng.core.Api;
|
||||
import net.minecraft.advancements.CriteriaTriggers;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockLiquid;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.IBucketPickupHandler;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.fluid.FluidState;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.fluid.IFluidState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Stats;
|
||||
import net.minecraft.tags.FluidTags;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.SoundEvent;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.FluidAttributes;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidUtil;
|
||||
import net.minecraftforge.fluids.IFluidBlock;
|
||||
import net.minecraftforge.fluids.capability.IFluidHandler;
|
||||
@@ -244,19 +258,23 @@ public class PartFluidAnnihilationPlane extends PartBasicState implements IGridT
|
||||
final TileEntity te = this.getTile();
|
||||
final World w = te.getWorld();
|
||||
final BlockPos pos = te.getPos().offset( this.getSide().getFacing() );
|
||||
final BlockState state = w.getBlockState( pos );
|
||||
final Block block = state.getBlock();
|
||||
|
||||
if( block instanceof IFluidBlock || block instanceof BlockLiquid )
|
||||
{
|
||||
final IFluidHandler fh = FluidUtil.getFluidHandler( w, pos, null );
|
||||
final IAEFluidStack blockFluid = AEFluidStack.fromFluidStack( fh.drain( Integer.MAX_VALUE, false ) );
|
||||
BlockState blockstate = w.getBlockState(pos);
|
||||
if (blockstate.getBlock() instanceof IBucketPickupHandler) {
|
||||
IFluidState fluidState = blockstate.getFluidState();
|
||||
|
||||
if( blockFluid != null )
|
||||
{
|
||||
Fluid fluid = fluidState.getFluid();
|
||||
if (fluid != Fluids.EMPTY && fluidState.isSource()) {
|
||||
|
||||
// Attempt to store the fluid in the network
|
||||
final IAEFluidStack blockFluid = AEFluidStack.fromFluidStack( new FluidStack(fluidState.getFluid(), FluidAttributes.BUCKET_VOLUME) );
|
||||
if( this.storeFluid( blockFluid, false ) )
|
||||
{
|
||||
this.storeFluid( AEFluidStack.fromFluidStack( fh.drain( Integer.MAX_VALUE, true ) ), true );
|
||||
// If that would succeed, actually slurp up the liquid as if we were using a bucket
|
||||
// This _MIGHT_ change the liquid, and if it does, and we dont have enough space,
|
||||
// tough luck. you loose the source block.
|
||||
fluid = ((IBucketPickupHandler)blockstate.getBlock()).pickupFluid(w, pos, blockstate);
|
||||
this.storeFluid( AEFluidStack.fromFluidStack( new FluidStack( fluid, FluidAttributes.BUCKET_VOLUME) ), true );
|
||||
|
||||
AppEng.proxy.sendToAllNearExcept( null, pos.getX(), pos.getY(), pos.getZ(), 64, w,
|
||||
new PacketTransitionEffect( pos.getX(), pos.getY(), pos.getZ(), this.getSide(), true ) );
|
||||
|
||||
@@ -41,7 +41,7 @@ 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;
|
||||
import appeng.fluids.util.IAEFluidTank;
|
||||
@@ -120,7 +120,7 @@ public class PartFluidFormationPlane extends PartAbstractFormationPlane<IAEFluid
|
||||
final BlockPos pos = te.getPos().offset( side.getFacing() );
|
||||
final BlockState state = w.getBlockState( pos );
|
||||
|
||||
if( this.canReplace( w, state, state.getBlock(), pos ) )
|
||||
if( this.canReplace( w, state, pos ) )
|
||||
{
|
||||
if( type == Actionable.MODULATE )
|
||||
{
|
||||
@@ -141,9 +141,9 @@ public class PartFluidFormationPlane extends PartAbstractFormationPlane<IAEFluid
|
||||
return input;
|
||||
}
|
||||
|
||||
private boolean canReplace( World w, BlockState state, Block block, BlockPos pos )
|
||||
private boolean canReplace( World w, BlockState state, BlockPos pos )
|
||||
{
|
||||
return block.isReplaceable( w, pos ) && !( block instanceof IFluidBlock ) && !( block instanceof BlockLiquid ) && !state.getMaterial().isLiquid();
|
||||
return state.getMaterial().isReplaceable() && w.getFluidState(pos).isEmpty() && !state.getMaterial().isLiquid();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -188,7 +188,7 @@ public class PartFluidFormationPlane extends PartAbstractFormationPlane<IAEFluid
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
Platform.openGUI( player, this.getHost().getTile(), this.getSide(), GuiBridge.GUI_FLUID_FORMATION_PLANE );
|
||||
// FIXME Platform.openGUI( player, this.getHost().getTile(), this.getSide(), GuiBridge.GUI_FLUID_FORMATION_PLANE );
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -229,9 +229,9 @@ public class PartFluidFormationPlane extends PartAbstractFormationPlane<IAEFluid
|
||||
return Api.INSTANCE.definitions().parts().fluidFormationnPlane().maybeStack( 1 ).orElse( ItemStack.EMPTY );
|
||||
}
|
||||
|
||||
@Override
|
||||
public GuiBridge getGuiBridge()
|
||||
{
|
||||
return GuiBridge.GUI_FLUID_FORMATION_PLANE;
|
||||
}
|
||||
// FIXME @Override
|
||||
// FIXME public GuiBridge getGuiBridge()
|
||||
// FIXME {
|
||||
// FIXME return GuiBridge.GUI_FLUID_FORMATION_PLANE;
|
||||
// FIXME }
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.config.Upgrades;
|
||||
@@ -50,7 +51,7 @@ 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;
|
||||
import appeng.fluids.helper.IFluidInterfaceHost;
|
||||
import appeng.helpers.IPriorityHost;
|
||||
@@ -138,7 +139,7 @@ public class PartFluidInterface extends PartBasicState implements IGridTickable,
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
Platform.openGUI( p, this.getTileEntity(), this.getSide(), GuiBridge.GUI_FLUID_INTERFACE );
|
||||
// FIXME Platform.openGUI( p, this.getTileEntity(), this.getSide(), GuiBridge.GUI_FLUID_INTERFACE );
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -204,13 +205,7 @@ public class PartFluidInterface extends PartBasicState implements IGridTickable,
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCapability( Capability<?> capabilityClass )
|
||||
{
|
||||
return this.duality.hasCapability( capabilityClass, this.getSide().getFacing() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T getCapability( Capability<T> capabilityClass )
|
||||
public <T> LazyOptional<T> getCapability(Capability<T> capabilityClass )
|
||||
{
|
||||
return this.duality.getCapability( capabilityClass, this.getSide().getFacing() );
|
||||
}
|
||||
@@ -239,9 +234,9 @@ public class PartFluidInterface extends PartBasicState implements IGridTickable,
|
||||
return Api.INSTANCE.definitions().parts().fluidIface().maybeStack( 1 ).orElse( ItemStack.EMPTY );
|
||||
}
|
||||
|
||||
@Override
|
||||
public GuiBridge getGuiBridge()
|
||||
{
|
||||
return GuiBridge.GUI_FLUID_INTERFACE;
|
||||
}
|
||||
// FIXME @Override
|
||||
// FIXME public GuiBridge getGuiBridge()
|
||||
// FIXME {
|
||||
// FIXME return GuiBridge.GUI_FLUID_INTERFACE;
|
||||
// FIXME }
|
||||
}
|
||||
|
||||
@@ -7,10 +7,8 @@ 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;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
@@ -40,7 +38,7 @@ 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;
|
||||
import appeng.fluids.util.IAEFluidInventory;
|
||||
import appeng.fluids.util.IAEFluidTank;
|
||||
@@ -319,8 +317,8 @@ public class PartFluidLevelEmitter extends PartUpgradeable implements IStackWatc
|
||||
final double d1 = d.yOffset * 0.45F + ( r.nextFloat() - 0.5F ) * 0.2D;
|
||||
final double d2 = d.zOffset * 0.45F + ( r.nextFloat() - 0.5F ) * 0.2D;
|
||||
|
||||
world.spawnParticle( EnumParticleTypes.REDSTONE, 0.5 + pos.getX() + d0, 0.5 + pos.getY() + d1, 0.5 + pos.getZ() + d2, 0.0D, 0.0D, 0.0D,
|
||||
new int[0] );
|
||||
// FIXME world.spawnParticle( EnumParticleTypes.REDSTONE, 0.5 + pos.getX() + d0, 0.5 + pos.getY() + d1, 0.5 + pos.getZ() + d2, 0.0D, 0.0D, 0.0D,
|
||||
// FIXME new int[0] );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -329,7 +327,7 @@ public class PartFluidLevelEmitter extends PartUpgradeable implements IStackWatc
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
Platform.openGUI( player, this.getHost().getTile(), this.getSide(), GuiBridge.GUI_FLUID_LEVEL_EMITTER );
|
||||
// FIXME Platform.openGUI( player, this.getHost().getTile(), this.getSide(), GuiBridge.GUI_FLUID_LEVEL_EMITTER );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ import appeng.capabilities.Capabilities;
|
||||
import appeng.core.Api;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.settings.TickRates;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
|
||||
import appeng.fluids.util.AEFluidInventory;
|
||||
import appeng.fluids.util.IAEFluidInventory;
|
||||
import appeng.fluids.util.IAEFluidTank;
|
||||
@@ -224,7 +224,7 @@ public class PartFluidStorageBus extends PartSharedStorageBus implements IMEMoni
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
Platform.openGUI( player, this.getHost().getTile(), this.getSide(), GuiBridge.GUI_STORAGEBUS_FLUID );
|
||||
// FIXME Platform.openGUI( player, this.getHost().getTile(), this.getSide(), GuiBridge.GUI_STORAGEBUS_FLUID );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -489,9 +489,9 @@ public class PartFluidStorageBus extends PartSharedStorageBus implements IMEMoni
|
||||
return Api.INSTANCE.definitions().parts().fluidStorageBus().maybeStack( 1 ).orElse( ItemStack.EMPTY );
|
||||
}
|
||||
|
||||
@Override
|
||||
public GuiBridge getGuiBridge()
|
||||
{
|
||||
return GuiBridge.GUI_STORAGEBUS_FLUID;
|
||||
}
|
||||
// FIXME @Override
|
||||
// FIXME public GuiBridge getGuiBridge()
|
||||
// FIXME {
|
||||
// FIXME return GuiBridge.GUI_STORAGEBUS_FLUID;
|
||||
// FIXME }
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import appeng.api.parts.IPartModel;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
|
||||
import appeng.items.parts.PartModels;
|
||||
import appeng.parts.PartModel;
|
||||
import appeng.parts.reporting.AbstractPartTerminal;
|
||||
@@ -53,11 +53,11 @@ public class PartFluidTerminal extends AbstractPartTerminal
|
||||
super( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public GuiBridge getGui( PlayerEntity player )
|
||||
{
|
||||
return GuiBridge.GUI_FLUID_TERMINAL;
|
||||
}
|
||||
// FIXME @Override
|
||||
// FIXME public GuiBridge getGui( PlayerEntity player )
|
||||
// FIXME {
|
||||
// FIXME return GuiBridge.GUI_FLUID_TERMINAL;
|
||||
// FIXME }
|
||||
|
||||
@Override
|
||||
public IPartModel getStaticModels()
|
||||
|
||||
@@ -39,7 +39,7 @@ 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;
|
||||
import appeng.me.GridAccessException;
|
||||
@@ -107,7 +107,7 @@ public abstract class PartSharedFluidBus extends PartUpgradeable implements IGri
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
Platform.openGUI( player, this.getHost().getTile(), this.getSide(), GuiBridge.GUI_BUS_FLUID );
|
||||
// FIXME Platform.openGUI( player, this.getHost().getTile(), this.getSide(), GuiBridge.GUI_BUS_FLUID );
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user