-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
218 additions
and
39 deletions.
There are no files selected for viewing
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
4 changes: 3 additions & 1 deletion
4
src/main/java/reobf/proghatches/ae/IIsExtractFromInvAllowed.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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
package reobf.proghatches.ae; | ||
|
||
import appeng.api.storage.data.IAEStack; | ||
|
||
public interface IIsExtractFromInvAllowed { | ||
public boolean isAllowed(); | ||
public boolean isAllowed(IAEStack stack); | ||
} |
43 changes: 42 additions & 1 deletion
43
src/main/java/reobf/proghatches/ae/TileStockingCircuitRequestInterceptor.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 |
---|---|---|
@@ -1,13 +1,54 @@ | ||
package reobf.proghatches.ae; | ||
|
||
import appeng.api.networking.GridFlags; | ||
import appeng.api.storage.data.IAEStack; | ||
import appeng.tile.grid.AENetworkTile; | ||
import appeng.util.item.AEItemStack; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.nbt.NBTTagCompound; | ||
import net.minecraft.tileentity.TileEntity; | ||
import reobf.proghatches.main.MyMod; | ||
|
||
public class TileStockingCircuitRequestInterceptor extends AENetworkTile { | ||
|
||
public TileStockingCircuitRequestInterceptor() { | ||
this.getProxy().setFlags(GridFlags.REQUIRE_CHANNEL); | ||
} | ||
|
||
public TileStockingCircuitRequestInterceptor(int type) { | ||
this.getProxy().setFlags(GridFlags.REQUIRE_CHANNEL); | ||
this.type=type; | ||
} | ||
int type; | ||
public boolean isAllowed(IAEStack stack) { | ||
if(stack==null)return true; | ||
if(type==0) | ||
return !(stack.isItem()&& | ||
((AEItemStack)stack).getItem()==MyMod.progcircuit); | ||
|
||
|
||
if(type==1&&mark[0]!=null){ | ||
return !stack.equals(mark[0]); | ||
} | ||
|
||
|
||
return true; | ||
} | ||
|
||
ItemStack[] mark=new ItemStack[1]; | ||
|
||
|
||
|
||
|
||
|
||
|
||
@Override | ||
public void writeToNBT_AENetwork(NBTTagCompound data) { | ||
data.setInteger("Interceptor_type", type); | ||
super.writeToNBT_AENetwork(data); | ||
} | ||
@Override | ||
public void readFromNBT_AENetwork(NBTTagCompound data) { | ||
type=data.getInteger("Interceptor_type" ); | ||
super.readFromNBT_AENetwork(data); | ||
} | ||
} |
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
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
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
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.