Skip to content

Commit

Permalink
Merge branch 'master' into research-completer-node
Browse files Browse the repository at this point in the history
  • Loading branch information
Bjdufre1 authored Jan 13, 2025
2 parents ae91f62 + 6fd5d64 commit d85e2e5
Show file tree
Hide file tree
Showing 87 changed files with 662 additions and 4,360 deletions.
8 changes: 4 additions & 4 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ dependencies {
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.16-gtnh:dev")
api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-521-GTNH:dev")
api("com.github.GTNewHorizons:AE2FluidCraft-Rework:1.4.21-gtnh:dev")
api('com.github.GTNewHorizons:Yamcl:0.6.0:dev')
api("com.github.GTNewHorizons:Postea:1.0.13:dev")

Expand Down Expand Up @@ -72,7 +72,7 @@ dependencies {
compileOnly('com.github.GTNewHorizons:VisualProspecting:1.4.0:dev') { transitive = false }
compileOnly("com.github.GTNewHorizons:Galaxy-Space-GTNH:1.1.106-GTNH:dev") { transitive = false }

compileOnlyApi("com.github.GTNewHorizons:Galacticraft:3.3.1-GTNH:dev") { transitive = false }
compileOnlyApi("com.github.GTNewHorizons:Galacticraft:3.3.2-GTNH:dev") { transitive = false }
implementation("com.github.GTNewHorizons:TinkersConstruct:1.13.3-GTNH:dev")

compileOnly("com.github.GTNewHorizons:Chisel:2.16.1-GTNH:dev") { transitive = false }
Expand All @@ -97,7 +97,7 @@ dependencies {
compileOnly('com.github.GTNewHorizons:SC2:2.3.0:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:Binnie:2.5.2:dev') {transitive = false}
compileOnly('curse.maven:PlayerAPI-228969:2248928') {transitive=false}
devOnlyNonPublishable('com.github.GTNewHorizons:BlockRenderer6343:1.3.0:dev'){transitive=false}
devOnlyNonPublishable('com.github.GTNewHorizons:BlockRenderer6343:1.3.1:dev'){transitive=false}

compileOnly("com.google.auto.value:auto-value-annotations:1.10.1") { transitive = false }
annotationProcessor("com.google.auto.value:auto-value:1.10.1")
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/bartworks/common/loaders/FluidLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public static void run() {

public static Fluid createAndRegisterFluid(String Name, Color color) {
return GTFluidFactory.builder(Name)
.withLocalizedName(Name)
.withTextureName("molten.autogenerated")
.withColorRGBA(
new short[] { (short) color.getRed(), (short) color.getGreen(), (short) color.getBlue(),
Expand All @@ -134,6 +135,7 @@ public static Fluid createAndRegisterFluid(String Name, Color color) {

public static Fluid createAndRegisterFluid(String Name, Color color, int temperature) {
return GTFluidFactory.builder(Name)
.withLocalizedName(Name)
.withTextureName("molten.autogenerated")
.withColorRGBA(
new short[] { (short) color.getRed(), (short) color.getGreen(), (short) color.getBlue(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
package bartworks.common.tileentities.multis;

import static bartworks.common.loaders.ItemRegistry.BW_BLOCKS;
import static com.gtnewhorizon.structurelib.structure.IStructureElement.PlaceResult.REJECT;
import static com.gtnewhorizon.structurelib.structure.IStructureElement.PlaceResult.SKIP;
import static com.gtnewhorizon.structurelib.structure.StructureUtility.isAir;
import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
Expand Down Expand Up @@ -76,6 +78,7 @@
import gregtech.api.enums.Mods;
import gregtech.api.enums.SoundResource;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.INEIPreviewModifier;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
Expand All @@ -93,7 +96,7 @@
import gregtech.api.util.shutdown.ShutDownReason;

public class MTEElectricImplosionCompressor extends MTEExtendedPowerMultiBlockBase<MTEElectricImplosionCompressor>
implements ISurvivalConstructable {
implements ISurvivalConstructable, INEIPreviewModifier {

private static final boolean pistonEnabled = !Configuration.multiblocks.disablePistonInEIC;
private Boolean piston = true;
Expand Down Expand Up @@ -188,12 +191,31 @@ public boolean placeBlock(MTEElectricImplosionCompressor te, World world, int x,
@Override
public BlocksToPlace getBlocksToPlace(MTEElectricImplosionCompressor t, World world, int x, int y, int z,
ItemStack trigger, AutoPlaceEnvironment env) {
if (t.piston) {
Pair<Block, Integer> tier = getTier(trigger);
return BlocksToPlace.create(tier.getKey(), tier.getValue());
}
return BlocksToPlace.createEmpty();
}

@Override
public PlaceResult survivalPlaceBlock(MTEElectricImplosionCompressor t, World world, int x, int y, int z,
ItemStack trigger, AutoPlaceEnvironment env) {
if (t.piston) {
if (check(t, world, x, y, z)) return SKIP;
Pair<Block, Integer> tier = getTier(trigger);
if (tier == null) return REJECT;
return StructureUtility.survivalPlaceBlock(
tier.getKey(),
tier.getValue(),
world,
x,
y,
z,
env.getSource(),
env.getActor(),
env.getChatter());
}
return isAir().survivalPlaceBlock(t, world, x, y, z, trigger, env);
}
})
Expand Down Expand Up @@ -222,7 +244,7 @@ private static int getTierOfBlock(Block block, int meta) {
if (block == GregTechAPI.sBlockMetal5 && meta == 2) {
return 1; // Neutronium
}
if (block == LudicrousBlocks.resource_block && meta == 1) {
if (Mods.Avaritia.isModLoaded() && block == LudicrousBlocks.resource_block && meta == 1) {
return 2; // Infinity
}
if (block == GregTechAPI.sBlockMetal9) {
Expand Down Expand Up @@ -548,4 +570,9 @@ public boolean onWireCutterRightClick(ForgeDirection side, ForgeDirection wrench
public boolean supportsVoidProtection() {
return true;
}

@Override
public void onPreviewStructureComplete(@NotNull ItemStack trigger) {
resetPiston(mBlockTier);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ protected MultiblockTooltipBuilder createTooltip() {
.addOutputHatch("1-16, Hint block with dot 1", 1)
.addStructureInfo("Supports Crafting Input Buffer")
.addStructureInfo(
"ALL Hatches must be " + GTUtility.getColoredTierNameFromTier((byte) hatchTier())
"Energy Hatches must be " + GTUtility.getColoredTierNameFromTier((byte) energyHatchTier())
+ EnumChatFormatting.GRAY
+ " or better")
.toolTipFinisher();
Expand Down Expand Up @@ -120,7 +120,7 @@ public int getGlassMeta() {
}

@Override
public int hatchTier() {
public int energyHatchTier() {
return 6;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected MultiblockTooltipBuilder createTooltip() {
.addOutputHatch("1-16, Hint block with dot 1", 1)
.addStructureInfo("Supports Crafting Input Buffer")
.addStructureInfo(
"ALL Hatches must be " + GTUtility.getColoredTierNameFromTier((byte) hatchTier())
"Energy Hatches must be " + GTUtility.getColoredTierNameFromTier((byte) energyHatchTier())
+ EnumChatFormatting.GRAY
+ " or better")
.toolTipFinisher();
Expand Down Expand Up @@ -121,7 +121,7 @@ public int getGlassMeta() {
}

@Override
public int hatchTier() {
public int energyHatchTier() {
return 7;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ protected MultiblockTooltipBuilder createTooltip() {
.addOutputHatch("1-16, Hint block with dot 1", 1)
.addStructureInfo("Supports Crafting Input Buffer")
.addStructureInfo(
"ALL Hatches must be " + GTUtility.getColoredTierNameFromTier((byte) hatchTier())
"Energy Hatches must be " + GTUtility.getColoredTierNameFromTier((byte) energyHatchTier())
+ EnumChatFormatting.GRAY
+ " or better")
.toolTipFinisher();
Expand Down Expand Up @@ -122,7 +122,7 @@ public int getGlassMeta() {
}

@Override
public int hatchTier() {
public int energyHatchTier() {
return 8;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected MultiblockTooltipBuilder createTooltip() {
.addOutputHatch("1-16, Hint block with dot 1", 1)
.addStructureInfo("Supports Crafting Input Buffer")
.addStructureInfo(
"ALL Hatches must be " + GTUtility.getColoredTierNameFromTier((byte) hatchTier())
"Energy Hatches must be " + GTUtility.getColoredTierNameFromTier((byte) energyHatchTier())
+ EnumChatFormatting.GRAY
+ " or better")
.toolTipFinisher();
Expand Down Expand Up @@ -121,7 +121,7 @@ public int getGlassMeta() {
}

@Override
public int hatchTier() {
public int energyHatchTier() {
return 9;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ protected MultiblockTooltipBuilder createTooltip() {
.addOutputHatch("1-16, Hint block with dot 1", 1)
.addStructureInfo("Supports Crafting Input Buffer")
.addStructureInfo(
"ALL Hatches must be " + GTUtility.getColoredTierNameFromTier((byte) hatchTier())
"Energy Hatches must be " + GTUtility.getColoredTierNameFromTier((byte) energyHatchTier())
+ EnumChatFormatting.GRAY
+ " or better")
.toolTipFinisher();
Expand Down Expand Up @@ -122,7 +122,7 @@ public int getGlassMeta() {
}

@Override
public int hatchTier() {
public int energyHatchTier() {
return 10;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public CheckRecipeResult process() {
mFloor = (lastRecipe.mSpecialValue % 10000) * 1000000;
mCeil = (lastRecipe.mSpecialValue / 10000) * 1000000;
if (eV > mCeil || eV < mFloor) {
setOutputItems(ItemRefer.Radioactive_Waste.get(4));
overwriteOutputItems(ItemRefer.Radioactive_Waste.get(4));
}
// NA does not consume power, its hatches do. Set it to 0 to be sure
calculatedEut = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,8 @@ protected IStructureDefinition<MTELargeFusionComputer> computeValue(Class<?> typ
.atLeast(
gregtech.api.enums.HatchElement.InputHatch.or(gregtech.api.enums.HatchElement.InputBus),
gregtech.api.enums.HatchElement.OutputHatch)
.adder(MTELargeFusionComputer::addFluidIO)
.casingIndex(x.textureIndex())
.dot(1)
.hatchItemFilterAnd(x2 -> filterByMTETier(x2.hatchTier(), Integer.MAX_VALUE))
.buildAndChain(x.getGlassBlock(), x.getGlassMeta())))
.addElement(
'E',
Expand All @@ -119,7 +117,7 @@ protected IStructureDefinition<MTELargeFusionComputer> computeValue(Class<?> typ
.or(gregtech.api.enums.HatchElement.Energy))
.adder(MTELargeFusionComputer::addEnergyInjector)
.casingIndex(x.textureIndex())
.hatchItemFilterAnd(x2 -> filterByMTETier(x2.hatchTier(), Integer.MAX_VALUE))
.hatchItemFilterAnd(x2 -> filterByMTETier(x2.energyHatchTier(), Integer.MAX_VALUE))
.dot(2)
.buildAndChain(x.getCasingBlock(), x.getCasingMeta())))
.addElement('F', lazy(x -> ofFrame(x.getFrameBox())))
Expand Down Expand Up @@ -197,7 +195,7 @@ public long maxEUStore() {

public abstract int getGlassMeta();

public abstract int hatchTier();
public abstract int energyHatchTier();

public abstract Materials getFrameBox();

Expand Down Expand Up @@ -485,40 +483,17 @@ private boolean addEnergyInjector(IGregTechTileEntity aBaseMetaTileEntity, int a
IMetaTileEntity aMetaTileEntity = aBaseMetaTileEntity.getMetaTileEntity();
if (aMetaTileEntity == null) return false;
if (aMetaTileEntity instanceof MTEHatchEnergy tHatch) {
if (tHatch.getTierForStructure() < hatchTier()) return false;
if (tHatch.getTierForStructure() < energyHatchTier()) return false;
tHatch.updateTexture(aBaseCasingIndex);
return mEnergyHatches.add(tHatch);
} else if (aMetaTileEntity instanceof MTEHatchEnergyMulti tHatch) {
if (tHatch.getTierForStructure() < hatchTier()) return false;
if (tHatch.getTierForStructure() < energyHatchTier()) return false;
tHatch.updateTexture(aBaseCasingIndex);
return eEnergyMulti.add(tHatch);
}
return false;
}

private boolean addFluidIO(IGregTechTileEntity aBaseMetaTileEntity, int aBaseCasingIndex) {
IMetaTileEntity aMetaTileEntity = aBaseMetaTileEntity.getMetaTileEntity();
if (aMetaTileEntity == null) return false;
if (aMetaTileEntity instanceof MTEHatch hatch) {
hatch.updateTexture(aBaseCasingIndex);
hatch.updateCraftingIcon(this.getMachineCraftingIcon());
}
if (aMetaTileEntity instanceof MTEHatchInput tInput) {
if (tInput.getTierForStructure() < hatchTier()) return false;
tInput.mRecipeMap = getRecipeMap();
return mInputHatches.add(tInput);
}
if (aMetaTileEntity instanceof MTEHatchOutput tOutput) {
if (tOutput.getTierForStructure() < hatchTier()) return false;
return mOutputHatches.add(tOutput);
}
if (aMetaTileEntity instanceof IDualInputHatch tInput) {
tInput.updateCraftingIcon(this.getMachineCraftingIcon());
return mDualInputHatches.add(tInput);
}
return false;
}

private boolean addDroneHatch(IGregTechTileEntity aBaseMetaTileEntity, int aBaseCasingIndex) {
if (aBaseMetaTileEntity == null) return false;
IMetaTileEntity aMetaTileEntity = aBaseMetaTileEntity.getMetaTileEntity();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

import gregtech.api.interfaces.IHatchElement;
import gregtech.api.interfaces.IIconContainer;
import gregtech.api.interfaces.INEIPreviewModifier;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.items.MetaGeneratedTool;
import gregtech.api.metatileentity.implementations.MTEEnhancedMultiBlockBase;
Expand All @@ -45,7 +46,7 @@
import gregtech.common.items.MetaGeneratedTool01;

public abstract class MTELargeTurbineBase extends MTEEnhancedMultiBlockBase<MTELargeTurbineBase>
implements ISurvivalConstructable {
implements ISurvivalConstructable, INEIPreviewModifier {

private static final String STRUCTURE_PIECE_MAIN = "main";
private static final ClassValue<IStructureDefinition<MTELargeTurbineBase>> STRUCTURE_DEFINITION = new ClassValue<>() {
Expand Down Expand Up @@ -114,18 +115,6 @@ protected IHatchElement<? super MTELargeTurbineBase>[] getHatchElements() {
return new IHatchElement[] { Maintenance, InputHatch, OutputHatch, OutputBus, InputBus, Muffler };
}

@Override
public boolean checkStructure(boolean aForceReset, IGregTechTileEntity aBaseMetaTileEntity) {
boolean f = super.checkStructure(aForceReset, aBaseMetaTileEntity);
if (f && getBaseMetaTileEntity().isServerSide()) {
// while is this a client side field, blockrenderer will reuse the server world for client side rendering
// so we must set it as well...
mFormed = true;
return true;
}
return f;
}

@Override
public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
maxPower = 0;
Expand Down Expand Up @@ -405,4 +394,9 @@ public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBu
if (mMachine) return -1;
return survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 2, 2, 1, elementBudget, env, false, true);
}

@Override
public void onPreviewStructureComplete(@NotNull ItemStack trigger) {
mFormed = true;
}
}
5 changes: 2 additions & 3 deletions src/main/java/goodgenerator/loader/RecipeLoader2.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
import gregtech.api.util.GTRecipe;
import gregtech.api.util.GTUtility;
import gregtech.api.util.recipe.Scanning;
import gtPlusPlus.core.item.chemistry.GenericChem;
import gtPlusPlus.core.material.MaterialsAlloy;
import gtPlusPlus.core.material.MaterialsElements;
import gtPlusPlus.core.recipe.common.CI;
Expand Down Expand Up @@ -1556,8 +1555,8 @@ public static void RecipeLoad() {
MaterialsAlloy.TITANSTEEL.getPlateDense(8), ItemRefer.HiC_T4.get(8),
ItemList.Field_Generator_UHV.get(8),
GGMaterial.enrichedNaquadahAlloy.get(OrePrefixes.gearGtSmall, 64) },
new FluidStack[] { GenericChem.TEFLON.getFluidStack(2304), GGMaterial.dalisenite.getMolten(1152),
MaterialsAlloy.BOTMIUM.getFluidStack(288) },
new FluidStack[] { MaterialsElements.STANDALONE.RHUGNOR.getFluidStack(144),
GGMaterial.dalisenite.getMolten(1152), MaterialsAlloy.BOTMIUM.getFluidStack(288) },
ItemRefer.Compact_Fusion_MK4.get(1),
6000,
(int) TierEU.RECIPE_UV);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/gregtech/GTMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
import gregtech.api.interfaces.internal.IGTMod;
import gregtech.api.metatileentity.BaseMetaPipeEntity;
import gregtech.api.metatileentity.implementations.MTEHatchNonConsumableBase;
import gregtech.api.objects.GTItemStack;
import gregtech.api.objects.ItemData;
import gregtech.api.objects.XSTR;
import gregtech.api.registries.LHECoolantRegistry;
Expand All @@ -80,7 +81,6 @@
import gregtech.api.util.GTRecipeRegistrator;
import gregtech.api.util.GTSpawnEventHandler;
import gregtech.api.util.GTUtility;
import gregtech.api.util.item.ItemHolder;
import gregtech.common.GTDummyWorld;
import gregtech.common.GTNetwork;
import gregtech.common.GTProxy;
Expand Down Expand Up @@ -800,7 +800,7 @@ public void onIDChangingEvent(FMLModIdMappingEvent aEvent) {
for (Map<?, ?> gt_itemStackMap : GregTechAPI.sItemStackMappings) {
GTUtility.reMap(gt_itemStackMap);
}
for (SetMultimap<? extends ItemHolder, ?> gt_itemStackMap : GregTechAPI.itemStackMultiMaps) {
for (SetMultimap<GTItemStack, ?> gt_itemStackMap : GregTechAPI.itemStackMultiMaps) {
GTUtility.reMap(gt_itemStackMap);
}
} catch (Throwable e) {
Expand Down
Loading

0 comments on commit d85e2e5

Please sign in to comment.