Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Nukepowered/GregTech4 int…
Browse files Browse the repository at this point in the history
…o Nukepowered-master
  • Loading branch information
DrParadox7 committed Feb 20, 2023
1 parent 6a90322 commit e7e50a5
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 37 deletions.
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ buildscript {
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
classpath ('com.anatawa12.forge:ForgeGradle:1.2-1.0.+') {
changing = true
}
}
}

Expand All @@ -27,7 +29,7 @@ compileJava {
sourceCompatibility = targetCompatibility = '1.8'
}

version = "v416.43LE"
version = "v416.44LE"
group = "gregtechmod"
archivesBaseName = "gregtechmod"

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-bin.zip
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ public void onPreTick() {
if (isFluidChangingAllowed() && mFluid[0] != null && mFluid[0].amount <= 0) mFluid[0] = null;

if (doesEmptyContainers()) {
FluidStack tFluid = GT_Utility.getFluidForFilledItem(mInventory[getInputSlot()]);
ItemStack container = GT_Utility.copyAmount(1, mInventory[getInputSlot()]);
FluidStack tFluid = GT_Utility.getFluidForFilledItem(container);
if (tFluid != null && isFluidInputAllowed(tFluid)) {
if (getFillableStack() == null) {
if (isFluidInputAllowed(tFluid) && tFluid.amount <= getCapacity()) {
Expand Down
6 changes: 1 addition & 5 deletions src/main/java/gregtechmod/api/recipe/RecipeLogic.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,7 @@ public boolean update() {

if (base.isAllowedToWork()) {
if (progressTime > 0) {
int tmp = progressTime;
success = updateRecipeProgress();
if (tmp == 0 && !success) {
throw new IllegalStateException();
}
}

if (progressTime == 0) {
Expand Down Expand Up @@ -120,7 +116,7 @@ protected boolean updateRecipeProgress() {
progressTime = 0;
maxProgressTime = 0;
EUt = 0;

endRecipe(previousRecipe);
getMachine().endProcess();
return true;
Expand Down
21 changes: 5 additions & 16 deletions src/main/java/gregtechmod/api/util/GT_ModHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -1229,30 +1229,19 @@ public static ArrayList<ItemStack> getRecipeOutputs(List<IRecipe> aList, boolean
* Used in Ore processors.
*/
public static ItemStack getSmeltingOutput(ItemStack aInput, boolean aRemoveInput, ItemStack aOutputSlot) {
if (aInput == null) return null;
if (GT_Utility.isStackInvalid(aInput)) {
return null;
}

ItemStack rStack = GT_OreDictUnificator.get(FurnaceRecipes.smelting().getSmeltingResult(aInput));
if (rStack != null && (aOutputSlot == null || (GT_Utility.areStacksEqual(rStack, aOutputSlot) && rStack.stackSize + aOutputSlot.stackSize <= aOutputSlot.getMaxStackSize()))) {
if (aRemoveInput) aInput.stackSize--;
return rStack;
}

return null;
}

/**
* Used in my furnances to create a Recipe
*/
public static ItemStack getSmeltingOutput(List<ItemStack> inputs) {
ItemStack output = null;
for (int idx = 0; idx < inputs.size(); idx++) {
ItemStack slot = inputs.get(idx);
if (GT_Utility.isStackValid(slot) && (output = FurnaceRecipes.smelting().getSmeltingResult(slot)) != null) {
break;
}
}

return output;
}

/**
* Used in my own Recycler.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -687,11 +687,12 @@ public void onBlockClicked(World aWorld, int aX, int aY, int aZ, EntityPlayer aP
public int getDamageValue(World aWorld, int aX, int aY, int aZ) {
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);

if (tTileEntity != null && tTileEntity instanceof IGregTechTileEntity) {
return ((IGregTechTileEntity)tTileEntity).getMetaTileID();
if (tTileEntity instanceof IGregTechTileEntity) {
return ((IGregTechTileEntity) tTileEntity).getMetaTileID();
}

return 0;

final int meta = aWorld.getBlockMetadata(aX, aY, aZ);
return meta > 0 && meta < 16 ? meta : 0;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, b
mString4[tDamage] = "";
mString5[tDamage] = "";
mString6[tDamage] = "";
if (tDamage == 0) {

} else {
if (tDamage != 0) {
TileEntity temp = GregTech_API.sBlockList[1].createTileEntity(aPlayer.worldObj, tDamage > 15 ? GregTech_API.mMetaTileList[tDamage] == null ? 0 : GregTech_API.mMetaTileList[tDamage].getTileEntityBaseType() : tDamage);
if (temp != null) {
temp.setWorldObj(aPlayer.worldObj); temp.xCoord = 0; temp.yCoord = 0; temp.zCoord = 0;
Expand All @@ -72,7 +70,7 @@ public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, b
if (tTileEntity.getEUCapacity() > 10000) mString4[tDamage] = I18n.format("metatileentity.TileEntity_EUp_STORE.tooltip",tTileEntity.getEUCapacity()); else mString4[tDamage] = "";
mString5[tDamage] = (tTileEntity.isOverclockerUpgradable()?"O ":"") + (tTileEntity.isTransformerUpgradable()?"T ":"") + (tTileEntity.isBatteryUpgradable(0, (byte)0)?"B ":"") + (tTileEntity.isRFConverterUpgradable()?"M ":"") + (tTileEntity.isSteamEngineUpgradable()?"S ":"");
if (!mString5[tDamage].equals(""))
mString5[tDamage] = I18n.format("metatileentity.TileEntity_UPGRADES.tooltip") + " " + (tTileEntity.isOverclockerUpgradable()?"O ":"") + (tTileEntity.isTransformerUpgradable()?"T ":"") + (tTileEntity.isBatteryUpgradable(0, (byte)0)?"B ":"") + (tTileEntity.isRFConverterUpgradable()?"M ":"") + (tTileEntity.isSteamEngineUpgradable()?"S ":"");
mString5[tDamage] = I18n.format("metatileentity.TileEntity_UPGRADES.tooltip") + " " + (tTileEntity.isOverclockerUpgradable()?"O ":"") + (tTileEntity.isTransformerUpgradable()?"T ":"") + (tTileEntity.isBatteryUpgradable(0, (byte)0)?"B ":"") + (tTileEntity.isRFConverterUpgradable()?"M ":"") + (tTileEntity.isSteamEngineUpgradable()?"S ":"");
mString6[tDamage] = "";
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,16 @@ public Recipe findRecipe(List<ItemStack> inputs, List<FluidStack> fluidInputs, P

for (int i = 0; i < inputs.size(); i++) {
ItemStack in = inputs.get(i);
if (in != null && null != (output = GT_ModHandler.getSmeltingOutput(inputs))) {
if (in != null && null != (output = GT_ModHandler.getSmeltingOutput(in, false, null))) {
in = in.copy();
in.stackSize = 1;
// It shall cook at 3 EU/t, if this Machine is overclocked then it will consume more
// The time it usually needs, the Heating Coils re decreasing this Time, and if the Machine is overclocked, then it gets processed faster
return new Recipe(0, 3, 130, false, Collections.singletonList(RecipeEntry.singleton(in, Match.STRICT)), Collections.singletonList(output), Collections.emptyList());
return new Recipe(0, 3, 130, false,
Collections.singletonList(RecipeEntry.singleton(in, Match.STRICT)),
Collections.singletonList(output),
Collections.emptyList()
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ public void run() {

boolean tNeedsSteel = GregTech_API.sRecipeFile.get(GT_ConfigCategories.Recipes.harderrecipes, "steelForIC2Machines", true);

GT_ModHandler.removeRecipe(GT_ModHandler.getIC2Item("generator", 1));
GT_ModHandler.removeRecipeByOutput(GT_ModHandler.getIC2Item("generator", 1));
GT_ModHandler.addCraftingRecipe(GT_ModHandler.getIC2Item("generator", 1), new Object[] {"B" , "M" , "F" , 'B', OrePrefixes.battery.get(Materials.Basic), 'M', tNeedsSteel?GT_OreDictNames.craftingRawMachineTier02:GT_OreDictNames.craftingRawMachineTier00, 'F', new ItemStack(Blocks.furnace, 1, GregTech_API.ITEM_WILDCARD_DAMAGE)});
if (!tNeedsSteel) {
GT_ModHandler.addCraftingRecipe(GT_ModHandler.getIC2Item("generator", 1), new Object[] {" B ", "RRR", " F ", 'B', OrePrefixes.battery.get(Materials.Basic), 'R', OrePrefixes.plate.get(Materials.Iron) , 'F', GT_OreDictNames.craftingIronFurnace});
Expand Down Expand Up @@ -746,7 +746,11 @@ public void run() {
GT_ModHandler.addCraftingRecipe(GT_Items.Reactor_Coolant_NaK_6.getUndamaged(1), new Object[] {"THT", "TCT", "THT", 'H', GT_Items.Reactor_Coolant_NaK_3.getWildcard(1), 'T', OrePrefixes.plate.get(Materials.Tin), 'C', OrePrefixes.plateDense.get(Materials.Copper)});
GT_ModHandler.addCraftingRecipe(GT_ModHandler.getIC2Item("overclockerUpgrade", 2), new Object[] {" H ", "WCW", " ", 'H', GT_Items.Reactor_Coolant_NaK_1.getWildcard(1), 'W', GT_OreDictNames.craftingWireCopper, 'C', OrePrefixes.circuit.get(Materials.Basic)});
}


if (GregTech_API.sRecipeFile.get(GT_ConfigCategories.Recipes.gregtechrecipes, "thickreflector_beryllium", true)) {
GT_ModHandler.addCraftingRecipe(GT_ModHandler.getIC2Item("reactorReflectorThick", 1, 1), " N ", "NBN", " N ", 'B', GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Beryllium), 'N', GT_ModHandler.getIC2Item("reactorReflector", 1, 1));
}

if (GregTech_API.sRecipeFile.get(GT_ConfigCategories.Recipes.gregtechrecipes, "iridiumreflector", true)) {
GT_ModHandler.addCraftingRecipe(GT_Items.Reactor_NeutronReflector.getUndamaged(1), new Object[] {"NNN", "NIN", "NNN", 'I', OrePrefixes.plateAlloy.get("Iridium"), 'N', GT_ModHandler.getIC2Item("reactorReflectorThick", 1, 1)});
}
Expand Down

0 comments on commit e7e50a5

Please sign in to comment.