Skip to content

Commit

Permalink
Merge branch 'GTNewHorizons:master' into removemorenaqfuels
Browse files Browse the repository at this point in the history
  • Loading branch information
StaffiX authored Jan 10, 2025
2 parents da0b55a + c2fad1f commit 130d0c7
Show file tree
Hide file tree
Showing 118 changed files with 1,653 additions and 897 deletions.
12 changes: 6 additions & 6 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@
dependencies {
api("com.github.GTNewHorizons:StructureLib:1.4.2:dev")
api("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev")
api("com.github.GTNewHorizons:NotEnoughItems:2.7.13-GTNH:dev")
api("com.github.GTNewHorizons:NotEnoughItems:2.7.15-GTNH:dev")
api("com.github.GTNewHorizons:NotEnoughIds:2.1.6:dev")
api("com.github.GTNewHorizons:GTNHLib:0.6.0:dev")
api("com.github.GTNewHorizons:GTNHLib:0.6.1:dev")
api("com.github.GTNewHorizons:ModularUI:1.2.17:dev")
api("com.github.GTNewHorizons:ModularUI2:2.2.0-1.7.10:dev")
api("com.github.GTNewHorizons:waila:1.8.2:dev")
api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-518-GTNH:dev")
api("com.github.GTNewHorizons:AE2FluidCraft-Rework:1.4.12-gtnh:dev")
api("com.github.GTNewHorizons:AE2FluidCraft-Rework:1.4.16-gtnh:dev")
api('com.github.GTNewHorizons:Yamcl:0.6.0:dev')
api("com.github.GTNewHorizons:Postea:1.0.13:dev")

Expand All @@ -64,7 +64,7 @@ dependencies {
compileOnlyApi("com.github.GTNewHorizons:EnderIO:2.9.2:dev") { transitive = false }
compileOnlyApi("com.github.GTNewHorizons:ForestryMC:4.10.1:dev") { transitive = false }
compileOnlyApi("com.github.GTNewHorizons:ProjectRed:4.11.0-GTNH:dev") { transitive = false }
compileOnlyApi("com.github.GTNewHorizons:Railcraft:9.16.1:dev") { transitive = false }
compileOnlyApi("com.github.GTNewHorizons:Railcraft:9.16.2:dev") { transitive = false }

compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.27:deobf") {transitive = false}
compileOnly("com.github.GTNewHorizons:ThaumicBases:1.8.2:dev") { transitive = false }
Expand All @@ -85,10 +85,10 @@ dependencies {
compileOnly('com.github.GTNewHorizons:HoloInventory:2.5.0-GTNH:dev') { transitive = false }
compileOnly rfg.deobf("curse.maven:extra-utilities-225561:2264384")
compileOnly rfg.deobf('curse.maven:minefactory-reloaded-66672:2366150')
compileOnly("com.github.GTNewHorizons:OpenComputers:1.11.2-GTNH:dev") {transitive = false}
compileOnly("com.github.GTNewHorizons:OpenComputers:1.11.3-GTNH:dev") {transitive = false}
// https://www.curseforge.com/minecraft/mc-mods/advancedsolarpanels
compileOnlyApi rfg.deobf('curse.maven:advsolar-362768:2885953')
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.7.2-GTNH:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.7.4-GTNH:dev') {transitive = false}
compileOnly("com.github.GTNewHorizons:BloodMagic:1.7.0:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:CraftTweaker:3.4.0:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:BetterLoadingScreen:1.7.0-GTNH:dev") { transitive = false }
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/bartworks/API/GlassTier.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ public static void addCustomGlass(String modname, String unlocalisedBlockName, i

public static void addCustomGlass(@NotNull Block block, int meta, int tier) {
Objects.requireNonNull(block, "Glass block cannot be null");
GlassTier.glasses.put(new BlockMetaPair(block, (byte) meta), tier);
GlassTier.glasses.put(new BlockMetaPair(block, meta), tier);
}

public static HashMap<BlockMetaPair, Integer> getGlassMap() {
return glasses;
}

public static int getGlassTier(Block block, int meta) {
return glasses.getOrDefault(new BlockMetaPair(block, (byte) meta), 0);
return glasses.getOrDefault(new BlockMetaPair(block, meta), 0);
}

public static class BlockMetaPair {
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/bartworks/common/loaders/recipes/Assembler.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,17 @@ public void run() {
.eut(TierEU.RECIPE_MV)
.addTo(assemblerRecipes);

GTValues.RA.stdBuilder()
.itemInputs(
ItemList.MACHINE_HULLS[3].get(1),
ItemList.Electric_Pump_HV.get(2),
GTOreDictUnificator.get(OrePrefixes.circuit, Materials.EV, 4),
GTOreDictUnificator.get(OrePrefixes.pipeLarge, Materials.StainlessSteel, 2))
.itemOutputs(ItemList.Distillation_Tower.get(1))
.duration(10 * SECONDS)
.eut(30)
.addTo(assemblerRecipes);

GTValues.RA.stdBuilder()
.itemInputs(
ItemList.Hatch_Input_HV.get(64),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import static gregtech.api.util.GTStructureUtility.buildHatchAdder;
import static gregtech.api.util.GTStructureUtility.ofCoil;

import java.util.ArrayList;
import java.util.Arrays;

import javax.annotation.Nonnull;
Expand All @@ -35,7 +34,6 @@
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;

import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
Expand All @@ -50,15 +48,13 @@
import gregtech.api.GregTechAPI;
import gregtech.api.enums.GTValues;
import gregtech.api.enums.HeatingCoilLevel;
import gregtech.api.enums.Materials;
import gregtech.api.enums.SoundResource;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.logic.ProcessingLogic;
import gregtech.api.metatileentity.implementations.MTEHatch;
import gregtech.api.metatileentity.implementations.MTEHatchEnergy;
import gregtech.api.metatileentity.implementations.MTEHatchOutput;
import gregtech.api.recipe.RecipeMap;
import gregtech.api.recipe.RecipeMaps;
import gregtech.api.recipe.check.CheckRecipeResult;
Expand All @@ -79,10 +75,7 @@ public class MTEMegaBlastFurnace extends MegaMultiBlockBase<MTEMegaBlastFurnace>
.addElement('=', StructureElementAirNoHint.getInstance())
.addElement(
't',
buildHatchAdder(MTEMegaBlastFurnace.class)
.atLeast(
OutputHatch.withAdder(MTEMegaBlastFurnace::addOutputHatchToTopList)
.withCount(t -> t.mPollutionOutputHatches.size()))
buildHatchAdder(MTEMegaBlastFurnace.class).atLeast(OutputHatch)
.casingIndex(CASING_INDEX)
.dot(1)
.buildAndChain(GregTechAPI.sBlockCasings1, CASING_INDEX))
Expand Down Expand Up @@ -144,9 +137,6 @@ private static String[][] createShape() {
}

private HeatingCoilLevel mCoilLevel;
protected final ArrayList<MTEHatchOutput> mPollutionOutputHatches = new ArrayList<>();
protected final FluidStack[] pollutionFluidStacks = { Materials.CarbonDioxide.getGas(1000),
Materials.CarbonMonoxide.getGas(1000), Materials.SulfurDioxide.getGas(1000) };
private int mHeatingCapacity;
private byte glassTier;
private final static int polPtick = PollutionConfig.basePollutionMBFSecond / 20
Expand All @@ -168,7 +158,7 @@ public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) {
@Override
protected MultiblockTooltipBuilder createTooltip() {
MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder();
tt.addMachineType("Blast Furnace, MEBF")
tt.addMachineType("Blast Furnace, MEBF, MBF")
.addParallelInfo(Configuration.Multiblocks.megaMachinesMax)
.addInfo("You can use some fluids to reduce recipe time. Place the circuit in the Input Bus")
.addInfo("Each 900K over the min. Heat required reduces power consumption by 5% (multiplicatively)")
Expand All @@ -189,7 +179,7 @@ protected MultiblockTooltipBuilder createTooltip() {
.addPollutionAmount(getPollutionPerSecond(null))
.beginStructureBlock(15, 20, 15, true)
.addController("3rd layer center")
.addCasingInfoRange("Heat Proof Machine Casing", 0, 279, false)
.addCasingInfoRange("Heat Proof Machine Casing", 0, 447, false)
.addOtherStructurePart("864x Heating Coils", "Inner 13x18x13 (Hollow)")
.addOtherStructurePart("1007x Borosilicate Glass", "Outer 15x18x15")
.addStructureInfo("The glass tier limits the Energy Input tier")
Expand All @@ -199,9 +189,7 @@ protected MultiblockTooltipBuilder createTooltip() {
.addInputBus("Any bottom layer casing")
.addInputHatch("Any bottom layer casing")
.addOutputBus("Any bottom layer casing")
.addOutputHatch("Gasses, Any top layer casing")
.addStructureInfo("Recovery amount scales with Muffler Hatch tier")
.addOutputHatch("Platline fluids, Any bottom layer casing")
.addOutputHatch("Any Heat Proof Machine Casing")
.addStructureHint("This Mega Multiblock is too big to have its structure hologram displayed fully.")
.toolTipFinisher();
return tt;
Expand Down Expand Up @@ -275,17 +263,6 @@ public int getPollutionPerSecond(ItemStack aStack) {
return polPtick * 20;
}

public boolean addOutputHatchToTopList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
if (aTileEntity == null) return false;
IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
if (aMetaTileEntity == null) return false;
if (aMetaTileEntity instanceof MTEHatchOutput) {
((MTEHatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
return this.mPollutionOutputHatches.add((MTEHatchOutput) aMetaTileEntity);
}
return false;
}

@Override
protected String[] getExtendedInfoData() {
return new String[] { StatCollector.translateToLocal("GT5U.EBF.heat") + ": "
Expand Down Expand Up @@ -344,36 +321,13 @@ public HeatingCoilLevel getCoilLevel() {
return this.mCoilLevel;
}

@Override
public boolean addOutput(FluidStack aLiquid) {
if (aLiquid == null) return false;
FluidStack tLiquid = aLiquid.copy();
boolean isOutputPollution = false;
for (FluidStack pollutionFluidStack : this.pollutionFluidStacks) {
if (!tLiquid.isFluidEqual(pollutionFluidStack)) continue;

isOutputPollution = true;
break;
}
ArrayList<MTEHatchOutput> tOutputHatches;
if (isOutputPollution) {
tOutputHatches = this.mPollutionOutputHatches;
tLiquid.amount = tLiquid.amount * Math.min(100 - getAveragePollutionPercentage(), 100) / 100;
} else {
tOutputHatches = this.mOutputHatches;
}
return dumpFluid(tOutputHatches, tLiquid, true) || dumpFluid(tOutputHatches, tLiquid, false);
}

@Override
public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) {
this.mHeatingCapacity = 0;
this.glassTier = 0;

this.setCoilLevel(HeatingCoilLevel.None);

this.mPollutionOutputHatches.clear();

if (!this.checkPiece("main", 7, 17, 0) || this.getCoilLevel() == HeatingCoilLevel.None
|| this.mMaintenanceHatches.size() != 1) return false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public boolean onEntityItemUpdate(EntityItem aItemEntity) {
int tY = MathHelper.floor_double(aItemEntity.posY);
int tZ = MathHelper.floor_double(aItemEntity.posZ);
Block tBlock = aItemEntity.worldObj.getBlock(tX, tY, tZ);
byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ);
int tMetaData = aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ);
if (tBlock == Blocks.cauldron && tMetaData > 0) {
if (this.orePrefixes == OrePrefixes.dustImpure || this.orePrefixes == OrePrefixes.dustPure) {
aItemEntity.setEntityItemStack(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import bartworks.util.MathUtils;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GTLanguageManager;
import gregtech.api.util.GTModHandler;

public class BWMetaGeneratedOres extends BWMetaGeneratedBlocks {

Expand All @@ -45,12 +44,7 @@ public BWMetaGeneratedOres(Material p_i45386_1_, Class<? extends TileEntity> til
}

@Override
protected void doRegistrationStuff(Werkstoff w) {
if (w != null) {
if (!w.hasItemType(OrePrefixes.ore) || (w.getGenerationFeatures().blacklist & 0b1000) != 0) return;
GTModHandler.addValuableOre(this, w.getmID(), 1);
}
}
protected void doRegistrationStuff(Werkstoff w) {}

public static boolean setOreBlock(World aWorld, int aX, int aY, int aZ, int aMetaData, boolean air, Block block,
int[] aBlockMeta) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GTLanguageManager;
import gregtech.api.util.GTModHandler;

public class BWMetaGeneratedSmallOres extends BWMetaGeneratedOres {

Expand All @@ -35,12 +34,7 @@ public BWMetaGeneratedSmallOres(Material p_i45386_1_, Class<? extends TileEntity
}

@Override
protected void doRegistrationStuff(Werkstoff w) {
if (w != null) {
if (!w.hasItemType(OrePrefixes.ore) || (w.getGenerationFeatures().blacklist & 0b1000) != 0) return;
GTModHandler.addValuableOre(this, w.getmID(), 1);
}
}
protected void doRegistrationStuff(Werkstoff w) {}

@Override
public String getUnlocalizedName() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,14 @@ public boolean isMiningTool() {
return false;
}

public boolean isMinableBlock(Block aBlock, byte aMetaData) {
public boolean isMinableBlock(Block aBlock, int aMetaData) {

return false;
}

@Override
public int convertBlockDrops(List<ItemStack> list, ItemStack itemStack, EntityPlayer entityPlayer, Block block,
int i, int i1, int i2, byte b, int i3, boolean b1, BlockEvent.HarvestDropsEvent harvestDropsEvent) {
int i, int i1, int i2, int b, int i3, boolean b1, BlockEvent.HarvestDropsEvent harvestDropsEvent) {
return 0;
}

Expand Down Expand Up @@ -193,8 +193,9 @@ public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase
+ EnumChatFormatting.WHITE);
}

public float getMiningSpeed(Block aBlock, byte aMetaData, float aDefault, EntityPlayer aPlayer, World aWorld,
int aX, int aY, int aZ) {
@Override
public float getMiningSpeed(Block aBlock, int aMetaData, float aDefault, EntityPlayer aPlayer, World aWorld, int aX,
int aY, int aZ) {
return aDefault;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static gregtech.api.util.GTStructureUtility.buildHatchAdder;
import static gregtech.api.util.GTStructureUtility.chainAllGlasses;
import static gregtech.api.util.GTStructureUtility.ofFrame;
import static net.minecraft.util.StatCollector.translateToLocal;

import java.util.ArrayList;
import java.util.Arrays;
Expand Down Expand Up @@ -57,16 +58,27 @@
import gregtech.api.util.IGTHatchAdder;
import gregtech.api.util.MultiblockTooltipBuilder;
import gregtech.api.util.OverclockCalculator;
import tectech.thing.metaTileEntity.multi.base.INameFunction;
import tectech.thing.metaTileEntity.multi.base.IStatusFunction;
import tectech.thing.metaTileEntity.multi.base.LedStatus;
import tectech.thing.metaTileEntity.multi.base.Parameters;

public class MTENeutronActivator extends MTETooltipMultiBlockBaseEM implements IConstructable, ISurvivalConstructable {

public Parameters.Group.ParameterIn batchSetting;

/** Name of the batch setting */
public static final INameFunction<MTENeutronActivator> BATCH_SETTING_NAME = (base,
p) -> translateToLocal("batch_mode.cfgi.0"); // Batch size
/** Status of the batch setting */
public static final IStatusFunction<MTENeutronActivator> BATCH_STATUS = (base, p) -> LedStatus
.fromLimitsInclusiveOuterBoundary(p.get(), 1, 0, 32, 128);
protected static IStructureDefinition<MTENeutronActivator> multiDefinition = null;
protected final ArrayList<MTENeutronAccelerator> mNeutronAccelerator = new ArrayList<>();
protected final ArrayList<MTENeutronSensor> mNeutronSensor = new ArrayList<>();
protected int casingAmount = 0;
protected int height = 0;
protected int eV = 0, mCeil = 0, mFloor = 0;
private GTRecipe lastRecipe;
protected static final NumberFormatMUI numberFormat;
static {
numberFormat = new NumberFormatMUI();
Expand Down Expand Up @@ -136,11 +148,12 @@ protected void setProcessingLogicPower(ProcessingLogic logic) {

@Override
public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer,
float aX, float aY, float aZ) {
batchMode = !batchMode;
if (batchMode) {
float aX, float aY, float aZ, ItemStack aTool) {
if (getMaxBatchSize() == 1) {
parametrization.trySetParameters(batchSetting.hatchId(), batchSetting.parameterId(), 128);
GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOn"));
} else {
parametrization.trySetParameters(batchSetting.hatchId(), batchSetting.parameterId(), 1);
GTUtility.sendChatToPlayer(aPlayer, StatCollector.translateToLocal("misc.BatchModeTextOff"));
}
return true;
Expand Down Expand Up @@ -294,23 +307,25 @@ public int getCurrentNeutronKineticEnergy() {
}

@Override
public boolean supportsBatchMode() {
return true;
protected void parametersInstantiation_EM() {
batchSetting = parametrization.getGroup(9, true)
.makeInParameter(1, 1, BATCH_SETTING_NAME, BATCH_STATUS);
}

@Override
public boolean supportsVoidProtection() {
return true;
protected int getMaxBatchSize() {
// Batch size 1~128
return (int) Math.min(Math.max(batchSetting.get(), 1.0D), 128.0D);
}

@Override
public boolean protectsExcessItem() {
return !eSafeVoid;
public boolean supportsBatchMode() {
return true;
}

@Override
public boolean protectsExcessFluid() {
return !eSafeVoid;
public boolean getDefaultBatchMode() {
return true;
}

@Override
Expand Down
Loading

0 comments on commit 130d0c7

Please sign in to comment.