diff options
author | Technus <daniel112092@gmail.com> | 2018-02-03 16:22:23 +0100 |
---|---|---|
committer | Technus <daniel112092@gmail.com> | 2018-02-03 16:22:23 +0100 |
commit | 1f7a29e1f4607f83cf2a0580dcf6485504706035 (patch) | |
tree | 098721deb3fb5218fd460d81abb83988f0a25732 /src | |
parent | 6e81d1fcd4d1fef4c5a4e3b8797d9efea5b12de8 (diff) | |
parent | 9b72b13fde8cfb7908cfd1569ad0399a4a10635e (diff) | |
download | GT5-Unofficial-1f7a29e1f4607f83cf2a0580dcf6485504706035.tar.gz GT5-Unofficial-1f7a29e1f4607f83cf2a0580dcf6485504706035.tar.bz2 GT5-Unofficial-1f7a29e1f4607f83cf2a0580dcf6485504706035.zip |
Merge branch 'master' of https://github.com/Technus/TecTech
# Conflicts:
# src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java
# src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java
Diffstat (limited to 'src')
9 files changed, 46 insertions, 40 deletions
diff --git a/src/main/java/com/github/technus/tectech/Util.java b/src/main/java/com/github/technus/tectech/Util.java index c699077110..25327e1369 100644 --- a/src/main/java/com/github/technus/tectech/Util.java +++ b/src/main/java/com/github/technus/tectech/Util.java @@ -237,7 +237,7 @@ public final class Util { if (block < ' ') {//Control chars allow skipping b -= block; break; - } else if (block > '@') //characters allow to skip check a-1 skip, b-2 skips etc. + } else if (block > '@') //characters allow to skip check A-1 skip, B-2 skips etc. { a += block - '@'; }//else if (block < '+')//used to mark THINGS diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java index 797be1d259..e8238af2cb 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java @@ -61,7 +61,7 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa eDismantleBoom=true; } - @SideOnly(Side.CLIENT) + public final static ResourceLocation activitySound=new ResourceLocation(Reference.MODID+":fx_whooum"); @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java index c2c80b5bc8..7b90703749 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_quantizer.java @@ -69,8 +69,6 @@ public class GT_MetaTileEntity_EM_quantizer extends GT_MetaTileEntity_Multiblock super(aName); } - - @SideOnly(Side.CLIENT) public final static ResourceLocation activitySound=new ResourceLocation(Reference.MODID+":fx_mid_freq"); @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java index 8370700e3f..e15d24243e 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java @@ -56,7 +56,6 @@ public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBas super(aName); } - @SideOnly(Side.CLIENT) public final static ResourceLocation activitySound=new ResourceLocation(Reference.MODID+":fx_hi_freq"); @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java index 8139c70ad7..1623ee60ad 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java @@ -69,7 +69,6 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo eDismantleBoom=true; } - @SideOnly(Side.CLIENT) public final static ResourceLocation activitySound=new ResourceLocation(Reference.MODID+":fx_noise"); @Override diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java index 0a0c874ad3..3074c00dc7 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java @@ -66,7 +66,6 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt protected static Textures.BlockIcons.CustomIcon ScreenON; //Sound resource - same as with screen but override getActivitySound - @SideOnly(Side.CLIENT) public final static ResourceLocation activitySound=new ResourceLocation(Reference.MODID+":fx_lo_freq"); @SideOnly(Side.CLIENT) private SoundLoop activitySoundLoop; @@ -101,7 +100,6 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt private final int[] iParamsOut = new int[20];//number O to parametrizers private final boolean[] bParamsAreFloats = new boolean[10]; - final byte[] eParamsInStatus = new byte[20];//LED status for I final byte[] eParamsOutStatus = new byte[20];//LED status for O public static final byte STATUS_UNUSED = 0, @@ -155,9 +153,9 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt //just some info - private so hidden private boolean explodedThisTick=false; - //endregion + //init param states in constructor, or implement it in checkrecipe/outputfunction - //region METHODS TO OVERRIDE + //METHODS TO OVERRIDE // My code handles AMPS, if you want overclocking just modify mEUt and mMaxProgressTime, leave amps as usual! // Set mEUt, Efficiencies, required computation, time, check input etc. diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/SoundLoop.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/SoundLoop.java index a0d7b421aa..338af1626e 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/SoundLoop.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/SoundLoop.java @@ -25,7 +25,7 @@ public class SoundLoop extends MovingSound{ zPosF=base.getZCoord(); worldID=base.getWorld().provider.dimensionId; repeat=true; - volume=0.001f; + volume=0f; } @Override @@ -40,10 +40,8 @@ public class SoundLoop extends MovingSound{ }else if(volume==0){ donePlaying=true; } - }else if(volume<1){ - volume+=0.05f; - } else { - volume=1f; + }else if(volume<1) { + volume += 0.05f; } World world=Minecraft.getMinecraft().thePlayer.worldObj; donePlaying=world.provider.dimensionId!=worldID || diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java index 24898cc433..fe40178e88 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/Behaviour_Centrifuge.java @@ -17,10 +17,20 @@ import static com.github.technus.tectech.auxiliary.TecTechConfig.DEBUG_MODE; * Created by danie_000 on 24.12.2017. */ public class Behaviour_Centrifuge implements GT_MetaTileEntity_EM_machine.Behaviour { - private static final double MAX_RCF = (float) (Math.pow(Math.E, 15) * 12); private final float radius, maxRPM, maxRCF, maxForce, maxCapacity; private final byte tier; + private static final double[/*tier+5*/][/*outputHatches+2*/] MIXING_FACTORS =new double[][]{ + {.45,.85,.95,1,1,}, + {.4 ,.75,.9,.95,1,}, + {.35,.45,.75,.9,.95,}, + {.25,.3,.45,.75,.9,}, + {.2,.25,.3,.45,.75,}, + {.1,.15,.2,.3,.45,}, + {.05,.1,.15,.2,.25,}, + {.01,.05,.1,.15,.2,}, + }; + //6 to 12 recommended public Behaviour_Centrifuge(int desiredTier) { tier = (byte) desiredTier; @@ -45,7 +55,7 @@ public class Behaviour_Centrifuge implements GT_MetaTileEntity_EM_machine.Behavi if (RPM > maxRPM) { te.setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_TOO_HIGH); te.setParameterOut(0, 0, maxRPM);//rpm - te.setParameterOut(0, 1, getRCF(maxRPM));//rcf + te.setParameterOut(0, 1, maxRCF);//rcf check=false; } else if (RPM > maxRPM / 3f * 2f) { te.setStatusOfParameterIn(0, 0, GT_MetaTileEntity_MultiblockBase_EM.STATUS_HIGH); @@ -87,7 +97,7 @@ public class Behaviour_Centrifuge implements GT_MetaTileEntity_EM_machine.Behavi } te.setParameterOut(3,0,(int) (Math.pow(parametersToCheckAndFix[0] / maxRPM, 3f) * V[tier]));//max eut - te.setParameterOut(3,1,(int) (20 * (MAX_RCF / getRCF(RPM)) * (fractionCount - 1)));//max time + te.setParameterOut(3,1,(int) (20 * (fractionCount - 1)));//max time return check; } @@ -128,10 +138,16 @@ public class Behaviour_Centrifuge implements GT_MetaTileEntity_EM_machine.Behavi outputs[i] = new cElementalInstanceStackMap(); } + //mixing factor... + double mixingFactor=Math.min(1d-(RCF/maxRCF)*(1d-MIXING_FACTORS[tier-5][fractionCount-2]),1); + if(DEBUG_MODE){ + TecTech.Logger.info("mixingFactor "+mixingFactor); + } + int mEut = (int) (Math.pow(checkedAndFixedParameters[0] / maxRPM, 3f) * V[tier]); mEut = Math.max(mEut, 512); mEut = -mEut; - int mTicks = (int) (20 * (MAX_RCF / RCF) * (inputMass / maxCapacity) * (fractionCount - 1)); + int mTicks = (int) (20 * (inputMass / maxCapacity) * (fractionCount - 1)); mTicks=Math.max(mTicks,20); @@ -149,18 +165,20 @@ public class Behaviour_Centrifuge implements GT_MetaTileEntity_EM_machine.Behavi } }); - //output sorting bleeding - float bleedingMod=0.5f-((float)(RCF/maxRCF)*(tier/25f)); - - double absMassPerOutput = 0;//"volume" for (cElementalInstanceStack stack : stacks) { - absMassPerOutput += Math.abs(stack.getMass()); - } - if(DEBUG_MODE){ - TecTech.Logger.info("absMass "+absMassPerOutput); + double tempMass=Math.abs(stack.getMass()); + if(tempMass!=0) { + long amount = stack.amount; + stack.amount *= mixingFactor; + addRandomly(stack, outputs, fractionCount); + stack.amount = amount - stack.amount; + absMassPerOutput += tempMass; + } } - + //if(DEBUG_MODE){ + // TecTech.Logger.info("absMass "+absMassPerOutput); + //} absMassPerOutput /= fractionCount; if(DEBUG_MODE){ TecTech.Logger.info("absMassPerOutput "+absMassPerOutput); @@ -184,13 +202,13 @@ public class Behaviour_Centrifuge implements GT_MetaTileEntity_EM_machine.Behavi stacks[stackNo] = null; } else if (amount >= stacks[stackNo].amount) { remaining -= stackMass; - outputs[fraction].putReplace(stacks[stackNo]); + outputs[fraction].putUnify(stacks[stackNo]); stacks[stackNo] = null; } else if (amount > 0) { remaining -= amount * stacks[stackNo].definition.getMass(); cElementalInstanceStack clone = stacks[stackNo].clone(); clone.amount = amount; - outputs[fraction].putReplace(clone); + outputs[fraction].putUnify(clone); stacks[stackNo].amount-=amount; //if(DEBUG_MODE){ // TecTech.Logger.info("remainingAfter "+remaining); @@ -205,7 +223,7 @@ public class Behaviour_Centrifuge implements GT_MetaTileEntity_EM_machine.Behavi //add remaining for (cElementalInstanceStack stack : stacks) { if (stack != null) { - outputs[fractionCount - 1].putReplace(stack); + outputs[fractionCount - 1].putUnify(stack); } } } else { diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java index 0936c1ad1e..032d4e48a8 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java @@ -4,17 +4,13 @@ import com.github.technus.tectech.CommonValues; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.Util; import com.github.technus.tectech.elementalMatter.core.cElementalInstanceStackMap; -import com.github.technus.tectech.recipe.TT_recipe; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.block.QuantumStuffBlock; import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.MultiblockControl; -import gregtech.api.enums.ItemList; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.objects.GT_ItemStack; -import gregtech.common.blocks.GT_Block_Machines; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; @@ -40,10 +36,10 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa private static final String[][] shape = new String[][]{ {"B0", "A ", "0 - 0", "A ", "B0",}, {"A000", "00000", "00.00", "00000", "A000",}, - {"A121", "1C1", "2C2", "1C1", "A121",}, - {"A131", "1C1", "3C3", "1C1", "A131",}, - {"A121", "1C1", "2C2", "1C1", "A121",}, - {"A000", "00000", "00A00", "00000", "A000",}, + {"A121", "1---1", "2---2", "1---1", "A121",}, + {"A131", "1---1", "3-A-3", "1---1", "A131",}, + {"A121", "1---1", "2---2", "1---1", "A121",}, + {"A000", "00000", "00-00", "00000", "A000",}, {"B0", "A!!!", "0!!!0", "A!!!", "B0",},}; private static final Block[] blockType = new Block[]{sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT}; private static final byte[] blockMeta = new byte[]{4, 0, 5, 6}; @@ -72,7 +68,7 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa @Override public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 1) && eInputHatches.size() == 1 && iGregTechTileEntity.getBlockAtSideAndDistance(iGregTechTileEntity.getBackFacing(), 5) instanceof GT_Block_Machines; + return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 1); } @Override |