Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
reobf committed Oct 19, 2024
1 parent 4994a29 commit 9c845de
Show file tree
Hide file tree
Showing 7 changed files with 182 additions and 9 deletions.
2 changes: 2 additions & 0 deletions src/main/java/reobf/proghatches/ae/BlockStorageProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public TileEntity createNewTileEntity(World worldIn, int meta) {

TileStorageProxy te=new TileStorageProxy();
if(meta==1)te.fluid=true;
if(meta==2)te.noAdvConfig=true;
return te;
}

Expand Down Expand Up @@ -89,6 +90,7 @@ public void getSubBlocks(Item itemIn, CreativeTabs tab, List list)
{
list.add(new ItemStack(itemIn, 1, 0));
list.add(new ItemStack(itemIn, 1, 1));
list.add(new ItemStack(itemIn, 1, 2));
}

@Override
Expand Down
11 changes: 7 additions & 4 deletions src/main/java/reobf/proghatches/ae/TileStorageProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public DimensionalCoord getLocation() {

ItemStack[] is=new ItemStack[36];

int fuzzmode;
int fuzzmode=2;
//0 disabled
//1 strict
//4 ignore nbt
Expand All @@ -157,7 +157,8 @@ public DimensionalCoord getLocation() {
String dict="";
String lastdict="";
Predicate<IAEItemStack> dictfilter;
FluidStack[] fs=new FluidStack[36];
FluidStack[] fs=new FluidStack[36];
public boolean noAdvConfig;

public Predicate<IAEItemStack> itemFilter(){
return
Expand Down Expand Up @@ -766,6 +767,7 @@ public void readFromNBT(NBTTagCompound compound) {
dict= compound.getString("dict" );
fuzzmode=compound.getInteger("fuzzmode");
fluid=compound.getBoolean("fluid");
noAdvConfig=compound.getBoolean("noAdvConfig");
NBTTagList nbttaglist = compound.getTagList("Items", 10);
Arrays.fill(this.is,null);

Expand All @@ -789,6 +791,7 @@ public void writeToNBT(NBTTagCompound compound) {
compound.setString("dict", dict);
compound.setInteger("fuzzmode", fuzzmode);
compound.setBoolean("fluid", fluid);
compound.setBoolean("noAdvConfig",noAdvConfig);
NBTTagList nbttaglist = new NBTTagList();

for (int i = 0; i < this.is.length; ++i)
Expand Down Expand Up @@ -880,7 +883,7 @@ public ModularWindow createWindow(UIBuildContext buildContext) {

;


if(!noAdvConfig)
builder.widget(
new CycleButtonWidget().setLength(5)
.setSetter(s->{this.fuzzmode=s;gridChanged();})
Expand All @@ -902,7 +905,7 @@ public ModularWindow createWindow(UIBuildContext buildContext) {
.setSize(18, 18)
);


if(!noAdvConfig)
builder.widget(new TextFieldWidget()

.setGetter(()->dict)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,25 @@

import appeng.api.config.Actionable;
import appeng.api.config.FuzzyMode;
import appeng.api.config.PriorityCardMode;
import appeng.api.config.Settings;
import appeng.api.networking.IGridNode;
import appeng.api.networking.security.BaseActionSource;
import appeng.api.networking.security.IActionHost;
import appeng.api.storage.ICellProvider;
import appeng.api.storage.IMEInventoryHandler;
import appeng.api.storage.IMEMonitor;
import appeng.api.storage.StorageChannel;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IAEStack;
import appeng.api.storage.data.IItemList;
import appeng.core.AELog;
import appeng.helpers.IPriorityHost;
import appeng.me.GridAccessException;
import appeng.me.cache.GridStorageCache;
import appeng.me.helpers.AENetworkProxy;
import appeng.me.storage.MEInventoryHandler;
import appeng.util.Platform;
import appeng.util.item.AEItemStack;
import appeng.util.item.MeaningfulItemIterator;
import gregtech.api.GregTech_API;
Expand All @@ -53,13 +60,16 @@
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.StatCollector;
import net.minecraftforge.common.util.ForgeDirection;
import reobf.proghatches.gt.metatileentity.util.IDataCopyablePlaceHolder;
import reobf.proghatches.gt.metatileentity.util.IDataCopyablePlaceHolderSuper;
import reobf.proghatches.gt.metatileentity.util.IMEHatchOverrided;
import reobf.proghatches.gt.metatileentity.util.polyfill.NumericWidget;
import reobf.proghatches.main.registration.Registration;
import reobf.proghatches.util.ProghatchesUtil;

public class PriorityFilterInputBusME extends GT_MetaTileEntity_Hatch_InputBus_ME implements IMEHatchOverrided,IDataCopyablePlaceHolderSuper{
public class PriorityFilterInputBusME extends GT_MetaTileEntity_Hatch_InputBus_ME implements IMEHatchOverrided,IDataCopyablePlaceHolderSuper,
IPriorityHost,IActionHost{

public PriorityFilterInputBusME(int aID, /*boolean autoPullAvailable,*/ String aName, String aNameRegional) {
super(aID, /*autoPullAvailable*/true, aName, aNameRegional);
Expand Down Expand Up @@ -351,4 +361,61 @@ public boolean pasteCopiedData(EntityPlayer player, NBTTagCompound nbt) {
public String getCopiedDataIdentifier(EntityPlayer player) {
return IDataCopyablePlaceHolderSuper.super.getCopiedDataIdentifier(player);
}



@Override
public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {


if(ProghatchesUtil.handleUse(aPlayer, this))return true;


return super.onRightclick(aBaseMetaTileEntity, aPlayer);
}


private static boolean isEditMode(ItemStack stack) {

NBTTagCompound tagCompound = Platform.openNbtData(stack);
try {
if (tagCompound.hasKey("PRIORITY_CARD_MODE")) {
return (tagCompound.getString("PRIORITY_CARD_MODE")).equals("EDIT");
}
} catch (final IllegalArgumentException e) {
AELog.debug(e);
}
return true;
}
@Override
public int getPriority() {

return filter;
}
@Override
public void setPriority(int newValue) {
filter=newValue;
markDirty();

}
@Override
public IGridNode getGridNode(ForgeDirection dir) {

return this.getProxy().getNode();
}
@Override
public void securityBreak() {


}
@Override
public IGridNode getActionableNode() {

return this.getProxy().getNode();
}





}
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,23 @@

import appeng.api.config.Actionable;
import appeng.api.config.FuzzyMode;
import appeng.api.networking.IGridNode;
import appeng.api.networking.security.BaseActionSource;
import appeng.api.networking.security.IActionHost;
import appeng.api.storage.ICellProvider;
import appeng.api.storage.IMEInventoryHandler;
import appeng.api.storage.IMEMonitor;
import appeng.api.storage.StorageChannel;
import appeng.api.storage.data.IAEFluidStack;
import appeng.api.storage.data.IAEStack;
import appeng.api.storage.data.IItemList;
import appeng.core.AELog;
import appeng.helpers.IPriorityHost;
import appeng.me.GridAccessException;
import appeng.me.cache.GridStorageCache;
import appeng.me.helpers.AENetworkProxy;
import appeng.me.storage.MEInventoryHandler;
import appeng.util.Platform;
import appeng.util.item.AEItemStack;
import appeng.util.item.MeaningfulItemIterator;
import gregtech.api.GregTech_API;
Expand All @@ -54,14 +59,17 @@
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.StatCollector;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import reobf.proghatches.gt.metatileentity.util.IDataCopyablePlaceHolder;
import reobf.proghatches.gt.metatileentity.util.IDataCopyablePlaceHolderSuper;
import reobf.proghatches.gt.metatileentity.util.IMEHatchOverrided;
import reobf.proghatches.gt.metatileentity.util.polyfill.NumericWidget;
import reobf.proghatches.main.registration.Registration;
import reobf.proghatches.util.ProghatchesUtil;

public class PriorityFilterInputHatchME extends GT_MetaTileEntity_Hatch_Input_ME implements IMEHatchOverrided,IDataCopyablePlaceHolderSuper{
public class PriorityFilterInputHatchME extends GT_MetaTileEntity_Hatch_Input_ME implements IMEHatchOverrided,IDataCopyablePlaceHolderSuper,
IPriorityHost,IActionHost{

public PriorityFilterInputHatchME(int aID, /*boolean autoPullAvailable,*/ String aName, String aNameRegional) {
super(aID, /*autoPullAvailable*/true, aName, aNameRegional);
Expand Down Expand Up @@ -350,4 +358,53 @@ public boolean pasteCopiedData(EntityPlayer player, NBTTagCompound nbt) {
public String getCopiedDataIdentifier(EntityPlayer player) {
return IDataCopyablePlaceHolderSuper.super.getCopiedDataIdentifier(player);
}
@Override
public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {


if(ProghatchesUtil.handleUse(aPlayer, this))return true;


return super.onRightclick(aBaseMetaTileEntity, aPlayer);
}


private static boolean isEditMode(ItemStack stack) {

NBTTagCompound tagCompound = Platform.openNbtData(stack);
try {
if (tagCompound.hasKey("PRIORITY_CARD_MODE")) {
return (tagCompound.getString("PRIORITY_CARD_MODE")).equals("EDIT");
}
} catch (final IllegalArgumentException e) {
AELog.debug(e);
}
return true;
}
@Override
public int getPriority() {

return filter;
}
@Override
public void setPriority(int newValue) {
filter=newValue;
markDirty();
}
@Override
public IGridNode getGridNode(ForgeDirection dir) {

return this.getProxy().getNode();
}
@Override
public void securityBreak() {


}
@Override
public IGridNode getActionableNode() {

return this.getProxy().getNode();
}

}
39 changes: 39 additions & 0 deletions src/main/java/reobf/proghatches/main/registration/PHRecipes.java
Original file line number Diff line number Diff line change
Expand Up @@ -1597,6 +1597,45 @@ public void run() {
,
new ItemStack(GregTech_API.sBlockMachines,1,Config.metaTileEntityOffset + Registration.PFilterHatchME)
, SECONDS*120, (int) GT_Values.VP[9]);


GT_Values.RA.stdBuilder()
.itemInputs(
new ItemStack(ItemAndBlockHolder.INTERFACE),
ItemList.FluidFilter.get(36)
)
.itemOutputs(new ItemStack(MyMod.storageproxy,1,1) )
.duration(100 * SECONDS)
.eut(480*4*4)
.addTo(RecipeMaps.assemblerRecipes);


for(ItemList item: new ItemList[]{ItemList.ItemFilter_Import,ItemList.ItemFilter_Export}){
GT_Values.RA.stdBuilder()
.itemInputs(
Api.INSTANCE.definitions().blocks().iface().maybeStack(1).get(),
item.get(36),
Api.INSTANCE.definitions().materials().cardFuzzy().maybeStack(1).get(),
Api.INSTANCE.definitions().materials().cardOreFilter().maybeStack(1).get()
)
.itemOutputs(new ItemStack(MyMod.storageproxy,1,0) )
.duration(100 * SECONDS)
.eut(480*4*4*4)
.addTo(RecipeMaps.assemblerRecipes);
GT_Values.RA.stdBuilder()
.itemInputs(
Api.INSTANCE.definitions().blocks().iface().maybeStack(1).get(),
item.get(36),
GT_Utility.getIntegratedCircuit(9)
)
.itemOutputs(new ItemStack(MyMod.storageproxy,1,2) )
.duration(100 * SECONDS)
.eut(480*4*4)
.addTo(RecipeMaps.assemblerRecipes);


}

}

}
Expand Down
5 changes: 4 additions & 1 deletion src/main/resources/assets/proghatches/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -599,9 +599,12 @@ proghatch.proxy.Strict=Strict Match
proghatch.proxy.ignoreNBT=Ignore NBT Tag
proghatch.proxy.oredict=Use Oredict
proghatch.proxy.passthrough=All items in storage
tile.proghatch.storageproxy.0.name=ME Storage Proxy
tile.proghatch.storageproxy.0.name=ME Storage Proxy(Advanced)
tile.proghatch.storageproxy.1.name=ME Fluid Storage Proxy
tile.proghatch.storageproxy.2.name=ME Storage Proxy
tile.proghatches.proxy.tooltip.0=1
tile.proghatches.proxy.tooltip.0.0=Provide filtered access to ME Storage Bus
tile.proghatches.proxy.tooltip.1=1
tile.proghatches.proxy.tooltip.1.0=Provide filtered access to ME Fluid Storage Bus
tile.proghatches.proxy.tooltip.2=1
tile.proghatches.proxy.tooltip.2.0=Provide filtered access to ME Storage Bus
6 changes: 4 additions & 2 deletions src/main/resources/assets/proghatches/lang/zh_CN.lang
Original file line number Diff line number Diff line change
Expand Up @@ -597,10 +597,12 @@ proghatch.proxy.Strict=严格匹配
proghatch.proxy.ignoreNBT=忽略NBT标签
proghatch.proxy.oredict=使用矿辞
proghatch.proxy.passthrough=所有物品
tile.proghatch.storageproxy.0.name=ME存储代理
tile.proghatch.storageproxy.0.name=ME存储代理(进阶)
tile.proghatch.storageproxy.1.name=ME流体存储代理
tile.proghatch.storageproxy.2.name=ME存储代理
tile.proghatches.proxy.tooltip.0=1
tile.proghatches.proxy.tooltip.0.0=向ME存储总线提供受过滤的访问
tile.proghatches.proxy.tooltip.1=1
tile.proghatches.proxy.tooltip.1.0=向ME流体存储总线提供受过滤的访问

tile.proghatches.proxy.tooltip.2=1
tile.proghatches.proxy.tooltip.2.0=向ME存储总线提供受过滤的访问

0 comments on commit 9c845de

Please sign in to comment.