mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-26 06:42:56 +00:00
A few ejector fixes
This commit is contained in:
1 parent
a22b33a629
commit
06dc2227f2
5 files changed
+51
-43
No files matched your search
@@ -2,13 +2,13 @@ package mekanism.api.gas;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.transmitters.ITransmitterTile;
|
||||
import mekanism.api.transmitters.TransmissionType;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@@ -20,16 +20,11 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
*/
|
||||
public final class GasTransmission
|
||||
{
|
||||
/**
|
||||
* Gets all the acceptors around a tile entity.
|
||||
* @param tileEntity - center tile entity
|
||||
* @return array of IGasAcceptors
|
||||
*/
|
||||
public static IGasHandler[] getConnectedAcceptors(TileEntity tileEntity)
|
||||
public static IGasHandler[] getConnectedAcceptors(TileEntity tileEntity, Collection<ForgeDirection> sides)
|
||||
{
|
||||
IGasHandler[] acceptors = new IGasHandler[] {null, null, null, null, null, null};
|
||||
|
||||
for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS)
|
||||
for(ForgeDirection orientation : sides)
|
||||
{
|
||||
TileEntity acceptor = Coord4D.get(tileEntity).getFromSide(orientation).getTileEntity(tileEntity.getWorldObj());
|
||||
|
||||
@@ -41,6 +36,16 @@ public final class GasTransmission
|
||||
|
||||
return acceptors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all the acceptors around a tile entity.
|
||||
* @param tileEntity - center tile entity
|
||||
* @return array of IGasAcceptors
|
||||
*/
|
||||
public static IGasHandler[] getConnectedAcceptors(TileEntity tileEntity)
|
||||
{
|
||||
return getConnectedAcceptors(tileEntity, Arrays.asList(ForgeDirection.VALID_DIRECTIONS));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all the tube connections around a tile entity.
|
||||
@@ -125,12 +130,12 @@ public final class GasTransmission
|
||||
|
||||
/**
|
||||
* Emits gas from a central block by splitting the received stack among the sides given.
|
||||
* @param sides - the list of sides to output from
|
||||
* @param stack - the stack to output
|
||||
* @param from - the TileEntity to output from
|
||||
* @param sides - the list of sides to output from
|
||||
* @return the amount of gas emitted
|
||||
*/
|
||||
public static int emit(List<ForgeDirection> sides, GasStack stack, TileEntity from)
|
||||
public static int emit(GasStack stack, TileEntity from, Collection<ForgeDirection> sides)
|
||||
{
|
||||
if(stack == null)
|
||||
{
|
||||
@@ -138,7 +143,7 @@ public final class GasTransmission
|
||||
}
|
||||
|
||||
List<IGasHandler> availableAcceptors = new ArrayList<IGasHandler>();
|
||||
IGasHandler[] possibleAcceptors = getConnectedAcceptors(from);
|
||||
IGasHandler[] possibleAcceptors = getConnectedAcceptors(from, sides);
|
||||
|
||||
for(int i = 0; i < possibleAcceptors.length; i++)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user