-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed some old interfaces Updated AE node Made selected inventories sync properly
- Loading branch information
Showing
32 changed files
with
444 additions
and
472 deletions.
There are no files selected for viewing
24 changes: 0 additions & 24 deletions
24
src/main/java/advancedsystemsmanager/api/execution/IHiddenInventory.java
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
src/main/java/advancedsystemsmanager/api/execution/IHiddenTank.java
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
src/main/java/advancedsystemsmanager/api/network/IPacketSync.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...ger/api/execution/IInternalInventory.java → .../api/tileentities/IInternalInventory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...smanager/api/execution/IInternalTank.java → ...nager/api/tileentities/IInternalTank.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
...in/java/advancedsystemsmanager/compatibility/appliedenergistics/AEFluidBufferElement.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package advancedsystemsmanager.compatibility.appliedenergistics; | ||
|
||
import advancedsystemsmanager.api.execution.IBufferElement; | ||
import advancedsystemsmanager.flow.execution.buffers.elements.BufferElementBase; | ||
import advancedsystemsmanager.flow.setting.Setting; | ||
import advancedsystemsmanager.tileentities.TileEntityAENode; | ||
import net.minecraftforge.common.util.ForgeDirection; | ||
import net.minecraftforge.fluids.Fluid; | ||
import net.minecraftforge.fluids.FluidStack; | ||
|
||
public class AEFluidBufferElement extends BufferElementBase<Fluid> | ||
{ | ||
protected TileEntityAENode node; | ||
|
||
public AEFluidBufferElement(int id, TileEntityAENode node, int amount, Fluid fluid, Setting<Fluid> setting, boolean whitelist) | ||
{ | ||
this(id, node, amount, fluid); | ||
this.setting = setting; | ||
this.whitelist = whitelist; | ||
} | ||
|
||
public AEFluidBufferElement(int id, TileEntityAENode node, int amount, Fluid fluid) | ||
{ | ||
super(id); | ||
this.node = node; | ||
this.amount = amount; | ||
this.content = fluid; | ||
} | ||
|
||
@Override | ||
public void remove() | ||
{ | ||
|
||
} | ||
|
||
@Override | ||
public void onUpdate() | ||
{ | ||
|
||
} | ||
|
||
@Override | ||
public int getSizeLeft() | ||
{ | ||
FluidStack stack = node.getTank().drain(ForgeDirection.UNKNOWN, new FluidStack(content, amount), false); | ||
return stack == null ? 0 : getMaxWithSetting(stack.amount); | ||
} | ||
|
||
@Override | ||
public int reduceBufferAmount(int amount) | ||
{ | ||
amount = Math.min(amount, this.amount); | ||
FluidStack stack = node.getTank().drain(ForgeDirection.UNKNOWN, new FluidStack(content, amount), true); | ||
return stack == null ? 0 : stack.amount; | ||
} | ||
|
||
@Override | ||
public IBufferElement<Fluid> getSplitElement(int elementAmount, int id, boolean fair) | ||
{ | ||
AEFluidBufferElement element = new AEFluidBufferElement(this.id, this.node, this.amount, this.content, this.setting, this.whitelist); | ||
int oldAmount = getSizeLeft(); | ||
int amount = oldAmount / elementAmount; | ||
if (!fair) | ||
{ | ||
int amountLeft = oldAmount % elementAmount; | ||
if (id < amountLeft) | ||
{ | ||
amount++; | ||
} | ||
} | ||
element.amount = amount; | ||
return element; | ||
} | ||
} |
83 changes: 83 additions & 0 deletions
83
...ain/java/advancedsystemsmanager/compatibility/appliedenergistics/AEItemBufferElement.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
package advancedsystemsmanager.compatibility.appliedenergistics; | ||
|
||
import advancedsystemsmanager.api.execution.IBufferElement; | ||
import advancedsystemsmanager.api.execution.Key; | ||
import advancedsystemsmanager.flow.execution.buffers.elements.BufferElementBase; | ||
import advancedsystemsmanager.flow.setting.Setting; | ||
import advancedsystemsmanager.tileentities.TileEntityAENode; | ||
import appeng.api.storage.data.IAEItemStack; | ||
import net.minecraft.item.ItemStack; | ||
|
||
public class AEItemBufferElement extends BufferElementBase<ItemStack> | ||
{ | ||
private TileEntityAENode node; | ||
private IAEItemStack stack; | ||
|
||
public AEItemBufferElement(int id, TileEntityAENode node, IAEItemStack stack, Setting<ItemStack> setting, boolean whitelist) | ||
{ | ||
this(id, node, stack); | ||
this.setting = setting; | ||
this.whitelist = whitelist; | ||
} | ||
|
||
private AEItemBufferElement(int id, TileEntityAENode node, IAEItemStack stack) | ||
{ | ||
super(id); | ||
this.node = node; | ||
this.stack = stack; | ||
this.amount = (int)Math.min(Integer.MAX_VALUE, stack.getStackSize()); | ||
} | ||
|
||
@Override | ||
public ItemStack getContent() | ||
{ | ||
return stack.getItemStack(); | ||
} | ||
|
||
@Override | ||
public void remove() | ||
{ | ||
} | ||
|
||
@Override | ||
public void onUpdate() | ||
{ | ||
|
||
} | ||
|
||
@Override | ||
public int getSizeLeft() | ||
{ | ||
return (int)Math.min(stack.getStackSize(), amount); | ||
} | ||
|
||
@Override | ||
public int reduceBufferAmount(int amount) | ||
{ | ||
return (int)node.helper.extract(stack.copy().setStackSize(amount)).getStackSize(); | ||
} | ||
|
||
@Override | ||
public IBufferElement<ItemStack> getSplitElement(int elementAmount, int id, boolean fair) | ||
{ | ||
AEItemBufferElement element = new AEItemBufferElement(this.id, this.node, this.stack, this.setting, this.whitelist); | ||
int oldAmount = this.getSizeLeft(); | ||
int amount = oldAmount / elementAmount; | ||
if (!fair) | ||
{ | ||
int amountLeft = oldAmount % elementAmount; | ||
if (id < amountLeft) | ||
{ | ||
++amount; | ||
} | ||
} | ||
element.amount = amount; | ||
return element; | ||
} | ||
|
||
@Override | ||
public Key<ItemStack> getKey() | ||
{ | ||
return new Key.ItemKey(stack.getItemStack()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.