From 0f0ef38bda93e28e27d5ca441ed07d1551cbe1d7 Mon Sep 17 00:00:00 2001 From: reobf <2215595288@qq.com> Date: Thu, 13 Feb 2025 23:02:22 +0800 Subject: [PATCH] update --- .../proghatches/ae/BlockOrbSwitcher.java | 163 +++++++ .../reobf/proghatches/ae/TileOrbSwitcher.java | 460 ++++++++++++++++++ .../proghatches/block/TileReactorSyncer.java | 6 +- .../gt/metatileentity/AutoDataOrbHatch.java | 68 +++ .../gt/metatileentity/NBTHatchMECatalyst.java | 403 +++++++++++++++ .../gt/metatileentity/NBTHatchMEFocus.java | 1 + .../reobf/proghatches/main/CommonProxy.java | 9 +- .../java/reobf/proghatches/main/MyMod.java | 4 +- .../main/registration/PHRecipes.java | 15 + .../registration/ProgHatchCreativeTab.java | 2 +- .../main/registration/Registration.java | 17 +- .../assets/proghatches/lang/en_US.lang | 14 + .../assets/proghatches/lang/en_US/ADOH.lang | 4 + .../assets/proghatches/lang/en_US/HMEC.lang | 4 + .../assets/proghatches/lang/zh_CN.lang | 14 + .../assets/proghatches/lang/zh_CN/ADOH.lang | 4 + .../assets/proghatches/lang/zh_CN/HMEC.lang | 4 + .../proghatches/textures/blocks/switch.png | Bin 0 -> 139 bytes .../textures/blocks/switch_circuit.png | Bin 0 -> 439 bytes .../textures/blocks/switch_orb.png | Bin 0 -> 196 bytes .../textures/blocks/switch_stocking.png | Bin 0 -> 203 bytes 21 files changed, 1183 insertions(+), 9 deletions(-) create mode 100644 src/main/java/reobf/proghatches/ae/BlockOrbSwitcher.java create mode 100644 src/main/java/reobf/proghatches/ae/TileOrbSwitcher.java create mode 100644 src/main/java/reobf/proghatches/gt/metatileentity/AutoDataOrbHatch.java create mode 100644 src/main/java/reobf/proghatches/gt/metatileentity/NBTHatchMECatalyst.java create mode 100644 src/main/resources/assets/proghatches/lang/en_US/ADOH.lang create mode 100644 src/main/resources/assets/proghatches/lang/en_US/HMEC.lang create mode 100644 src/main/resources/assets/proghatches/lang/zh_CN/ADOH.lang create mode 100644 src/main/resources/assets/proghatches/lang/zh_CN/HMEC.lang create mode 100644 src/main/resources/assets/proghatches/textures/blocks/switch.png create mode 100644 src/main/resources/assets/proghatches/textures/blocks/switch_circuit.png create mode 100644 src/main/resources/assets/proghatches/textures/blocks/switch_orb.png create mode 100644 src/main/resources/assets/proghatches/textures/blocks/switch_stocking.png diff --git a/src/main/java/reobf/proghatches/ae/BlockOrbSwitcher.java b/src/main/java/reobf/proghatches/ae/BlockOrbSwitcher.java new file mode 100644 index 0000000..6050714 --- /dev/null +++ b/src/main/java/reobf/proghatches/ae/BlockOrbSwitcher.java @@ -0,0 +1,163 @@ +package reobf.proghatches.ae; + +import java.util.List; + +import com.gtnewhorizons.modularui.api.UIInfos; +import com.gtnewhorizons.modularui.api.screen.ITileWithModularUI; +import com.gtnewhorizons.modularui.common.internal.network.NetworkUtils; + +import gregtech.api.enums.SoundResource; +import gregtech.api.util.GTUtility; +import li.cil.oc.integration.util.Wrench; +import li.cil.oc.util.BlockPosition; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.BlockPistonBase; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.StatCollector; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import reobf.proghatches.block.INameAndTooltips; +import scala.Some; + +public class BlockOrbSwitcher extends BlockContainer implements INameAndTooltips { + + public BlockOrbSwitcher() { + super(Material.rock); + this.setHardness(2.2F); + this.setHarvestLevel("pickaxe", 0); setBlockName("proghatches.orb_switcher"); + } + + @Override + public TileEntity createNewTileEntity(World worldIn, int meta) { + + return new TileOrbSwitcher(); + } + + @Override + public void addInformation(ItemStack p_77624_1_, List l) { + l.add(StatCollector.translateToLocal("proghatch.orb_switcher.tooltip.0")); + l.add(StatCollector.translateToLocal("proghatch.orb_switcher.tooltip.1")); + l.add(StatCollector.translateToLocal("proghatch.orb_switcher.tooltip.2")); + l.add(StatCollector.translateToLocal("proghatch.orb_switcher.tooltip.3")); + l.add(StatCollector.translateToLocal("proghatch.orb_switcher.tooltip.4")); + l.add(StatCollector.translateToLocal("proghatch.orb_switcher.tooltip.5")); + l.add(StatCollector.translateToLocal("proghatch.orb_switcher.tooltip.6")); + } + + @Override + public String getName(ItemStack p_77624_1_) { + // TODO Auto-generated method stub + return null; + }@Override + public IIcon getIcon(int side, int meta) { + if(side==1){ + return orb; + } + if(side==0){ + return stocking; + } + if(side==3){ + return cirucit; + } + return blockIcon; + } + IIcon cirucit; + IIcon stocking; + IIcon orb; + @Override + public void registerBlockIcons(IIconRegister reg) { + cirucit=reg.registerIcon("proghatches:switch_circuit"); + stocking=reg.registerIcon("proghatches:switch_stocking"); + orb=reg.registerIcon("proghatches:switch_orb"); + blockIcon=reg.registerIcon("proghatches:switch"); + } + @Override + public IIcon getIcon(IBlockAccess worldIn, int x, int y, int z, int side) { + + TileOrbSwitcher tile=(TileOrbSwitcher) worldIn.getTileEntity(x, y, z); + if(side==tile.dirorb.ordinal()){ + return orb; + } + if(side==tile.dirstocking.ordinal()){ + return stocking; + } + if(side==tile.facing.ordinal()){ + return cirucit; + } + return blockIcon; + } + + +@Override +public void onBlockPlacedBy(World worldIn, int x, int y, int z, EntityLivingBase placer, ItemStack itemIn) { + int l = BlockPistonBase.determineOrientation(worldIn, x, y, z, placer); + // worldIn.setBlockMetadataWithNotify(x, y, z, l, 2); + TileOrbSwitcher tile=(TileOrbSwitcher) worldIn.getTileEntity(x, y, z); + tile.facing=ForgeDirection.VALID_DIRECTIONS[l]; + if(l<=1){ + tile.dirorb=ForgeDirection.EAST; + tile.dirstocking=ForgeDirection.WEST; + + } + + + if(tile!=null&&placer instanceof EntityPlayer)tile.mark((EntityPlayer) placer); + super.onBlockPlacedBy(worldIn, x, y, z, placer, itemIn); +} + +@Override +public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, + float subY, float subZ) { + + TileOrbSwitcher tile=(TileOrbSwitcher) worldIn.getTileEntity(x, y, z); + if(tile!=null){ + if (Wrench.holdsApplicableWrench(player, new BlockPosition(x, y, z, Some.apply(worldIn)))) { + if (!worldIn.isRemote ) { + GTUtility.sendSoundToPlayers(worldIn, SoundResource.IC2_TOOLS_WRENCH, 1.0F, -1.0F, x, y, z); + Wrench.wrenchUsed(player, new BlockPosition(x, y, z, Some.apply(worldIn))); + + tile.dirorb= tile.dirorb.getRotation(ForgeDirection.VALID_DIRECTIONS[side]); + tile.dirstocking= tile.dirstocking.getRotation(ForgeDirection.VALID_DIRECTIONS[side]); + tile.facing= tile.facing.getRotation(ForgeDirection.VALID_DIRECTIONS[side]); + + + + tile.updateConnection(); + + /*worldIn.setBlockMetadataWithNotify(x, y, z, + ForgeDirection.VALID_DIRECTIONS[ worldIn.getBlockMetadata(x, y, z)].getRotation(ForgeDirection.VALID_DIRECTIONS[side]) + .ordinal(), 2); + */ + + + + tile.sendPacket(); + + } + return true; + } + } + + + TileEntity te = worldIn.getTileEntity(x, y, z); + final ItemStack is = player.inventory.getCurrentItem(); + + b: { + if (NetworkUtils.isClient()) break b; + UIInfos.TILE_MODULAR_UI.open(player, worldIn, x, y, z); + } + + return true; +} + + +} diff --git a/src/main/java/reobf/proghatches/ae/TileOrbSwitcher.java b/src/main/java/reobf/proghatches/ae/TileOrbSwitcher.java new file mode 100644 index 0000000..54075ca --- /dev/null +++ b/src/main/java/reobf/proghatches/ae/TileOrbSwitcher.java @@ -0,0 +1,460 @@ +package reobf.proghatches.ae; + +import java.util.Collection; + +import com.google.common.base.Objects; +import com.gtnewhorizons.modularui.api.ModularUITextures; +import com.gtnewhorizons.modularui.api.drawable.IDrawable; +import com.gtnewhorizons.modularui.api.screen.ITileWithModularUI; +import com.gtnewhorizons.modularui.api.screen.ModularWindow; +import com.gtnewhorizons.modularui.api.screen.UIBuildContext; +import com.gtnewhorizons.modularui.common.widget.CycleButtonWidget; + +import appeng.api.config.Actionable; +import appeng.api.config.FuzzyMode; +import appeng.api.exceptions.FailedConnection; +import appeng.api.networking.GridFlags; +import appeng.api.networking.IGridConnection; +import appeng.api.networking.IGridHost; +import appeng.api.networking.IGridNode; +import appeng.api.networking.security.IActionHost; +import appeng.api.networking.security.MachineSource; +import appeng.api.networking.storage.IStorageGrid; +import appeng.api.storage.IMEMonitor; +import appeng.api.storage.data.IAEItemStack; +import appeng.api.util.AECableType; +import appeng.api.util.DimensionalCoord; +import appeng.me.GridAccessException; +import appeng.me.GridConnection; +import appeng.me.MachineSet; +import appeng.me.helpers.AENetworkProxy; +import appeng.me.helpers.IGridProxyable; +import appeng.tile.networking.TileCableBus; +import appeng.util.item.AEItemStack; +import gregtech.api.gui.modularui.GTUITextures; +import gregtech.api.interfaces.IConfigurationCircuitSupport; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Items; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import reobf.proghatches.main.MyMod; + +public class TileOrbSwitcher extends TileEntity implements IActionHost, IGridProxyable ,ITileWithModularUI{ + AENetworkProxy stocking = new AENetworkProxy(this, "stocking", new ItemStack(Items.apple), false); + AENetworkProxy orb = new AENetworkProxy(this, "orb", new ItemStack(Items.apple), false); + AENetworkProxy primary = new AENetworkProxy(this, "primary", new ItemStack(Items.apple), false); + + public TileOrbSwitcher() { + primary.setFlags(GridFlags.CANNOT_CARRY); + stocking.setFlags(GridFlags.CANNOT_CARRY); + orb.setFlags(GridFlags.CANNOT_CARRY); + } private boolean isDead; + +@Override +public void validate() { + if(this.worldObj.isRemote==false) + MyMod.callbacks.put(this, this::pretick); + super.validate(); +} +MachineSource source=new MachineSource(this); +ItemStack select=new ItemStack(Items.apple); + + +boolean nbt; +boolean meta; +boolean circuit=true; +boolean index; + +public void pretick(){ + + + if ((!isDead) && (!isInvalid())) { + if(this.worldObj.getTileEntity(xCoord, yCoord, zCoord)==this){ + + if (!init) { + init = true; + if(worldObj.isRemote==false){ + this.orb.onReady(); + this.primary.onReady(); + this.stocking.onReady(); + updateConnection(); + } + } + + + ForgeDirection dir=facing;//ForgeDirection.VALID_DIRECTIONS[ this.worldObj.getBlockMetadata(xCoord, yCoord, zCoord)]; + select=null; + TileEntity te = this.worldObj.getTileEntity(xCoord+dir.offsetX, yCoord+dir.offsetY, zCoord+dir.offsetZ); + + if(circuit){ + if(te instanceof IGregTechTileEntity){ + IMetaTileEntity mte = ((IGregTechTileEntity) te).getMetaTileEntity(); + if(mte instanceof IConfigurationCircuitSupport){ + + select=mte.getStackInSlot(((IConfigurationCircuitSupport) mte).getCircuitSlot()); + if(select!=null){select=select.copy(); + select.stackSize=1;} + } + } + }else{ + if(te instanceof IInventory){ + IInventory inv=(IInventory) te; + for(int i=0;i0){ + select=inv.getStackInSlot(i).copy(); + select.stackSize=1; + + } + + } + } + + + } + + + + + try { + + + IMEMonitor stockinginv = stocking.getStorage().getItemInventory(); + IMEMonitor orbinv = orb.getStorage().getItemInventory(); + + + boolean foundTarget=false; + for(IAEItemStack i:orb.getStorage().getItemInventory() + .getStorageList()){ + if(same(i,select)){foundTarget=true; + if(select.stackSize fuzz = stockinginv.getStorageList().findFuzzy(sel, FuzzyMode.IGNORE_ALL); + + for(IAEItemStack item:stockinginv.getStorageList()){ + if(same(item,select)){//find fuzzy might return some oredict items... check it! + + get = stockinginv.extractItems(item.copy().setStackSize(select.stackSize), Actionable.MODULATE, source); + if(get!=null)break; + } + + } + } + } + + + if(get!=null)get=orbinv.injectItems(get, Actionable.MODULATE, source); + if(get!=null)stockinginv.injectItems(get, Actionable.MODULATE, source); + + + } + + + + + + + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + + + + } + } + +} + +public boolean same(IAEItemStack a, ItemStack b){ + + + if(a.getItem()!=b.getItem()){return false;} + if(meta)if(a.getItemDamage()!=b.getItemDamage()){return false;} + if(nbt)if( + Objects.equal( + a.getTagCompound(),b.getTagCompound()) + ){return false;} + return true; +} + @Override + public void writeToNBT(NBTTagCompound compound) { + stocking.writeToNBT(compound); + orb.writeToNBT(compound); + primary.writeToNBT(compound); + compound.setByte("dirorb", (byte) dirorb.ordinal()); + compound.setByte("dirstocking", (byte) dirstocking.ordinal()); + compound.setByte("facing", (byte) facing.ordinal()); + compound.setBoolean("nbt",nbt); + compound.setBoolean("meta",meta); + super.writeToNBT(compound); + } + + @Override + public void readFromNBT(NBTTagCompound compound) { + stocking.readFromNBT(compound); + orb.readFromNBT(compound); + primary.readFromNBT(compound); + dirorb=ForgeDirection.VALID_DIRECTIONS[compound.getByte("dirorb")]; + dirstocking=ForgeDirection.VALID_DIRECTIONS[compound.getByte("dirstocking")]; + facing=ForgeDirection.VALID_DIRECTIONS[compound.getByte("facing")]; + nbt=compound.getBoolean("nbt"); + meta=compound.getBoolean("meta"); + super.readFromNBT(compound); + } + + public void updateConnection(){ + + + for (ForgeDirection forgeDirection : ForgeDirection.VALID_DIRECTIONS) { + TileEntity tileEntity = worldObj.getTileEntity( + xCoord + forgeDirection.offsetX, + yCoord + forgeDirection.offsetY, + zCoord + forgeDirection.offsetZ); + if (tileEntity != null && tileEntity instanceof IGridHost) { + IGridNode gridNode = ((IGridHost) tileEntity).getGridNode(forgeDirection.getOpposite()); + if (gridNode != null){ + for(IGridConnection side:gridNode.getConnections()){ + IGridNode other = side.getOtherSide(gridNode); + if(other==orb.getNode()||other==stocking.getNode()){ + side.destroy();break; + } + } + + + gridNode.updateState();} + } + } + + + + + } + public ForgeDirection facing=ForgeDirection.DOWN; + ForgeDirection dirorb=ForgeDirection.DOWN; + ForgeDirection dirstocking=ForgeDirection.UP; + @Override + public IGridNode getGridNode(ForgeDirection dir) { + if (dir == dirstocking) { + return stocking.getNode(); + } + if (dir == dirorb) { + return orb.getNode(); + } + /*if (dir == ForgeDirection.UNKNOWN) { + return primary.getNode(); + }*/ + return null; + } + + public void mark(EntityPlayer player) { + + stocking.setOwner(player); + orb.setOwner(player); + primary.setOwner(player); + } + + @Override + public AECableType getCableConnectionType(ForgeDirection dir) { + + return AECableType.SMART; + } + + @Override + public void securityBreak() { + + } + + boolean init; + + + @Override + public void updateEntity() { isDead = false; + + super.updateEntity(); + } + + @Override + public IGridNode getActionableNode() { + + return primary.getNode(); + } + + @Override + public DimensionalCoord getLocation() { + + return new DimensionalCoord(this); + } + + @Override + public void gridChanged() { + + } +@Override +public void invalidate() { + this.orb.invalidate(); + this.primary.invalidate(); + this.stocking.invalidate(); + super.invalidate(); +} + +@Override +public void onChunkUnload() { + this.orb.onChunkUnload(); + this.primary.onChunkUnload(); + this.stocking.onChunkUnload(); + super.onChunkUnload(); isDead = true; +} + @Override + public AENetworkProxy getProxy() { + + return primary; + } + + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) + { + NBTTagCompound tag = pkt.func_148857_g(); + dirorb=ForgeDirection.VALID_DIRECTIONS[tag.getByte("dirorb")]; + dirstocking=ForgeDirection.VALID_DIRECTIONS[tag.getByte("dirstocking")]; + facing=ForgeDirection.VALID_DIRECTIONS[tag.getByte("facing")]; + worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord, yCoord, zCoord); + } + + @Override + public Packet getDescriptionPacket() { + + return new S35PacketUpdateTileEntity( + xCoord, + yCoord, + zCoord, + this.worldObj.getBlockMetadata(xCoord, yCoord, zCoord) + ,new NBTTagCompound(){{ + this.setByte("dirorb", (byte)dirorb.ordinal()); + this.setByte("dirstocking", (byte)dirstocking.ordinal()); + this.setByte("facing", (byte)facing.ordinal()); + }} + ); + } + public void sendPacket() { + + sendPacketToAllPlayers(getDescriptionPacket(),this.getWorldObj()); + + } + + private static void sendPacketToAllPlayers(Packet packet, World world) { + for (Object player : world.playerEntities) { + if (player instanceof EntityPlayerMP) { + ((EntityPlayerMP) player).playerNetServerHandler.sendPacket(packet); + } + } + } + protected int getGUIWidth() { + return 176; + } + + protected int getGUIHeight() { + return 107 + 18 * 3 + 18; + } + + protected boolean doesBindPlayerInventory() { + return true; + } + @Override + public ModularWindow createWindow(UIBuildContext buildContext) { + ModularWindow.Builder builder = ModularWindow.builder(getGUIWidth(), getGUIHeight()); + builder.setBackground(ModularUITextures.VANILLA_BACKGROUND); + + if (doesBindPlayerInventory()) { + builder.bindPlayerInventory(buildContext.getPlayer()); + } + + + builder.widget( + new CycleButtonWidget().setToggle(() -> nbt, s -> nbt = s) + .setTextureGetter(s -> { + if (s == 0) return GTUITextures.OVERLAY_BUTTON_CROSS; + + return GTUITextures.OVERLAY_BUTTON_CHECKMARK; + }) + .addTooltip(0, StatCollector.translateToLocal("proghatches.orb_switcher.nbt.mode.0")) + .addTooltip(1, StatCollector.translateToLocal("proghatches.orb_switcher.nbt.mode.1")) + .setBackground(() -> { + { + return new IDrawable[] { GTUITextures.BUTTON_STANDARD, }; + } + }) + .setSize(18, 18) + .setPos(3, 3)); + builder.widget( + new CycleButtonWidget().setToggle(() -> meta, s -> meta = s) + .setTextureGetter(s -> { + if (s == 0) return GTUITextures.OVERLAY_BUTTON_CROSS; + + return GTUITextures.OVERLAY_BUTTON_CHECKMARK; + }) + .addTooltip(0, StatCollector.translateToLocal("proghatches.orb_switcher.meta.mode.0")) + .addTooltip(1, StatCollector.translateToLocal("proghatches.orb_switcher.meta.mode.1")) + .setBackground(() -> { + { + return new IDrawable[] { GTUITextures.BUTTON_STANDARD, }; + } + }) + .setSize(18, 18) + .setPos(3, 3+20)); + /* builder.widget( + new CycleButtonWidget().setToggle(() -> circuit, s -> circuit = s) + .setTextureGetter(s -> { + if (s == 0) return GTUITextures.OVERLAY_BUTTON_CROSS; + + return GTUITextures.OVERLAY_BUTTON_CHECKMARK; + }) + .addTooltip(0, StatCollector.translateToLocal("proghatches.orb_switcher.circuit.mode.0")) + .addTooltip(1, StatCollector.translateToLocal("proghatches.orb_switcher.circuit.mode.1")) + .setBackground(() -> { + { + return new IDrawable[] { GTUITextures.BUTTON_STANDARD, }; + } + }) + .setSize(18, 18) + .setPos(3, 3+20));*/ + + + return builder.build(); + } + +} diff --git a/src/main/java/reobf/proghatches/block/TileReactorSyncer.java b/src/main/java/reobf/proghatches/block/TileReactorSyncer.java index d4b8bd7..62aee9f 100644 --- a/src/main/java/reobf/proghatches/block/TileReactorSyncer.java +++ b/src/main/java/reobf/proghatches/block/TileReactorSyncer.java @@ -39,14 +39,16 @@ public class TileReactorSyncer extends TileEntity implements ITileWithModularUI @Override public void validate() { + + if(this.worldObj.isRemote==false) MyMod.callbacks.put(this, this::pretick); super.validate(); - MyMod.callbacks.put(this, this::pretick); } boolean skipCycleZero; public void pretick() { if ((!isDead) && (!isInvalid())) { + if(this.worldObj.getTileEntity(xCoord, yCoord, zCoord)==this){ TileEntityNuclearReactorElectric reactor = findTarget(); if (reactor != null) tick = reactor.updateTicker % 20; @@ -65,7 +67,7 @@ public void pretick() { power = new_power; - } + }} } public int power() { diff --git a/src/main/java/reobf/proghatches/gt/metatileentity/AutoDataOrbHatch.java b/src/main/java/reobf/proghatches/gt/metatileentity/AutoDataOrbHatch.java new file mode 100644 index 0000000..cb46237 --- /dev/null +++ b/src/main/java/reobf/proghatches/gt/metatileentity/AutoDataOrbHatch.java @@ -0,0 +1,68 @@ +package reobf.proghatches.gt.metatileentity; + +import com.google.common.collect.ImmutableMap; + +import gregtech.api.GregTechAPI; +import gregtech.api.enums.ItemList; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.MTEHatchElementalDataOrbHolder; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; +import reobf.proghatches.main.registration.Registration; + +public class AutoDataOrbHatch extends MTEHatchElementalDataOrbHolder{ + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + + return new AutoDataOrbHatch(mName,mTier, mDescriptionArray, mTextures); + } + public AutoDataOrbHatch(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier); + Registration.items.add(new ItemStack(GregTechAPI.sBlockMachines, 1, aID)); + } + String[] descCache; + @Override + public String[] getDescription() { + + return descCache==null?(descCache=reobf.proghatches.main.Config.get("ADOH", ImmutableMap.of())):descCache; + } + public AutoDataOrbHatch(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + + } @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, + ItemStack aStack) { + + return aIndex < mInventory.length - 1 + &&ItemList.Tool_DataOrb.isStackEqual(aStack, false, true); + //&& side == getBaseMetaTileEntity().getFrontFacing(); + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, + ItemStack aStack) { + + return aIndex < mInventory.length - 1 + &&ItemList.Tool_DataOrb.isStackEqual(aStack, false, true); + // && side == getBaseMetaTileEntity().getFrontFacing(); + } + @Override + public boolean canInsertItem(int aIndex, ItemStack aStack, int ordinalSide) { + + return aIndex < mInventory.length - 1 + &&ItemList.Tool_DataOrb.isStackEqual(aStack, false, true) + ; + } + + @Override + public boolean canExtractItem(int aIndex, ItemStack aStack, int ordinalSide) { + return aIndex < mInventory.length - 1 + &&ItemList.Tool_DataOrb.isStackEqual(aStack, false, true) + ; + } + +} diff --git a/src/main/java/reobf/proghatches/gt/metatileentity/NBTHatchMECatalyst.java b/src/main/java/reobf/proghatches/gt/metatileentity/NBTHatchMECatalyst.java new file mode 100644 index 0000000..b0f7f3b --- /dev/null +++ b/src/main/java/reobf/proghatches/gt/metatileentity/NBTHatchMECatalyst.java @@ -0,0 +1,403 @@ +package reobf.proghatches.gt.metatileentity; + +import java.util.EnumSet; +import java.util.List; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; + +import appeng.api.config.Actionable; +import appeng.api.networking.GridFlags; +import appeng.api.networking.IGridNode; +import appeng.api.networking.events.MENetworkCellArrayUpdate; +import appeng.api.networking.security.BaseActionSource; +import appeng.api.networking.security.MachineSource; +import appeng.api.storage.ICellContainer; +import appeng.api.storage.IMEInventory; +import appeng.api.storage.IMEInventoryHandler; +import appeng.api.storage.StorageChannel; +import appeng.api.storage.data.IAEItemStack; +import appeng.api.storage.data.IItemList; +import appeng.api.util.DimensionalCoord; +import appeng.helpers.IPriorityHost; +import appeng.me.GridAccessException; +import appeng.me.helpers.AENetworkProxy; +import appeng.me.helpers.IGridProxyable; +import appeng.me.storage.MEInventoryHandler; +import appeng.util.Platform; +import appeng.util.item.AEItemStack; +import gregtech.api.GregTechAPI; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.nbthandlers.MTEHatchCatalysts; +import gtnhlanth.common.hatch.MTEBusInputFocus; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import reobf.proghatches.gt.metatileentity.SuperChestME.UnlimitedWrapper; +import reobf.proghatches.gt.metatileentity.util.IStoageCellUpdate; +import reobf.proghatches.main.registration.Registration; + +public class NBTHatchMECatalyst extends MTEHatchCatalysts implements ICellContainer, IGridProxyable, IStoageCellUpdate{ + public NBTHatchMECatalyst(int id, String name, String nameRegional) { + super(id, name, nameRegional); + Registration.items.add(new ItemStack(GregTechAPI.sBlockMachines, 1, id)); + } + public NBTHatchMECatalyst(String name, String[] descriptionArray, ITexture[][][] textures) { + super(name, descriptionArray, textures); + + } +String[] descCache; +@Override +public String[] getDescription() { + + return descCache==null?(descCache=reobf.proghatches.main.Config.get("HMEC", ImmutableMap.of())):descCache; +} + /*@Override + public boolean isItemValidForUsageSlot(ItemStack aStack) { + return false; + }*/ + @Override + public IGridNode getActionableNode() { + + return getProxy().getNode(); + } + @Override + public IGridNode getGridNode(ForgeDirection dir) { + + return getProxy().getNode(); + } + @Override + public void securityBreak() { + } + public int getIndex(){ + + return getInputSlotCount(); + } + IMEInventoryHandler handler = new MEInventoryHandler(new UnlimitedWrapper(), StorageChannel.ITEMS) ; + public class UnlimitedWrapper implements IMEInventory { + + public UnlimitedWrapper() { + + } + + @Override + public IAEItemStack injectItems(IAEItemStack input, Actionable type, BaseActionSource src) { + if (type != Actionable.SIMULATE)post(); + + if(input==null){ + return input; + } + if(!isItemValidForUsageSlot(input.getItemStack())){ + return input; + } + + try { + long l = input.getStackSize(); + long compl = 0; + if (l > Integer.MAX_VALUE) { + compl = l - Integer.MAX_VALUE; + } + ItemStack in = input.getItemStack(); + ItemStack thiz = mInventory[getIndex()]; + if (thiz != null && !Platform.isSameItem(in, thiz)) return input; + if (thiz == null) { + thiz = in.copy(); + thiz.stackSize = 0; + } + int space = Math.max(0, cap() - thiz.stackSize); + int transfer = Math.min(space, in.stackSize); + if (type == Actionable.SIMULATE) { + in.stackSize -= transfer; + if (in.stackSize <= 0 && compl == 0) in = null; + AEItemStack ret = AEItemStack.create(in); + if (ret != null) ret.incStackSize(compl); + return ret; + } + if (type == Actionable.MODULATE) { + thiz.stackSize += transfer; + mInventory[getIndex()] = thiz; + in.stackSize -= transfer; + if (in.stackSize <= 0 && compl == 0) in = null; + AEItemStack ret = AEItemStack.create(in); + if (ret != null) ret.incStackSize(compl); + return ret; + + } + + return null; + } finally { + last = AEItemStack.create(mInventory[getIndex()]); + + } + } + + + + @Override + public IAEItemStack extractItems(IAEItemStack input, Actionable type, BaseActionSource src) { + try { + + if (type != Actionable.SIMULATE) post(); + + ItemStack in = input.getItemStack(); + ItemStack thiz = mInventory[getIndex()]; + if (thiz != null && !Platform.isSameItem(in, thiz)) return null; + if (thiz == null) { + return null; + } // thiz=in.copy(); } + int transfer = Math.min(in.stackSize, thiz.stackSize); + if (transfer == 0) return null; + if (type == Actionable.SIMULATE) { + in.stackSize = transfer; + return AEItemStack.create(in); + + } + if (type == Actionable.MODULATE) { + thiz.stackSize -= transfer; + if (thiz.stackSize <= 0) thiz = null; + mInventory[getIndex()] = thiz; + in.stackSize = transfer; + return AEItemStack.create(in); + } + + return null; + } finally { + + last = AEItemStack.create(mInventory[getIndex()]); + } + } + + @Override + public IItemList getAvailableItems(IItemList out) { + if (mInventory[getIndex()] != null) out.addStorage(AEItemStack.create(mInventory[getIndex()])); + return out; + } + + @Override + public StorageChannel getChannel() { + + return StorageChannel.ITEMS; + } + } + + private AEItemStack last; + + private void post() { + + try { + + // this.getProxy().getGrid().postEvent(new MENetworkCellArrayUpdate()); + // this.getProxy().getGrid().postEvent(new MENetworkStorageEvent(handler0, StorageChannel.ITEMS)); + try { + + if (last != null) { + if (mInventory[getIndex()] != null) { + if (last.equals(mInventory[getIndex()])) { + if (last.getStackSize() == mInventory[getIndex()].stackSize) { + return; + } else { + + this.getProxy() + .getStorage() + .postAlterationOfStoredItems( + StorageChannel.ITEMS, + ImmutableList.of( + last.copy() + .setStackSize(mInventory[getIndex()].stackSize - last.getStackSize())), + new MachineSource(this)); + last = AEItemStack.create(mInventory[getIndex()]); + return; + } + } + + } ; + + this.getProxy() + .getStorage() + .postAlterationOfStoredItems( + StorageChannel.ITEMS, + ImmutableList.of( + last.copy() + .setStackSize(-last.getStackSize())), + new MachineSource(this)); + } + last = AEItemStack.create(mInventory[getIndex()]); + if (last != null) { + this.getProxy() + .getStorage() + .postAlterationOfStoredItems( + StorageChannel.ITEMS, + ImmutableList.of( + last.copy() + .setStackSize(last.getStackSize())), + new MachineSource(this)); + } + + } catch (final GridAccessException ignore) {} + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + @Override + public List getCellArray(StorageChannel channel) { + if(channel==StorageChannel.FLUIDS)return ImmutableList.of(); + + return ImmutableList.of(handler); + } + @Override + public int getPriority() { + + return 0; + } + @Override + public void saveChanges(IMEInventory cellInventory) { + markDirty(); + + } + @Override + public void cellUpdate() { + markDirty(); + update = true; + } + @Override + public DimensionalCoord getLocation() { + + return new DimensionalCoord((TileEntity)this.getBaseMetaTileEntity()); + } + AENetworkProxy gridProxy; + @Override + public AENetworkProxy getProxy() { + + if (gridProxy == null) { + gridProxy = new AENetworkProxy(this, "proxy", visualStack(), true); + gridProxy.setFlags(GridFlags.REQUIRE_CHANNEL); + updateValidGridProxySides(); + if (getBaseMetaTileEntity().getWorld() != null) gridProxy.setOwner( + getBaseMetaTileEntity().getWorld() + .getPlayerEntityByName(getBaseMetaTileEntity().getOwnerName())); + } + + return this.gridProxy;} + + private ItemStack visualStack() { + return new ItemStack(GregTechAPI.sBlockMachines, 1, getBaseMetaTileEntity().getMetaTileID()); + } + + @Override + public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { + + super.onFirstTick(aBaseMetaTileEntity); + getProxy().onReady(); + // onColorChangeServer(aBaseMetaTileEntity.getColorization()); + post(); + } boolean wasActive; + boolean update; + int rep; + public void updateStatus() { + + post(); + + } + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + + boolean active = this.getProxy() + .isActive(); + if (!aBaseMetaTileEntity.getWorld().isRemote) { + if (aTick % 40 == 1) { + post(); + } + + if (rep > 0) { + rep--; + update = true; + } + if (this.getBaseMetaTileEntity() + .hasInventoryBeenModified()) { + update = true; + rep = 1; + } ; + + if (update) { + update = false; + updateStatus(); + } + if (wasActive != active) { + wasActive = active; + + try { + this.getProxy() + .getGrid() + .postEvent(new MENetworkCellArrayUpdate()); + } catch (GridAccessException e) { + + } + post(); + } + + + + if (!aBaseMetaTileEntity.getWorld().isRemote && (aTick & 16) != 0) { + this.getBaseMetaTileEntity() + .setActive( + this.getProxy() + .isPowered() && active); + + } + + + + } + super.onPostTick(aBaseMetaTileEntity, aTick); + + if (aBaseMetaTileEntity.getWorld().isRemote) { + return; + } + + boolean needToSort = false; + for (int i = 1; i < mInventory.length; i++) { + ItemStack is = mInventory[i]; + if (is == null) continue; + markDirty(); + if (mInventory[getIndex()] == null) { + mInventory[getIndex()] = is.copy(); + mInventory[i] = null; + } else if (cap() - is.stackSize >= mInventory[getIndex()].stackSize) { + mInventory[getIndex()].stackSize += is.stackSize; + mInventory[i] = null; + } else { + int to = Math.min(cap() - mInventory[getIndex()].stackSize, is.stackSize); + mInventory[getIndex()].stackSize += to; + mInventory[i].stackSize -= to; + needToSort = true; + } + } + if (needToSort) fillStacksIntoFirstSlots(); + + } + private int cap() { + + return 1; + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + + return new NBTHatchMECatalyst(mName, mDescriptionArray, mTextures); + } + private void updateValidGridProxySides() { + /* + * if (disabled) { + * getProxy().setValidSides(EnumSet.noneOf(ForgeDirection.class)); + * return; + * } + */ + getProxy().setValidSides(EnumSet.complementOf(EnumSet.of(ForgeDirection.UNKNOWN))); + + } +} diff --git a/src/main/java/reobf/proghatches/gt/metatileentity/NBTHatchMEFocus.java b/src/main/java/reobf/proghatches/gt/metatileentity/NBTHatchMEFocus.java index 7d1de83..abba9a6 100644 --- a/src/main/java/reobf/proghatches/gt/metatileentity/NBTHatchMEFocus.java +++ b/src/main/java/reobf/proghatches/gt/metatileentity/NBTHatchMEFocus.java @@ -244,6 +244,7 @@ private void post() { } @Override public List getCellArray(StorageChannel channel) { + if(channel==StorageChannel.FLUIDS)return ImmutableList.of(); return ImmutableList.of(handler); } diff --git a/src/main/java/reobf/proghatches/main/CommonProxy.java b/src/main/java/reobf/proghatches/main/CommonProxy.java index bc78557..0aed7a6 100644 --- a/src/main/java/reobf/proghatches/main/CommonProxy.java +++ b/src/main/java/reobf/proghatches/main/CommonProxy.java @@ -23,6 +23,7 @@ import reobf.proghatches.ae.BlockCraftingCondenser; import reobf.proghatches.ae.BlockCyclicPatternSubmitter; import reobf.proghatches.ae.BlockMolecularAssemblerInterface; +import reobf.proghatches.ae.BlockOrbSwitcher; import reobf.proghatches.ae.BlockRequestTunnel; import reobf.proghatches.ae.BlockStockingCircuitRequestInterceptor; import reobf.proghatches.ae.BlockStorageProxy; @@ -36,6 +37,7 @@ import reobf.proghatches.ae.TileCraftingCondenser; import reobf.proghatches.ae.TileCyclicPatternSubmitter; import reobf.proghatches.ae.TileMolecularAssemblerInterface; +import reobf.proghatches.ae.TileOrbSwitcher; import reobf.proghatches.ae.TileRequestTunnel; import reobf.proghatches.ae.TileStockingCircuitRequestInterceptor; import reobf.proghatches.ae.TileStorageProxy; @@ -105,6 +107,7 @@ public void preInit(FMLPreInitializationEvent event) { GameRegistry.registerTileEntity(TileAutoFillerMKII.class, "proghatches.autofillerMKII"); GameRegistry.registerTileEntity(TileGTHatchConfigurator.class, "proghatches.configurator"); GameRegistry.registerTileEntity(TileRequestTunnel.class, "proghatches.request_tunnel"); + GameRegistry.registerTileEntity(TileOrbSwitcher.class, "proghatches.orb_switcher"); ItemMEPlunger a = new ItemMEPlunger(100000); GameRegistry.registerItem( @@ -269,7 +272,11 @@ public void preInit(FMLPreInitializationEvent event) { ItemBlockTooltip.class, "autofillerMKII", new Object[] { "" }); - + GameRegistry.registerBlock( + MyMod.orbswitcher = new BlockOrbSwitcher(), + ItemBlockTooltip.class, + "orbswitcher", + new Object[] { "" }); GameRegistry.registerTileEntity(TileCraftingCondenser.class, "proghatches.craftingdumper"); GameRegistry.registerBlock(MyMod.ma_iface = new BlockMolecularAssemblerInterface(), ItemBlockTooltip.class diff --git a/src/main/java/reobf/proghatches/main/MyMod.java b/src/main/java/reobf/proghatches/main/MyMod.java index 6605d59..4b30f8c 100644 --- a/src/main/java/reobf/proghatches/main/MyMod.java +++ b/src/main/java/reobf/proghatches/main/MyMod.java @@ -82,6 +82,7 @@ import reobf.proghatches.Tags; import reobf.proghatches.ae.BlockAutoFillerMKII; import reobf.proghatches.ae.BlockMolecularAssemblerInterface; +import reobf.proghatches.ae.BlockOrbSwitcher; import reobf.proghatches.ae.BlockRequestTunnel; import reobf.proghatches.block.ChunkTrackingGridCahce; import reobf.proghatches.block.TileIOHub; @@ -777,10 +778,11 @@ public void init(Entity entity, World world) { public static Item emitterpattern; public static boolean newGTCache; public static Item part_tunnel; + public static BlockOrbSwitcher orbswitcher; @SubscribeEvent(priority = EventPriority.HIGH, receiveCanceled = false) public void pretick(final TickEvent.ServerTickEvent event) { - if (event.phase == Phase.START && event.side == Side.SERVER) { + if (event.phase == Phase.START && event.side == Side.SERVER&&event.type==TickEvent.Type.SERVER) { callbacks.forEach((a, b) -> b.run()); } } diff --git a/src/main/java/reobf/proghatches/main/registration/PHRecipes.java b/src/main/java/reobf/proghatches/main/registration/PHRecipes.java index b489bfc..b43d14f 100644 --- a/src/main/java/reobf/proghatches/main/registration/PHRecipes.java +++ b/src/main/java/reobf/proghatches/main/registration/PHRecipes.java @@ -2040,6 +2040,21 @@ public void run() { .duration(1 * SECONDS) .eut(30) .addTo(RecipeMaps.assemblerRecipes); + + GTValues.RA.stdBuilder() + .itemInputs( + Api.INSTANCE.parts().partStorageBus.stack(1) + , + GregtechItemList.Bus_Catalysts.get(1) + ) + .itemOutputs( new ItemStack( + GregTechAPI.sBlockMachines, + 1, + Config.metaTileEntityOffset + Registration.MECatalystOffset)) + .duration(1 * SECONDS) + .eut(30) + .addTo(RecipeMaps.assemblerRecipes); + /* * rec = new ShapelessOreRecipe( new ItemStack( MyMod.plunger,1,1), * ItemEnum.BOOSTER_CARD.getStack(0), diff --git a/src/main/java/reobf/proghatches/main/registration/ProgHatchCreativeTab.java b/src/main/java/reobf/proghatches/main/registration/ProgHatchCreativeTab.java index b833e0d..da82eac 100644 --- a/src/main/java/reobf/proghatches/main/registration/ProgHatchCreativeTab.java +++ b/src/main/java/reobf/proghatches/main/registration/ProgHatchCreativeTab.java @@ -104,7 +104,7 @@ public void displayAllReleventItems(List p_78018_1_) { p_78018_1_.add(new ItemStack(MyMod.cover, 1, 94)); p_78018_1_.add(new ItemStack(MyMod.emitterpattern)); p_78018_1_.add(new ItemStack(MyMod.request_tunnel)); - + p_78018_1_.add(new ItemStack(MyMod.orbswitcher)); } @Override diff --git a/src/main/java/reobf/proghatches/main/registration/Registration.java b/src/main/java/reobf/proghatches/main/registration/Registration.java index a2ef992..7df86a8 100644 --- a/src/main/java/reobf/proghatches/main/registration/Registration.java +++ b/src/main/java/reobf/proghatches/main/registration/Registration.java @@ -37,6 +37,7 @@ import reobf.proghatches.gt.cover.ProgrammingCover; import reobf.proghatches.gt.cover.SmartArmCover; import reobf.proghatches.gt.cover.WirelessControlCover; +import reobf.proghatches.gt.metatileentity.AutoDataOrbHatch; import reobf.proghatches.gt.metatileentity.BufferedDualInputHatch; import reobf.proghatches.gt.metatileentity.CommunicationPortHatch; import reobf.proghatches.gt.metatileentity.DataHatchME; @@ -51,6 +52,7 @@ import reobf.proghatches.gt.metatileentity.FilterOutputBus; import reobf.proghatches.gt.metatileentity.IngredientBuffer; import reobf.proghatches.gt.metatileentity.MultiCircuitInputBus; +import reobf.proghatches.gt.metatileentity.NBTHatchMECatalyst; import reobf.proghatches.gt.metatileentity.NBTHatchMEFocus; import reobf.proghatches.gt.metatileentity.PatternDualInputHatch; import reobf.proghatches.gt.metatileentity.PatternDualInputHatchInventoryMappingSlave; @@ -99,8 +101,9 @@ public class Registration implements Runnable { public final static int IngBufferOffset = 79;// -80 public final static int WaterProviderOffset = 81; public final static int MEFocusOffset = 82; - - + public final static int DataOrbOffset = 83; + public final static int MECatalystOffset = 84; + public final static int BufferedQuadDualInputHatchOffset = 100;// -115 public final static int LargeProviderOffset = 116; public final static int ChainerOffset = 117; @@ -562,12 +565,18 @@ public boolean supportsFluids() { LangManager.translateToLocalFormatted("provider.water.name"), 6 ); - + new NBTHatchMECatalyst( + Config.metaTileEntityOffset + MECatalystOffset, + "input.catalyst.me", + LangManager.translateToLocal("input.catalyst.me.name")); new NBTHatchMEFocus( Config.metaTileEntityOffset + MEFocusOffset, "input.focus.me", LangManager.translateToLocal("input.focus.me.name")); - + new AutoDataOrbHatch( + Config.metaTileEntityOffset + DataOrbOffset, + "input.dataorb", + LangManager.translateToLocal("input.dataorb.name"), 10); diff --git a/src/main/resources/assets/proghatches/lang/en_US.lang b/src/main/resources/assets/proghatches/lang/en_US.lang index 3bd2921..6cfe447 100644 --- a/src/main/resources/assets/proghatches/lang/en_US.lang +++ b/src/main/resources/assets/proghatches/lang/en_US.lang @@ -748,3 +748,17 @@ programmable_hatches.gt.newcrib.nosupport=§cNot supported on current GT5u item.proghatches.part.tunnel.name=Crafting Request Tunnel provider.water.name=Water Provider input.focus.me.name=Automatable Focus Input Bus(ME) +input.dataorb.name=Automatable Data Orb Repository +proghatches.orb_switcher.nbt.mode.0=Match NBT: false +proghatches.orb_switcher.nbt.mode.1=Match NBT: true +proghatches.orb_switcher.meta.mode.0=Match meta: false +proghatches.orb_switcher.meta.mode.1=Match meta: true +proghatch.orb_switcher.tooltip.0=Switch the special item in Hatch according to the item in circuit slot +proghatch.orb_switcher.tooltip.1=Connect Stocking Port(blue) to stocking ME Network conatining all possible items. +proghatch.orb_switcher.tooltip.2=Connect Target Port(green) to ME Network accessible to the special Hatch . +proghatch.orb_switcher.tooltip.3=Turn the front side with a wrench to a GT Blcok with circuit slot. +proghatch.orb_switcher.tooltip.4=Then this device will maintain Target ME Network +proghatch.orb_switcher.tooltip.5=to make sure it only has one item same as the one in circuit slot. +proghatch.orb_switcher.tooltip.6=Hint: use this to automate Power Plant Catalyst/Target Chamer Foci/Element Orb Hatch +input.catalyst.me.name=Automatable Catalyst Housing(ME) +tile.proghatches.orb_switcher.name=Catalyst Item Switcher(WIP) diff --git a/src/main/resources/assets/proghatches/lang/en_US/ADOH.lang b/src/main/resources/assets/proghatches/lang/en_US/ADOH.lang new file mode 100644 index 0000000..1f46416 --- /dev/null +++ b/src/main/resources/assets/proghatches/lang/en_US/ADOH.lang @@ -0,0 +1,4 @@ +Holds Data Orbs for the Elemental Duplicator +Cannot insert/extract the circuit slot +Can insert/extract Data Orbs +A circuit must be used to select a slot (1-16) \ No newline at end of file diff --git a/src/main/resources/assets/proghatches/lang/en_US/HMEC.lang b/src/main/resources/assets/proghatches/lang/en_US/HMEC.lang new file mode 100644 index 0000000..d12a7ae --- /dev/null +++ b/src/main/resources/assets/proghatches/lang/en_US/HMEC.lang @@ -0,0 +1,4 @@ +Input Bus for Catalyst +Connect ME Network to access the first Active Catalyst slot +Not a Stocking Input Bus! +You still need to automate the Catalyst switching process \ No newline at end of file diff --git a/src/main/resources/assets/proghatches/lang/zh_CN.lang b/src/main/resources/assets/proghatches/lang/zh_CN.lang index d67bf2d..51420f3 100644 --- a/src/main/resources/assets/proghatches/lang/zh_CN.lang +++ b/src/main/resources/assets/proghatches/lang/zh_CN.lang @@ -746,3 +746,17 @@ programmable_hatches.gt.newcrib.nosupport=§c当前版本GT5u没有缓存机制 item.proghatches.part.tunnel.name=合成请求隧道 provider.water.name=水提供器 input.focus.me.name=自动化焦点输入总线(ME) +input.dataorb.name=自动化数据球仓 +proghatches.orb_switcher.nbt.mode.0=匹配 NBT: false +proghatches.orb_switcher.nbt.mode.1=匹配NBT: true +proghatches.orb_switcher.meta.mode.0=匹配损害值: false +proghatches.orb_switcher.meta.mode.1=匹配损害值: true +proghatch.orb_switcher.tooltip.0=根据电路板中物品更换仓内特殊物品 +proghatch.orb_switcher.tooltip.1=库存端口(蓝色)连接包含所有可能物品的库存网络 +proghatch.orb_switcher.tooltip.2=目标端口(蓝色)连接放置特殊物品的仓 +proghatch.orb_switcher.tooltip.3=用扳手将正面指向一个带有电路板槽的GT方块 +proghatch.orb_switcher.tooltip.4=这个机器会根据电路板槽内物品 +proghatch.orb_switcher.tooltip.5=维持目标网络中物品,为数量为1的电路板槽内相同物品 +proghatch.orb_switcher.tooltip.6=提示:用于自动化化工厂催化剂/靶仓聚焦物品/元素数据球仓 +input.catalyst.me.name=自动化催化剂仓(ME) +tile.proghatches.orb_switcher.name=催化剂物品切换器(WIP) diff --git a/src/main/resources/assets/proghatches/lang/zh_CN/ADOH.lang b/src/main/resources/assets/proghatches/lang/zh_CN/ADOH.lang new file mode 100644 index 0000000..e40a001 --- /dev/null +++ b/src/main/resources/assets/proghatches/lang/zh_CN/ADOH.lang @@ -0,0 +1,4 @@ +为大型元素复制机存储数据球 +电路板槽不再能插入/拔出 +数据球可以插入/拔出 +必须使用编程电路指定生效数据球(1-16) \ No newline at end of file diff --git a/src/main/resources/assets/proghatches/lang/zh_CN/HMEC.lang b/src/main/resources/assets/proghatches/lang/zh_CN/HMEC.lang new file mode 100644 index 0000000..a864820 --- /dev/null +++ b/src/main/resources/assets/proghatches/lang/zh_CN/HMEC.lang @@ -0,0 +1,4 @@ +催化剂的输入总线 +连接ME网络访问活跃区的第一个催化剂 +并非存储输入总线! +你依然需要自动化催化剂更换过程 \ No newline at end of file diff --git a/src/main/resources/assets/proghatches/textures/blocks/switch.png b/src/main/resources/assets/proghatches/textures/blocks/switch.png new file mode 100644 index 0000000000000000000000000000000000000000..1e79dc896b34ec8e487d41974779523b3540c857 GIT binary patch literal 139 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucK?P42#}EtuPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0Zd6mK~y+Tl~UPG z!cY{v3wHS#AK=}@7>o@9y%q&Q{V8Ak0V0?pi-5A2nCNSNqMy+Mb=rF?K3LI7mzieH zIdgJLqbMT(0aI^6gb+Ikur2r_;z-{c`~u(iJd|241U|AQ@%#X0_8E;>+cg9Ry)wOediJ zX|NDA%eg4I-AUY!lJ5Pec`aHuXCRm&omuA)XHXUyH&rSU{*Q9C*ms}7F(isMn+-j0 zR66YeyvVi+RU}mqh9QPpr-zKOAPAEF*qGUl1rlO|)ml2^Ln#yrQv3)QP$M}`I@S{T he10bZvX;&OA)i{slyOJAfO7x<002ovPDHLkV1fnzvTpzY literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/proghatches/textures/blocks/switch_orb.png b/src/main/resources/assets/proghatches/textures/blocks/switch_orb.png new file mode 100644 index 0000000000000000000000000000000000000000..2635f82f1eaa699fbb1414f84bf2298889f04790 GIT binary patch literal 196 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!AMUR#}Etu>s;O~n_H~EIgobsD99l<{7wWLJeVg9BP)9LB`oti~s*$q_{vKM2csF#mTNl&b|ds9ti?% uLSnqfCH@^04B_Am5L@GHq-$uvz;IY{^5;$5(o2ALF?hQAxvX