diff --git a/build.gradle b/build.gradle index 12d226f..cdaf8ea 100644 --- a/build.gradle +++ b/build.gradle @@ -372,7 +372,7 @@ catch (Exception ignored) { // Pulls version first from the VERSION env and then git tag String identifiedVersion = null -String versionOverride = '0.0.5' +String versionOverride = '0.0.6' try { // Produce a version based on the tag, or for branches something like 0.2.2-configurable-maven-and-extras.38+43090270b6-dirty if (versionOverride == null) { diff --git a/src/main/java/reobf/proghatches/eucrafting/BlockEUInterface.java b/src/main/java/reobf/proghatches/eucrafting/BlockEUInterface.java index 10665b4..fcec03f 100644 --- a/src/main/java/reobf/proghatches/eucrafting/BlockEUInterface.java +++ b/src/main/java/reobf/proghatches/eucrafting/BlockEUInterface.java @@ -31,6 +31,7 @@ import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; @@ -50,7 +51,12 @@ public class BlockEUInterface extends AEBaseTileBlock{ - @Override + private IIcon back; + private IIcon arr; + + + + @Override protected boolean hasCustomRotation() { return true; } @@ -61,6 +67,18 @@ protected void customRotateBlock(final IOrientable rotatable, final ForgeDirecti ((TileInterface) rotatable).setSide(axis); } } +@Override@SideOnly(Side.CLIENT) +public void registerBlockIcons(IIconRegister i) { + super.registerBlockIcons(i); + this.blockIcon = i.registerIcon("proghatches:eu_interface"); + this.back = i.registerIcon("proghatches:eu_interface_a"); + this.arr = i.registerIcon("proghatches:eu_interface_arrow"); + +}@Override +public String getTextureName() { + + return "proghatches:eu_interface"; +} @Override @SideOnly(Side.CLIENT) @@ -78,9 +96,9 @@ public boolean renderInWorld(final BlockEUInterface block, final IBlockAccess wo final BlockRenderInfo info = block.getRendererInstance(); if (ti != null && ti.getForward() != ForgeDirection.UNKNOWN) { - final IIcon side = FCPartsTexture.BlockFluidInterfaceAlternate_Arrow.getIcon(); + final IIcon side = arr; info.setTemporaryRenderIcons( - FCPartsTexture.BlockInterfaceAlternate.getIcon(), + back, block.getIcon(0, 0), side, side, diff --git a/src/main/java/reobf/proghatches/eucrafting/IEUSource.java b/src/main/java/reobf/proghatches/eucrafting/IEUSource.java index de6dd36..1f7a1d9 100644 --- a/src/main/java/reobf/proghatches/eucrafting/IEUSource.java +++ b/src/main/java/reobf/proghatches/eucrafting/IEUSource.java @@ -58,6 +58,7 @@ public EUSource(final IGrid g) { public long inject(ISource s,long amp,long v){ + if(amp==0){return 0;} //long v=s.getVoltage(); //use actual voltage long[] a=new long[]{amp}; cache.get(s.getVoltage()).stream().map(d->{ diff --git a/src/main/java/reobf/proghatches/eucrafting/ItemEUToken.java b/src/main/java/reobf/proghatches/eucrafting/ItemEUToken.java index 6b53912..bab69ad 100644 --- a/src/main/java/reobf/proghatches/eucrafting/ItemEUToken.java +++ b/src/main/java/reobf/proghatches/eucrafting/ItemEUToken.java @@ -5,12 +5,20 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; import reobf.proghatches.util.ProghatchesUtil; public class ItemEUToken extends Item{ + private IIcon bound; + + + + + @SuppressWarnings({ "rawtypes", "unchecked" }) @SideOnly(Side.CLIENT) @Override @@ -30,6 +38,27 @@ public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p }); } + + @SideOnly(Side.CLIENT) + @Override + public IIcon getIconFromDamage( int d) { + if(d==1){ + + + return bound;} + return itemIcon; + }@SideOnly(Side.CLIENT) + @Override + public void registerIcons(IIconRegister register) { + + this.itemIcon=register.registerIcon("proghatches:eu"); + this.bound=register.registerIcon("proghatches:eu_bound"); + } + + + + + @Override public String getUnlocalizedName(ItemStack stack) { if(stack.getItemDamage()==1){ diff --git a/src/main/java/reobf/proghatches/eucrafting/PartEUSource.java b/src/main/java/reobf/proghatches/eucrafting/PartEUSource.java index fffb251..0fc8adc 100644 --- a/src/main/java/reobf/proghatches/eucrafting/PartEUSource.java +++ b/src/main/java/reobf/proghatches/eucrafting/PartEUSource.java @@ -120,14 +120,14 @@ public void renderInventory(final IPartRenderHelper rh, final RenderBlocks rende sideTexture); rh.renderInventoryBox(renderer); - rh.setInvColor(this.getColor().whiteVariant); - rh.renderInventoryFace(this.getFrontBright(), ForgeDirection.SOUTH, renderer); + // rh.setInvColor(this.getColor().whiteVariant); + // rh.renderInventoryFace(this.getFrontBright(), ForgeDirection.SOUTH, renderer); rh.setInvColor(this.getColor().mediumVariant); rh.renderInventoryFace(this.getFrontBright(), ForgeDirection.SOUTH, renderer); - rh.setInvColor(this.getColor().blackVariant); - rh.renderInventoryFace(this.getFrontColored(), ForgeDirection.SOUTH, renderer); + // rh.setInvColor(this.getColor().blackVariant); + // rh.renderInventoryFace(this.getFrontColored(), ForgeDirection.SOUTH, renderer); rh.setBounds(4, 4, 13, 12, 12, 14); rh.renderInventoryBox(renderer); @@ -170,14 +170,14 @@ public void renderStatic(final int x, final int y, final int z, final IPartRende renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = this .getSpin(); - Tessellator.instance.setColorOpaque_I(this.getColor().whiteVariant); - rh.renderFace(x, y, z, this.getFrontBright(), ForgeDirection.SOUTH, renderer); + // Tessellator.instance.setColorOpaque_I(this.getColor().whiteVariant); + // rh.renderFace(x, y, z, this.getFrontBright(), ForgeDirection.SOUTH, renderer); Tessellator.instance.setColorOpaque_I(this.getColor().mediumVariant); rh.renderFace(x, y, z, this.getFrontBright(), ForgeDirection.SOUTH, renderer); - Tessellator.instance.setColorOpaque_I(this.getColor().blackVariant); - rh.renderFace(x, y, z, this.getFrontColored(), ForgeDirection.SOUTH, renderer); + // Tessellator.instance.setColorOpaque_I(this.getColor().blackVariant); + // rh.renderFace(x, y, z, this.getFrontColored(), ForgeDirection.SOUTH, renderer); renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0; @@ -236,7 +236,7 @@ private int getSpin() { public static void registerIcons(IIconRegister _iconRegister) { - a=_iconRegister.registerIcon("sss"); + a=_iconRegister.registerIcon("proghatches:eu_interface"); } diff --git a/src/main/java/reobf/proghatches/gt/cover/RecipeCheckResultCover.java b/src/main/java/reobf/proghatches/gt/cover/RecipeCheckResultCover.java index 3af2a77..d44c3f6 100644 --- a/src/main/java/reobf/proghatches/gt/cover/RecipeCheckResultCover.java +++ b/src/main/java/reobf/proghatches/gt/cover/RecipeCheckResultCover.java @@ -1,52 +1,210 @@ package reobf.proghatches.gt.cover; +import java.lang.reflect.Field; +import java.util.Arrays; + +import com.google.common.io.ByteArrayDataInput; + import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.BaseMetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.recipe.check.CheckRecipeResult; +import gregtech.api.recipe.check.CheckRecipeResultRegistry; import gregtech.api.util.GT_CoverBehavior; +import gregtech.api.util.GT_CoverBehaviorBase; +import gregtech.api.util.ISerializableObject; +import io.netty.buffer.ByteBuf; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import reobf.proghatches.gt.cover.WirelessControlCover.Data; + +public class RecipeCheckResultCover extends GT_CoverBehaviorBase { + + public RecipeCheckResultCover() { + super(Data.class); + + } + + public static class Data implements ISerializableObject { + private int pulses; + private int lastSuccess; + + public void loadDataFromNBT(NBTBase aNBTt) { + + NBTTagCompound aNBT = (NBTTagCompound) aNBTt; + lastSuccess = aNBT.getInteger("lastSuccess"); + pulses = aNBT.getInteger("pulses"); + + } + + public NBTBase saveDataToNBT() { + NBTTagCompound aNBT = new NBTTagCompound(); + + aNBT.setInteger("lastSuccess", lastSuccess); + aNBT.setInteger("pulses", pulses); + return aNBT; + } + + @Override + public ISerializableObject copy() { + Data d = new Data(); + d.loadDataFromNBT(this.saveDataToNBT()); + ; + return d; + } + + @Override + public void writeToByteBuf(ByteBuf aBuf) { + aBuf.writeInt(pulses); + aBuf.writeInt(lastSuccess); + } + + @Override + public ISerializableObject readFromPacket(ByteArrayDataInput aBuf, EntityPlayerMP aPlayer) { + Data d = new Data(); + d.pulses = aBuf.readInt(); + d.lastSuccess = aBuf.readInt(); + + return d; + } + + } + + @Override + protected int getTickRateImpl(ForgeDirection side, int aCoverID, Data aCoverVariable, ICoverable aTileEntity) { + + return 1; + } + + @Override + public boolean allowsTickRateAddition() { + + return false; + } + + @Override + protected boolean manipulatesSidedRedstoneOutputImpl(ForgeDirection side, int aCoverID, Data aCoverVariable, + ICoverable aTileEntity) { + + return true; + } + + private static int check(CheckRecipeResult crr) { + if (crr.wasSuccessful()) + return 1; + if (crr == CheckRecipeResultRegistry.NO_RECIPE) + return 0; + return 2; + } + + public static void start(int lastSuccess, int newSuccess, Data d) { + + if (lastSuccess == 1 && newSuccess == 0) { + d.pulses++; + } + } + + @Override + protected Data doCoverThingsImpl(ForgeDirection side, byte aInputRedstone, int aCoverID, Data aCoverVariable, + ICoverable aBaseMetaTileEntity, long aTimer) { + + if( + aBaseMetaTileEntity instanceof BaseMetaTileEntity){ + IMetaTileEntity mte = ((BaseMetaTileEntity) aBaseMetaTileEntity).getMetaTileEntity() ; + if(mte!=null&&mte instanceof GT_MetaTileEntity_BasicMachine){ + //when placed on single-block machine + GT_MetaTileEntity_BasicMachine mach=(GT_MetaTileEntity_BasicMachine) mte; + boolean working=((BaseMetaTileEntity) aBaseMetaTileEntity).getMaxProgress()>0; + start(aCoverVariable.lastSuccess, working?1:0 , aCoverVariable); + aCoverVariable.lastSuccess = working?1:0; + + } + + } + + + if(aCoverVariable.pulses>0){ + aCoverVariable.pulses--; + + + aBaseMetaTileEntity.setOutputRedstoneSignal(side, (byte) 15); + + }else{ + + aBaseMetaTileEntity.setOutputRedstoneSignal(side, (byte) 0); + + + + } + return aCoverVariable; + } + + public static void update(CheckRecipeResult controller, Data d) { + try { + CheckRecipeResult res = controller; + int newSuccess = check(res); + start(d.lastSuccess, newSuccess, d); + d.lastSuccess = newSuccess; + } catch (Exception e) { + + e.printStackTrace(); + + } + + /// return CheckRecipeResultRegistry.SUCCESSFUL; + } + + @Override + public Data createDataObject(int aLegacyData) { + + throw new UnsupportedOperationException("no legacy"); + } + + @Override + public Data createDataObject() { + + return new Data(); + } + + @Override + protected boolean letsItemsInImpl(ForgeDirection side, int aCoverID, Data aCoverVariable, int aSlot, + ICoverable aTileEntity) { + + return true; + } + + @Override + protected boolean letsItemsOutImpl(ForgeDirection side, int aCoverID, Data aCoverVariable, int aSlot, + ICoverable aTileEntity) { + return true; + } + + @Override + protected boolean letsEnergyInImpl(ForgeDirection side, int aCoverID, Data aCoverVariable, ICoverable aTileEntity) { + return true; + } + + @Override + protected boolean letsEnergyOutImpl(ForgeDirection side, int aCoverID, Data aCoverVariable, + ICoverable aTileEntity) { + return true; + } + + @Override + protected boolean letsFluidInImpl(ForgeDirection side, int aCoverID, Data aCoverVariable, Fluid aFluid, + ICoverable aTileEntity) { + return true; + } -public class RecipeCheckResultCover extends GT_CoverBehavior{ - @Override - public int getTickRate(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - - return 1; - } - - - public int doCoverThings(ForgeDirection side, byte aInputRedstone, int aCoverID, int aCoverVariable, - ICoverable aTileEntity, long aTimer) { - - - aTileEntity.setOutputRedstoneSignal(side, (byte) ((aTimer%2==0)?15:0)); - - - b: if(aTileEntity instanceof IGregTechTileEntity ){ - - IGregTechTileEntity te=(IGregTechTileEntity) aTileEntity; - IMetaTileEntity mte = te.getMetaTileEntity(); - if(mte==null)break b; - if(mte instanceof GT_MetaTileEntity_MultiBlockBase){ - GT_MetaTileEntity_MultiBlockBase mb=(GT_MetaTileEntity_MultiBlockBase) mte; - - - } - - - - - - } - - - - return aCoverVariable; - - - } @Override - public boolean manipulatesSidedRedstoneOutput(ForgeDirection side, int aCoverID, int aCoverVariable, - ICoverable aTileEntity) { - return true; - } + @Override + protected boolean letsFluidOutImpl(ForgeDirection side, int aCoverID, Data aCoverVariable, Fluid aFluid, + ICoverable aTileEntity) { + return true; + } } diff --git a/src/main/java/reobf/proghatches/gt/metatileentity/RecipeCheckResultDetector.java b/src/main/java/reobf/proghatches/gt/metatileentity/RecipeCheckResultDetector.java index d0ae61f..40225ae 100644 --- a/src/main/java/reobf/proghatches/gt/metatileentity/RecipeCheckResultDetector.java +++ b/src/main/java/reobf/proghatches/gt/metatileentity/RecipeCheckResultDetector.java @@ -28,7 +28,7 @@ public RecipeCheckResultDetector(int id, String name, String nameRegional, int t super(id, name, nameRegional, tier, 1, reobf.proghatches.main.Config.get("RCRD", ImmutableMap.of())); - Registration.items.add(new ItemStack(GregTech_API.sBlockMachines, 1, id)); + Registration.items_eucrafting.add(new ItemStack(GregTech_API.sBlockMachines, 1, id)); } public RecipeCheckResultDetector(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { diff --git a/src/main/java/reobf/proghatches/item/ItemDedicatedCover.java b/src/main/java/reobf/proghatches/item/ItemDedicatedCover.java index b781f34..5a5c118 100644 --- a/src/main/java/reobf/proghatches/item/ItemDedicatedCover.java +++ b/src/main/java/reobf/proghatches/item/ItemDedicatedCover.java @@ -1,6 +1,7 @@ package reobf.proghatches.item; import java.util.List; +import java.util.stream.IntStream; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; @@ -34,10 +35,13 @@ public void registerIcons(IIconRegister register) { @Override @SideOnly(Side.CLIENT) public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) { - if(LangManager.canTranslate("item.proghatch.cover.dedicated.tooltips." + p_77624_1_.getItemDamage())) - p_77624_3_.add( - LangManager.translateToLocal("item.proghatch.cover.dedicated.tooltips." + p_77624_1_.getItemDamage())); - super.addInformation(p_77624_1_, p_77624_2_, p_77624_3_, p_77624_4_); + + IntStream.range(0,Integer.valueOf( StatCollector.translateToLocal("item.proghatch.cover.dedicated.tooltips." + p_77624_1_.getItemDamage())) + ).forEach(s-> + p_77624_3_.add(LangManager.translateToLocal("item.proghatch.cover.dedicated.tooltips." + p_77624_1_.getItemDamage()+"."+s))); + + + super.addInformation(p_77624_1_, p_77624_2_, p_77624_3_, p_77624_4_); } @Override diff --git a/src/main/java/reobf/proghatches/main/CommonProxy.java b/src/main/java/reobf/proghatches/main/CommonProxy.java index 47634b3..bb13efc 100644 --- a/src/main/java/reobf/proghatches/main/CommonProxy.java +++ b/src/main/java/reobf/proghatches/main/CommonProxy.java @@ -40,6 +40,7 @@ import reobf.proghatches.item.ItemProgrammingCircuit; import reobf.proghatches.item.ItemProgrammingToolkit; import reobf.proghatches.item.ItemSmartArm; +import reobf.proghatches.main.registration.EUCraftingCreativeTab; import reobf.proghatches.main.registration.PHRecipes; import reobf.proghatches.main.registration.ProgHatchCreativeTab; import reobf.proghatches.main.registration.Registration; @@ -70,10 +71,10 @@ public void preInit(FMLPreInitializationEvent event) { // setCreativeTab(FluidCraftingTabs.INSTANCE); - GameRegistry.registerItem( + /*GameRegistry.registerItem( MyMod.euupgrade = new ItemEUUpgradeModule().setUnlocalizedName("proghatches.eu_upgrade_module") .setTextureName("?"), - "proghatches.eu_upgrade_module"); + "proghatches.eu_upgrade_module");*/ GameRegistry.registerItem( MyMod.progcircuit = new ItemProgrammingCircuit().setUnlocalizedName("prog_circuit") @@ -138,7 +139,7 @@ public void preInit(FMLPreInitializationEvent event) { public void init(FMLInitializationEvent event) { tab = new ProgHatchCreativeTab("proghatches"); - + new EUCraftingCreativeTab("proghatches.eucrafting"); //AEApi.instance().registries().gridCache().registerGridCache(null, null);; // AEApi.instance().registries().interfaceTerminal().register(TileFluidInterface.class); new Registration().run(); diff --git a/src/main/java/reobf/proghatches/main/MyMod.java b/src/main/java/reobf/proghatches/main/MyMod.java index 920b2c2..ef3b3e3 100644 --- a/src/main/java/reobf/proghatches/main/MyMod.java +++ b/src/main/java/reobf/proghatches/main/MyMod.java @@ -3,6 +3,8 @@ import java.util.ArrayList; import java.util.Optional; +import javax.annotation.Nullable; + import net.minecraft.block.Block; import net.minecraft.entity.item.EntityItem; import net.minecraft.init.Items; @@ -58,7 +60,7 @@ public class MyMod { public static Block iohub; public static Block pstation; public static Item pitem; - public static Item euupgrade; + @Nullable public static Item euupgrade; public static Item eu_token; public static Item eu_source_part; diff --git a/src/main/java/reobf/proghatches/main/mixin/MixinPlugin.java b/src/main/java/reobf/proghatches/main/mixin/MixinPlugin.java index 5388c90..3998c92 100644 --- a/src/main/java/reobf/proghatches/main/mixin/MixinPlugin.java +++ b/src/main/java/reobf/proghatches/main/mixin/MixinPlugin.java @@ -105,9 +105,9 @@ public List getMixins() { ArrayList ret = new ArrayList<>(); - - ret.add("eucrafting."+"MixinInterface"); - ret.add("eucrafting."+"MixinInterfacePart"); + ret.add("eucrafting."+"MixinRecipeStateDetect"); + //ret.add("eucrafting."+"MixinInterface"); + //ret.add("eucrafting."+"MixinInterfacePart"); ret.add("eucrafting."+"MixinUpgrade"); ret.add("eucrafting."+"MixinInstantComplete"); diff --git a/src/main/java/reobf/proghatches/main/mixin/mixins/eucrafting/MixinRecipeStateDetect.java b/src/main/java/reobf/proghatches/main/mixin/mixins/eucrafting/MixinRecipeStateDetect.java new file mode 100644 index 0000000..deebf99 --- /dev/null +++ b/src/main/java/reobf/proghatches/main/mixin/mixins/eucrafting/MixinRecipeStateDetect.java @@ -0,0 +1,97 @@ +package reobf.proghatches.main.mixin.mixins.eucrafting; + +import static gregtech.api.util.GT_Utility.filterValidMTEs; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Objects; +import java.util.Optional; + +import org.spongepowered.asm.lib.Opcodes; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.ModifyVariable; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.recipe.check.CheckRecipeResult; +import gregtech.common.tileentities.machines.IDualInputHatch; +import gregtech.common.tileentities.machines.IRecipeProcessingAwareHatch; +import net.minecraftforge.common.util.ForgeDirection; +import reobf.proghatches.gt.cover.ProgrammingCover; +import reobf.proghatches.gt.cover.RecipeCheckResultCover; +import reobf.proghatches.gt.cover.RecipeCheckResultCover.Data; +@Mixin(value = GT_MetaTileEntity_MultiBlockBase.class, remap = false) +public class MixinRecipeStateDetect { + @Shadow public ArrayList mInputBusses = new ArrayList<>(); + @Shadow public ArrayList mInputHatches = new ArrayList<>(); + @Shadow public ArrayList mDualInputHatches = new ArrayList<>(); + @Shadow CheckRecipeResult checkRecipeResult; + + @Inject( + method = "endRecipeProcessing", + at = @At( value = "RETURN"), require = 1) + public void endRecipeProcessing(CallbackInfo a) { + for (GT_MetaTileEntity_Hatch_InputBus hatch : filterValidMTEs(mInputBusses)) { + updateCover(hatch); + } + for (GT_MetaTileEntity_Hatch_Input hatch : filterValidMTEs(mInputHatches)) { + updateCover(hatch); + } + for (IDualInputHatch hatch : mDualInputHatches) { + if(hatch!=null&&((MetaTileEntity)hatch).isValid()){ + + updateCover((MetaTileEntity) hatch); + }; + + } + + + /* try { + GT_MetaTileEntity_Hatch_InputBus bus = (GT_MetaTileEntity_Hatch_InputBus) a; + Arrays.stream(ForgeDirection.VALID_DIRECTIONS) + .map( + s -> bus.getBaseMetaTileEntity() + .getCoverBehaviorAtSideNew(s)) + .filter(Objects::nonNull) + .filter(s -> s instanceof ProgrammingCover) + .forEach(s -> ((ProgrammingCover) s).impl(bus.getBaseMetaTileEntity()));; + + } catch (Exception e) { + // huh? + e.printStackTrace(); + } + return a; +*/ + + } + + public void updateCover(MetaTileEntity bus){ + + + Arrays.stream(ForgeDirection.VALID_DIRECTIONS) + .filter( + s -> Optional.ofNullable(bus.getBaseMetaTileEntity() + .getCoverBehaviorAtSideNew(s)).map(sx->sx instanceof RecipeCheckResultCover).orElse(false)) + .forEach(s -> + RecipeCheckResultCover.update(checkRecipeResult, (Data) bus.getBaseMetaTileEntity().getCoverInfoAtSide(s).getCoverData()) + + ); + + + ; + + /* .forEach(s -> bus.getBaseMetaTileEntity().getCoverInfoAtSide(null) + + ));;*/ + + + } + +} diff --git a/src/main/java/reobf/proghatches/main/registration/EUCraftingCreativeTab.java b/src/main/java/reobf/proghatches/main/registration/EUCraftingCreativeTab.java new file mode 100644 index 0000000..38131d4 --- /dev/null +++ b/src/main/java/reobf/proghatches/main/registration/EUCraftingCreativeTab.java @@ -0,0 +1,41 @@ +package reobf.proghatches.main.registration; + +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.util.GT_Utility; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import reobf.proghatches.item.ItemProgrammingCircuit; +import reobf.proghatches.main.MyMod; + +public class EUCraftingCreativeTab extends CreativeTabs { + + public EUCraftingCreativeTab(String lable) { + super(lable); + // TODO Auto-generated constructor stub + } + @SideOnly(Side.CLIENT) + public ItemStack getIconItemStack() { + return new ItemStack(MyMod.block_euinterface); + } + + @Override + public Item getTabIconItem() { + + return Item.getItemFromBlock(MyMod.block_euinterface); + } + @Override + public void displayAllReleventItems(List p_78018_1_) { + p_78018_1_.addAll(Registration.items_eucrafting); + p_78018_1_.add(new ItemStack(MyMod.eu_source_part)); + p_78018_1_.add(new ItemStack(MyMod.block_euinterface)); + p_78018_1_.add(new ItemStack(MyMod.cover, 1, 2)); + + + + super.displayAllReleventItems(p_78018_1_); + } +} diff --git a/src/main/java/reobf/proghatches/main/registration/ProgHatchCreativeTab.java b/src/main/java/reobf/proghatches/main/registration/ProgHatchCreativeTab.java index 94df66e..e24b3b4 100644 --- a/src/main/java/reobf/proghatches/main/registration/ProgHatchCreativeTab.java +++ b/src/main/java/reobf/proghatches/main/registration/ProgHatchCreativeTab.java @@ -59,12 +59,13 @@ public void displayAllReleventItems(List p_78018_1_) { p_78018_1_.add(new ItemStack(MyMod.cover, 1, 0)); p_78018_1_.add(new ItemStack(MyMod.cover, 1, 1)); + //p_78018_1_.add(new ItemStack(MyMod.cover, 1, 2)); p_78018_1_.add(new ItemStack(MyMod.oc_api, 1)); p_78018_1_.add(new ItemStack(MyMod.oc_redstone, 1)); p_78018_1_.add(new ItemStack(MyMod.iohub, 1)); p_78018_1_.add(new ItemStack(MyMod.pitem, 1)); p_78018_1_.add(new ItemStack(MyMod.pstation, 1)); - p_78018_1_.add(new ItemStack(MyMod.euupgrade, 1)); + // p_78018_1_.add(new ItemStack(MyMod.euupgrade, 1)); } @Override diff --git a/src/main/java/reobf/proghatches/main/registration/Registration.java b/src/main/java/reobf/proghatches/main/registration/Registration.java index 210a5c9..87918f2 100644 --- a/src/main/java/reobf/proghatches/main/registration/Registration.java +++ b/src/main/java/reobf/proghatches/main/registration/Registration.java @@ -32,6 +32,7 @@ public class Registration implements Runnable { public static ArrayList items = new ArrayList(); + public static ArrayList items_eucrafting = new ArrayList(); public final static int DualInputHatchOffset = 0;// -15 public final static int QuadDualInputHatchOffset = 16;// -31 public final static int BufferedQuadDualInputHatchOffset = 100; @@ -134,7 +135,7 @@ public void run() { TextureFactory.of(gregtech.api.enums.Textures.BlockIcons.OVERLAY_SCREEN_GLOW)), new RecipeOutputAwarenessCover()); GregTech_API.registerCover( - new ItemStack(MyMod.cover, 1, 14), + new ItemStack(MyMod.cover, 1, 2), TextureFactory.of( MACHINE_CASINGS[1][0], TextureFactory.of(gregtech.api.enums.Textures.BlockIcons.OVERLAY_SCREEN_GLOW)), diff --git a/src/main/resources/assets/proghatches/lang/en_US.lang b/src/main/resources/assets/proghatches/lang/en_US.lang index 96208b5..8db29a7 100644 --- a/src/main/resources/assets/proghatches/lang/en_US.lang +++ b/src/main/resources/assets/proghatches/lang/en_US.lang @@ -118,7 +118,9 @@ programmable_hatches.tutorial=How to master Programmable Hatches in 30 minutes programmable_hatches.tutorial.pages.0=Not yet completed programmable_hatches.tutorial.pages=1 item.prog_toolkit.name.tooltip.emptyinput=For automation, use Programming Circuit Provider instead. -item.proghatch.cover.dedicated.tooltips.1=Redstone Receiver(Internal) with Safe Mode +item.proghatch.cover.dedicated.tooltips.1.0=Redstone Receiver(Internal) with Safe Mode +item.proghatch.cover.dedicated.tooltips.1=1 +item.proghatch.cover.dedicated.tooltips.0=0 programmable_hatches.gt.marking.slot.0=§7Use item to mark, NEI bookmark not supported. programmable_hatches.gt.marking.slot.1=§7Click to remove programmable_hatches.gt.pattern=Insert Patterns @@ -213,3 +215,11 @@ proghatches.eu.interface.hint=Note:if expected Current > 0, better not modify th proghatches.eu.interface.tooltip.volt.0=The expected voltage that the Interface should emit. proghatches.eu.interface.tooltip.volt.1=Level:%s %s proghatches.eu.interface.tooltip.amp=The expected current that the Interface should emit. +item.proghatch.cover.dedicated.2=Idle Detecting Cover +item.proghatch.cover.dedicated.tooltips.2.0=Place on an input hatch/bus or a Single Block Machine to make it works like an Idle Detector. +item.proghatch.cover.dedicated.tooltips.2.1=Will not block item/fluid/energy interaction. +item.proghatch.cover.dedicated.tooltips.2.2=Works on single block machine as well. +item.proghatch.cover.dedicated.tooltips.2.3=Emits a 1-tick redstone pulse when a running Multiblock turn off due to no recipe found. +item.proghatch.cover.dedicated.tooltips.2.4=Redstone wire cannot pass 1-tick pulse? Try Redstone P2P or Redstone Conduit! +item.proghatch.cover.dedicated.tooltips.2=5 +itemGroup.proghatches.eucrafting=Programmable Hatches|EU Crafting diff --git a/src/main/resources/assets/proghatches/lang/zh_CN.lang b/src/main/resources/assets/proghatches/lang/zh_CN.lang index 3dbb8d8..3d4e1c2 100644 --- a/src/main/resources/assets/proghatches/lang/zh_CN.lang +++ b/src/main/resources/assets/proghatches/lang/zh_CN.lang @@ -129,7 +129,9 @@ programmable_hatches.tutorial.pages.10=注意,缓存编程二合一输入仓 programmable_hatches.tutorial.pages.11=右上角的“电源”按钮控制机器是否向“缓存区”转移材料,你可以关掉它,然后手动塞入一份材料再打开,这样缓冲区才能正确记录你的配方。 programmable_hatches.tutorial.pages.12=无线控制覆盖板&智能机械臂>高级无线红石卡\n\n这些物品所访问的都是GT高级无线红石系统,是的,它们不兼容基础版的GT无线红石。 programmable_hatches.tutorial.pages=13 -item.proghatch.cover.dedicated.tooltips.1=带有安全模式的红石接收覆盖板(内) +item.proghatch.cover.dedicated.tooltips.1.0=带有安全模式的红石接收覆盖板(内) +item.proghatch.cover.dedicated.tooltips.1=1 +item.proghatch.cover.dedicated.tooltips.0=0 programmable_hatches.gt.marking.slot.0=§7使用物品标记,不支持NEI书签 programmable_hatches.gt.marking.slot.1=§7点击清空 programmable_hatches.gt.pattern=添加样板 @@ -223,3 +225,11 @@ proghatches.eu.interface.hint=注意:期望电流如果不为0时,应当避免 proghatches.eu.interface.tooltip.volt.0=EU接口期望电压 proghatches.eu.interface.tooltip.volt.1=电压等级:%s %s proghatches.eu.interface.tooltip.amp=EU接口期望电流 +item.proghatch.cover.dedicated.2=空闲检测覆盖板 +item.proghatch.cover.dedicated.tooltips.2.0=放在任意输入仓室或单方块机器上以使其获得空闲检测器功能. +item.proghatch.cover.dedicated.tooltips.2.1=不阻隔此面物品/流体/能量交互. +item.proghatch.cover.dedicated.tooltips.2.2=也能检测单方块机器. +item.proghatch.cover.dedicated.tooltips.2.3=当多方块机器由于未找到配方从工作状态停机时,发射1tick红石信号 +item.proghatch.cover.dedicated.tooltips.2.4=红石线无法传递1tick脉冲?试试红石P2P或者红石导管吧! +item.proghatch.cover.dedicated.tooltips.2=5 +itemGroup.proghatches.eucrafting=可编程仓室|EU合成 diff --git a/src/main/resources/assets/proghatches/textures/blocks/eu_interface.png b/src/main/resources/assets/proghatches/textures/blocks/eu_interface.png new file mode 100644 index 0000000..db0d520 Binary files /dev/null and b/src/main/resources/assets/proghatches/textures/blocks/eu_interface.png differ diff --git a/src/main/resources/assets/proghatches/textures/blocks/eu_interface_a.png b/src/main/resources/assets/proghatches/textures/blocks/eu_interface_a.png new file mode 100644 index 0000000..7643d93 Binary files /dev/null and b/src/main/resources/assets/proghatches/textures/blocks/eu_interface_a.png differ diff --git a/src/main/resources/assets/proghatches/textures/blocks/eu_interface_arrow.png b/src/main/resources/assets/proghatches/textures/blocks/eu_interface_arrow.png new file mode 100644 index 0000000..28e6a65 Binary files /dev/null and b/src/main/resources/assets/proghatches/textures/blocks/eu_interface_arrow.png differ diff --git a/src/main/resources/assets/proghatches/textures/items/eu.png b/src/main/resources/assets/proghatches/textures/items/eu.png new file mode 100644 index 0000000..a33fda7 Binary files /dev/null and b/src/main/resources/assets/proghatches/textures/items/eu.png differ diff --git a/src/main/resources/assets/proghatches/textures/items/eu_bound.png b/src/main/resources/assets/proghatches/textures/items/eu_bound.png new file mode 100644 index 0000000..89d6f4e Binary files /dev/null and b/src/main/resources/assets/proghatches/textures/items/eu_bound.png differ