Merge branch 'Testing-new-Commits' into experimental

This commit is contained in:
Dream-Master 2016-10-02 13:49:45 +02:00
commit a64dc0f33a
22 changed files with 230 additions and 332 deletions

View file

@ -78,15 +78,15 @@ public class GT_Mod implements IGT_Mod {
public GT_Mod() {
try {
Class.forName("ic2.core.IC2").getField("enableOreDictCircuit").set(null, Boolean.valueOf(true));
Class.forName("ic2.core.IC2").getField("enableOreDictCircuit").set(null, Boolean.FALSE);
} catch (Throwable e) {
}
try {
Class.forName("ic2.core.IC2").getField("enableCraftingBucket").set(null, Boolean.valueOf(false));
Class.forName("ic2.core.IC2").getField("enableCraftingBucket").set(null, Boolean.FALSE);
} catch (Throwable e) {
}
try {
Class.forName("ic2.core.IC2").getField("enableEnergyInStorageBlockItems").set(null, Boolean.valueOf(false));
Class.forName("ic2.core.IC2").getField("enableEnergyInStorageBlockItems").set(null, Boolean.FALSE);
} catch (Throwable e) {
}
GT_Values.GT = this;
@ -100,6 +100,7 @@ public class GT_Mod implements IGT_Mod {
@Mod.EventHandler
public void onPreLoad(FMLPreInitializationEvent aEvent) {
Locale.setDefault(Locale.ENGLISH);
if (GregTech_API.sPreloadStarted) {
return;
}
@ -450,7 +451,7 @@ public class GT_Mod implements IGT_Mod {
GT_Log.out.println("GT_Mod: List of Lists of Tool Recipes: "+GT_ModHandler.sSingleNonBlockDamagableRecipeList_list.toString());
GT_Log.out.println("GT_Mod: Vanilla Recipe List -> Outputs null or stackSize <=0: " + GT_ModHandler.sVanillaRecipeList_warntOutput.toString());
GT_Log.out.println("GT_Mod: Single Non Block Damagable Recipe List -> Outputs null or stackSize <=0: " + GT_ModHandler.sSingleNonBlockDamagableRecipeList_warntOutput.toString());
GT_Log.out.println("GT_Mod: sRodMaterialList cycles: " + GT_RecipeRegistrator.sRodMaterialList_cycles);
//GT_Log.out.println("GT_Mod: sRodMaterialList cycles: " + GT_RecipeRegistrator.sRodMaterialList_cycles);
if (GT_Values.D1) {
IRecipe tRecipe;
for (Iterator i$ = GT_ModHandler.sSingleNonBlockDamagableRecipeList.iterator(); i$.hasNext(); GT_Log.out.println("=> " + tRecipe.getRecipeOutput().getDisplayName())) {
@ -683,7 +684,6 @@ public class GT_Mod implements IGT_Mod {
}
achievements = new GT_Achievements();
Map.Entry<IRecipeInput, RecipeOutput> tRecipe;
GT_Log.out.println("GT_Mod: Loading finished, deallocating temporary Init Variables.");
GregTech_API.sBeforeGTPreload = null;
GregTech_API.sAfterGTPreload = null;

View file

@ -210,7 +210,7 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
tPipeList.add(tTileEntity);
while (!temp && !isInventoryEmpty() && tTileEntity.sendItemStack(aBaseMetaTileEntity))
for (IMetaTileEntityItemPipe tPipe : tPipeList)
if (!tPipe.incrementTransferCounter(1)) temp = true;
if (!tPipe.incrementTransferCounter(1)) temp = false;
}
}
}

View file

@ -1228,12 +1228,11 @@ public class GT_ModHandler {
sAllRecipeList.clear();
sAllRecipeList.addAll(tList);
}
int sAllRecipeList_sS=sAllRecipeList.size();
for (int i = 0, j = sAllRecipeList_sS; i < j; i++) {
for (int i = 0, j = sAllRecipeList.size(); i < j; i++) {
IRecipe tRecipe = sAllRecipeList.get(i);
if (tRecipe.matches(aCrafting, aWorld)) {
if (i > 10) {
sAllRecipeList.remove(i); sAllRecipeList_sS=sAllRecipeList.size();
sAllRecipeList.remove(i);
sAllRecipeList.add(i - 10, tRecipe);
}
return tRecipe.getCraftingResult(aCrafting);
@ -1293,23 +1292,25 @@ public class GT_ModHandler {
}, 3, 3);
for (int i = 0; i < 9 && i < aRecipe.length; i++) aCrafting.setInventorySlotContents(i, aRecipe[i]);
ArrayList<IRecipe> tList = (ArrayList<IRecipe>) CraftingManager.getInstance().getRecipeList();
int tList_sS=tList.size();
try {
for (int i = 0; i < tList_sS; i++) {
temp = false;
for (int i = 0; i < tList.size(); i++) {
temp = false;
try {
temp = tList.get(i).matches(aCrafting, DW);
if (temp) {
ItemStack tOutput = aUncopiedStack ? tList.get(i).getRecipeOutput() : tList.get(i).getCraftingResult(aCrafting);
if (tOutput == null || tOutput.stackSize <= 0) {
// Seriously, who would ever do that shit?
if (!GregTech_API.sPostloadFinished)
throw new GT_ItsNotMyFaultException("Seems another Mod added a Crafting Recipe with null Output. Tell the Developer of said Mod to fix that.");
} else {
if (aUncopiedStack) return tOutput;
return GT_Utility.copy(tOutput);
}
} catch (Throwable e) {
e.printStackTrace(GT_Log.err);
}
if (temp) {
ItemStack tOutput = aUncopiedStack ? tList.get(i).getRecipeOutput() : tList.get(i).getCraftingResult(aCrafting);
if (tOutput == null || tOutput.stackSize <= 0) {
// Seriously, who would ever do that shit?
if (!GregTech_API.sPostloadFinished)
throw new GT_ItsNotMyFaultException("Seems another Mod added a Crafting Recipe with null Output. Tell the Developer of said Mod to fix that.");
} else {
if (aUncopiedStack) return tOutput;
return GT_Utility.copy(tOutput);
}
}} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
}
}
return null;
}
@ -1319,69 +1320,47 @@ public class GT_ModHandler {
* This also removes old Recipes from the List.
*/
public static ArrayList<ItemStack> getVanillyToolRecipeOutputs(ItemStack... aRecipe) {
ArrayList<ItemStack> rList = new ArrayList<ItemStack>();
if (aRecipe == null) {return rList;}
if (!GregTech_API.sPostloadStarted || GregTech_API.sPostloadFinished) {
sSingleNonBlockDamagableRecipeList.clear();sSingleNonBlockDamagableRecipeList_create = true;sSingleNonBlockDamagableRecipeList_validsShapes1.clear();}
if (sSingleNonBlockDamagableRecipeList_create/*sSingleNonBlockDamagableRecipeList.isEmpty()*/) {
if (!GregTech_API.sPostloadStarted || GregTech_API.sPostloadFinished)
sSingleNonBlockDamagableRecipeList.clear();
if (sSingleNonBlockDamagableRecipeList.isEmpty()) {
for (IRecipe tRecipe : (ArrayList<IRecipe>) CraftingManager.getInstance().getRecipeList()) {
ItemStack tStack = tRecipe.getRecipeOutput();
if (GT_Utility.isStackValid(tStack) && tStack.getMaxStackSize() == 1 && tStack.getMaxDamage() > 0 && !(tStack.getItem() instanceof ItemBlock) && !(tStack.getItem() instanceof IReactorComponent) && !isElectricItem(tStack) && !GT_Utility.isStackInList(tStack, sNonReplaceableItems)) {
//if (!(tRecipe instanceof ShapelessRecipes) || tRecipe instanceof ShapelessOreRecipe) {
if (tRecipe instanceof ShapedOreRecipe) {
boolean temp = true;
for (Object tObject : ((ShapedOreRecipe) tRecipe).getInput()) {
if (tObject != null) {
if (tObject instanceof ItemStack && (((ItemStack) tObject).getItem() == null || ((ItemStack) tObject).getMaxStackSize() < 2 || ((ItemStack) tObject).getMaxDamage() > 0 || ((ItemStack) tObject).getItem() instanceof ItemBlock)) {
if (!(tRecipe instanceof ShapelessRecipes || tRecipe instanceof ShapelessOreRecipe)) {
if (tRecipe instanceof ShapedOreRecipe) {
boolean temp = true;
for (Object tObject : ((ShapedOreRecipe) tRecipe).getInput())
if (tObject != null) {
if (tObject instanceof ItemStack && (((ItemStack) tObject).getItem() == null || ((ItemStack) tObject).getMaxStackSize() < 2 || ((ItemStack) tObject).getMaxDamage() > 0 || ((ItemStack) tObject).getItem() instanceof ItemBlock)) {
temp = false;
break;
}
if (tObject instanceof List && ((List) tObject).isEmpty()) {
temp = false;
break;
}
}
if (temp) sSingleNonBlockDamagableRecipeList.add(tRecipe);
} else if (tRecipe instanceof ShapedRecipes) {
boolean temp = true;
for (ItemStack tObject : ((ShapedRecipes) tRecipe).recipeItems) {
if (tObject != null && (tObject.getItem() == null || tObject.getMaxStackSize() < 2 || tObject.getMaxDamage() > 0 || tObject.getItem() instanceof ItemBlock)) {
temp = false;
break;
}
if (tObject instanceof List && ((List) tObject).isEmpty()) {
temp = false;
break;
}
}}
if (temp) {sSingleNonBlockDamagableRecipeList.add(tRecipe);}
} else if (tRecipe instanceof ShapedRecipes) {
boolean temp = true;
for (ItemStack tObject : ((ShapedRecipes) tRecipe).recipeItems) {
if (tObject != null && (tObject.getItem() == null || tObject.getMaxStackSize() < 2 || tObject.getMaxDamage() > 0 || tObject.getItem() instanceof ItemBlock)) {
temp = false;
break;
}
if (temp) sSingleNonBlockDamagableRecipeList.add(tRecipe);
} else {
sSingleNonBlockDamagableRecipeList.add(tRecipe);
}
if (temp) {sSingleNonBlockDamagableRecipeList.add(tRecipe);}
} else {
sSingleNonBlockDamagableRecipeList.add(tRecipe);
}
//}
}
}
GT_Log.out.println("GT_Mod: Created a List of Tool Recipes containing " + sSingleNonBlockDamagableRecipeList.size() + " Recipes for recycling." + (sSingleNonBlockDamagableRecipeList.size() > 1024 ? " Scanning all these Recipes is the reason for the startup Lag you receive right now." : E));
int aList_move = sSingleNonBlockDamagableRecipeList.size();
sSingleNonBlockDamagableRecipeList_list.add(aList_move);
sSingleNonBlockDamagableRecipeList_create = false;
sSingleNonBlockDamagableRecipeList_validsShapes1_update = true;
InventoryCrafting aCrafting = new InventoryCrafting(new Container() {
@Override
public boolean canInteractWith(EntityPlayer var1) {return false;}}, 3, 3);
for (int i = 0; i < aList_move; i++) {
for (int j = 0; j < sShapes1.length; j++) {
ItemStack[] sRecipe = sShapes1[j];
for (int l = 0; l < 9 && l < sRecipe.length; l++) {aCrafting.setInventorySlotContents(l, sRecipe[l]);}
IRecipe vRecipe = sSingleNonBlockDamagableRecipeList.get(i);
if (vRecipe.matches(aCrafting, DW)) {
if (!(sSingleNonBlockDamagableRecipeList_validsShapes1.contains(j))) {sSingleNonBlockDamagableRecipeList_validsShapes1.add(j);}
sSingleNonBlockDamagableRecipeList_verified.add(vRecipe);
}
}
}
}
/*ArrayList<ItemStack> */
if (sSingleNonBlockDamagableRecipeList_verified.size() != 0) {rList = getRecipeOutputs(sSingleNonBlockDamagableRecipeList_verified, true, aRecipe);}
if (!GregTech_API.sPostloadStarted || GregTech_API.sPostloadFinished) {
sSingleNonBlockDamagableRecipeList.clear();sSingleNonBlockDamagableRecipeList_create = true;sSingleNonBlockDamagableRecipeList_validsShapes1.clear();}
ArrayList<ItemStack> rList = getRecipeOutputs(sSingleNonBlockDamagableRecipeList, true, aRecipe);
if (!GregTech_API.sPostloadStarted || GregTech_API.sPostloadFinished)
sSingleNonBlockDamagableRecipeList.clear();
return rList;
}
@ -1399,7 +1378,7 @@ public class GT_ModHandler {
*/
public static ArrayList<ItemStack> getRecipeOutputs(List<IRecipe> aList, boolean aDeleteFromList, ItemStack... aRecipe) {
ArrayList<ItemStack> rList = new ArrayList<ItemStack>();
if (aRecipe == null || aList.size() == 0) {return rList;}
if (aRecipe == null) return rList;
boolean temp = false;
for (byte i = 0; i < aRecipe.length; i++) {
if (aRecipe[i] != null) {
@ -1407,51 +1386,33 @@ public class GT_ModHandler {
break;
}
}
if (!temp) {return rList;}
if (!temp) return rList;
InventoryCrafting aCrafting = new InventoryCrafting(new Container() {
@Override
public boolean canInteractWith(EntityPlayer var1) {
return false;
}
}, 3, 3);
for (int i = 0; i < 9 && i < aRecipe.length; i++) {aCrafting.setInventorySlotContents(i, aRecipe[i]);}
int aList_sS=aList.size();
ArrayList<Integer> tempaList_list = new ArrayList<Integer>();
if(!aDeleteFromList) {
for (int i = 0; i < aList_sS; i++) {
IRecipe tempALg0 = aList.get(i);
if (tempALg0.matches(aCrafting, DW)) {
ItemStack tOutput = tempALg0.getCraftingResult(aCrafting);
if (tOutput == null || tOutput.stackSize <= 0) {
if (!(sVanillaRecipeList_warntOutput.contains(i))) {sVanillaRecipeList_warntOutput.add(i);}
} else {
rList.add(GT_Utility.copy(tOutput));
if (aDeleteFromList) {tempaList_list.add(i);}
}
}
for (int i = 0; i < 9 && i < aRecipe.length; i++) aCrafting.setInventorySlotContents(i, aRecipe[i]);
for (int i = 0; i < aList.size(); i++) {
temp = false;
try {
temp = aList.get(i).matches(aCrafting, DW);
} catch (Throwable e) {
e.printStackTrace(GT_Log.err);
}
} else {
for (int i = 0; i < aList_sS; i++) {
IRecipe tempALg0 = aList.get(i);
ItemStack tOutput = tempALg0.getCraftingResult(aCrafting);
if (temp) {
ItemStack tOutput = aList.get(i).getCraftingResult(aCrafting);
if (tOutput == null || tOutput.stackSize <= 0) {
if (!(sSingleNonBlockDamagableRecipeList_warntOutput.contains(i))) {sSingleNonBlockDamagableRecipeList_warntOutput.add(i);}
// Seriously, who would ever do that shit?
if (!GregTech_API.sPostloadFinished)
throw new GT_ItsNotMyFaultException("Seems another Mod added a Crafting Recipe with null Output. Tell the Developer of said Mod to fix that.");
} else {
rList.add(GT_Utility.copy(tOutput));
if (aDeleteFromList) {tempaList_list.add(i);}
if (aDeleteFromList) aList.remove(i--);
}
}
}
//boolean tempaList_list_b = tempaList_list.size() != 0 ? true : false;
if (aDeleteFromList && tempaList_list.size() != 0) {
List<IRecipe> tempaList_2 = new ArrayList<IRecipe>();
for (int i = 0; i < aList_sS; i++) {
int k = 0, l = 0;
if (tempaList_list.get(k) == i) {k++;continue;}
tempaList_2.add(aList.get(l));l++;
}
aList = tempaList_2;
}
return rList;
}

View file

@ -121,8 +121,6 @@ public class GT_RecipeRegistrator {
{"Scythe", s_H + s_P + s_I, s_P + s_F + s_R, " " + " " + s_R}
};
public static volatile int VERSION = 509;
public static int sRodMaterialList_cycles = 0;
private static int i_count = 0;
public static void registerMaterialRecycling(ItemStack aStack, Materials aMaterial, long aMaterialAmount, MaterialStack aByproduct) {
if (GT_Utility.isStackInvalid(aStack)) return;
@ -153,8 +151,8 @@ public class GT_RecipeRegistrator {
ItemData tData = GT_OreDictUnificator.getItemData(aStack);
boolean tHide = (aMaterial != Materials.Iron)&&(GT_Mod.gregtechproxy.mHideRecyclingRecipes);
if(tHide && tData!=null&&tData.hasValidPrefixData()&&tData.mPrefix==OrePrefixes.ingot){
tHide=false;
}
tHide=false;
}
RA.addFluidSmelterRecipe(GT_Utility.copyAmount(1, aStack), aByproduct == null ? null : aByproduct.mMaterial.contains(SubTag.NO_SMELTING) || !aByproduct.mMaterial.contains(SubTag.METAL) ? aByproduct.mMaterial.contains(SubTag.FLAMMABLE) ? GT_OreDictUnificator.getDust(Materials.Ash, aByproduct.mAmount / 2) : aByproduct.mMaterial.contains(SubTag.UNBURNABLE) ? GT_OreDictUnificator.getDustOrIngot(aByproduct.mMaterial.mSmeltInto, aByproduct.mAmount) : null : GT_OreDictUnificator.getIngotOrDust(aByproduct.mMaterial.mSmeltInto, aByproduct.mAmount), aMaterial.mSmeltInto.getMolten((L * aMaterialAmount) / (M * aStack.stackSize)), 10000, (int) Math.max(1, (24 * aMaterialAmount) / M), Math.max(8, (int) Math.sqrt(2 * aMaterial.mSmeltInto.mStandardMoltenFluid.getTemperature())), tHide);
}
@ -191,8 +189,8 @@ public class GT_RecipeRegistrator {
for (MaterialStack tMaterial : aData.getAllMaterialStacks()) {
if (tMaterial.mMaterial == Materials.Iron||tMaterial.mMaterial == Materials.Copper ||
tMaterial.mMaterial == Materials.WroughtIron||tMaterial.mMaterial == Materials.AnnealedCopper) tIron = true;
tMaterial.mMaterial == Materials.WroughtIron||tMaterial.mMaterial == Materials.AnnealedCopper) tIron = true;
if (tMaterial.mMaterial.contains(SubTag.UNBURNABLE)) {
tMaterial.mMaterial = tMaterial.mMaterial.mSmeltInto.mArcSmeltInto;
continue;
@ -230,7 +228,7 @@ public class GT_RecipeRegistrator {
long tAmount = 0;
for (MaterialStack tMaterial : aData.getAllMaterialStacks())
tAmount += tMaterial.mAmount * tMaterial.mMaterial.getMass();
boolean tHide = !tIron && GT_Mod.gregtechproxy.mHideRecyclingRecipes;
RA.addArcFurnaceRecipe(aStack, new ItemStack[]{GT_OreDictUnificator.getIngotOrDust(aData.mMaterial), GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(0)), GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(1)), GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(2))}, null, (int) Math.max(16, tAmount / M), 96, tHide);
}
@ -274,7 +272,7 @@ public class GT_RecipeRegistrator {
* You give this Function a Material and it will scan almost everything for adding recycling Recipes
*
* @param aMat a Material, for example an Ingot or a Gem.
* @param aPlate the Dust you usually get from macerating aMat
* @param aOutput the Dust you usually get from macerating aMat
* @param aRecipeReplacing allows to replace the Recipe with a Plate variant
*/
public static synchronized void registerUsagesForMaterials(ItemStack aMat, String aPlate, boolean aRecipeReplacing) {
@ -282,11 +280,8 @@ public class GT_RecipeRegistrator {
aMat = GT_Utility.copy(aMat);
ItemStack tStack;
ItemData aItemData = GT_OreDictUnificator.getItemData(aMat);
boolean aItemData_b_0 = aItemData != null ? true : false;
if (!aItemData_b_0 || aItemData.mPrefix != OrePrefixes.ingot) {aPlate = null;}
if (aItemData == null || aItemData.mPrefix != OrePrefixes.ingot) aPlate = null;
if (aPlate != null && GT_OreDictUnificator.getFirstOre(aPlate, 1) == null) aPlate = null;
boolean aItemData_b_1 = aItemData.hasValidPrefixMaterialData() ? true : false;
boolean aPlate_b_0 = aPlate != null ? true : false;
sMt1.func_150996_a(aMat.getItem());
sMt1.stackSize = 1;
@ -301,13 +296,12 @@ public class GT_RecipeRegistrator {
for (ItemStack tMat : tRecipe) {
if (tMat == sMt1) tAmount1++;
}
if (aItemData_b_0 && aItemData_b_1)
if (aItemData != null && aItemData.hasValidPrefixMaterialData())
for (ItemStack tCrafted : GT_ModHandler.getRecipeOutputs(tRecipe)) {
GT_OreDictUnificator.addItemData(tCrafted, new ItemData(aItemData.mMaterial.mMaterial, aItemData.mMaterial.mAmount * tAmount1));
}
}
GT_ModHandler.getVanillyToolRecipeOutputs(sShapes1[0]);
for (Materials tMaterial : sRodMaterialList) {
ItemStack tMt2 = GT_OreDictUnificator.get(OrePrefixes.stick, tMaterial, 1);
if (tMt2 != null) {
@ -315,48 +309,37 @@ public class GT_RecipeRegistrator {
sMt2.stackSize = 1;
Items.feather.setDamage(sMt2, Items.feather.getDamage(tMt2));
if (GT_ModHandler.sSingleNonBlockDamagableRecipeList.size() == 0 || GT_ModHandler.sSingleNonBlockDamagableRecipeList_validsShapes1.size() == 0 || GT_ModHandler.sSingleNonBlockDamagableRecipeList_verified.size() == 0) { sRodMaterialList_cycles++;continue;}
int sShapes1_len = GT_ModHandler.sSingleNonBlockDamagableRecipeList_validsShapes1.size();
for (int i = 0; i < sShapes1_len; i++) {
int i2 = GT_ModHandler.sSingleNonBlockDamagableRecipeList_validsShapes1.get(i);
ItemStack[] tRecipe = sShapes1[i2];
if (tRecipe == null) continue;
for (int i = 0; i < sShapes1.length; i++) {
ItemStack[] tRecipe = sShapes1[i];
int tAmount1 = 0, tAmount2 = 0;
for (ItemStack tMat : tRecipe) {
if (tMat == sMt1) tAmount1++;
if (tMat == sMt2) tAmount2++;
}
List<ItemStack> tempTest = GT_ModHandler.getVanillyToolRecipeOutputs(tRecipe);
if (GT_ModHandler.sSingleNonBlockDamagableRecipeList_validsShapes1_update && GT_ModHandler.sSingleNonBlockDamagableRecipeList_validsShapes1.size() != 0) {sShapes1_len = GT_ModHandler.sSingleNonBlockDamagableRecipeList_validsShapes1.size();GT_ModHandler.sSingleNonBlockDamagableRecipeList_validsShapes1_update = false;}
int tempTest_size_sS = tempTest.size();
if (tempTest_size_sS > 0) {
for (ItemStack tCrafted : tempTest/*GT_ModHandler.getVanillyToolRecipeOutputs(tRecipe)*/) {
if (aItemData_b_0 && aItemData_b_1) {
GT_OreDictUnificator.addItemData(tCrafted, new ItemData(aItemData.mMaterial.mMaterial, aItemData.mMaterial.mAmount * tAmount1, new MaterialStack(tMaterial, OrePrefixes.stick.mMaterialAmount * tAmount2)));
}
for (ItemStack tCrafted : GT_ModHandler.getVanillyToolRecipeOutputs(tRecipe)) {
if (aItemData != null && aItemData.hasValidPrefixMaterialData())
GT_OreDictUnificator.addItemData(tCrafted, new ItemData(aItemData.mMaterial.mMaterial, aItemData.mMaterial.mAmount * tAmount1, new MaterialStack(tMaterial, OrePrefixes.stick.mMaterialAmount * tAmount2)));
if (aRecipeReplacing && aPlate_b_0 && sShapesA[i2] != null && sShapesA[i2].length > 1) {
//assert aItemData != null;//dead dev code or decomp JAD?
if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.recipereplacements, new StringBuilder().append(aItemData.mMaterial.mMaterial).append('.').append(sShapesA[i2][0]).toString(), true)) {
if (null != (tStack = GT_ModHandler.removeRecipe(tRecipe))) {
switch (sShapesA[i].length) {
case 2:
GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.BUFFERED, new Object[]{sShapesA[i2][1], s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData});
break;
case 3:
GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.BUFFERED, new Object[]{sShapesA[i2][1], sShapesA[i2][2], s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData});
break;
default:
GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.BUFFERED, new Object[]{sShapesA[i2][1], sShapesA[i2][2], sShapesA[i2][3], s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData});
break;
}
if (aRecipeReplacing && aPlate != null && sShapesA[i] != null && sShapesA[i].length > 1) {
assert aItemData != null;
if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.recipereplacements, aItemData.mMaterial.mMaterial + "." + sShapesA[i][0], true)) {
if (null != (tStack = GT_ModHandler.removeRecipe(tRecipe))) {
switch (sShapesA[i].length) {
case 2:
GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.BUFFERED, new Object[]{sShapesA[i][1], s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData});
break;
case 3:
GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.BUFFERED, new Object[]{sShapesA[i][1], sShapesA[i][2], s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData});
break;
default:
GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.BUFFERED, new Object[]{sShapesA[i][1], sShapesA[i][2], sShapesA[i][3], s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData});
break;
}
}
}
}
}
sRodMaterialList_cycles++;
}
}
}

View file

@ -869,10 +869,12 @@ public class GT_Utility {
return false;
}
}
ItemStack[] tStack = GT_OreDictUnificator.getStackArray(true, aOutput);
if(tStack==null||(tStack.length>0&&GT_Utility.areStacksEqual(aInput, tStack[0])))return false;
if (tOreName != null) {
aRecipeList.put(new RecipeInputOreDict(tOreName.toString(), aInput.stackSize), new RecipeOutput(aNBT, GT_OreDictUnificator.getStackArray(true, aOutput)));
aRecipeList.put(new RecipeInputOreDict(tOreName.toString(), aInput.stackSize), new RecipeOutput(aNBT, tStack));
} else {
aRecipeList.put(new RecipeInputItemStack(copy(aInput), aInput.stackSize), new RecipeOutput(aNBT, GT_OreDictUnificator.getStackArray(true, aOutput)));
aRecipeList.put(new RecipeInputItemStack(copy(aInput), aInput.stackSize), new RecipeOutput(aNBT, tStack));
}
return true;
}
@ -929,7 +931,7 @@ public class GT_Utility {
}
public static boolean doSoundAtClient(String aSoundName, int aTimeUntilNextSound, float aSoundStrength, double aX, double aY, double aZ) {
return doSoundAtClient(aSoundName, aTimeUntilNextSound, aSoundStrength, 0.9F + new Random().nextFloat() * 0.2F, aX, aY, aZ);
return doSoundAtClient(aSoundName, aTimeUntilNextSound, aSoundStrength, 1.01818028F, aX, aY, aZ);
}
public static boolean doSoundAtClient(String aSoundName, int aTimeUntilNextSound, float aSoundStrength, float aSoundModulation, double aX, double aY, double aZ) {
@ -1053,35 +1055,15 @@ public class GT_Utility {
}
public static boolean isOpaqueBlock(World aWorld, int aX, int aY, int aZ) {
boolean result;
try {
result=aWorld.getBlock(aX, aY, aZ).isOpaqueCube();
} catch (Throwable e) {
result=true;
}
return result;
return aWorld.getBlock(aX, aY, aZ).isOpaqueCube();
}
public static boolean isBlockAir(World aWorld, int aX, int aY, int aZ) {
boolean result;
try {
result=aWorld.getBlock(aX, aY, aZ).isAir(aWorld, aX, aY, aZ);
} catch (Throwable e) {
result=false;
}
return result;
}
return aWorld.getBlock(aX, aY, aZ).isAir(aWorld, aX, aY, aZ);
}
public static boolean hasBlockHitBox(World aWorld, int aX, int aY, int aZ) {
boolean result;
try {
result=aWorld.getBlock(aX, aY, aZ).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ) != null;
} catch (Throwable e) {
result=false;
}
return result;
return aWorld.getBlock(aX, aY, aZ).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ) != null;
}
public static void setCoordsOnFire(World aWorld, int aX, int aY, int aZ, boolean aReplaceCenter) {
@ -1123,7 +1105,6 @@ public class GT_Utility {
* Converts a Number to a String
*/
public static String parseNumberToString(int aNumber) {
String tString = E;
boolean temp = true, negative = false;
if (aNumber < 0) {
@ -1131,15 +1112,18 @@ public class GT_Utility {
negative = true;
}
StringBuilder tStringB = new StringBuilder();
for (int i = 1000000000; i > 0; i /= 10) {
int tDigit = (aNumber / i) % 10;
if (temp && tDigit != 0) temp = false;
if (!temp) {
tString += tDigit;
if (i != 1) for (int j = i; j > 0; j /= 1000) if (j == 1) tString += ",";
tStringB.append(tDigit);
if (i != 1) for (int j = i; j > 0; j /= 1000) if (j == 1) tStringB.append(",");
}
}
String tString = tStringB.toString();
if (tString.equals(E)) tString = "0";
return negative ? "-" + tString : tString;
@ -1438,7 +1422,7 @@ public class GT_Utility {
Collections.sort(tEntrySet, new Comparator<Map.Entry<X, Y>>() {
@Override
public int compare(Entry<X, Y> aValue1, Entry<X, Y> aValue2) {
return -aValue1.getValue().compareTo(aValue2.getValue());
return aValue2.getValue().compareTo(aValue1.getValue());//FB: RV - RV_NEGATING_RESULT_OF_COMPARETO
}
});
LinkedHashMap<X, Y> rMap = new LinkedHashMap<X, Y>();
@ -1483,23 +1467,25 @@ public class GT_Utility {
if (aEntity instanceof EntityPlayerMP) {
EntityPlayerMP aPlayer = (EntityPlayerMP) aEntity;
aPlayer.dimension = aDimension;
aPlayer.playerNetServerHandler.sendPacket(new S07PacketRespawn(aPlayer.dimension, aPlayer.worldObj.difficultySetting, aPlayer.worldObj.getWorldInfo().getTerrainType(), aPlayer.theItemInWorldManager.getGameType()));
tOriginalWorld.removePlayerEntityDangerously(aPlayer);
aPlayer.isDead = false;
aPlayer.setWorld(tTargetWorld);
MinecraftServer.getServer().getConfigurationManager().func_72375_a(aPlayer, tOriginalWorld);
// aPlayer.dimension = aDimension;
// aPlayer.playerNetServerHandler.sendPacket(new S07PacketRespawn(aPlayer.dimension, aPlayer.worldObj.difficultySetting, aPlayer.worldObj.getWorldInfo().getTerrainType(), aPlayer.theItemInWorldManager.getGameType()));
// tOriginalWorld.removePlayerEntityDangerously(aPlayer);
// aPlayer.isDead = false;
// aPlayer.setWorld(tTargetWorld);
// MinecraftServer.getServer().getConfigurationManager().func_72375_a(aPlayer, tOriginalWorld);
// aPlayer.playerNetServerHandler.setPlayerLocation(aX + 0.5, aY + 0.5, aZ + 0.5, aPlayer.rotationYaw, aPlayer.rotationPitch);
// aPlayer.theItemInWorldManager.setWorld(tTargetWorld);
// MinecraftServer.getServer().getConfigurationManager().updateTimeAndWeatherForPlayer(aPlayer, tTargetWorld);
// MinecraftServer.getServer().getConfigurationManager().syncPlayerInventory(aPlayer);
// Iterator tIterator = aPlayer.getActivePotionEffects().iterator();
// while (tIterator.hasNext()) {
// PotionEffect potioneffect = (PotionEffect) tIterator.next();
// aPlayer.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(aPlayer.getEntityId(), potioneffect));
// }
// FMLCommonHandler.instance().firePlayerChangedDimensionEvent(aPlayer, tOriginalWorld.provider.dimensionId, aDimension);
aPlayer.travelToDimension(aDimension);
aPlayer.playerNetServerHandler.setPlayerLocation(aX + 0.5, aY + 0.5, aZ + 0.5, aPlayer.rotationYaw, aPlayer.rotationPitch);
aPlayer.theItemInWorldManager.setWorld(tTargetWorld);
MinecraftServer.getServer().getConfigurationManager().updateTimeAndWeatherForPlayer(aPlayer, tTargetWorld);
MinecraftServer.getServer().getConfigurationManager().syncPlayerInventory(aPlayer);
Iterator tIterator = aPlayer.getActivePotionEffects().iterator();
while (tIterator.hasNext()) {
PotionEffect potioneffect = (PotionEffect) tIterator.next();
aPlayer.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(aPlayer.getEntityId(), potioneffect));
}
aPlayer.playerNetServerHandler.setPlayerLocation(aX + 0.5, aY + 0.5, aZ + 0.5, aPlayer.rotationYaw, aPlayer.rotationPitch);
FMLCommonHandler.instance().firePlayerChangedDimensionEvent(aPlayer, tOriginalWorld.provider.dimensionId, aDimension);
} else {
aEntity.setPosition(aX + 0.5, aY + 0.5, aZ + 0.5);
aEntity.worldObj.removeEntity(aEntity);
@ -1585,15 +1571,15 @@ public class GT_Utility {
Block tBlock = aWorld.getBlock(aX, aY, aZ);
tList.add("----- X: " +EnumChatFormatting.AQUA+ aX +EnumChatFormatting.RESET + " Y: " +EnumChatFormatting.AQUA+ aY +EnumChatFormatting.RESET+ " Z: " +EnumChatFormatting.AQUA+ aZ +EnumChatFormatting.RESET+ " -----");
tList.add("----- X: " + aX + " Y: " + aY + " Z: " + aZ + " -----");
try {
if (tTileEntity != null && tTileEntity instanceof IInventory)
tList.add("Name: " + EnumChatFormatting.BLUE+ ((IInventory) tTileEntity).getInventoryName()+EnumChatFormatting.RESET + " MetaData: " +EnumChatFormatting.AQUA+ aWorld.getBlockMetadata(aX, aY, aZ)+EnumChatFormatting.RESET);
if (tTileEntity instanceof IInventory)
tList.add("Name: " + ((IInventory) tTileEntity).getInventoryName() + " MetaData: " + aWorld.getBlockMetadata(aX, aY, aZ));
else
tList.add("Name: " +EnumChatFormatting.BLUE+ tBlock.getUnlocalizedName() +EnumChatFormatting.RESET+ " MetaData: " +EnumChatFormatting.AQUA+ aWorld.getBlockMetadata(aX, aY, aZ)+EnumChatFormatting.RESET);
tList.add("Name: " + tBlock.getUnlocalizedName() + " MetaData: " + aWorld.getBlockMetadata(aX, aY, aZ));
tList.add("Hardness: " +EnumChatFormatting.YELLOW+ tBlock.getBlockHardness(aWorld, aX, aY, aZ) +EnumChatFormatting.RESET+ " Blast Resistance: " +EnumChatFormatting.YELLOW+ tBlock.getExplosionResistance(aPlayer, aWorld, aX, aY, aZ, aPlayer.posX, aPlayer.posY, aPlayer.posZ)+EnumChatFormatting.RESET);
if (tBlock.isBeaconBase(aWorld, aX, aY, aZ, aX, aY + 1, aZ)) tList.add(EnumChatFormatting.GOLD+"Is valid Beacon Pyramid Material"+EnumChatFormatting.RESET );
tList.add("Hardness: " + tBlock.getBlockHardness(aWorld, aX, aY, aZ) + " Blast Resistance: " + tBlock.getExplosionResistance(aPlayer, aWorld, aX, aY, aZ, aPlayer.posX, aPlayer.posY, aPlayer.posZ));
if (tBlock.isBeaconBase(aWorld, aX, aY, aZ, aX, aY + 1, aZ)) tList.add("Is valid Beacon Pyramid Material");
} catch (Throwable e) {
if (D1) e.printStackTrace(GT_Log.err);
}
@ -1603,7 +1589,7 @@ public class GT_Utility {
rEUAmount += 500;
FluidTankInfo[] tTanks = ((IFluidHandler) tTileEntity).getTankInfo(ForgeDirection.getOrientation(aSide));
if (tTanks != null) for (byte i = 0; i < tTanks.length; i++) {
tList.add("Tank " + i + ": " +EnumChatFormatting.GREEN+ GT_Utility.formatNumbers((tTanks[i].fluid == null ? 0 : tTanks[i].fluid.amount)) +EnumChatFormatting.RESET+ " L / " +EnumChatFormatting.YELLOW+ GT_Utility.formatNumbers(tTanks[i].capacity) +EnumChatFormatting.RESET+ " L of " +EnumChatFormatting.GOLD+ getFluidName(tTanks[i].fluid, true)+EnumChatFormatting.RESET);
tList.add("Tank " + i + ": " + GT_Utility.formatNumbers((tTanks[i].fluid == null ? 0 : tTanks[i].fluid.amount)) + " / " + GT_Utility.formatNumbers(tTanks[i].capacity) + " " + getFluidName(tTanks[i].fluid, true));
}
}
} catch (Throwable e) {
@ -1620,8 +1606,8 @@ public class GT_Utility {
try {
if (tTileEntity instanceof ic2.api.reactor.IReactor) {
rEUAmount += 500;
tList.add("Heat: " +EnumChatFormatting.GREEN+ ((ic2.api.reactor.IReactor) tTileEntity).getHeat() +EnumChatFormatting.RESET+ " / " +EnumChatFormatting.YELLOW+ ((ic2.api.reactor.IReactor) tTileEntity).getMaxHeat()+EnumChatFormatting.RESET);
tList.add("HEM: " +EnumChatFormatting.YELLOW+((ic2.api.reactor.IReactor) tTileEntity).getHeatEffectModifier() +EnumChatFormatting.RESET/*+ " Base EU Output: " + ((ic2.api.reactor.IReactor)tTileEntity).getOutput()*/);//TODO WHAT?
tList.add("Heat: " + ((ic2.api.reactor.IReactor) tTileEntity).getHeat() + "/" + ((ic2.api.reactor.IReactor) tTileEntity).getMaxHeat()
+ " HEM: " + ((ic2.api.reactor.IReactor) tTileEntity).getHeatEffectModifier() + " Base EU Output: "/* + ((ic2.api.reactor.IReactor)tTileEntity).getOutput()*/);
}
} catch (Throwable e) {
if (D1) e.printStackTrace(GT_Log.err);
@ -1629,8 +1615,8 @@ public class GT_Utility {
try {
if (tTileEntity instanceof ic2.api.tile.IWrenchable) {
rEUAmount += 100;
tList.add("Facing: " +EnumChatFormatting.GREEN+ ((ic2.api.tile.IWrenchable) tTileEntity).getFacing() +EnumChatFormatting.RESET+ " / Chance: " +EnumChatFormatting.YELLOW+ (((ic2.api.tile.IWrenchable) tTileEntity).getWrenchDropRate() * 100) +EnumChatFormatting.RESET+ "%");
tList.add(((ic2.api.tile.IWrenchable) tTileEntity).wrenchCanRemove(aPlayer) ? EnumChatFormatting.GREEN+"You can remove this with a Wrench"+EnumChatFormatting.RESET : EnumChatFormatting.RED+"You can NOT remove this with a Wrench"+EnumChatFormatting.RESET);
tList.add("Facing: " + ((ic2.api.tile.IWrenchable) tTileEntity).getFacing() + " / Chance: " + (((ic2.api.tile.IWrenchable) tTileEntity).getWrenchDropRate() * 100) + "%");
tList.add(((ic2.api.tile.IWrenchable) tTileEntity).wrenchCanRemove(aPlayer) ? "You can remove this with a Wrench" : "You can NOT remove this with a Wrench");
}
} catch (Throwable e) {
if (D1) e.printStackTrace(GT_Log.err);
@ -1664,7 +1650,7 @@ public class GT_Utility {
try {
if (tTileEntity instanceof ic2.api.energy.tile.IEnergyConductor) {
rEUAmount += 200;
tList.add("Conduction Loss: " +EnumChatFormatting.YELLOW+ ((ic2.api.energy.tile.IEnergyConductor) tTileEntity).getConductionLoss()+EnumChatFormatting.RESET);
tList.add("Conduction Loss: " + ((ic2.api.energy.tile.IEnergyConductor) tTileEntity).getConductionLoss());
}
} catch (Throwable e) {
if (D1) e.printStackTrace(GT_Log.err);
@ -1672,7 +1658,7 @@ public class GT_Utility {
try {
if (tTileEntity instanceof ic2.api.tile.IEnergyStorage) {
rEUAmount += 200;
tList.add("Contained Energy: " +EnumChatFormatting.YELLOW+ ((ic2.api.tile.IEnergyStorage) tTileEntity).getStored() +EnumChatFormatting.RESET+ " EU / " +EnumChatFormatting.YELLOW+ ((ic2.api.tile.IEnergyStorage) tTileEntity).getCapacity()+EnumChatFormatting.RESET+" EU");
tList.add("Contained Energy: " + ((ic2.api.tile.IEnergyStorage) tTileEntity).getStored() + " of " + ((ic2.api.tile.IEnergyStorage) tTileEntity).getCapacity());
//aList.add(((ic2.api.tile.IEnergyStorage)tTileEntity).isTeleporterCompatible(ic2.api.Direction.YP)?"Teleporter Compatible":"Not Teleporter Compatible");
}
} catch (Throwable e) {
@ -1681,7 +1667,7 @@ public class GT_Utility {
try {
if (tTileEntity instanceof IUpgradableMachine) {
rEUAmount += 500;
if (((IUpgradableMachine) tTileEntity).hasMufflerUpgrade()) tList.add(EnumChatFormatting.GREEN+"Has Muffler Upgrade"+EnumChatFormatting.RESET);
if (((IUpgradableMachine) tTileEntity).hasMufflerUpgrade()) tList.add("Has Muffler Upgrade");
}
} catch (Throwable e) {
if (D1) e.printStackTrace(GT_Log.err);
@ -1691,7 +1677,7 @@ public class GT_Utility {
rEUAmount += 400;
int tValue = 0;
if (0 < (tValue = ((IMachineProgress) tTileEntity).getMaxProgress()))
tList.add("Progress: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(((IMachineProgress) tTileEntity).getProgress()/20) +EnumChatFormatting.RESET+ " s / " +EnumChatFormatting.YELLOW+GT_Utility.formatNumbers(tValue/20) +EnumChatFormatting.RESET+" s");
tList.add("Progress: " + GT_Utility.formatNumbers(tValue) + " / " + GT_Utility.formatNumbers(((IMachineProgress) tTileEntity).getProgress()));
}
} catch (Throwable e) {
if (D1) e.printStackTrace(GT_Log.err);
@ -1707,16 +1693,16 @@ public class GT_Utility {
}
try {
if (tTileEntity instanceof IBasicEnergyContainer && ((IBasicEnergyContainer) tTileEntity).getEUCapacity() > 0) {
tList.add("Max IN: " +EnumChatFormatting.RED+ ((IBasicEnergyContainer) tTileEntity).getInputVoltage() +EnumChatFormatting.RESET+ " EU at "+EnumChatFormatting.RED+((IBasicEnergyContainer)tTileEntity).getInputAmperage()+EnumChatFormatting.RESET+" A");
tList.add("Max OUT: " +EnumChatFormatting.RED+ ((IBasicEnergyContainer) tTileEntity).getOutputVoltage() +EnumChatFormatting.RESET+ " EU at " +EnumChatFormatting.RED+ ((IBasicEnergyContainer) tTileEntity).getOutputAmperage() +EnumChatFormatting.RESET+ " A");
tList.add("Energy: " +EnumChatFormatting.GREEN+ GT_Utility.formatNumbers(((IBasicEnergyContainer) tTileEntity).getStoredEU()) +EnumChatFormatting.RESET+ " EU / " +EnumChatFormatting.YELLOW+ GT_Utility.formatNumbers(((IBasicEnergyContainer) tTileEntity).getEUCapacity()) +EnumChatFormatting.RESET+ " EU");
tList.add("Max IN: " + ((IBasicEnergyContainer) tTileEntity).getInputVoltage() + " EU");
tList.add("Max OUT: " + ((IBasicEnergyContainer) tTileEntity).getOutputVoltage() + " EU at " + ((IBasicEnergyContainer) tTileEntity).getOutputAmperage() + " Amperes");
tList.add("Energy: " + GT_Utility.formatNumbers(((IBasicEnergyContainer) tTileEntity).getStoredEU()) + " / " + GT_Utility.formatNumbers(((IBasicEnergyContainer) tTileEntity).getEUCapacity()) + "EU");
}
} catch (Throwable e) {
if (D1) e.printStackTrace(GT_Log.err);
}
try {
if (tTileEntity instanceof IGregTechTileEntity) {
tList.add("Owned by: " +EnumChatFormatting.BLUE+ ((IGregTechTileEntity) tTileEntity).getOwnerName()+EnumChatFormatting.RESET);
tList.add("Owned by: " + ((IGregTechTileEntity) tTileEntity).getOwnerName());
}
} catch (Throwable e) {
if (D1) e.printStackTrace(GT_Log.err);
@ -1750,10 +1736,11 @@ public class GT_Utility {
+ " Humidity: " + ((ic2.api.crops.ICropTile) tTileEntity).getHumidity()
+ " Air-Quality: " + ((ic2.api.crops.ICropTile) tTileEntity).getAirQuality()
);
String tString = E;
StringBuilder tStringB = new StringBuilder();
for (String tAttribute : ic2.api.crops.Crops.instance.getCropList()[((ic2.api.crops.ICropTile) tTileEntity).getID()].attributes()) {
tString += ", " + tAttribute;
tStringB.append(", ").append(tAttribute);
}
String tString = tStringB.toString();
tList.add("Attributes:" + tString.replaceFirst(",", E));
tList.add("Discovered by: " + ic2.api.crops.Crops.instance.getCropList()[((ic2.api.crops.ICropTile) tTileEntity).getID()].discoveredBy());
}
@ -1764,8 +1751,19 @@ public class GT_Utility {
}
if (aPlayer.capabilities.isCreativeMode&&GT_Values.D1) {
FluidStack tFluid = getUndergroundOil(aWorld, aX, aZ);
tList.add(EnumChatFormatting.GOLD+"Oil"+EnumChatFormatting.RESET+" in Chunk: " +EnumChatFormatting.YELLOW+ tFluid.amount + " " + tFluid.getLocalizedName()+EnumChatFormatting.RESET);
tList.add("Oil in Chunk: " + tFluid.amount + " " + tFluid.getLocalizedName());
}
// if(aPlayer.capabilities.isCreativeMode){
ChunkPosition tPos = new ChunkPosition(aX/16, 1, aZ/16);
if(GT_Proxy.chunkData.containsKey(tPos)){
int[] tPollution = GT_Proxy.chunkData.get(tPos);
if(tPollution.length>1){
tList.add("Pollution in Chunk: "+tPollution[1]);
}else{
tList.add("No Pollution in Chunk");
}
}
// }
try {
if (tBlock instanceof IDebugableBlock) {

View file

@ -13,7 +13,7 @@ import net.minecraft.init.Blocks;
public class GT_Block_Ores extends GT_Block_Ores_Abstract {
public GT_Block_Ores() {
super("gt.blockores", false, Material.rock);
super("gt.blockores", 7, false, Material.rock);
}
@Override
@ -36,11 +36,6 @@ public class GT_Block_Ores extends GT_Block_Ores_Abstract {
return new Materials[]{Materials.Stone, Materials.Netherrack, Materials.Endstone, Materials.GraniteBlack, Materials.GraniteRed, Materials.Marble, Materials.Basalt, Materials.Stone};
}
@Override
public int getHarvestLevel(int aMeta) {
return aMeta == 5 || aMeta == 6 ? 2 : aMeta % 8;
}
@Override
public ITexture[] getTextureSet() { //Must have 16 entries.
return new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.netherrack, 0, 0), new GT_CopiedBlockTexture(Blocks.end_stone, 0, 0), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_BLACK_STONE), new GT_RenderedTexture(Textures.BlockIcons.GRANITE_RED_STONE), new GT_RenderedTexture(Textures.BlockIcons.MARBLE_STONE), new GT_RenderedTexture(Textures.BlockIcons.BASALT_STONE), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0), new GT_CopiedBlockTexture(Blocks.stone, 0, 0)};

View file

@ -36,64 +36,34 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements
public static ThreadLocal<GT_TileEntity_Ores> mTemporaryTileEntity = new ThreadLocal();
public static boolean FUCKING_LOCK = false;
public static boolean tHideOres;
public static int tOreMetaCount;
private final String aTextName = ".name";
private final String aTextSmall = "Small ";
private final String aTextDot = ".";
private final String aTextNothing = "";
protected GT_Block_Ores_Abstract(String aUnlocalizedName, boolean aHideFirstMeta, Material aMaterial) {
protected GT_Block_Ores_Abstract(String aUnlocalizedName, int aOreMetaCount, boolean aHideFirstMeta, Material aMaterial) {
super(GT_Item_Ores.class, aUnlocalizedName, aMaterial);
this.isBlockContainer = true;
setStepSound(soundTypeStone);
setCreativeTab(GregTech_API.TAB_GREGTECH_ORES);
tHideOres = Loader.isModLoaded("NotEnoughItems") && GT_Mod.gregtechproxy.mHideUnusedOres;
tOreMetaCount = aOreMetaCount;
if(aOreMetaCount > 8 || aOreMetaCount < 0) aOreMetaCount = 8;
for (int i = 0; i < 16; i++) {
GT_ModHandler.addValuableOre(this, i, 1);
}
for (int i = 1; i < GregTech_API.sGeneratedMaterials.length; i++) {
if (GregTech_API.sGeneratedMaterials[i] != null) {
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + i + aTextName, getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 1000) + aTextName, getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 2000) + aTextName, getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 3000) + aTextName, getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 4000) + aTextName, getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 5000) + aTextName, getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 6000) + aTextName, getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 7000) + aTextName, getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 16000) + aTextName, aTextSmall + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 17000) + aTextName, aTextSmall + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 18000) + aTextName, aTextSmall + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 19000) + aTextName, aTextSmall + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 20000) + aTextName, aTextSmall + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 21000) + aTextName, aTextSmall + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 22000) + aTextName, aTextSmall + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + aTextDot + (i + 23000) + aTextName, aTextSmall + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
if ((GregTech_API.sGeneratedMaterials[i].mTypes & 0x8) != 0) {
GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[0] != null ? this.getProcessingPrefix()[0].get(GregTech_API.sGeneratedMaterials[i]) : aTextNothing, new ItemStack(this, 1, i));
GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[1] != null ? this.getProcessingPrefix()[1].get(GregTech_API.sGeneratedMaterials[i]) : aTextNothing, new ItemStack(this, 1, i + 1000));
GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[2] != null ? this.getProcessingPrefix()[2].get(GregTech_API.sGeneratedMaterials[i]) : aTextNothing, new ItemStack(this, 1, i + 2000));
GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[3] != null ? this.getProcessingPrefix()[3].get(GregTech_API.sGeneratedMaterials[i]) : aTextNothing, new ItemStack(this, 1, i + 3000));
GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[4] != null ? this.getProcessingPrefix()[4].get(GregTech_API.sGeneratedMaterials[i]) : aTextNothing, new ItemStack(this, 1, i + 4000));
GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[5] != null ? this.getProcessingPrefix()[5].get(GregTech_API.sGeneratedMaterials[i]) : aTextNothing, new ItemStack(this, 1, i + 5000));
GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[6] != null ? this.getProcessingPrefix()[6].get(GregTech_API.sGeneratedMaterials[i]) : aTextNothing, new ItemStack(this, 1, i + 6000));
GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[7] != null ? this.getProcessingPrefix()[7].get(GregTech_API.sGeneratedMaterials[i]) : aTextNothing, new ItemStack(this, 1, i + 7000));
if (tHideOres) {
if (aHideFirstMeta) codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 1000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 2000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 3000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 4000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 5000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 6000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 7000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 16000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 17000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 18000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 19000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 20000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 21000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 22000));
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + 23000));
for (int j = 0; j < aOreMetaCount; j++) {
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + (j * 1000)) + aTextName, getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + ((i + 16000) + (j * 1000)) + aTextName, aTextSmall + getLocalizedName(GregTech_API.sGeneratedMaterials[i]));
if ((GregTech_API.sGeneratedMaterials[i].mTypes & 0x8) != 0) {
GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[j] != null ? this.getProcessingPrefix()[j].get(GregTech_API.sGeneratedMaterials[i]) : "", new ItemStack(this, 1, i + (j * 1000)));
if (tHideOres) {
if(!(j == 0 && !aHideFirstMeta)){
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + (j * 1000)));}
codechicken.nei.api.API.hideItem(new ItemStack(this, 1, (i + 16000) + (j * 1000)));
}
}
}
}
@ -166,7 +136,7 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements
}
public int getHarvestLevel(int aMeta) {
return 2;
return aMeta == 5 || aMeta == 6 ? 2 : aMeta % 8;
}
public float getBlockHardness(World aWorld, int aX, int aY, int aZ) {

View file

@ -8,12 +8,14 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.objects.GT_CopiedBlockTexture;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
public class GT_Block_Ores_UB1 extends GT_Block_Ores_Abstract {
Block aUBBlock = GameRegistry.findBlock("UndergroundBiomes", "igneousStone");
public GT_Block_Ores_UB1() {
super("gt.blockores.ub1", true, Material.rock);
super("gt.blockores.ub1", 8, true, Material.rock);
if (aUBBlock == null) aUBBlock = Blocks.stone;
}
@Override

View file

@ -8,12 +8,14 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.objects.GT_CopiedBlockTexture;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
public class GT_Block_Ores_UB2 extends GT_Block_Ores_Abstract {
Block aUBBlock = GameRegistry.findBlock("UndergroundBiomes", "metamorphicStone");
public GT_Block_Ores_UB2() {
super("gt.blockores.ub2", true, Material.rock);
super("gt.blockores.ub2", 8, true, Material.rock);
if (aUBBlock == null) aUBBlock = Blocks.stone;
}
@Override

View file

@ -8,12 +8,14 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.objects.GT_CopiedBlockTexture;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
public class GT_Block_Ores_UB3 extends GT_Block_Ores_Abstract {
Block aUBBlock = GameRegistry.findBlock("UndergroundBiomes", "sedimentaryStone");
public GT_Block_Ores_UB3() {
super("gt.blockores.ub3", true, Material.rock);
super("gt.blockores.ub3", 8, true, Material.rock);
if (aUBBlock == null) aUBBlock = Blocks.stone;
}
@Override
@ -40,4 +42,4 @@ public class GT_Block_Ores_UB3 extends GT_Block_Ores_Abstract {
public ITexture[] getTextureSet() { //Must have 16 entries.
return new ITexture[]{new GT_CopiedBlockTexture(aUBBlock, 0, 0), new GT_CopiedBlockTexture(aUBBlock, 0, 1), new GT_CopiedBlockTexture(aUBBlock, 0, 2), new GT_CopiedBlockTexture(aUBBlock, 0, 3), new GT_CopiedBlockTexture(aUBBlock, 0, 4), new GT_CopiedBlockTexture(aUBBlock, 0, 5), new GT_CopiedBlockTexture(aUBBlock, 0, 6), new GT_CopiedBlockTexture(aUBBlock, 0, 7), new GT_CopiedBlockTexture(aUBBlock, 0, 0), new GT_CopiedBlockTexture(aUBBlock, 0, 1), new GT_CopiedBlockTexture(aUBBlock, 0, 2), new GT_CopiedBlockTexture(aUBBlock, 0, 3), new GT_CopiedBlockTexture(aUBBlock, 0, 4), new GT_CopiedBlockTexture(aUBBlock, 0, 5), new GT_CopiedBlockTexture(aUBBlock, 0, 6), new GT_CopiedBlockTexture(aUBBlock, 0, 7)};
}
}
}

View file

@ -96,7 +96,7 @@ public class GT_TileEntity_Ores extends TileEntity implements ITexturedTileEntit
} else if (!tBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)) {
return false;
}
System.out.println(tOreBlock);
//System.out.println(tOreBlock);
aWorld.setBlock(aX, aY, aZ, tOreBlock, getHarvestData((short) aMetaData), 0);
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if ((tTileEntity instanceof GT_TileEntity_Ores)) {

View file

@ -58,7 +58,6 @@ public class GT_MetaTileEntity_Boiler_Solar
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GT_MetaTileEntity_Boiler_Solar(this.mName, this.mTier, this.mDescription, this.mTextures);
}
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L)) {
@ -92,8 +91,7 @@ public class GT_MetaTileEntity_Boiler_Solar
aBaseMetaTileEntity.doExplosion(2048L);
return;
}
}
this.mFluid.amount -= 1;
if (this.mSteam == null) {
this.mSteam = GT_ModHandler.getSteam(150L);
} else if (GT_ModHandler.isSteam(this.mSteam)) {
@ -122,4 +120,6 @@ public class GT_MetaTileEntity_Boiler_Solar
aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0);
}
}
}

View file

@ -226,11 +226,8 @@ public class GT_MetaTileEntity_Scanner
@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (mProgresstime >= (mMaxProgresstime - 1)) {
try {
if (this.mOutputItems[0].getUnlocalizedName().equals("gt.metaitem.01.32707")) {
GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "scanning");
}
} catch (Exception e) {
if ((this.mOutputItems[0] != null) && (this.mOutputItems[0].getUnlocalizedName().equals("gt.metaitem.01.32707"))) {
GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "scanning");
}
}
super.onPostTick(aBaseMetaTileEntity, aTick);

View file

@ -9,6 +9,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.objects.XSTR;
import gregtech.api.util.GT_Config;
import gregtech.api.util.GT_Utility;
import gregtech.common.gui.GT_Container_Teleporter;
@ -22,11 +23,13 @@ import net.minecraft.entity.boss.EntityDragonPart;
import net.minecraft.entity.effect.EntityWeatherEffect;
import net.minecraft.entity.item.*;
import net.minecraft.entity.player.EntityPlayer;
//import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.entity.projectile.EntityFireball;
import net.minecraft.entity.projectile.EntityFishHook;
import net.minecraft.entity.projectile.EntityThrowable;
//import net.minecraft.init.Blocks;
import net.minecraft.inventory.IInventory;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
@ -246,7 +249,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank {
}
if ((getBaseMetaTileEntity().isAllowedToWork()) && (getBaseMetaTileEntity().getRedstone())) {
if (getBaseMetaTileEntity().decreaseStoredEnergyUnits(2048, false)) {
if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasBlock || mFluid.isFluidEqual(Materials.Iron.getPlasma(1)))) {
if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasBlock || mFluid.isFluidEqual(Materials.Iron.getPlasma(1)))&& new XSTR().nextInt(10)==0) {
mFluid.amount--;
if (mFluid.amount < 1) {
mFluid = null;
@ -267,7 +270,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank {
int tStacksize = mInventory[0].stackSize;
GT_Utility.moveOneItemStack(this, tTile, (byte) 0, (byte) 0, null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1);
if (mInventory[0] == null || mInventory[0].stackSize < tStacksize) {
getBaseMetaTileEntity().decreaseStoredEnergyUnits((long)tDistance * tDistance * ((long)tStacksize - (mInventory[0] == null ? 0 : mInventory[0].stackSize)), false);
getBaseMetaTileEntity().decreaseStoredEnergyUnits((long) (Math.pow(tDistance, 1.5)) * (tStacksize - (mInventory[0] == null ? 0 : mInventory[0].stackSize)), false);
}
}
@ -275,9 +278,10 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank {
for (Object tObject : getBaseMetaTileEntity().getWorld().getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 2) - 1, getBaseMetaTileEntity().getOffsetX(getBaseMetaTileEntity().getFrontFacing(), 2) + 2, getBaseMetaTileEntity().getOffsetY(getBaseMetaTileEntity().getFrontFacing(), 2) + 2, getBaseMetaTileEntity().getOffsetZ(getBaseMetaTileEntity().getFrontFacing(), 2) + 2))) {
if (((tObject instanceof Entity)) && (!((Entity) tObject).isDead)) {
Entity tEntity = (Entity) tObject;
if (getBaseMetaTileEntity().decreaseStoredEnergyUnits((long)(tDistance * tDistance * weightCalculation(tEntity)), false)) {
//System.out.println("teleport"+(Math.pow(tDistance, 1.5)));
if (getBaseMetaTileEntity().decreaseStoredEnergyUnits((long) Math.pow(tDistance, 1.5) * (long)weightCalculation(tEntity), false)) {
if (hasDimensionalTeleportCapability() && this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId && (hasBlock || mFluid.isFluidEqual(Materials.Iron.getPlasma(1)))) {
mFluid.amount = mFluid.amount - (GT_Utility.safeInt(Math.min(1000L, (long)(tDistance * tDistance * weightCalculation(tEntity) / 8192))));
mFluid.amount = mFluid.amount - GT_Utility.safeInt((long)Math.min(1000L, (long)Math.pow(tDistance, 1.5) * weightCalculation(tEntity) / 8192));
if (mFluid.amount < 1) {
mFluid = null;
}
@ -307,7 +311,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank {
}
private int distanceCalculation() {
return Math.abs(((this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId) && (isDimensionalTeleportAvailable()) ? 100 : 1) * (int) Math.sqrt(Math.pow(getBaseMetaTileEntity().getXCoord() - this.mTargetX, 2.0D) + Math.pow(getBaseMetaTileEntity().getYCoord() - this.mTargetY, 2.0D) + Math.pow(getBaseMetaTileEntity().getZCoord() - this.mTargetZ, 2.0D)));
return Math.abs(((this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId) && (isDimensionalTeleportAvailable()) ? 4000 : (int) Math.sqrt(Math.pow(getBaseMetaTileEntity().getXCoord() - this.mTargetX, 2.0D) + Math.pow(getBaseMetaTileEntity().getYCoord() - this.mTargetY, 2.0D) + Math.pow(getBaseMetaTileEntity().getZCoord() - this.mTargetZ, 2.0D))));
}
@Override

View file

@ -42,6 +42,7 @@ public class GT_MetaTileEntity_DieselEngine extends GT_MetaTileEntity_MultiBlock
"Size(WxHxD): 3x3x4, Controller (front centered)",
"3x3x4 of Stable Titanium Casing (hollow, Min 24!)",
"2x Titanium Gear Box Casing inside the Hollow Casing",
"8x Engine Intake Casings (around controller, Min 8!)",
"1x Input Hatch (one of the Casings)",
"1x Maintenance Hatch (one of the Casings)",
"1x Muffler Hatch (top middle back)",

View file

@ -75,7 +75,7 @@ public class GT_Tool_File
public boolean isMinableBlock(Block aBlock, byte aMetaData) {
String tTool = aBlock.getHarvestTool(aMetaData);
return (tTool != null) && (tTool.equals("file"));
return ((tTool != null) && tTool.equals("file"));
}
public ItemStack getBrokenItem(ItemStack aStack) {

View file

@ -43,7 +43,7 @@ public class GT_Tool_Plunger
public boolean isMinableBlock(Block aBlock, byte aMetaData) {
String tTool = aBlock.getHarvestTool(aMetaData);
return (tTool != null) && (tTool.equals("plunger"));
return ((tTool != null) && tTool.equals("plunger"));
}
public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) {

View file

@ -84,7 +84,7 @@ public class GT_Tool_SoftHammer
public boolean isMinableBlock(Block aBlock, byte aMetaData) {
String tTool = aBlock.getHarvestTool(aMetaData);
return (tTool != null) && (tTool.equals("softhammer"));
return ((tTool != null) && tTool.equals("softhammer"));
}
public ItemStack getBrokenItem(ItemStack aStack) {

View file

@ -13,7 +13,6 @@ public class ProcessingIngot1 implements gregtech.api.interfaces.IOreRecipeRegis
}
public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) {
GT_Values.RA.addLatheRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.round, aMaterial, 9L), null, (int) Math.max(aMaterial.getMass() / 4L, 1L), 8);
Object[] Ogem1 = new Object[]{aStack};
if (aMaterial.mFuelPower > 0) {
GT_Values.RA.addFuel(GT_Utility.copyAmount(1L, Ogem1), null, aMaterial.mFuelPower, aMaterial.mFuelType);

View file

@ -32,7 +32,6 @@ public class ProcessingOre implements gregtech.api.interfaces.IOreRecipeRegistra
GT_ModHandler.addValuableOre(GT_Utility.getBlockFromStack(aOreStack), aOreStack.getItemDamage(), aMaterial.mOreValue);
Materials tMaterial = aMaterial.mOreReplacement;
Materials tPrimaryByMaterial = null;
Materials tSecondaryByMaterial = null;
aMultiplier = Math.max(1, aMultiplier);
aOreStack = GT_Utility.copyAmount(1L, new Object[]{aOreStack});
aOreStack.stackSize = 1;
@ -42,14 +41,10 @@ public class ProcessingOre implements gregtech.api.interfaces.IOreRecipeRegistra
ItemStack tGem = GT_OreDictUnificator.get(OrePrefixes.gem, tMaterial, 1L);
ItemStack tSmeltInto = tIngot == null ? null : aMaterial.contains(SubTag.SMELTING_TO_GEM) ? GT_OreDictUnificator.get(OrePrefixes.gem, tMaterial.mDirectSmelting, GT_OreDictUnificator.get(OrePrefixes.crystal, tMaterial.mDirectSmelting, GT_OreDictUnificator.get(OrePrefixes.gem, tMaterial, GT_OreDictUnificator.get(OrePrefixes.crystal, tMaterial, 1L), 1L), 1L), 1L) : tIngot;
ItemStack tSmall = GT_OreDictUnificator.get(OrePrefixes.dustSmall, tMaterial, 1L);
ItemStack tDust = GT_OreDictUnificator.get(OrePrefixes.dust, tMaterial, tGem, 1L);
ItemStack tCleaned = GT_OreDictUnificator.get(OrePrefixes.crushedPurified, tMaterial, tDust, 1L);
ItemStack tCrushed = GT_OreDictUnificator.get(OrePrefixes.crushed, tMaterial, aMaterial.mOreMultiplier * aMultiplier);
ItemStack tPrimaryByProduct = null;
ItemStack tPrimaryByProductSmall = null;
ItemStack tSecondaryByProduct = null;
ItemStack tSecondaryByProductSmall = null;
if (tCrushed == null) {
tCrushed = GT_OreDictUnificator.get(OrePrefixes.dustImpure, tMaterial, GT_Utility.copyAmount(aMaterial.mOreMultiplier * aMultiplier, new Object[]{tCleaned, tDust, tGem}), aMaterial.mOreMultiplier * aMultiplier);
@ -63,17 +58,12 @@ public class ProcessingOre implements gregtech.api.interfaces.IOreRecipeRegistra
if (tPrimaryByProduct == null) {
tPrimaryByMaterial = tMat;
tPrimaryByProduct = GT_OreDictUnificator.get(OrePrefixes.dust, tMat, 1L);
tPrimaryByProductSmall = GT_OreDictUnificator.get(OrePrefixes.dustSmall, tMat, 1L);
if (tPrimaryByProductSmall == null)
tPrimaryByProductSmall = GT_OreDictUnificator.get(OrePrefixes.dustTiny, tMat, GT_OreDictUnificator.get(OrePrefixes.nugget, tMat, 2L), 2L);
if (GT_OreDictUnificator.get(OrePrefixes.dustSmall, tMat, 1L) == null)
GT_OreDictUnificator.get(OrePrefixes.dustTiny, tMat, GT_OreDictUnificator.get(OrePrefixes.nugget, tMat, 2L), 2L);
}
if ((tSecondaryByProduct == null) || (tSecondaryByMaterial == tPrimaryByMaterial)) {
tSecondaryByMaterial = tMat;
tSecondaryByProduct = GT_OreDictUnificator.get(OrePrefixes.dust, tMat, 1L);
tSecondaryByProductSmall = GT_OreDictUnificator.get(OrePrefixes.dustSmall, tMat, 1L);
if (tSecondaryByProductSmall == null) {
tSecondaryByProductSmall = GT_OreDictUnificator.get(OrePrefixes.dustTiny, tMat, GT_OreDictUnificator.get(OrePrefixes.nugget, tMat, 2L), 2L);
}
GT_OreDictUnificator.get(OrePrefixes.dust, tMat, 1L);
if (GT_OreDictUnificator.get(OrePrefixes.dustSmall, tMat, 1L) == null) {
GT_OreDictUnificator.get(OrePrefixes.dustTiny, tMat, GT_OreDictUnificator.get(OrePrefixes.nugget, tMat, 2L), 2L);
}
}
if ((!tByProductStacks.isEmpty()) && (!this.mAlreadyListedOres.contains(aMaterial))) {
@ -83,14 +73,6 @@ public class ProcessingOre implements gregtech.api.interfaces.IOreRecipeRegistra
if (tPrimaryByMaterial == null) tPrimaryByMaterial = tMaterial;
if (tPrimaryByProduct == null) tPrimaryByProduct = tDust;
if (tPrimaryByProductSmall == null) {
tPrimaryByProductSmall = tSmall;
}
if (tSecondaryByMaterial == null) tSecondaryByMaterial = tPrimaryByMaterial;
if (tSecondaryByProduct == null) tSecondaryByProduct = tPrimaryByProduct;
if (tSecondaryByProductSmall == null) {
tSecondaryByProductSmall = tPrimaryByProductSmall;
}
boolean tHasSmelting = false;
if (tSmeltInto != null) {
@ -110,7 +92,9 @@ public class ProcessingOre implements gregtech.api.interfaces.IOreRecipeRegistra
}
if (!tHasSmelting) {
tHasSmelting = GT_ModHandler.addSmeltingRecipe(aOreStack, GT_OreDictUnificator.get(OrePrefixes.gem, tMaterial.mDirectSmelting, Math.max(1, aMultiplier * aMaterial.mSmeltingMultiplier / 2)));
//dead code?
//tHasSmelting = GT_ModHandler.addSmeltingRecipe(aOreStack, GT_OreDictUnificator.get(OrePrefixes.gem, tMaterial.mDirectSmelting, Math.max(1, aMultiplier * aMaterial.mSmeltingMultiplier / 2)));
GT_ModHandler.addSmeltingRecipe(aOreStack, GT_OreDictUnificator.get(OrePrefixes.gem, tMaterial.mDirectSmelting, Math.max(1, aMultiplier * aMaterial.mSmeltingMultiplier / 2)));
}
if (tCrushed != null) {

View file

@ -736,10 +736,10 @@ public class GT_CraftingRecipeLoader implements Runnable {
GT_ModHandler.removeRecipeByOutput(new ItemStack(Items.sugar));
GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Paper, 2), new Object[]{"SSS", " m ", 'S', new ItemStack(Items.reeds)});
GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Sugar, 1), new Object[]{"Sm ", 'S', new ItemStack(Items.reeds)});
ItemStack brick = new ItemStack(new ItemStack(Blocks.stone_slab).getItem().setContainerItem(new ItemStack(Blocks.stone_slab).getItem()));
// ItemStack brick = new ItemStack(Items.brick.setContainerItem(Items.brick));
GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.paper, Materials.Empty, 2), new Object[]{" C ", "SSS", " C ", 'S', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Paper, 1), 'C', brick});
// GameRegistry.addRecipe(GT_OreDictUnificator.get(OrePrefixes.paper, Materials.Empty, 2), " C ", "SSS", " C ", 'S', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Paper, 1), 'C', brick);
// ItemStack brick = new ItemStack(new ItemStack(Blocks.stone_slab).getItem().setContainerItem(new ItemStack(Blocks.stone_slab).getItem()));
// GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.paper, Materials.Empty, 2), new Object[]{" C ", "SSS", " C ", 'S', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Paper, 1), 'C', brick});
GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.paper, Materials.Empty, 2), new Object[]{" C ", "SSS", " C ", 'S', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Paper, 1), 'C', new ItemStack(Blocks.stone_slab)});
// GameRegistry.addRecipe(GT_OreDictUnificator.get(OrePrefixes.paper, Materials.Empty, 2), " C ", "SSS", " C ", 'S', GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Paper, 1), 'C', brick);
}
GT_Log.out.println("GT_Mod: Applying Recipes for Tools");

View file

@ -49,16 +49,16 @@ public class GT_Worldgenloader
new GT_Worldgen_Stone("overworld.stone.basalt.large", true, GregTech_API.sBlockStones, 8, 0, 1, 300, 192, 0, 120, null, false);
new GT_Worldgen_Stone("overworld.stone.basalt.huge", true, GregTech_API.sBlockStones, 8, 0, 1, 400, 240, 0, 120, null, false);
new GT_Worldgen_Stone("nether.stone.marble.tiny", true, GregTech_API.sBlockStones, 0, 0, 1, 50, 48, 0, 120, null, false);
new GT_Worldgen_Stone("nether.stone.marble.small", true, GregTech_API.sBlockStones, 0, 0, 1, 100, 96, 0, 120, null, false);
new GT_Worldgen_Stone("nether.stone.marble.medium", true, GregTech_API.sBlockStones, 0, 0, 1, 200, 144, 0, 120, null, false);
new GT_Worldgen_Stone("nether.stone.marble.large", true, GregTech_API.sBlockStones, 0, 0, 1, 300, 192, 0, 120, null, false);
new GT_Worldgen_Stone("nether.stone.marble.huge", true, GregTech_API.sBlockStones, 0, 0, 1, 400, 240, 0, 120, null, false);
new GT_Worldgen_Stone("nether.stone.basalt.tiny", true, GregTech_API.sBlockStones, 8, 0, 1, 50, 48, 0, 120, null, false);
new GT_Worldgen_Stone("nether.stone.basalt.small", true, GregTech_API.sBlockStones, 8, 0, 1, 100, 96, 0, 120, null, false);
new GT_Worldgen_Stone("nether.stone.basalt.medium", true, GregTech_API.sBlockStones, 8, 0, 1, 200, 144, 0, 120, null, false);
new GT_Worldgen_Stone("nether.stone.basalt.large", true, GregTech_API.sBlockStones, 8, 0, 1, 300, 192, 0, 120, null, false);
new GT_Worldgen_Stone("nether.stone.basalt.huge", true, GregTech_API.sBlockStones, 8, 0, 1, 400, 240, 0, 120, null, false);
new GT_Worldgen_Stone("nether.stone.marble.tiny", false, GregTech_API.sBlockStones, 0, 0, 1, 50, 48, 0, 120, null, false);
new GT_Worldgen_Stone("nether.stone.marble.small", false, GregTech_API.sBlockStones, 0, 0, 1, 100, 96, 0, 120, null, false);
new GT_Worldgen_Stone("nether.stone.marble.medium", false, GregTech_API.sBlockStones, 0, 0, 1, 200, 144, 0, 120, null, false);
new GT_Worldgen_Stone("nether.stone.marble.large", false, GregTech_API.sBlockStones, 0, 0, 1, 300, 192, 0, 120, null, false);
new GT_Worldgen_Stone("nether.stone.marble.huge", false, GregTech_API.sBlockStones, 0, 0, 1, 400, 240, 0, 120, null, false);
new GT_Worldgen_Stone("nether.stone.basalt.tiny", false, GregTech_API.sBlockStones, 8, 0, 1, 50, 48, 0, 120, null, false);
new GT_Worldgen_Stone("nether.stone.basalt.small", false, GregTech_API.sBlockStones, 8, 0, 1, 100, 96, 0, 120, null, false);
new GT_Worldgen_Stone("nether.stone.basalt.medium", false, GregTech_API.sBlockStones, 8, 0, 1, 200, 144, 0, 120, null, false);
new GT_Worldgen_Stone("nether.stone.basalt.large", false, GregTech_API.sBlockStones, 8, 0, 1, 300, 192, 0, 120, null, false);
new GT_Worldgen_Stone("nether.stone.basalt.huge", false, GregTech_API.sBlockStones, 8, 0, 1, 400, 240, 0, 120, null, false);
new GT_Worldgen_GT_Ore_SmallPieces("ore.small.copper", true, 60, 120, 32, !tPFAA, true, true, Materials.Copper);
new GT_Worldgen_GT_Ore_SmallPieces("ore.small.tin", true, 60, 120, 32, !tPFAA, true, true, Materials.Tin);