diff --git a/dependencies.gradle b/dependencies.gradle index ebb48582104..67d571185df 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -40,9 +40,9 @@ dependencies { api("com.github.GTNewHorizons:NotEnoughIds:2.1.6:dev") api("com.github.GTNewHorizons:GTNHLib:0.5.11:dev") api("com.github.GTNewHorizons:ModularUI:1.2.8:dev") - api("com.github.GTNewHorizons:ModularUI2:2.1.11-1.7.10:dev") + api("com.github.GTNewHorizons:ModularUI2:2.1.12-1.7.10:dev") api("com.github.GTNewHorizons:waila:1.8.1:dev") - api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-463-GTNH:dev") + api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-464-GTNH:dev") api("com.github.GTNewHorizons:AE2FluidCraft-Rework:1.3.36-gtnh:dev") api('com.github.GTNewHorizons:Yamcl:0.6.0:dev') api("com.github.GTNewHorizons:Postea:1.0.13:dev") @@ -95,7 +95,7 @@ dependencies { compileOnly rfg.deobf("curse.maven:biomes-o-plenty-220318:2499612") compileOnly('com.github.GTNewHorizons:SC2:2.2.0:dev') {transitive=false} - compileOnly('com.github.GTNewHorizons:Binnie:2.4.2:dev') {transitive = false} + compileOnly('com.github.GTNewHorizons:Binnie:2.4.3:dev') {transitive = false} compileOnly('curse.maven:PlayerAPI-228969:2248928') {transitive=false} compileOnly('com.github.GTNewHorizons:BlockRenderer6343:1.2.14:dev'){transitive=false} @@ -108,7 +108,7 @@ dependencies { // runtimeOnlyNonPublishable("com.github.GTNewHorizons:ForestryMC:4.9.16:dev") // runtimeOnlyNonPublishable('com.github.GTNewHorizons:neiaddons:1.16.0:dev') // runtimeOnlyNonPublishable('com.github.GTNewHorizons:MagicBees:2.8.5-GTNH:dev') - // runtimeOnlyNonPublishable('com.github.GTNewHorizons:Binnie:2.4.2:dev') + // runtimeOnlyNonPublishable('com.github.GTNewHorizons:Binnie:2.4.3:dev') testImplementation(platform('org.junit:junit-bom:5.9.2')) testImplementation('org.junit.jupiter:junit-jupiter') diff --git a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaBlastFurnace.java b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaBlastFurnace.java index 12d36dd9448..e43da001f09 100644 --- a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaBlastFurnace.java +++ b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaBlastFurnace.java @@ -36,7 +36,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -435,7 +434,7 @@ public boolean supportsVoidProtection() { @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_MEGA_BLAST_FURNACE_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_MEGA_BLAST_FURNACE_LOOP; } } diff --git a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaVacuumFreezer.java b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaVacuumFreezer.java index fdc0a465cfe..753e6a2d7ef 100644 --- a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaVacuumFreezer.java +++ b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaVacuumFreezer.java @@ -37,7 +37,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -537,7 +536,7 @@ public boolean supportsVoidProtection() { @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_MULTI_MEGA_VACUUM_FREEZER_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_MULTI_MEGA_VACUUM_FREEZER_LOOP; } } diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTEExtremeHeatExchanger.java b/src/main/java/goodgenerator/blocks/tileEntity/MTEExtremeHeatExchanger.java index 582b9d04aad..45f5bafca10 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTEExtremeHeatExchanger.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTEExtremeHeatExchanger.java @@ -51,6 +51,8 @@ import gregtech.api.util.GTUtility; import gregtech.api.util.IGTHatchAdder; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.tileentities.machines.IRecipeProcessingAwareHatch; +import gregtech.common.tileentities.machines.MTEHatchInputME; public class MTEExtremeHeatExchanger extends MTETooltipMultiBlockBaseEM implements IConstructable, ISurvivalConstructable { @@ -223,18 +225,26 @@ protected MultiblockTooltipBuilder createTooltip() { @Override public @NotNull CheckRecipeResult checkProcessing_EM() { tRunningRecipe = null; - if (mHotFluidHatch.getFluid() == null) return CheckRecipeResultRegistry.SUCCESSFUL; + FluidStack hotFluid = null; + if (mHotFluidHatch instanceof MTEHatchInputME inputME) { + FluidStack[] fluids = inputME.getStoredFluids(); + if (fluids.length > 0) { + hotFluid = fluids[0]; + } + } else { + hotFluid = mHotFluidHatch.getFluid(); + } + if (hotFluid == null) return CheckRecipeResultRegistry.SUCCESSFUL; ExtremeHeatExchangerRecipe tRecipe = (ExtremeHeatExchangerRecipe) GoodGeneratorRecipeMaps.extremeHeatExchangerFuels .getBackend() - .findFuel(mHotFluidHatch.getFluid()); + .findFuel(hotFluid); if (tRecipe == null) return CheckRecipeResultRegistry.NO_RECIPE; tRunningRecipe = tRecipe; - this.hotName = mHotFluidHatch.getFluid() - .getFluid() + this.hotName = hotFluid.getFluid() .getName(); int tMaxConsume = tRecipe.getMaxHotFluidConsume(); int transformed_threshold = tRecipe.mSpecialValue; - int tRealConsume = Math.min(tMaxConsume, mHotFluidHatch.getFluid().amount); + int tRealConsume = Math.min(tMaxConsume, hotFluid.amount); double penalty = 0.0d; double efficiency = 1d; int shs_reduction_per_config = 150; @@ -255,7 +265,8 @@ protected MultiblockTooltipBuilder createTooltip() { this.mMaxProgresstime = 20; this.mEUt = (int) (tRecipe.getEUt() * efficiency * ((double) tRealConsume / (double) tMaxConsume)); - mHotFluidHatch.drain(tRealConsume, true); + // the 3-arg drain will work on both normal hatch and ME hatch + mHotFluidHatch.drain(ForgeDirection.UNKNOWN, new FluidStack(hotFluid.getFluid(), tRealConsume), true); mCooledFluidHatch.fill(new FluidStack(tRecipe.getCooledFluid(), tRealConsume), true); this.mEfficiencyIncrease = 160; @@ -269,7 +280,10 @@ public boolean onRunningTick(ItemStack aStack) { int waterAmount = (int) (this.mEUt / getUnitSteamPower(tReadySteam.getName())) / 160; if (waterAmount < 0) return false; int steamToOutput; - if (depleteInput(GTModHandler.getDistilledWater(waterAmount))) { + startRecipeProcessing(); + boolean isDepleteSuccess = depleteInput(GTModHandler.getDistilledWater(waterAmount)); + endRecipeProcessing(); + if (isDepleteSuccess) { if (tRunningRecipe.mFluidInputs[0].getUnlocalizedName() .contains("plasma")) { steamToOutput = waterAmount * 160 / 1000; @@ -421,4 +435,20 @@ public IGTHatchAdder adder() { return adder; } } + + @Override + public void startRecipeProcessing() { + super.startRecipeProcessing(); + if (mHotFluidHatch instanceof IRecipeProcessingAwareHatch aware && mHotFluidHatch.isValid()) { + aware.startRecipeProcessing(); + } + } + + @Override + public void endRecipeProcessing() { + super.endRecipeProcessing(); + if (mHotFluidHatch instanceof IRecipeProcessingAwareHatch aware && mHotFluidHatch.isValid()) { + aware.endRecipeProcessing(this); + } + } } diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTELargeEssentiaSmeltery.java b/src/main/java/goodgenerator/blocks/tileEntity/MTELargeEssentiaSmeltery.java index 40f01fbde4e..43d066d5b53 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTELargeEssentiaSmeltery.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTELargeEssentiaSmeltery.java @@ -41,6 +41,7 @@ import gregtech.api.recipe.check.SimpleCheckRecipeResult; import gregtech.api.render.TextureFactory; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.api.util.OverclockCalculator; import tectech.thing.metaTileEntity.hatch.MTEHatchEnergyMulti; import tectech.thing.metaTileEntity.multi.base.TTMultiblockBase; import thaumcraft.api.aspects.Aspect; @@ -363,14 +364,18 @@ protected void runMachine(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { this.drainNodePower(WORLD, x, y, z); this.nodePower -= expectedPower(); - calculatePerfectOverclockedNessMulti( - RECIPE_EUT, - (int) Math.ceil(this.mOutputAspects.visSize() * RECIPE_DURATION * (1 - this.nodeIncrease * 0.005)), - 1, - Math.min(Integer.MAX_VALUE, getMaxInputEnergy_EM())); + OverclockCalculator calculator = new OverclockCalculator().setRecipeEUt(RECIPE_EUT) + .setEUt(getMaxInputEu()) + .setDuration( + (int) Math.ceil(this.mOutputAspects.visSize() * RECIPE_DURATION * (1 - this.nodeIncrease * 0.005))) + .setDurationDecreasePerOC(4) + .calculate(); + + useLongPower = true; + lEUt = -calculator.getConsumption(); + mMaxProgresstime = calculator.getDuration(); this.updateSlots(); - if (this.mEUt > 0) this.mEUt = -this.mEUt; return CheckRecipeResultRegistry.SUCCESSFUL; } diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTEPreciseAssembler.java b/src/main/java/goodgenerator/blocks/tileEntity/MTEPreciseAssembler.java index 7eef5abfe56..cac24ea97c1 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTEPreciseAssembler.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTEPreciseAssembler.java @@ -24,7 +24,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; @@ -534,8 +533,8 @@ public void getWailaBody(ItemStack itemStack, List currentTip, IWailaDat @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_MULTI_PRECISE_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_MULTI_PRECISE_LOOP; } } diff --git a/src/main/java/goodgenerator/blocks/tileEntity/base/MTELargeFusionComputer.java b/src/main/java/goodgenerator/blocks/tileEntity/base/MTELargeFusionComputer.java index d07597418fe..72ced183c31 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/base/MTELargeFusionComputer.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/base/MTELargeFusionComputer.java @@ -16,7 +16,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.ChunkCoordIntPair; import net.minecraftforge.common.util.ForgeDirection; @@ -358,7 +357,7 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { .setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (mMachine ? 0 : 64)); aBaseMetaTileEntity.setActive(mMaxProgresstime > 0); } else { - soundMagic(getActivitySoundLoop()); + doActivitySound(getActivitySoundLoop()); } } @@ -570,8 +569,8 @@ public boolean explodesOnComponentBreak(ItemStack aStack) { @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_FUSION_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_FUSION_LOOP; } @Override diff --git a/src/main/java/gregtech/api/enums/OrePrefixes.java b/src/main/java/gregtech/api/enums/OrePrefixes.java index 27cf37a2de3..08dd2b77926 100644 --- a/src/main/java/gregtech/api/enums/OrePrefixes.java +++ b/src/main/java/gregtech/api/enums/OrePrefixes.java @@ -3,6 +3,7 @@ import static gregtech.api.enums.GTValues.B; import static gregtech.api.enums.GTValues.D2; import static gregtech.api.enums.GTValues.M; +import static gregtech.api.util.GTRecipeBuilder.DEBUG_MODE_COLLISION; import java.util.ArrayList; import java.util.Arrays; @@ -1309,20 +1310,32 @@ public void processOre(Materials aMaterial, String aOreDictName, String aModName return; } - if (aMaterial != Materials._NULL && !used.add(aMaterial)) { - GTLog.out.println("Duplicate material registry attempted by " + aModName + " for " + aOreDictName); + if (aMaterial.contains(SubTag.NO_RECIPES)) { return; } - if (aMaterial.contains(SubTag.NO_RECIPES)) { + if (aMaterial == Materials._NULL && !mIsSelfReferencing && mIsMaterialBased) { return; } - if (!((aMaterial != Materials._NULL || mIsSelfReferencing || !mIsMaterialBased) - && GTUtility.isStackValid(aStack))) { + if (!GTUtility.isStackValid(aStack)) { return; } + if (aMaterial != Materials._NULL) { + if (!used.add(aMaterial)) { + if (DEBUG_MODE_COLLISION) { + GTLog.out + .println("Attempted duplicate recipe registration by " + aModName + " for " + aOreDictName); + } + return; + } else { + if (DEBUG_MODE_COLLISION) { + GTLog.out.println("New recipe registration by " + aModName + " for " + aOreDictName); + } + } + } + for (IOreRecipeRegistrator tRegistrator : mOreProcessing) { if (D2) GTLog.ore.println( "Processing '" + aOreDictName diff --git a/src/main/java/gregtech/api/enums/SoundResource.java b/src/main/java/gregtech/api/enums/SoundResource.java index 9de5c560159..f262dc2619a 100644 --- a/src/main/java/gregtech/api/enums/SoundResource.java +++ b/src/main/java/gregtech/api/enums/SoundResource.java @@ -2,6 +2,7 @@ import static gregtech.api.enums.Mods.GregTech; import static gregtech.api.enums.Mods.IndustrialCraft2; +import static gregtech.api.enums.Mods.TecTech; import java.util.EnumSet; import java.util.Locale; @@ -100,6 +101,10 @@ public enum SoundResource { GT_MACHINES_QUANTUM_FORCE_TRANSFORMER_LOOP(264, GregTech.ID, "machines.MTEQuantumForceTransformer"), GT_MACHINES_ADV_EBF_LOOP(265, GregTech.ID, "machines.MTEAdvEBF"), GT_MACHINES_LARGE_TURBINES_LOOP(266, GregTech.ID, "machines.MTELargeTurbine"), + TECTECH_MACHINES_FX_LOW_FREQ(267, TecTech.ID, "fx_lo_freq"), + TECTECH_MACHINES_FX_HIGH_FREQ(268, TecTech.ID, "fx_hi_freq"), + TECTECH_MACHINES_NOISE(269, TecTech.ID, "fx_noise"), + TECTECH_MACHINES_FX_WHOOUM(270, TecTech.ID, "fx_whooum"), GUI_BUTTON_DOWN(-1, GregTech.ID, "gui.buttonDown"), GUI_BUTTON_UP(-1, GregTech.ID, "gui.buttonUp"), @@ -346,7 +351,16 @@ public enum SoundResource { static { EnumSet.allOf(SoundResource.class) - .forEach(sound -> { if (sound.id >= 0) ID_SOUND_MAP.put(sound.id, sound); }); + .forEach(sound -> { + if (sound.id < 0) { + return; + } + + if (ID_SOUND_MAP.containsKey(sound.id)) { + throw new IllegalStateException(String.format("Sound ID %s is already occupied!", sound.id)); + } + ID_SOUND_MAP.put(sound.id, sound); + }); EnumSet.allOf(SoundResource.class) .forEach(sound -> RESOURCE_STR_SOUND_MAP.put(sound.resourceLocation.toString(), sound)); } diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java index 30a1561f203..0ef1d196e93 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java @@ -960,7 +960,7 @@ public boolean onRightclick(EntityPlayer aPlayer, ForgeDirection side, float aX, && mMetaTileEntity.allowCoverOnSide(coverSide, new GTItemStack(tCurrentItem))) { setCoverItemAtSide(coverSide, tCurrentItem); - coverBehavior.onPlayerAttach(aPlayer, tCurrentItem, this, side); + coverBehavior.onPlayerAttach(aPlayer, tCurrentItem, this, coverSide); mMetaTileEntity.markDirty(); if (!aPlayer.capabilities.isCreativeMode) tCurrentItem.stackSize--; diff --git a/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java index b677f6ae246..5da5bff57df 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java @@ -32,7 +32,6 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; @@ -677,10 +676,14 @@ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { } @SideOnly(Side.CLIENT) - protected void doActivitySound(ResourceLocation activitySound) { + protected void doActivitySound(SoundResource activitySound) { if (getBaseMetaTileEntity().isActive() && activitySound != null) { if (activitySoundLoop == null) { - activitySoundLoop = new GTSoundLoop(activitySound, getBaseMetaTileEntity(), false, true); + activitySoundLoop = new GTSoundLoop( + activitySound.resourceLocation, + getBaseMetaTileEntity(), + false, + true); Minecraft.getMinecraft() .getSoundHandler() .playSound(activitySoundLoop); @@ -710,7 +713,7 @@ protected SoundResource getProcessStartSound() { * @return Sound that will be looped for as long as the machine is doing a recipe */ @SideOnly(Side.CLIENT) - protected ResourceLocation getActivitySoundLoop() { + protected SoundResource getActivitySoundLoop() { return null; } diff --git a/src/main/java/gregtech/api/util/GTRecipeBuilder.java b/src/main/java/gregtech/api/util/GTRecipeBuilder.java index 69890e564df..f93f8b38c81 100644 --- a/src/main/java/gregtech/api/util/GTRecipeBuilder.java +++ b/src/main/java/gregtech/api/util/GTRecipeBuilder.java @@ -43,7 +43,7 @@ public class GTRecipeBuilder { private static final boolean DEBUG_MODE_FULL_ENERGY; // Any stable release should be tested at least once with this: -Dgt.recipebuilder.panic.invalid=true private static final boolean PANIC_MODE_INVALID; - private static final boolean DEBUG_MODE_COLLISION; + public static final boolean DEBUG_MODE_COLLISION; // Any stable release should be tested at least once with this: -Dgt.recipebuilder.panic.collision=true private static final boolean PANIC_MODE_COLLISION; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEElectricBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEElectricBlastFurnace.java index be11e400fec..47e4b75cad7 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEElectricBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEElectricBlastFurnace.java @@ -30,7 +30,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -402,7 +401,7 @@ public boolean supportsBatchMode() { @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_EBF_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_EBF_LOOP; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEFusionComputer.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEFusionComputer.java index ae005560be1..c35761c7369 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEFusionComputer.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEFusionComputer.java @@ -21,7 +21,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -546,8 +545,8 @@ public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBu @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_FUSION_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_FUSION_LOOP; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEHeatExchanger.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEHeatExchanger.java index fb90f1acc46..688fa3e706c 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEHeatExchanger.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEHeatExchanger.java @@ -48,6 +48,8 @@ import gregtech.api.util.GTModHandler; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.tileentities.machines.IRecipeProcessingAwareHatch; +import gregtech.common.tileentities.machines.MTEHatchInputME; public class MTEHeatExchanger extends MTEEnhancedMultiBlockBase implements ISurvivalConstructable { @@ -179,9 +181,19 @@ protected IAlignmentLimits getInitialAlignmentLimits() { @Override @Nonnull public CheckRecipeResult checkProcessing() { - if (mInputHotFluidHatch.getFluid() == null) return CheckRecipeResultRegistry.NO_RECIPE; + FluidStack hotFluid = null; + if (mInputHotFluidHatch instanceof MTEHatchInputME inputME) { + FluidStack[] fluids = inputME.getStoredFluids(); + if (fluids.length > 0) { + hotFluid = fluids[0]; + } + } else { + hotFluid = mInputHotFluidHatch.getFluid(); + } + + if (hotFluid == null) return CheckRecipeResultRegistry.NO_RECIPE; - int fluidAmountToConsume = mInputHotFluidHatch.getFluidAmount(); // how much fluid is in hatch + int fluidAmountToConsume = hotFluid.amount; // how much fluid is in hatch superheated_threshold = 4000; // default: must have 4000L per second to generate superheated steam float efficiency = 1f; // default: operate at 100% efficiency with no integrated circuitry @@ -202,9 +214,7 @@ public CheckRecipeResult checkProcessing() { efficiency -= penalty; - var coolant = LHECoolantRegistry.getCoolant( - mInputHotFluidHatch.getFluid() - .getFluid()); + var coolant = LHECoolantRegistry.getCoolant(hotFluid.getFluid()); if (coolant == null) { superheated_threshold = 0; @@ -220,8 +230,9 @@ public CheckRecipeResult checkProcessing() { // Don't consume too much hot fluid per second fluidAmountToConsume = Math.min(fluidAmountToConsume, superheated_threshold * 2); - - mInputHotFluidHatch.drain(fluidAmountToConsume, true); + // the 3-arg drain will work on both normal hatch and ME hatch + mInputHotFluidHatch + .drain(ForgeDirection.UNKNOWN, new FluidStack(hotFluid.getFluid(), fluidAmountToConsume), true); mOutputColdFluidHatch.fill(coolant.getColdFluid(fluidAmountToConsume), true); this.mMaxProgresstime = 20; @@ -393,4 +404,20 @@ public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBu if (mMachine) return -1; return survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 1, 3, 0, elementBudget, env, false, true); } + + @Override + public void startRecipeProcessing() { + super.startRecipeProcessing(); + if (mInputHotFluidHatch instanceof IRecipeProcessingAwareHatch aware && mInputHotFluidHatch.isValid()) { + aware.startRecipeProcessing(); + } + } + + @Override + public void endRecipeProcessing() { + super.endRecipeProcessing(); + if (mInputHotFluidHatch instanceof IRecipeProcessingAwareHatch aware && mInputHotFluidHatch.isValid()) { + aware.endRecipeProcessing(this); + } + } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbine.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbine.java index d23731d7e14..a411621eaa8 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbine.java @@ -25,7 +25,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.IBlockAccess; import net.minecraftforge.common.util.ForgeDirection; @@ -479,7 +478,7 @@ public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBu @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_LARGE_TURBINES_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_LARGE_TURBINES_LOOP; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiAutoclave.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiAutoclave.java index 10a334fb2b2..c07089a3aac 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiAutoclave.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiAutoclave.java @@ -34,7 +34,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; @@ -301,8 +300,8 @@ public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBu @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_MULTI_AUTOCLAVE_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_MULTI_AUTOCLAVE_LOOP; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiLathe.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiLathe.java index 6250a582d20..784d12c12c3 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiLathe.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiLathe.java @@ -28,7 +28,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; @@ -287,8 +286,8 @@ public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBu @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_MULTI_LATHE_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_MULTI_LATHE_LOOP; } private int mCasingAmount; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEOilDrillBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEOilDrillBase.java index 35be525c51f..721097d1c4c 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEOilDrillBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEOilDrillBase.java @@ -25,7 +25,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.chunk.Chunk; @@ -492,7 +491,7 @@ public boolean supportsVoidProtection() { @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_OIL_DRILL_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_OIL_DRILL_LOOP; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEPlasmaForge.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEPlasmaForge.java index df64db05541..0eb43414e48 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEPlasmaForge.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEPlasmaForge.java @@ -32,7 +32,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.ChunkCoordIntPair; import net.minecraftforge.common.util.ForgeDirection; @@ -1113,8 +1112,8 @@ public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBu @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_PLASMAFORGE_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_PLASMAFORGE_LOOP; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEVacuumFreezer.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEVacuumFreezer.java index bd2400b3a53..520351729bf 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEVacuumFreezer.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEVacuumFreezer.java @@ -15,7 +15,6 @@ import java.util.List; import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; import com.google.common.collect.ImmutableList; @@ -166,7 +165,7 @@ public boolean supportsBatchMode() { @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_MULTI_VACUUM_FREEZER_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_MULTI_VACUUM_FREEZER_LOOP; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitClarifier.java b/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitClarifier.java index 4cd654af282..c35511d9513 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitClarifier.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitClarifier.java @@ -21,7 +21,6 @@ import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -326,7 +325,7 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a } @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_PURIFICATIONPLANT_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_PURIFICATIONPLANT_LOOP; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitFlocculation.java b/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitFlocculation.java index 36856fa11cd..00e9807af79 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitFlocculation.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitFlocculation.java @@ -25,7 +25,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -482,7 +481,7 @@ public void loadNBTData(NBTTagCompound aNBT) { } @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_COAGULATION_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_COAGULATION_LOOP; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitOzonation.java b/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitOzonation.java index bf221d69730..bae99e306bd 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitOzonation.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitOzonation.java @@ -17,7 +17,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -269,8 +268,8 @@ public CheckRecipeResult checkProcessing() { } @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_OZONATION_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_OZONATION_LOOP; } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitPhAdjustment.java b/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitPhAdjustment.java index 803d9b684e4..464d7406480 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitPhAdjustment.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitPhAdjustment.java @@ -23,7 +23,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; @@ -572,8 +571,8 @@ public void loadNBTData(NBTTagCompound aNBT) { } @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_PURIFICATION_PH_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_PURIFICATION_PH_LOOP; } private enum SpecialHatchElement implements IHatchElement { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitPlasmaHeater.java b/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitPlasmaHeater.java index f59554171f0..3f61f02cf0d 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitPlasmaHeater.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitPlasmaHeater.java @@ -25,7 +25,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -559,7 +558,7 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a } @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_PURIFICATION_PLASMA_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_PURIFICATION_PLASMA_LOOP; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitUVTreatment.java b/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitUVTreatment.java index 464beb7cc88..e79fb96509e 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitUVTreatment.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitUVTreatment.java @@ -22,7 +22,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; import org.jetbrains.annotations.NotNull; @@ -516,7 +515,7 @@ public IGTHatchAdder adder() { } @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.IC2_MACHINES_MAGNETIZER_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.IC2_MACHINES_MAGNETIZER_LOOP; } } diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingWire.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingWire.java index d3e6750f33b..274488c7863 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingWire.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingWire.java @@ -312,7 +312,7 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic GTValues.RA.stdBuilder() .itemInputs( GTOreDictUnificator.get(OrePrefixes.ingot, Materials.Rubber, 2L), - GTOreDictUnificator.get(OrePrefixes.cableGt01, aMaterial, 1L)) + GTOreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 1L)) .itemOutputs(GTOreDictUnificator.get(OrePrefixes.cableGt01, aMaterial, 1L)) .duration(5 * SECONDS) .eut(8) @@ -321,7 +321,7 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic GTValues.RA.stdBuilder() .itemInputs( GTOreDictUnificator.get(OrePrefixes.ingot, Materials.Rubber, 2L), - GTOreDictUnificator.get(OrePrefixes.cableGt02, aMaterial, 1L)) + GTOreDictUnificator.get(OrePrefixes.wireGt02, aMaterial, 1L)) .itemOutputs(GTOreDictUnificator.get(OrePrefixes.cableGt02, aMaterial, 1L)) .duration(10 * SECONDS) .eut(16) @@ -330,7 +330,7 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic GTValues.RA.stdBuilder() .itemInputs( GTOreDictUnificator.get(OrePrefixes.ingot, Materials.Rubber, 4L), - GTOreDictUnificator.get(OrePrefixes.cableGt04, aMaterial, 1L)) + GTOreDictUnificator.get(OrePrefixes.wireGt04, aMaterial, 1L)) .itemOutputs(GTOreDictUnificator.get(OrePrefixes.cableGt04, aMaterial, 1L)) .duration(15 * SECONDS) .eut(TierEU.RECIPE_LV) diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialArcFurnace.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialArcFurnace.java index 9c2c9153ea1..28e32e1ab79 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialArcFurnace.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialArcFurnace.java @@ -24,7 +24,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; @@ -358,7 +357,7 @@ public void getWailaBody(ItemStack itemStack, List currentTip, IWailaDat @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_ARC_FURNACE_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_ARC_FURNACE_LOOP; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCuttingMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCuttingMachine.java index 8f1a748f21e..cd488cd6aff 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCuttingMachine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCuttingMachine.java @@ -24,7 +24,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; @@ -274,7 +273,7 @@ public void getWailaBody(ItemStack itemStack, List currentTip, IWailaDat @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_CUTTING_MACHINE_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_CUTTING_MACHINE_LOOP; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialSifter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialSifter.java index 604e216e5e7..d79c6150e74 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialSifter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialSifter.java @@ -15,7 +15,6 @@ import java.util.Random; import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; @@ -213,7 +212,7 @@ public boolean isOverclockerUpgradable() { @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_SIFTER_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_SIFTER_LOOP; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialThermalCentrifuge.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialThermalCentrifuge.java index 75ddb73c465..f9a366d66cf 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialThermalCentrifuge.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialThermalCentrifuge.java @@ -13,7 +13,6 @@ import net.minecraft.block.Block; import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; @@ -188,7 +187,7 @@ public byte getCasingTextureIndex() { @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_THERMAL_CENTRIFUGE_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_THERMAL_CENTRIFUGE_LOOP; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialVacuumFreezer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialVacuumFreezer.java index 90114322dc1..8d543b7bcc9 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialVacuumFreezer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialVacuumFreezer.java @@ -18,7 +18,6 @@ import java.util.Objects; import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.fluids.FluidStack; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; @@ -259,7 +258,7 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_ADV_FREEZER_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_ADV_FREEZER_LOOP; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialWashPlant.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialWashPlant.java index be3c6404020..56e099dfe90 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialWashPlant.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialWashPlant.java @@ -29,7 +29,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; @@ -430,7 +429,7 @@ public void setMachineModeIcons() { @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_MULTI_ORE_WASHER_PLANT_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_MULTI_ORE_WASHER_PLANT_LOOP; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvEBF.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvEBF.java index 737cea642ab..36455565830 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvEBF.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvEBF.java @@ -23,7 +23,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; @@ -328,7 +327,7 @@ public boolean supportsInputSeparation() { @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_ADV_EBF_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_ADV_EBF_LOOP; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvHeatExchanger.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvHeatExchanger.java index 0779c03183d..5ebf5d1659e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvHeatExchanger.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvHeatExchanger.java @@ -11,6 +11,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; @@ -35,6 +36,8 @@ import gregtech.api.util.GTModHandler; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.tileentities.machines.IRecipeProcessingAwareHatch; +import gregtech.common.tileentities.machines.MTEHatchInputME; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.block.base.BasicBlock.BlockTypes; import gtPlusPlus.core.block.base.BlockBaseModular; @@ -168,9 +171,18 @@ protected IAlignmentLimits getInitialAlignmentLimits() { @Override public @NotNull CheckRecipeResult checkProcessing() { - if (mInputHotFluidHatch.getFluid() == null) return CheckRecipeResultRegistry.SUCCESSFUL; + FluidStack hotFluid = null; + if (mInputHotFluidHatch instanceof MTEHatchInputME inputME) { + FluidStack[] fluids = inputME.getStoredFluids(); + if (fluids.length > 0) { + hotFluid = fluids[0]; + } + } else { + hotFluid = mInputHotFluidHatch.getFluid(); + } + if (hotFluid == null) return CheckRecipeResultRegistry.SUCCESSFUL; - int fluidAmountToConsume = mInputHotFluidHatch.getFluidAmount(); // how much fluid is in hatch + int fluidAmountToConsume = hotFluid.amount; // how much fluid is in hatch // The XL LHE works as fast as 32 regular LHEs. These are the comments from the original LHE, // with changes where the values needed to change for the 32x speed multiplier @@ -193,9 +205,7 @@ protected IAlignmentLimits getInitialAlignmentLimits() { efficiency -= penalty; - var coolant = LHECoolantRegistry.getCoolant( - mInputHotFluidHatch.getFluid() - .getFluid()); + var coolant = LHECoolantRegistry.getCoolant(hotFluid.getFluid()); if (coolant == null) { superheated_threshold = 0; @@ -210,8 +220,9 @@ protected IAlignmentLimits getInitialAlignmentLimits() { // Don't consume too much hot fluid per second, maximum is 2x SH threshold. fluidAmountToConsume = Math.min(fluidAmountToConsume, superheated_threshold * 2); - - mInputHotFluidHatch.drain(fluidAmountToConsume, true); + // the 3-arg drain will work on both normal hatch and ME hatch + mInputHotFluidHatch + .drain(ForgeDirection.UNKNOWN, new FluidStack(hotFluid.getFluid(), fluidAmountToConsume), true); mOutputColdFluidHatch.fill(coolant.getColdFluid(fluidAmountToConsume), true); this.mMaxProgresstime = 20; @@ -242,6 +253,7 @@ public boolean onRunningTick(ItemStack aStack) { // 1:160 ratio with distilled water consumption FluidStack distilledStack = GTModHandler.getDistilledWater(distilledConsumed); + startRecipeProcessing(); if (depleteInput(distilledStack)) // Consume the distilled water { if (superheated) { @@ -255,6 +267,7 @@ public boolean onRunningTick(ItemStack aStack) { GTLog.exp.println(this.mName + " had no more Distilled water!"); explodeMultiblock(); // Generate crater } + endRecipeProcessing(); } return true; } @@ -393,4 +406,20 @@ public static Block getFrame() { } return sFrame; } + + @Override + public void startRecipeProcessing() { + super.startRecipeProcessing(); + if (mInputHotFluidHatch instanceof IRecipeProcessingAwareHatch aware && mInputHotFluidHatch.isValid()) { + aware.startRecipeProcessing(); + } + } + + @Override + public void endRecipeProcessing() { + super.endRecipeProcessing(); + if (mInputHotFluidHatch instanceof IRecipeProcessingAwareHatch aware && mInputHotFluidHatch.isValid()) { + aware.endRecipeProcessing(this); + } + } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamCentrifuge.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamCentrifuge.java index 52338322a30..fa2bc634d8f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamCentrifuge.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamCentrifuge.java @@ -18,7 +18,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; @@ -408,8 +407,8 @@ public void loadNBTData(final NBTTagCompound aNBT) { @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_STEAM_CENTRIFUGE_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_STEAM_CENTRIFUGE_LOOP; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamCompressor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamCompressor.java index c8b441738b9..1ead5a5ce34 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamCompressor.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamCompressor.java @@ -19,7 +19,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; @@ -345,8 +344,8 @@ public void loadNBTData(final NBTTagCompound aNBT) { @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.IC2_MACHINES_COMPRESSOR_OP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.IC2_MACHINES_COMPRESSOR_OP; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamForgeHammer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamForgeHammer.java index 01e719130ea..2b06c12ece9 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamForgeHammer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamForgeHammer.java @@ -21,7 +21,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; @@ -285,8 +284,8 @@ public RecipeMap getRecipeMap() { @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.RANDOM_ANVIL_USE.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.RANDOM_ANVIL_USE; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamMacerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamMacerator.java index 0a94a3068e0..7f126efd141 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamMacerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamMacerator.java @@ -19,7 +19,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; @@ -344,8 +343,8 @@ public void loadNBTData(final NBTTagCompound aNBT) { @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.IC2_MACHINES_MACERATOR_OP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.IC2_MACHINES_MACERATOR_OP; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamMixer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamMixer.java index edbbb574eec..44fd98c06d2 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamMixer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamMixer.java @@ -24,7 +24,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; @@ -82,7 +81,7 @@ public String getMachineType() { return "Mixer"; } - private static final String STRUCTUR_PIECE_MAIN = "main"; + private static final String STRUCTURE_PIECE_MAIN = "main"; private IStructureDefinition STRUCTURE_DEFINITION = null; // spotless:off @@ -181,7 +180,7 @@ public IStructureDefinition getStructureDefinition() { STRUCTURE_DEFINITION = StructureDefinition.builder() - .addShape(STRUCTUR_PIECE_MAIN, transpose(shape)) + .addShape(STRUCTURE_PIECE_MAIN, transpose(shape)) .addElement( 'B', ofBlocksTiered( @@ -230,14 +229,20 @@ public IStructureDefinition getStructureDefinition() { @Override public void construct(ItemStack stackSize, boolean hintsOnly) { - this.buildPiece(STRUCTUR_PIECE_MAIN, stackSize, hintsOnly, HORIZONTAL_OFF_SET, VERTICAL_OFF_SET, DEPTH_OFF_SET); + this.buildPiece( + STRUCTURE_PIECE_MAIN, + stackSize, + hintsOnly, + HORIZONTAL_OFF_SET, + VERTICAL_OFF_SET, + DEPTH_OFF_SET); } @Override public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) { if (this.mMachine) return -1; return this.survivialBuildPiece( - STRUCTUR_PIECE_MAIN, + STRUCTURE_PIECE_MAIN, stackSize, HORIZONTAL_OFF_SET, VERTICAL_OFF_SET, @@ -254,16 +259,12 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a tierPipeCasing = -1; tierMachineCasing = -1; tCountCasing = 0; - if (!checkPiece(STRUCTUR_PIECE_MAIN, HORIZONTAL_OFF_SET, VERTICAL_OFF_SET, DEPTH_OFF_SET)) return false; + if (!checkPiece(STRUCTURE_PIECE_MAIN, HORIZONTAL_OFF_SET, VERTICAL_OFF_SET, DEPTH_OFF_SET)) return false; if (tierGearBoxCasing < 0 && tierPipeCasing < 0 && tierMachineCasing < 0) return false; if (tierGearBoxCasing == 1 && tierPipeCasing == 1 && tierMachineCasing == 1 && tCountCasing >= 90 - && !mSteamInputFluids.isEmpty() - && !mSteamInputs.isEmpty() - && !mSteamOutputs.isEmpty() - && !mInputHatches.isEmpty() - && !mOutputHatches.isEmpty()) { + && !mSteamInputFluids.isEmpty()) { updateHatchTexture(); tierMachine = 1; return true; @@ -271,11 +272,7 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a if (tierGearBoxCasing == 2 && tierPipeCasing == 2 && tierMachineCasing == 2 && tCountCasing >= 90 - && !mSteamInputFluids.isEmpty() - && !mSteamInputs.isEmpty() - && !mSteamOutputs.isEmpty() - && !mInputHatches.isEmpty() - && !mOutputHatches.isEmpty()) { + && !mSteamInputFluids.isEmpty()) { updateHatchTexture(); tierMachine = 2; return true; @@ -407,8 +404,8 @@ public void loadNBTData(final NBTTagCompound aNBT) { @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_STEAM_CENTRIFUGE_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_STEAM_CENTRIFUGE_LOOP; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamWasher.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamWasher.java index 4967ab4ee26..575db34e798 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamWasher.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamWasher.java @@ -20,7 +20,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; @@ -441,8 +440,8 @@ protected IAlignmentLimits getInitialAlignmentLimits() { @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_STEAM_WASHER_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_STEAM_WASHER_LOOP; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamWaterPump.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamWaterPump.java index ea0a78ccf01..f8a8384bf18 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamWaterPump.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/MTESteamWaterPump.java @@ -16,7 +16,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; @@ -376,8 +375,8 @@ protected IAlignmentLimits getInitialAlignmentLimits() { @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_WATER_PUMP_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_WATER_PUMP_LOOP; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTECyclotron.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTECyclotron.java index 7f1098b8acd..4c313a3be32 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTECyclotron.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTECyclotron.java @@ -15,7 +15,6 @@ import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; import org.jetbrains.annotations.NotNull; @@ -139,8 +138,8 @@ public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBu @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_FUSION_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_FUSION_LOOP; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEQuantumForceTransformer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEQuantumForceTransformer.java index ceeba543e89..05a65afaf23 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEQuantumForceTransformer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEQuantumForceTransformer.java @@ -33,7 +33,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.IBlockAccess; import net.minecraftforge.common.util.ForgeDirection; @@ -941,7 +940,7 @@ public boolean getDefaultHasMaintenanceChecks() { @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_QUANTUM_FORCE_TRANSFORMER_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_QUANTUM_FORCE_TRANSFORMER_LOOP; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/MTEAlgaePondBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/MTEAlgaePondBase.java index 33e4024af71..49e9878bece 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/MTEAlgaePondBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/MTEAlgaePondBase.java @@ -17,7 +17,6 @@ import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.fluids.FluidStack; import org.jetbrains.annotations.NotNull; @@ -396,7 +395,7 @@ public boolean getDefaultHasMaintenanceChecks() { @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_ALGAE_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_ALGAE_LOOP; } } diff --git a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeEntityCrusher.java b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeEntityCrusher.java index 7d01c51ebab..4e90c2634c8 100644 --- a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeEntityCrusher.java +++ b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEExtremeEntityCrusher.java @@ -63,7 +63,6 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraft.world.EnumDifficulty; import net.minecraft.world.World; import net.minecraft.world.WorldProviderHell; @@ -780,8 +779,8 @@ public void createInventorySlots() { @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_EXTREME_ENTITY_CRUSHER_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_EXTREME_ENTITY_CRUSHER_LOOP; } private static class EECFakePlayer extends FakePlayer { diff --git a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEMegaIndustrialApiary.java b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEMegaIndustrialApiary.java index 33ca31d39b5..2d3eb590d93 100644 --- a/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEMegaIndustrialApiary.java +++ b/src/main/java/kubatech/tileentity/gregtech/multiblock/MTEMegaIndustrialApiary.java @@ -61,7 +61,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; @@ -1181,7 +1180,7 @@ public int hashCode() { @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_MEGA_INDUSTRIAL_APIARY_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_MEGA_INDUSTRIAL_APIARY_LOOP; } } diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTEActiveTransformer.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTEActiveTransformer.java index d9cc9080cbc..bf353799dc5 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTEActiveTransformer.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTEActiveTransformer.java @@ -11,7 +11,6 @@ import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; import org.jetbrains.annotations.NotNull; @@ -20,8 +19,7 @@ import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.SoundResource; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -29,7 +27,6 @@ import gregtech.api.recipe.check.CheckRecipeResult; import gregtech.api.recipe.check.SimpleCheckRecipeResult; import gregtech.api.util.MultiblockTooltipBuilder; -import tectech.Reference; import tectech.thing.casing.BlockGTCasingsTT; import tectech.thing.casing.TTCasingsContainer; import tectech.thing.metaTileEntity.multi.base.TTMultiblockBase; @@ -168,12 +165,9 @@ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirec return new ITexture[] { Textures.BlockIcons.casingTexturePages[BlockGTCasingsTT.texturePage][0] }; } - public static final ResourceLocation activitySound = new ResourceLocation(Reference.MODID + ":fx_noise"); - @Override - @SideOnly(Side.CLIENT) - protected ResourceLocation getActivitySound() { - return activitySound; + protected SoundResource getActivitySoundLoop() { + return SoundResource.TECTECH_MACHINES_NOISE; } @Override diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTEDataBank.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTEDataBank.java index d3e52b97161..0118127670e 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTEDataBank.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTEDataBank.java @@ -17,7 +17,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; import org.jetbrains.annotations.NotNull; @@ -26,8 +25,7 @@ import com.gtnewhorizon.structurelib.structure.IItemSource; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.SoundResource; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IHatchElement; import gregtech.api.interfaces.ITexture; @@ -41,7 +39,6 @@ import gregtech.api.util.IGTHatchAdder; import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.common.WirelessComputationPacket; -import tectech.Reference; import tectech.mechanics.dataTransport.InventoryDataPacket; import tectech.recipe.TTRecipeAdder; import tectech.thing.casing.BlockGTCasingsTT; @@ -212,12 +209,9 @@ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirec return new ITexture[] { Textures.BlockIcons.casingTexturePages[BlockGTCasingsTT.texturePage][1] }; } - public static final ResourceLocation activitySound = new ResourceLocation(Reference.MODID + ":fx_hi_freq"); - @Override - @SideOnly(Side.CLIENT) - protected ResourceLocation getActivitySound() { - return activitySound; + protected SoundResource getActivitySoundLoop() { + return SoundResource.TECTECH_MACHINES_FX_HIGH_FREQ; } public final boolean addDataBankHatchToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTEEnergyInfuser.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTEEnergyInfuser.java index cdc4b07a56f..e40e18f9445 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTEEnergyInfuser.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTEEnergyInfuser.java @@ -9,7 +9,6 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.fluids.FluidStack; import org.jetbrains.annotations.NotNull; @@ -18,9 +17,8 @@ import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import cofh.api.energy.IEnergyContainerItem; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Materials; +import gregtech.api.enums.SoundResource; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.MTEHatchInputBus; @@ -30,7 +28,6 @@ import gregtech.common.tileentities.machines.MTEHatchInputBusME; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; -import tectech.Reference; import tectech.TecTech; import tectech.loader.ConfigHandler; import tectech.thing.casing.BlockGTCasingsTT; @@ -275,12 +272,9 @@ public MultiblockTooltipBuilder createTooltip() { return tt; } - public static final ResourceLocation activitySound = new ResourceLocation(Reference.MODID + ":fx_whooum"); - @Override - @SideOnly(Side.CLIENT) - protected ResourceLocation getActivitySound() { - return activitySound; + protected SoundResource getActivitySoundLoop() { + return SoundResource.TECTECH_MACHINES_FX_WHOOUM; } @Override diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTEEyeOfHarmony.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTEEyeOfHarmony.java index ef9d64a2167..238116cdc68 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTEEyeOfHarmony.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTEEyeOfHarmony.java @@ -46,7 +46,6 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; @@ -1854,7 +1853,7 @@ public boolean getDefaultHasMaintenanceChecks() { @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_EYE_OF_HARMONY_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_EYE_OF_HARMONY_LOOP; } } diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTEForgeOfGods.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTEForgeOfGods.java index 714e06f1782..d3ac3939272 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTEForgeOfGods.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTEForgeOfGods.java @@ -40,7 +40,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -3427,7 +3426,7 @@ public boolean getDefaultHasMaintenanceChecks() { @SideOnly(Side.CLIENT) @Override - protected ResourceLocation getActivitySoundLoop() { - return SoundResource.GT_MACHINES_GOD_FORGE_LOOP.resourceLocation; + protected SoundResource getActivitySoundLoop() { + return SoundResource.GT_MACHINES_GOD_FORGE_LOOP; } } diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTENetworkSwitch.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTENetworkSwitch.java index 4ce04dc6ab7..690aed254ff 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTENetworkSwitch.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTENetworkSwitch.java @@ -8,7 +8,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; import org.jetbrains.annotations.NotNull; @@ -17,8 +16,7 @@ import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.util.Vec3Impl; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.SoundResource; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -26,7 +24,6 @@ import gregtech.api.recipe.check.CheckRecipeResult; import gregtech.api.recipe.check.SimpleCheckRecipeResult; import gregtech.api.util.MultiblockTooltipBuilder; -import tectech.Reference; import tectech.mechanics.dataTransport.QuantumDataPacket; import tectech.thing.casing.BlockGTCasingsTT; import tectech.thing.casing.TTCasingsContainer; @@ -247,12 +244,9 @@ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirec return new ITexture[] { Textures.BlockIcons.casingTexturePages[BlockGTCasingsTT.texturePage][1] }; } - public static final ResourceLocation activitySound = new ResourceLocation(Reference.MODID + ":fx_hi_freq"); - @Override - @SideOnly(Side.CLIENT) - protected ResourceLocation getActivitySound() { - return activitySound; + protected SoundResource getActivitySoundLoop() { + return SoundResource.TECTECH_MACHINES_FX_HIGH_FREQ; } @Override diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTEQuantumComputer.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTEQuantumComputer.java index 4c57cbe3769..787a8f4ea55 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTEQuantumComputer.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTEQuantumComputer.java @@ -22,7 +22,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; import org.jetbrains.annotations.NotNull; @@ -34,6 +33,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.SoundResource; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IHatchElement; import gregtech.api.interfaces.ITexture; @@ -431,9 +431,8 @@ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirec } @Override - @SideOnly(Side.CLIENT) - protected ResourceLocation getActivitySound() { - return MTENetworkSwitch.activitySound; + protected SoundResource getActivitySoundLoop() { + return SoundResource.TECTECH_MACHINES_FX_HIGH_FREQ; } @Override diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/base/SoundLoop.java b/src/main/java/tectech/thing/metaTileEntity/multi/base/SoundLoop.java deleted file mode 100644 index c337f5093e5..00000000000 --- a/src/main/java/tectech/thing/metaTileEntity/multi/base/SoundLoop.java +++ /dev/null @@ -1,59 +0,0 @@ -package tectech.thing.metaTileEntity.multi.base; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.audio.MovingSound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; - -@SideOnly(Side.CLIENT) -public class SoundLoop extends MovingSound { - - private final boolean whileActive; - private final boolean whileInactive; - private final int worldID; - private boolean fadeMe = false; - - public SoundLoop(ResourceLocation p_i45104_1_, IGregTechTileEntity base, boolean stopWhenActive, - boolean stopWhenInactive) { - super(p_i45104_1_); - this.whileActive = stopWhenActive; - this.whileInactive = stopWhenInactive; - xPosF = base.getXCoord(); - yPosF = base.getYCoord(); - zPosF = base.getZCoord(); - worldID = base.getWorld().provider.dimensionId; - repeat = true; - volume = 0.0625f; - } - - @Override - public void update() { - if (donePlaying) { - return; - } - if (fadeMe) { - volume -= 0.0625f; - if (volume <= 0) { - volume = 0; - donePlaying = true; - } - } else if (volume < 1) { - volume += 0.0625f; - } - World world = Minecraft.getMinecraft().thePlayer.worldObj; - donePlaying = world.provider.dimensionId != worldID - || !world.checkChunksExist((int) xPosF, (int) yPosF, (int) zPosF, (int) xPosF, (int) yPosF, (int) zPosF); - if (donePlaying) return; - TileEntity tile = world.getTileEntity((int) xPosF, (int) yPosF, (int) zPosF); - if (!(tile instanceof IGregTechTileEntity)) { - donePlaying = true; - return; - } - fadeMe |= ((IGregTechTileEntity) tile).isActive() ? whileActive : whileInactive; - } -} diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/base/TTMultiblockBase.java b/src/main/java/tectech/thing/metaTileEntity/multi/base/TTMultiblockBase.java index fdc3f9f8260..8ee6eb3863b 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/base/TTMultiblockBase.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/base/TTMultiblockBase.java @@ -21,12 +21,10 @@ import javax.annotation.Nonnull; import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -60,6 +58,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.SoundResource; import gregtech.api.enums.Textures; import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.interfaces.IHatchElement; @@ -88,7 +87,6 @@ import gregtech.api.util.shutdown.ShutDownReasonRegistry; import gregtech.api.util.shutdown.SimpleShutDownReason; import gregtech.common.tileentities.machines.IDualInputHatch; -import tectech.Reference; import tectech.TecTech; import tectech.loader.ConfigHandler; import tectech.thing.gui.TecTechUITextures; @@ -117,11 +115,6 @@ public abstract class TTMultiblockBase extends MTEExtendedPowerMultiBlockBase 0; setMufflers(active); } else { - soundMagic(getActivitySound()); + doActivitySound(getActivitySoundLoop()); } }