Skip to content

Commit

Permalink
Merge branch 'master' into black-hole-compressor-sounds
Browse files Browse the repository at this point in the history
  • Loading branch information
Dream-Master committed Sep 23, 2024
2 parents 21a9bc4 + 2368c35 commit 14a49d8
Show file tree
Hide file tree
Showing 51 changed files with 213 additions and 231 deletions.
12 changes: 6 additions & 6 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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.10-1.7.10:dev")
api("com.github.GTNewHorizons:ModularUI2:2.1.11-1.7.10:dev")
api("com.github.GTNewHorizons:waila:1.8.1:dev")
api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-462-GTNH:dev")
api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-463-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")
Expand All @@ -69,18 +69,18 @@ dependencies {
compileOnly("TGregworks:TGregworks:1.7.10-GTNH-1.0.27:deobf") {transitive = false}
compileOnly("com.github.GTNewHorizons:ThaumicBases:1.7.5:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:EnderCore:0.4.6:dev") { transitive = false }
compileOnly('com.github.GTNewHorizons:VisualProspecting:1.3.22:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:VisualProspecting:1.3.24:dev') { transitive = false }
compileOnly("com.github.GTNewHorizons:Galaxy-Space-GTNH:1.1.94-GTNH:dev") { transitive = false }

compileOnlyApi("com.github.GTNewHorizons:Galacticraft:3.2.4-GTNH:dev") { transitive = false }
implementation("com.github.GTNewHorizons:TinkersConstruct:1.12.9-GTNH:dev")
compileOnlyApi("com.github.GTNewHorizons:Galacticraft:3.2.5-GTNH:dev") { transitive = false }
implementation("com.github.GTNewHorizons:TinkersConstruct:1.12.10-GTNH:dev")

compileOnly("com.github.GTNewHorizons:Chisel:2.15.2-GTNH:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:Translocators:1.2.1:dev") { transitive = false }
compileOnly rfg.deobf("curse.maven:cofh-core-69162:2388751")
compileOnly("com.github.GTNewHorizons:Nuclear-Control:2.6.7:dev") { transitive = false }
compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") { transitive = false }
implementation("com.github.GTNewHorizons:Hodgepodge:2.5.69:dev")
implementation("com.github.GTNewHorizons:Hodgepodge:2.5.70:dev")
compileOnly('com.github.GTNewHorizons:Botania:1.11.5-GTNH:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:HoloInventory:2.4.12-GTNH:dev') { transitive = false }
compileOnly rfg.deobf("curse.maven:extra-utilities-225561:2264384")
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/goodgenerator/loader/RecipeLoader2.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static void RecipeLoad() {
CrackRecipeAdder.reAddBlastRecipe(GGMaterial.zircaloy2, 513, 480, 2800, false);
CrackRecipeAdder.reAddBlastRecipe(GGMaterial.zircaloy4, 500, 480, 2800, true);
CrackRecipeAdder.reAddBlastRecipe(GGMaterial.zircaloy4, 513, 480, 2800, false);
CrackRecipeAdder.reAddBlastRecipe(GGMaterial.incoloy903, 2400, 1920, 3700, true);
CrackRecipeAdder.reAddBlastRecipe(GGMaterial.incoloy903, 1200, 1920, 3700, true);
CrackRecipeAdder.reAddBlastRecipe(GGMaterial.adamantiumAlloy, 2500, 1920, 5500, true);
CrackRecipeAdder.reAddBlastRecipe(GGMaterial.marM200, 200, 7680, 5000, true);
CrackRecipeAdder.reAddBlastRecipe(GGMaterial.marM200, 220, 7680, 5000, false);
Expand Down
15 changes: 12 additions & 3 deletions src/main/java/gregtech/api/recipe/RecipeMapBackend.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import static gregtech.api.util.GTRecipeBuilder.ENABLE_COLLISION_CHECK;
import static gregtech.api.util.GTRecipeBuilder.handleInvalidRecipe;
import static gregtech.api.util.GTRecipeBuilder.handleInvalidRecipeLowFluids;
import static gregtech.api.util.GTRecipeBuilder.handleInvalidRecipeLowItems;
import static gregtech.api.util.GTRecipeBuilder.handleRecipeCollision;
import static gregtech.api.util.GTUtility.areStacksEqualOrNull;

Expand Down Expand Up @@ -172,14 +174,21 @@ protected Collection<GTRecipe> doAdd(GTRecipeBuilder builder) {
Iterable<? extends GTRecipe> recipes = properties.recipeEmitter.apply(builder);
Collection<GTRecipe> ret = new ArrayList<>();
for (GTRecipe recipe : recipes) {
if (recipe.mFluidInputs.length < properties.minFluidInputs
|| recipe.mInputs.length < properties.minItemInputs) {
if (recipe.mInputs.length < properties.minItemInputs) {
handleInvalidRecipeLowItems();
return Collections.emptyList();
}
if (recipe.mFluidInputs.length < properties.minFluidInputs) {
handleInvalidRecipeLowFluids();
return Collections.emptyList();
}
if (properties.recipeTransformer != null) {
recipe = properties.recipeTransformer.apply(recipe);
}
if (recipe == null) continue;
if (recipe == null) {
handleInvalidRecipe();
continue;
}
if (builder.isCheckForCollision() && ENABLE_COLLISION_CHECK && checkCollision(recipe)) {
handleCollision(recipe);
continue;
Expand Down
24 changes: 24 additions & 0 deletions src/main/java/gregtech/api/util/GTRecipeBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,30 @@ public static void handleInvalidRecipe() {
}
}

public static void handleInvalidRecipeLowFluids() {
if (!DEBUG_MODE_INVALID && !PANIC_MODE_INVALID) {
return;
}
// place a breakpoint here to catch all these issues
GTLog.err.println("invalid recipe: not enough input fluids");
new IllegalArgumentException().printStackTrace(GTLog.err);
if (PANIC_MODE_INVALID) {
throw new IllegalArgumentException("invalid recipe");
}
}

public static void handleInvalidRecipeLowItems() {
if (!DEBUG_MODE_INVALID && !PANIC_MODE_INVALID) {
return;
}
// place a breakpoint here to catch all these issues
GTLog.err.println("invalid recipe: not enough input items");
new IllegalArgumentException().printStackTrace(GTLog.err);
if (PANIC_MODE_INVALID) {
throw new IllegalArgumentException("invalid recipe");
}
}

public static void handleRecipeCollision(String details) {
if (!DEBUG_MODE_COLLISION && !PANIC_MODE_COLLISION) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.minecraft.CubicObject;
import gtPlusPlus.api.objects.minecraft.SafeTexture;
import gtPlusPlus.core.lib.GTPPCore;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.InventoryUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
Expand Down Expand Up @@ -64,28 +63,28 @@ public Class<? extends ItemBlock> getItemBlockClass() {
}

/**
* A lazy way to declare the unlocal name for the block, makes boilerplating easy.
* A lazy way to declare the unlocal name for the block, makes boilerplate easy.
*
* @return The internal name for this block.
*/
public abstract String getUnlocalBlockName();

/**
* Lazy Boilerplating.
* Lazy Boilerplate.
*
* @return Block Hardness.
*/
protected abstract float initBlockHardness();

/**
* Lazy Boilerplating.
* Lazy Boilerplate.
*
* @return Block Resistance.
*/
protected abstract float initBlockResistance();

/**
* Lazy Boilerplating.
* Lazy Boilerplate.
*
* @return The {@link CreativeTab} this Block is shown on.
*/
Expand Down Expand Up @@ -131,7 +130,7 @@ private String getTileEntityNameForTexturePathing() {
/**
* An array of CubicObjects, one for each meta, else just a single cell array. Expected to be null regularly, as the
* default texture handling should suffice. Handy if re-using textures or using a non-standard structure for them.
* FULL texture path must be used, inclusive of the MODID and a colon.
* FULL texture path must be used, inclusive of the MOD ID and a colon.
*/
public CubicObject<String>[] getCustomTextureDirectoryObject() {
return null;
Expand All @@ -155,24 +154,14 @@ private void handleTextures() {

Logger.INFO("[TeTexture] Building Texture Maps for " + getTileEntityName() + ".");

// Init on the Client side only, to prevent Field initialisers existing in the Server side bytecode.
// Init on the Client side only, to prevent Field initializers existing in the Server side bytecode.
mSidedTextureArray = new ArrayList<>();
/**
* Holds the data for the six sides, each side holds an array of data for each respective meta.
*/
// Holds the data for the six sides, each side holds an array of data for each respective meta.
ArrayList<CubicObject<String>> sidedTexturePathArray = new ArrayList<>();

// Store them in forge order
// DOWN, UP, NORTH, SOUTH, WEST, EAST

// Default Path Name, this will make us look inside 'miscutils\textures\blocks'
final String aPrefixTexPath = GTPlusPlus.ID + ":";
// Default Path Name, this will make us look in the subdirectory for this Tile Entity.
final String aTexPathMid = "TileEntities" + GTPPCore.SEPERATOR
+ getTileEntityNameForTexturePathing()
+ GTPPCore.SEPERATOR;
// Construct a full path
String aTexPathBuilt = aPrefixTexPath + aTexPathMid;
String aTexPathBuilt = GTPlusPlus.ID + ":TileEntities/" + getTileEntityNameForTexturePathing() + "/";
// File Name Suffixes, without meta tags
String aStringBot;
String aStringTop;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/gtPlusPlus/core/block/base/BlockBaseFluid.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ public IIcon getIcon(int ordinalSide, int meta) {
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister icon) {
this.textureArray[0] = icon.registerIcon(GTPlusPlus.ID + ":" + "fluid/" + "Fluid_" + this.name + "_Still");
this.textureArray[1] = icon.registerIcon(GTPlusPlus.ID + ":" + "fluid/" + "Fluid_" + this.name + "_Flow");
this.textureArray[0] = icon.registerIcon(GTPlusPlus.ID + ":fluid/Fluid_" + this.name + "_Still");
this.textureArray[1] = icon.registerIcon(GTPlusPlus.ID + ":fluid/Fluid_" + this.name + "_Flow");
}

@Override
Expand Down
28 changes: 9 additions & 19 deletions src/main/java/gtPlusPlus/core/block/base/BlockBaseOre.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z
if (EnchantmentHelper.getSilkTouchModifier(player)) {
shouldSilkTouch = true;
super.harvestBlock(worldIn, player, x, y, z, meta);

if (shouldSilkTouch) {
shouldSilkTouch = false;
}
Expand All @@ -145,12 +144,9 @@ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metad
drops.add(ItemUtils.simpleMetaStack(this, metadata, 1));
} else {
switch (GTMod.gregtechproxy.oreDropSystem) {
case Item -> {
drops.add(
ItemUtils.getItemStackOfAmountFromOreDictNoBroken(
"oreRaw" + this.blockMaterial.getLocalizedName(),
1));
}
case Item -> drops.add(
ItemUtils
.getItemStackOfAmountFromOreDictNoBroken("oreRaw" + this.blockMaterial.getLocalizedName(), 1));
case FortuneItem -> {
// if shouldFortune and isNatural then get fortune drops
// if not shouldFortune or not isNatural then get normal drops
Expand All @@ -174,18 +170,12 @@ public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metad
1));
}
}
case UnifiedBlock -> {
// Unified ore
drops.add(ItemUtils.simpleMetaStack(this, metadata, 1));
}
case PerDimBlock -> {
// Per Dimension ore
drops.add(ItemUtils.simpleMetaStack(this, metadata, 1));
}
case Block -> {
// Regular ore
drops.add(ItemUtils.simpleMetaStack(this, metadata, 1));
}
// Unified ore
case UnifiedBlock -> drops.add(ItemUtils.simpleMetaStack(this, metadata, 1));
// Per Dimension ore
case PerDimBlock -> drops.add(ItemUtils.simpleMetaStack(this, metadata, 1));
// Regular ore
case Block -> drops.add(ItemUtils.simpleMetaStack(this, metadata, 1));
}
}
return drops;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

public class BlockCompressedObsidian extends BlockObsidian {

private final IIcon textureArray[] = new IIcon[11];
private final IIcon[] textureArray = new IIcon[11];

public BlockCompressedObsidian() {
this.setBlockName("blockCompressedObsidian");
Expand All @@ -49,17 +49,17 @@ public MapColor getMapColor(final int meta) {
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(final IIconRegister iicon) {
this.textureArray[0] = iicon.registerIcon(GTPlusPlus.ID + ":" + "compressed/" + "obsidian1");
this.textureArray[1] = iicon.registerIcon(GTPlusPlus.ID + ":" + "compressed/" + "obsidian2");
this.textureArray[2] = iicon.registerIcon(GTPlusPlus.ID + ":" + "compressed/" + "obsidian3");
this.textureArray[3] = iicon.registerIcon(GTPlusPlus.ID + ":" + "compressed/" + "obsidian4");
this.textureArray[4] = iicon.registerIcon(GTPlusPlus.ID + ":" + "compressed/" + "obsidian5");
this.textureArray[5] = iicon.registerIcon(GTPlusPlus.ID + ":" + "compressed/" + "obsidian_invert");
this.textureArray[6] = iicon.registerIcon(GTPlusPlus.ID + ":" + "compressed/" + "glowstone1");
this.textureArray[7] = iicon.registerIcon(GTPlusPlus.ID + ":" + "compressed/" + "glowstone2");
this.textureArray[8] = iicon.registerIcon(GTPlusPlus.ID + ":" + "compressed/" + "glowstone3");
this.textureArray[9] = iicon.registerIcon(GTPlusPlus.ID + ":" + "compressed/" + "glowstone4");
this.textureArray[10] = iicon.registerIcon(GTPlusPlus.ID + ":" + "compressed/" + "glowstone5");
this.textureArray[0] = iicon.registerIcon(GTPlusPlus.ID + ":compressed/obsidian1");
this.textureArray[1] = iicon.registerIcon(GTPlusPlus.ID + ":compressed/obsidian2");
this.textureArray[2] = iicon.registerIcon(GTPlusPlus.ID + ":compressed/obsidian3");
this.textureArray[3] = iicon.registerIcon(GTPlusPlus.ID + ":compressed/obsidian4");
this.textureArray[4] = iicon.registerIcon(GTPlusPlus.ID + ":compressed/obsidian5");
this.textureArray[5] = iicon.registerIcon(GTPlusPlus.ID + ":compressed/obsidian_invert");
this.textureArray[6] = iicon.registerIcon(GTPlusPlus.ID + ":compressed/glowstone1");
this.textureArray[7] = iicon.registerIcon(GTPlusPlus.ID + ":compressed/glowstone2");
this.textureArray[8] = iicon.registerIcon(GTPlusPlus.ID + ":compressed/glowstone3");
this.textureArray[9] = iicon.registerIcon(GTPlusPlus.ID + ":compressed/glowstone4");
this.textureArray[10] = iicon.registerIcon(GTPlusPlus.ID + ":compressed/glowstone5");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidContainerItem;
import net.minecraftforge.fluids.ItemFluidContainer;

import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
Expand Down Expand Up @@ -55,12 +54,10 @@ public IIcon getIcon(final int ordinalSide, final int meta) {
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(final IIconRegister p_149651_1_) {
this.blockIcon = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "Generic_Creative_Texture");
this.textureTop = p_149651_1_.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "Generic_Creative_Texture");
this.textureBottom = p_149651_1_
.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "Generic_Creative_Texture");
this.textureFront = p_149651_1_
.registerIcon(GTPlusPlus.ID + ":" + "TileEntities/" + "Generic_Creative_Texture");
this.blockIcon = p_149651_1_.registerIcon(GTPlusPlus.ID + ":TileEntities/Generic_Creative_Texture");
this.textureTop = p_149651_1_.registerIcon(GTPlusPlus.ID + ":TileEntities/Generic_Creative_Texture");
this.textureBottom = p_149651_1_.registerIcon(GTPlusPlus.ID + ":TileEntities/Generic_Creative_Texture");
this.textureFront = p_149651_1_.registerIcon(GTPlusPlus.ID + ":TileEntities/Generic_Creative_Texture");
}

/**
Expand All @@ -81,9 +78,8 @@ public boolean onBlockActivated(final World world, final int x, final int y, fin
} catch (Throwable t) {
handItem = null;
}
if (handItem != null
&& (handItem instanceof IFluidContainerItem || handItem instanceof ItemFluidContainer
|| FluidContainerRegistry.isFilledContainer(player.getHeldItem()))) {
if (handItem != null && (handItem instanceof IFluidContainerItem
|| FluidContainerRegistry.isFilledContainer(player.getHeldItem()))) {
if (tank.tank.getFluid() == null) {
try {
if (!FluidContainerRegistry.isFilledContainer(player.getHeldItem())) {
Expand Down
Loading

0 comments on commit 14a49d8

Please sign in to comment.