Loaders from bloodasp code

This commit is contained in:
Technus 2016-10-07 17:58:04 +02:00
parent 37c6d2407a
commit 999be045f9
12 changed files with 102 additions and 121 deletions

View file

@ -191,13 +191,11 @@ public class GT_Achievements {
if(Loader.isModLoaded("NotEnoughItems") && GT_Mod.gregtechproxy.mHideUnusedOres){
for (int i = 1; i < GregTech_API.sGeneratedMaterials.length; i++) {
if (GregTech_API.sGeneratedMaterials[i] != null) {
if(!oreList.contains(GregTech_API.sGeneratedMaterials[i])){
if ((GregTech_API.sGeneratedMaterials[i] != null) && !oreList.contains(GregTech_API.sGeneratedMaterials[i])) {
codechicken.nei.api.API.hideItem(GT_OreDictUnificator.get(OrePrefixes.ore, GregTech_API.sGeneratedMaterials[i], 1));
}
}
}
}
if (GT_Mod.gregtechproxy.mAchievements) {
AchievementPage.registerAchievementPage(new AchievementPage("GregTech 5", (Achievement[]) this.achievementList.values().toArray(
new Achievement[this.achievementList.size()])));
@ -285,8 +283,7 @@ public class GT_Achievements {
}
ItemData data = GT_OreDictUnificator.getItemData(stack);
if (data != null) {
if (data.mPrefix == OrePrefixes.ingot) {
if ((data != null) && (data.mPrefix == OrePrefixes.ingot)) {
if (data.mMaterial.mMaterial == Materials.Aluminium) {
issueAchievement(player, "gtaluminium");
} else if (data.mMaterial.mMaterial == Materials.Titanium) {
@ -309,7 +306,6 @@ public class GT_Achievements {
issueAchievement(player, "finalpreparations");
}
}
}
if (stack.getUnlocalizedName().equals("ic2.itemPartIndustrialDiamond")) {
issueAchievement(player, "artificaldia");
issueAchievement(player, "buildCoalDiamond");
@ -518,11 +514,9 @@ public class GT_Achievements {
} else if (data.mMaterial.mMaterial == Materials.Steel) {
if (data.mPrefix == OrePrefixes.ingot && stack.stackSize == stack.getMaxStackSize()) {
issueAchievement(player, "steel");
} else if (data.mPrefix == OrePrefixes.nugget && Loader.isModLoaded("Thaumcraft")) {
if (ThaumcraftApiHelper.isResearchComplete(player.getDisplayName(), "GT_IRON_TO_STEEL")) {
} else if (data.mPrefix == OrePrefixes.nugget && Loader.isModLoaded("Thaumcraft") && ThaumcraftApiHelper.isResearchComplete(player.getDisplayName(), "GT_IRON_TO_STEEL")) {
issueAchievement(player, "steel");
}
}
} else if (data.mPrefix == OrePrefixes.circuit && data.mMaterial.mMaterial == Materials.Advanced) {
issueAchievement(player, "stepforward");
}

View file

@ -1,13 +1,14 @@
package gregtech.loaders.misc;
import java.io.File;
import java.util.HashMap;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
public class OreProcessingConfiguration
implements Runnable
{
@ -40,17 +41,12 @@ public class OreProcessingConfiguration
}
}
@Override
public void run()
{
for (String tMaterialName : this.mEnabledMaterials.keySet())
{
if (this.mEnabledMaterials.get(tMaterialName))
{
Materials.valueOf(tMaterialName).mTypes |= 8;
}
else if ((Materials.valueOf(tMaterialName).mTypes & 8) != 0)
{
Materials.valueOf(tMaterialName).mTypes ^= 8;
public void run() {
for (Map.Entry<String, Boolean> aEntry : this.mEnabledMaterials.entrySet()) {
if (this.mEnabledMaterials.get(aEntry.getKey())) {
Materials.valueOf(aEntry.getKey()).mTypes |= 8;
} else if ((Materials.valueOf(aEntry.getKey()).mTypes & 8) != 0) {
Materials.valueOf(aEntry.getKey()).mTypes ^= 8;
}
}
}

View file

@ -1,11 +1,7 @@
package gregtech.loaders.oreprocessing;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
import net.minecraft.item.ItemStack;
public class ProcessingBattery implements gregtech.api.interfaces.IOreRecipeRegistrator {
@ -14,8 +10,8 @@ public class ProcessingBattery implements gregtech.api.interfaces.IOreRecipeRegi
}
public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) {
if (aMaterial == Materials.Lithium) {
/*if (aMaterial == Materials.Lithium) {
// GT_Values.RA.addAssemblerRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GT_ModHandler.getIC2Item("cropnalyzer", 1L, 32767), ItemList.Tool_Scanner.getAlmostBroken(1L, new Object[0]), 12800, 16);
}
}*/
}
}

View file

@ -61,8 +61,7 @@ public class ProcessingCell
tList.add(GT_Utility.copyAmount(64L, new Object[]{tStack}));
tStack.stackSize -= 64;
}
if (tStack.stackSize > 0) {
if (tCapsuleCount + GT_ModHandler.getCapsuleCellContainerCountMultipliedWithStackSize(new ItemStack[]{tStack}) <= 64L) {
if ((tStack.stackSize > 0) && tCapsuleCount + GT_ModHandler.getCapsuleCellContainerCountMultipliedWithStackSize(new ItemStack[]{tStack}) <= 64L) {
if (tCapsuleCount + GT_ModHandler.getCapsuleCellContainerCountMultipliedWithStackSize(new ItemStack[]{tStack}) < 0L ? tList.size() < 5 : tList.size() < 6) {
tCapsuleCount += GT_ModHandler.getCapsuleCellContainerCountMultipliedWithStackSize(new ItemStack[]{tStack});
tList.add(tStack);
@ -72,7 +71,6 @@ public class ProcessingCell
}
}
}
}
tItemAmount = (tItemAmount * tDensityMultiplier % aMaterial.getDensity() > 0L ? 1 : 0) + tItemAmount * tDensityMultiplier / aMaterial.getDensity();
if (tList.size() > 0) {
if ((aMaterial.mExtraData & 0x1) != 0) {

View file

@ -76,15 +76,13 @@ public class ProcessingDust implements gregtech.api.interfaces.IOreRecipeRegistr
tList.add(GT_Utility.copyAmount(64L, new Object[]{tStack}));
tStack.stackSize -= 64;
}
if ((tStack.stackSize > 0) && (tList.size() < 6)) {
if (tCapsuleCount + GT_ModHandler.getCapsuleCellContainerCountMultipliedWithStackSize(new ItemStack[]{tStack}) <= 64L) {
if ((tStack.stackSize > 0) && (tList.size() < 6) && (tCapsuleCount + GT_ModHandler.getCapsuleCellContainerCountMultipliedWithStackSize(new ItemStack[]{tStack}) <= 64L)) {
tCapsuleCount += GT_ModHandler.getCapsuleCellContainerCountMultipliedWithStackSize(new ItemStack[]{tStack});
tList.add(tStack);
}
}
}
}
}
tItemAmount = (tItemAmount * tDensityMultiplier % aMaterial.getDensity() > 0L ? 1 : 0) + tItemAmount * tDensityMultiplier / aMaterial.getDensity();
if (tList.size() > 0) {
FluidStack tFluid = null;

View file

@ -12,6 +12,8 @@ import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidRegistry;
import java.util.Locale;
public class ProcessingDye implements IOreRecipeRegistrator {
public ProcessingDye() {
OrePrefixes.dye.add(this);
@ -23,9 +25,9 @@ public class ProcessingDye implements IOreRecipeRegistrator {
(GT_Utility.getContainerItem(aStack, true) == null)) {
GT_ModHandler.addAlloySmelterRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glass, 8L), GT_Utility.copyAmount(1L, new Object[]{aStack}), new ItemStack(Blocks.stained_glass, 8, 15 - aDye.mIndex), 200, 8, false);
GT_ModHandler.addAlloySmelterRecipe(new ItemStack(Blocks.glass, 8, 32767), GT_Utility.copyAmount(1L, new Object[]{aStack}), new ItemStack(Blocks.stained_glass, 8, 15 - aDye.mIndex), 200, 8, false);
GT_Values.RA.addMixerRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), null, null, null, Materials.Water.getFluid(216L), FluidRegistry.getFluidStack("dye.watermixed." + aDye.name().toLowerCase(), 192), null, 16, 4);
GT_Values.RA.addMixerRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), null, null, null, GT_ModHandler.getDistilledWater(288L), FluidRegistry.getFluidStack("dye.watermixed." + aDye.name().toLowerCase(), 216), null, 16, 4);
GT_Values.RA.addChemicalRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Salt, 2), Materials.SulfuricAcid.getFluid(432), FluidRegistry.getFluidStack("dye.chemical." + aDye.name().toLowerCase(), 288), GT_Values.NI, 600, 48);
GT_Values.RA.addMixerRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), null, null, null, Materials.Water.getFluid(216L), FluidRegistry.getFluidStack("dye.watermixed." + aDye.name().toLowerCase(Locale.ENGLISH), 192), null, 16, 4);
GT_Values.RA.addMixerRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), null, null, null, GT_ModHandler.getDistilledWater(288L), FluidRegistry.getFluidStack("dye.watermixed." + aDye.name().toLowerCase(Locale.ENGLISH), 216), null, 16, 4);
GT_Values.RA.addChemicalRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Salt, 2), Materials.SulfuricAcid.getFluid(432), FluidRegistry.getFluidStack("dye.chemical." + aDye.name().toLowerCase(Locale.ENGLISH), 288), GT_Values.NI, 600, 48);
}
}
}

View file

@ -41,6 +41,7 @@ public class ProcessingIngot1 implements gregtech.api.interfaces.IOreRecipeRegis
GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(9L, Ogem1), GT_OreDictUnificator.get(OrePrefixes.plateDense, aMaterial, 1L), (int) Math.max(matgM1 * 9L, 1L), 96);
}
if (!OrePrefixes.block.isIgnored(aMaterial)) {
GT_ModHandler.addCompressionRecipe(GT_Utility.copyAmount(9L, Ogem1), GT_OreDictUnificator.get(OrePrefixes.block, aMaterial, 1L));}
if (!aMaterial.contains(SubTag.NO_WORKING)) {

View file

@ -16,12 +16,7 @@ public class ProcessingItem implements gregtech.api.interfaces.IOreRecipeRegistr
}
public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) {
if (GT_OreDictUnificator.getItemData(aStack) == null) {
if (!aOreDictName.equals("itemCertusQuartz")) {
if (!aOreDictName.equals("itemNetherQuartz")) {
if ((GT_OreDictUnificator.getItemData(aStack) == null) && !aOreDictName.equals("itemCertusQuartz") && !aOreDictName.equals("itemNetherQuartz")) {
if (aOreDictName.equals("itemSilicon")) {
GT_OreDictUnificator.addItemData(aStack, new ItemData(Materials.Silicon, 3628800L, new MaterialStack[0]));
GT_Values.RA.addFormingPressRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GT_ModHandler.getModItem("appliedenergistics2", "item.ItemMultiMaterial", 0L, 19), GT_ModHandler.getModItem("appliedenergistics2", "item.ItemMultiMaterial", 1L, 20), 200, 16);
@ -49,5 +44,3 @@ public class ProcessingItem implements gregtech.api.interfaces.IOreRecipeRegistr
}
}
}
}
}

View file

@ -42,12 +42,10 @@ public class ProcessingPlank implements gregtech.api.interfaces.IOreRecipeRegist
GT_ModHandler.removeRecipe(new ItemStack[]{tStack, tStack, tStack});
GT_ModHandler.addCraftingRecipe(GT_Utility.copyAmount(tOutput.stackSize / 3, new Object[]{tOutput}), new Object[]{"sP", Character.valueOf('P'), tStack});
}
if(tStack==null){
if(i>=16){
if((tStack == null) && (i >= 16)){
break;
}
}
}
} else {
ItemStack tOutput = GT_ModHandler.getRecipeOutput(new ItemStack[]{aStack, aStack, aStack});
if ((tOutput != null) && (tOutput.stackSize >= 3)) {

View file

@ -388,6 +388,8 @@ public class GT_CraftingRecipeLoader implements Runnable {
GT_ModHandler.addCraftingRecipe(GT_ModHandler.getModItem(aTextRailcraft, aTextMachineBeta, 8L, 0), tBitMask, new Object[]{tWrench + "PP", tHammer + "PP", Character.valueOf('P'), OrePrefixes.plate.get(Materials.AnyIron)});
GT_ModHandler.addCraftingRecipe(GT_ModHandler.getModItem(aTextRailcraft, aTextMachineBeta, 8L, 1), tBitMask, new Object[]{"GPG", "PGP", "GPG", Character.valueOf('P'), OrePrefixes.plate.get(Materials.AnyIron), Character.valueOf('G'), new ItemStack(Blocks.glass_pane, 1, 32767)});
GT_ModHandler.addCraftingRecipe(GT_ModHandler.getModItem(aTextRailcraft, aTextMachineBeta, 8L, 2), tBitMask, new Object[]{"BPB", "PLP", "BPB", Character.valueOf('P'), OrePrefixes.plate.get(Materials.AnyIron), Character.valueOf('B'), new ItemStack(Blocks.iron_bars, 1, 32767), Character.valueOf('L'), new ItemStack(Blocks.lever, 1, 32767)});
//GT_ModHandler.addCraftingRecipe(GT_ModHandler.getModItem(aTextRailcraft, aTextMachineBeta, 1L, 3), tBitMask, new Object[]{tWrench + "P", tHammer + "P", Character.valueOf('P'), OrePrefixes.plate.get(Materials.AnyIron)});
//GT_ModHandler.addCraftingRecipe(GT_ModHandler.getModItem(aTextRailcraft, aTextMachineBeta, 1L, 4), tBitMask, new Object[]{tWrench + "P", tHammer + "P", Character.valueOf('P'), OrePrefixes.plate.get(Materials.Steel)});
GT_ModHandler.addCraftingRecipe(GT_ModHandler.getModItem(aTextRailcraft, aTextMachineBeta, 1L, 5), tBitMask, new Object[]{"BBB", "BFB", "BOB", Character.valueOf('B'), OrePrefixes.ingot.get(Materials.Brick), Character.valueOf('F'), new ItemStack(Items.fire_charge, 1, 32767), Character.valueOf('O'), OreDictNames.craftingFurnace});
GT_ModHandler.addCraftingRecipe(GT_ModHandler.getModItem(aTextRailcraft, aTextMachineBeta, 1L, 6), tBitMask, new Object[]{"PUP", "BFB", "POP", Character.valueOf('P'), OrePrefixes.plate.get(Materials.Steel), Character.valueOf('B'), new ItemStack(Blocks.iron_bars, 1, 32767), Character.valueOf('F'), new ItemStack(Items.fire_charge, 1, 32767), Character.valueOf('U'), OrePrefixes.bucket.get(Materials.Empty), Character.valueOf('O'), OreDictNames.craftingFurnace});
GT_ModHandler.addCraftingRecipe(GT_ModHandler.getModItem(aTextRailcraft, aTextMachineBeta, 1L, 7), tBitMask | GT_ModHandler.RecipeBits.MIRRORED, new Object[]{"PPP", tHammer + "G" + tWrench, "OTO", Character.valueOf('P'), OrePrefixes.nugget.get(Materials.Gold), Character.valueOf('O'), GT_ModHandler.getModItem(aTextRailcraft, "part.gear", 1L, 0), Character.valueOf('G'), new ItemStack(Blocks.glass, 1, 32767), Character.valueOf('T'), OreDictNames.craftingPiston});

View file

@ -2004,6 +2004,7 @@ public class GT_MachineRecipeLoader implements Runnable {
// RobotArm
GT_Values.RA.addAssemblylineRecipe(ItemList.Robot_Arm_IV.get(1, new Object(){}),144000,new ItemStack[]{
GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.HSSG, 4L),
GT_OreDictUnificator.get(OrePrefixes.gear, Materials.HSSG, 1L),

View file

@ -29,6 +29,8 @@ import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import java.util.Locale;
public class GT_Loader_Item_Block_And_Fluid
implements Runnable {
public void run() {
@ -447,8 +449,8 @@ public class GT_Loader_Item_Block_And_Fluid
for (byte i = 0; i < Dyes.VALUES.length; i = (byte) (i + 1)) {
Dyes tDye = Dyes.VALUES[i];
Fluid tFluid;
tDye.addFluidDye(tFluid = GT_Mod.gregtechproxy.addFluid("dye.watermixed." + tDye.name().toLowerCase(), "dyes", "Water Mixed " + tDye.mName + " Dye", null, tDye.getRGBA(), 1, 295, null, null, 0));
tDye.addFluidDye(tFluid = GT_Mod.gregtechproxy.addFluid("dye.chemical." + tDye.name().toLowerCase(), "dyes", "Chemical " + tDye.mName + " Dye", null, tDye.getRGBA(), 1, 295, null, null, 0));
tDye.addFluidDye(tFluid = GT_Mod.gregtechproxy.addFluid("dye.watermixed." + tDye.name().toLowerCase(Locale.ENGLISH), "dyes", "Water Mixed " + tDye.mName + " Dye", null, tDye.getRGBA(), 1, 295, null, null, 0));
tDye.addFluidDye(tFluid = GT_Mod.gregtechproxy.addFluid("dye.chemical." + tDye.name().toLowerCase(Locale.ENGLISH), "dyes", "Chemical " + tDye.mName + " Dye", null, tDye.getRGBA(), 1, 295, null, null, 0));
FluidContainerRegistry.registerFluidContainer(new FluidStack(tFluid, 2304), ItemList.SPRAY_CAN_DYES[i].get(1L, new Object[0]), ItemList.Spray_Empty.get(1L, new Object[0]));
}
GT_Mod.gregtechproxy.addFluid("ice", "Crushed Ice", Materials.Ice, 0, 270, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Ice, 1L), ItemList.Cell_Empty.get(1L, new Object[0]), 1000);