Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
reobf committed Feb 18, 2025
1 parent 1f5909c commit 01bed9a
Show file tree
Hide file tree
Showing 12 changed files with 140 additions and 13 deletions.
12 changes: 11 additions & 1 deletion src/main/java/reobf/proghatches/block/BlockIOHub.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ public void registerBlockIcons(IIconRegister reg) {
provider_in_overlay = reg.registerIcon("proghatches:provider_in");
provider_in_active_overlay = reg.registerIcon("proghatches:provider_in_active");
inv_me_slave = reg.registerIcon("proghatches:inv_me_slave");

overlay_dual = reg.registerIcon("proghatches:overlay_dual");
overlay_dual_active = reg.registerIcon("proghatches:overlay_dual_active");


super.registerBlockIcons(reg);
}

Expand Down Expand Up @@ -104,12 +109,14 @@ public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer
public static IIcon provider_active_overlay;
public static IIcon provider_in_overlay;
public static IIcon provider_in_active_overlay;
public static IIcon overlay_dual,overlay_dual_active;
static public int magicNO_provider_overlay = 0x7e;
static public int magicNO_provider_active_overlay = 0x7d;
static public int magicNO_provider_in_overlay = 0x7c;
static public int magicNO_provider_in_active_overlay = 0x7b;
static public int magicNO_inv_me_slave = 0x7a;

static public int magicNO_overlay_dual = 0x79;
static public int magicNO_overlay_dual_active= 0x78;
@SideOnly(value = Side.CLIENT)
@Override
public IIcon getIcon(int side, int meta) {
Expand All @@ -120,6 +127,9 @@ public IIcon getIcon(int side, int meta) {
if(meta==0x7c)return provider_in_overlay;
if(meta==0x7b)return provider_in_active_overlay;
if(meta==0x7a)return inv_me_slave;

if(meta==magicNO_overlay_dual)return overlay_dual;
if(meta==magicNO_overlay_dual_active)return overlay_dual_active;
//spotless:on
return super.getIcon(side, meta);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.reflect.Method;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Deque;
Expand Down Expand Up @@ -99,6 +100,9 @@
import gregtech.api.util.GTTooltipDataCache.TooltipData;
import gregtech.api.util.GTUtility;
import gregtech.common.tileentities.machines.IDualInputInventory;
import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectSortedMaps;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import reobf.proghatches.gt.metatileentity.BufferedDualInputHatch.Recipe;
Expand Down Expand Up @@ -253,6 +257,21 @@ public class DualInvBuffer implements INeoDualInputInventory {
* }
*/
public long tickFirstClassify = -1;

protected Int2ObjectMap<ArrayList<ItemStack>> mExItem=new Int2ObjectArrayMap<>();
protected Int2ObjectMap<ArrayList<FluidStack>> mExFluid=new Int2ObjectArrayMap<>();
protected ArrayList<ItemStack> getExItem(int index){
if(mExItem.containsKey(index)){
mExItem.put(index, new ArrayList<>());
}
return mExItem.get(index);
}
protected ArrayList<FluidStack> getExFluid(int index){
if(mExFluid.containsKey(index)){
mExFluid.put(index, new ArrayList<>());
}
return mExFluid.get(index);
}
protected FluidTank[] mStoredFluidInternal;
protected ItemStack[] mStoredItemInternal;
protected FluidTank[] mStoredFluidInternalSingle;
Expand All @@ -268,8 +287,7 @@ public class DualInvBuffer implements INeoDualInputInventory {

// public boolean lock;
public boolean full() {

for (int index = 0; index < mStoredItemInternalSingle.length; index++) {
for (int index = 0; index < mStoredItemInternalSingle.length; index++) {
ItemStack i = mStoredItemInternal[index];
ItemStack si = mStoredItemInternalSingle[index];
if (i != null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package reobf.proghatches.gt.metatileentity;

import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ME_INPUT_HATCH_ACTIVE;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ME_CRAFTING_INPUT_BUFFER;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ME_CRAFTING_INPUT_BUS;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ME_INPUT_FLUID_HATCH_ACTIVE;
import static kubatech.api.Variables.numberFormat;
import static kubatech.api.Variables.numberFormatScientific;
Expand Down Expand Up @@ -57,11 +59,13 @@
import appeng.api.config.FuzzyMode;
import appeng.api.implementations.IPowerChannelState;
import appeng.api.networking.GridFlags;
import appeng.api.networking.IGridNode;
import appeng.api.networking.security.IActionHost;
import appeng.api.networking.security.MachineSource;
import appeng.api.storage.IMEMonitor;
import appeng.api.storage.data.IAEFluidStack;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.util.DimensionalCoord;
import appeng.me.GridAccessException;
import appeng.me.helpers.AENetworkProxy;
import appeng.me.helpers.IGridProxyable;
Expand All @@ -84,6 +88,7 @@
import gregtech.api.recipe.check.CheckRecipeResult;
import gregtech.api.recipe.check.CheckRecipeResultRegistry;
import gregtech.api.recipe.check.SimpleCheckRecipeResult;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GTOreDictUnificator;
import gregtech.api.util.GTUtility;
import gregtech.api.util.shutdown.ShutDownReason;
Expand All @@ -99,6 +104,7 @@
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import net.minecraftforge.common.util.ForgeDirection;
Expand All @@ -109,7 +115,7 @@
import reobf.proghatches.main.registration.Registration;

public class StockingDualInputHatchME extends MTEHatchInputBus
implements IDualInputHatch, IRecipeProcessingAwareDualHatch, IPowerChannelState
implements IDualInputHatch, IRecipeProcessingAwareDualHatch, IPowerChannelState,IGridProxyable

{

Expand Down Expand Up @@ -611,7 +617,20 @@ public void program(){
if(ext!=null&&ext.getStackSize()>0){
ItemStack item = ext.getItemStack();
item.stackSize=0;
this.setInventorySlotContents(getCircuitSlot(),ItemProgrammingCircuit.getCircuit(item).orElse(null));

ItemStack circuit = ItemProgrammingCircuit.getCircuit(item).orElse(null);
this.setInventorySlotContents(getCircuitSlot(),circuit);

this.getProxy().getNode().getGrid().getMachines(this.getClass()).forEach(m->{
StockingDualInputHatchME thiz=(StockingDualInputHatchME) m.getMachine();
if(thiz.program){
thiz.setInventorySlotContents(thiz.getCircuitSlot(),circuit);

}



});;

}
}
Expand Down Expand Up @@ -860,7 +879,7 @@ public AENetworkProxy getProxy() {

if (gridProxy == null) {
if (getBaseMetaTileEntity() instanceof IGridProxyable) {
gridProxy = new AENetworkProxy((IGridProxyable) getBaseMetaTileEntity(), "proxy",
gridProxy = new AENetworkProxy(this, "proxy",
new ItemStack(GregTechAPI.sBlockMachines, 1, getBaseMetaTileEntity().getMetaTileID()), true);
gridProxy.setFlags(GridFlags.REQUIRE_CHANNEL);
updateValidGridProxySides();
Expand Down Expand Up @@ -896,7 +915,7 @@ protected void updateValidGridProxySides() {
}

@Override
public void saveNBTData(NBTTagCompound aNBT) {allowAuto=aNBT.getBoolean("allowAuto");
public void saveNBTData(NBTTagCompound aNBT) {aNBT.setBoolean("allowAuto",allowAuto);
getProxy().writeToNBT(aNBT);
super.saveNBTData(aNBT);
NBTTagList nbtTagList = new NBTTagList();
Expand Down Expand Up @@ -941,7 +960,7 @@ protected void updateValidGridProxySides() {
}

@Override
public void loadNBTData(NBTTagCompound aNBT) {aNBT.setBoolean("allowAuto", allowAuto);
public void loadNBTData(NBTTagCompound aNBT) {allowAuto=aNBT.getBoolean("allowAuto" );
getProxy().readFromNBT(aNBT);
super.loadNBTData(aNBT);
if (aNBT.hasKey("storedFluids")) {
Expand Down Expand Up @@ -1003,5 +1022,35 @@ protected void updateValidGridProxySides() {
}

public IItemHandlerModifiable inventoryHandlerMark = new ItemStackHandler(i_mark);;
public IItemHandlerModifiable inventoryHandlerDisplay = new ItemStackHandler(i_display);;
public IItemHandlerModifiable inventoryHandlerDisplay = new ItemStackHandler(i_display);

@Override
public IGridNode getGridNode(ForgeDirection dir) {

return getProxy().getNode();
}

@Override
public void securityBreak() {


}

@Override
public DimensionalCoord getLocation() {

return new DimensionalCoord((TileEntity)this.getBaseMetaTileEntity());
};
@Override
public ITexture[] getTexturesActive(ITexture aBaseTexture) {
return new ITexture[] { aBaseTexture,
TextureFactory.of(MyMod.iohub ,MyMod.iohub.magicNO_overlay_dual_active) };
}

@Override
public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
return new ITexture[] { aBaseTexture,
TextureFactory.of( MyMod.iohub,MyMod.iohub.magicNO_overlay_dual) };
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,9 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a
// if(succ){forceUpdatePattern=true ;}
multiply = Math.min(multiply, totalAcc + 1);
multiply = Math.max(multiply, 1);

if(mEnergyHatches.size()==0)return false;

return succ;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/reobf/proghatches/main/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public void preInit(FMLPreInitializationEvent event) {
"proghatches.proxy",
new Object[] { "tile.proghatches.proxy.tooltip" });

MyMod.iohub = GameRegistry.registerBlock(new BlockIOHub(), ItemBlockIOHub.class, "proghatches.iohub");
MyMod.iohub = (BlockIOHub) GameRegistry.registerBlock(new BlockIOHub(), ItemBlockIOHub.class, "proghatches.iohub");
MyMod.alert = GameRegistry.registerBlock(
new BlockAnchorAlert(Material.rock),
ItemBlockAnchorAlert.class,
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/reobf/proghatches/main/MyMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
import reobf.proghatches.ae.BlockMolecularAssemblerInterface;
import reobf.proghatches.ae.BlockOrbSwitcher;
import reobf.proghatches.ae.BlockRequestTunnel;
import reobf.proghatches.block.BlockIOHub;
import reobf.proghatches.block.ChunkTrackingGridCahce;
import reobf.proghatches.block.TileIOHub;
import reobf.proghatches.eio.ICraftingMachineConduit;
Expand Down Expand Up @@ -218,7 +219,7 @@ public int getItemStackLimit() {
public static Item cover;
public static Item oc_redstone;
public static Item oc_api;
public static Block iohub;
public static BlockIOHub iohub;
public static Block pstation;
public static Item pitem;
@Nullable
Expand Down
32 changes: 32 additions & 0 deletions src/main/java/reobf/proghatches/main/registration/PHRecipes.java
Original file line number Diff line number Diff line change
Expand Up @@ -2068,6 +2068,38 @@ public void run() {
.duration(1 * SECONDS)
.eut(30)
.addTo(RecipeMaps.assemblerRecipes);



GTValues.RA.stdBuilder()
.itemInputs(
ItemList.Hatch_Input_Bus_ME.get(1),
ItemList.Hatch_Input_ME.get(1),
new ItemStack(MyMod.toolkit,0,OreDictionary.WILDCARD_VALUE)
)
.itemOutputs( new ItemStack(
GregTechAPI.sBlockMachines,
1,
Config.metaTileEntityOffset + Registration.StockingDualInputOffset))
.duration(1 * SECONDS)
.eut(30)
.addTo(RecipeMaps.assemblerRecipes);

GTValues.RA.stdBuilder()
.itemInputs(
ItemList.Hatch_Input_Bus_ME_Advanced.get(1),
ItemList.Hatch_Input_ME_Advanced.get(1),
new ItemStack(MyMod.toolkit,0,OreDictionary.WILDCARD_VALUE)
)
.itemOutputs( new ItemStack(
GregTechAPI.sBlockMachines,
1,
Config.metaTileEntityOffset + Registration.StockingDualInputOffset+1))
.duration(1 * SECONDS)
.eut(30)
.addTo(RecipeMaps.assemblerRecipes);


/*
* rec = new ShapelessOreRecipe( new ItemStack( MyMod.plunger,1,1),
* ItemEnum.BOOSTER_CARD.getStack(0),
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/reobf/proghatches/util/A.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package reobf.proghatches.util;

public class A {
public static void main(String[] args){

System.out.println(Integer.MAX_VALUE+Integer.MAX_VALUE);


}
}
4 changes: 3 additions & 1 deletion src/main/resources/assets/proghatches/lang/en_US/SDIHME.lang
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
Just as its name implies...
Just as its name implies...
You'd better not install more than one of this on the same Multiblock.
Or it might void your ingredients, use at your own risk!
4 changes: 3 additions & 1 deletion src/main/resources/assets/proghatches/lang/zh_CN/SDIHME.lang
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
你懂的
顾名思义
最好不要在一个机器上装多个这玩意儿
否则可能会吞材料,后果自负!
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 01bed9a

Please sign in to comment.