diff options
Diffstat (limited to 'src/main/java/gregtech/common')
8 files changed, 152 insertions, 95 deletions
diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index d63ef122ae..880db79838 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -446,7 +446,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("orangePainter", 1L, 32767));
GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("whitePainter", 1L, 32767));
GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("cfPack", 1L, 32767));
- GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("jetpack", 1L, 32767));
+ //GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("jetpack", 1L, 32767));
GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("treetap", 1L, 32767));
GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("weedEx", 1L, 32767));
GT_ModHandler.sNonReplaceableItems.add(GT_ModHandler.getIC2Item("staticBoots", 1L, 32767));
@@ -496,6 +496,11 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { GT_OreDictUnificator.registerOre("cropGrape", GT_ModHandler.getModItem("magicalcrops", "magicalcrops_CropProduce", 1L, 4));
GT_OreDictUnificator.registerOre("cropTea", GT_ModHandler.getModItem("ganyssurface", "teaLeaves", 1L, 0));
+ GregTech_API.sGasHazmatList.add(GT_ModHandler.getModItem("EMT", "NanoBootsTraveller", 1L, 32767));
+ GregTech_API.sGasHazmatList.add(GT_ModHandler.getModItem("EMT", "NanosuitGogglesRevealing", 1L, 32767));
+ GregTech_API.sGasHazmatList.add(GT_ModHandler.getModItem("EMT", "QuantumBootsTraveller", 1L, 32767));
+ GregTech_API.sGasHazmatList.add(GT_ModHandler.getModItem("EMT", "QuantumGogglesRevealing", 1L, 32767));
+
GregTech_API.sLoadStarted = true;
for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) {
if ((tData.filledContainer.getItem() == Items.potionitem) && (tData.filledContainer.getItemDamage() == 0)) {
diff --git a/src/main/java/gregtech/common/GT_RecipeAdder.java b/src/main/java/gregtech/common/GT_RecipeAdder.java index 4ba1e1ea24..7bf34fbc97 100644 --- a/src/main/java/gregtech/common/GT_RecipeAdder.java +++ b/src/main/java/gregtech/common/GT_RecipeAdder.java @@ -29,7 +29,6 @@ import net.minecraftforge.fluids.FluidStack; public class GT_RecipeAdder implements IGT_RecipeAdder {
- private boolean isAddingDeprecatedRecipes = false;
@Deprecated
public boolean addFusionReactorRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt, int aStartEU) {
@@ -128,10 +127,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick) {
return addChemicalRecipe(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aOutput2, aDuration, aEUtick, false);
}
- public boolean addChemicalRecipeForBasicMachineOnly(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick) {
- return addChemicalRecipe(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aOutput2, aDuration, aEUtick, false);
- }
- public boolean addChemicalRecipeForBasicMachineOnly(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick, boolean aCleanroom) {
+ public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick, boolean aCleanroom) {
if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput == null) && (aOutput2 == null) && (aFluidOutput == null))) {
return false;
}
@@ -148,33 +144,25 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { aCleanroom = false;
}
GT_Recipe.GT_Recipe_Map.sChemicalRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput, aOutput2}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUtick, aCleanroom ? -200 : 0);
+ if (!(aInput1 != null && aInput1.getItem() instanceof GT_IntegratedCircuit_Item && aInput1.getItemDamage() >= 10)
+ && !(aInput2 != null && aInput2.getItem() instanceof GT_IntegratedCircuit_Item && aInput2.getItemDamage() >= 10)) {
+ GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe(false, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput, aOutput2}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUtick, 0);
+ }
return true;
}
- public boolean addChemicalRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick, boolean aCleanroom) {
- if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput == null) && (aOutput2 == null) && (aFluidOutput == null))) {
- return false;
- }
- if ((aOutput != null || aOutput2 != null) && ((aDuration = GregTech_API.sRecipeFile.get("chemicalreactor", aOutput, aDuration)) <= 0)) {
- return false;
- }
- if ((aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("chemicalreactor", aFluidOutput.getFluid().getName(), aDuration)) <= 0)) {
+
+ public boolean addMultiblockChemicalRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int aDuration, int aEUtick){
+ if (areItemsAndFluidsBothNull(aInputs, aFluidInputs) || areItemsAndFluidsBothNull(aOutputs, aFluidOutputs)) {
return false;
}
if (aEUtick <= 0) {
return false;
}
- if (!GT_Mod.gregtechproxy.mEnableCleanroom){
- aCleanroom = false;
- }
- GT_Recipe.GT_Recipe_Map.sChemicalRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput, aOutput2}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUtick, aCleanroom ? -200 : 0);
- if (!(aInput1 != null && aInput1.getItem() instanceof GT_IntegratedCircuit_Item && aInput1.getItemDamage() >= 10)
- && !(aInput2 != null && aInput2.getItem() instanceof GT_IntegratedCircuit_Item && aInput2.getItemDamage() >= 10)) {
- GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe(false, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput, aOutput2}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUtick, 0);
- }
+ GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe(false, aInputs, aOutputs, null, null, aFluidInputs, aFluidOutputs, aDuration, aEUtick, 0);
return true;
}
- public boolean addChemicalRecipeDeprecated(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick) {
+ public boolean addChemicalRecipeForBasicMachineOnly(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, ItemStack aOutput2, int aDuration, int aEUtick) {
if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput == null) && (aOutput2 == null) && (aFluidOutput == null))) {
return false;
}
@@ -187,22 +175,7 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { if (aEUtick <= 0) {
return false;
}
- GT_Recipe.GT_Recipe_Map.sChemicalRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput, aOutput2}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUtick, isAddingDeprecatedRecipes ? -400 : 0);
- if (!(aInput1 != null && aInput1.getItem() instanceof GT_IntegratedCircuit_Item && aInput1.getItemDamage() >= 10)
- && !(aInput2 != null && aInput2.getItem() instanceof GT_IntegratedCircuit_Item && aInput2.getItemDamage() >= 10)) {
- GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe(false, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput, aOutput2}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUtick, isAddingDeprecatedRecipes ? -400 : 0);
- }
- return true;
- }
-
- public boolean addMultiblockChemicalRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int aDuration, int aEUtick){
- if (areItemsAndFluidsBothNull(aInputs, aFluidInputs) || areItemsAndFluidsBothNull(aOutputs, aFluidOutputs)) {
- return false;
- }
- if (aEUtick <= 0) {
- return false;
- }
- GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe(false, aInputs, aOutputs, null, null, aFluidInputs, aFluidOutputs, aDuration, aEUtick, 0);
+ GT_Recipe.GT_Recipe_Map.sChemicalRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput, aOutput2}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUtick, 0);
return true;
}
@@ -1273,14 +1246,4 @@ public class GT_RecipeAdder implements IGT_RecipeAdder { return itemsNull && fluidsNull;
}
-
- public boolean isAddingDeprecatedRecipes() {
- return isAddingDeprecatedRecipes;
-
- }
-
- public void setIsAddingDeprecatedRecipes(boolean isAddingDeprecatedRecipes) {
- this.isAddingDeprecatedRecipes = isAddingDeprecatedRecipes;
- }
-
}
diff --git a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java index 8d8d044d6f..36f6b5b8da 100644 --- a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java +++ b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_Layer.java @@ -7,6 +7,8 @@ import gregtech.api.util.GT_Log; import gregtech.api.world.GT_Worldgen;
import gregtech.common.blocks.GT_TileEntity_Ores;
import gregtech.loaders.misc.GT_Achievements;
+import net.minecraft.block.Block;
+import net.minecraft.init.Blocks;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
@@ -40,7 +42,7 @@ public class GT_Worldgen_GT_Ore_Layer public static final int NO_ORE_IN_BOTTOM_LAYER=2;
public static final int NO_OVERLAP=3;
public static final int ORE_PLACED=4;
-
+ public static final int NO_OVERLAP_AIR_BLOCK=5;
//public final boolean mMoon;
//public final boolean mMars;
@@ -114,6 +116,10 @@ public class GT_Worldgen_GT_Ore_Layer if (!this.mRestrictBiome.equals("None") && !(this.mRestrictBiome.equals(aBiome))) {
return WRONG_BIOME;
}
+ // For optimal performance, this should be done upstream. Meh
+ String tDimensionName = aWorld.provider.getDimensionName();
+ boolean isUnderdark = tDimensionName.equals("Underdark");
+
int[] placeCount=new int[4];
int tMinY = mMinY + aRandom.nextInt(mMaxY - mMinY - 5);
@@ -124,14 +130,18 @@ public class GT_Worldgen_GT_Ore_Layer int wX = Math.max( wXVein, aChunkX + 2); // Bias placement by 2 blocks to prevent worldgen cascade.
int eX = Math.min( eXVein, aChunkX + 2 + 16);
if (wX >= eX) { //No overlap between orevein and this chunk exists in X
- /*
- if (debugOrevein) {
- GT_Log.out.println(
- "No X overlap"
- );
+ Block tBlock = aWorld.getBlock(aChunkX + 7, tMinY, aChunkZ + 9);
+ if (tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, Blocks.stone) ||
+ tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, Blocks.netherrack) ||
+ tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, Blocks.end_stone) ||
+ tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, GregTech_API.sBlockGranites) ||
+ tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, GregTech_API.sBlockStones) ) {
+ // Didn't reach, but could have placed. Save orevein for future use.
+ return NO_OVERLAP;
+ } else {
+ // Didn't reach, but couldn't place in test spot anywys, try for another orevein
+ return NO_OVERLAP_AIR_BLOCK;
}
- */
- return NO_OVERLAP;
}
// Determine North/Sound ends of orevein
int nZVein = aSeedZ - aRandom.nextInt(mSize);
@@ -140,14 +150,30 @@ public class GT_Worldgen_GT_Ore_Layer int nZ = Math.max(nZVein, aChunkZ + 2); // Bias placement by 2 blocks to prevent worldgen cascade.
int sZ = Math.min(sZVein, aChunkZ + 2 + 16);
if (nZ >= sZ) { //No overlap between orevein and this chunk exists in Z
- /*
- if (debugOrevein) {
- GT_Log.out.println(
- "No Z overlap"
- );
+ Block tBlock = aWorld.getBlock(aChunkX + 7, tMinY, aChunkZ + 9);
+ if (tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, Blocks.stone) ||
+ tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, Blocks.netherrack) ||
+ tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, Blocks.end_stone) ||
+ tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, GregTech_API.sBlockGranites) ||
+ tBlock.isReplaceableOreGen(aWorld, aChunkX+7, tMinY, aChunkZ + 9, GregTech_API.sBlockStones) ) {
+ // Didn't reach, but could have placed. Save orevein for future use.
+ return NO_OVERLAP;
+ } else {
+ // Didn't reach, but couldn't place in test spot anywys, try for another orevein
+ return NO_OVERLAP_AIR_BLOCK;
}
- */
- return NO_OVERLAP;
+ }
+
+ if (debugOrevein) {
+ GT_Log.out.print(
+ "Trying Orevein:" + this.mWorldGenName +
+ " Dimension=" + tDimensionName +
+ " mX="+aChunkX/16+
+ " mZ="+aChunkZ/16+
+ " oreseedX="+ aSeedX/16 +
+ " oreseedZ="+ aSeedZ/16 +
+ " cY="+tMinY
+ );
}
// Adjust the density down the more chunks we are away from the oreseed. The 5 chunks surrounding the seed should always be max density due to truncation of Math.sqrt().
int localDensity = Math.max(1, this.mDensity / ((int)Math.sqrt(2 + Math.pow(aChunkX/16 - aSeedX/16, 2) + Math.pow(aChunkZ/16 - aSeedZ/16, 2))) );
@@ -160,12 +186,12 @@ public class GT_Worldgen_GT_Ore_Layer for (int tZ = nZ; tZ < sZ; tZ++) {
int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity);
if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSecondaryMeta > 0) ) {
- if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSecondaryMeta, false, false)) {
+ if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSecondaryMeta, false, isUnderdark)) {
placeCount[1]++;
}
}
else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta > 0) ) { // Sporadics are only 1 per vertical column normally, reduce by 1/7 to compensate
- if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false))
+ if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark))
placeCount[3]++;
}
}
@@ -182,12 +208,12 @@ public class GT_Worldgen_GT_Ore_Layer for (int tZ = nZ; tZ < sZ; tZ++) {
int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity);
if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSecondaryMeta > 0) ) {
- if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSecondaryMeta, false, false)) {
+ if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSecondaryMeta, false, isUnderdark)) {
placeCount[1]++;
}
}
else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta > 0) ) { // Sporadics are only 1 per vertical column normally, reduce by 1/7 to compensate
- if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false))
+ if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark))
placeCount[3]++;
}
}
@@ -200,12 +226,12 @@ public class GT_Worldgen_GT_Ore_Layer for (int tZ = nZ; tZ < sZ; tZ++) {
int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity);
if ((aRandom.nextInt(2) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mBetweenMeta > 0) ) { // Between are only 1 per vertical column, reduce by 1/2 to compensate
- if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mBetweenMeta, false, false)) {
+ if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mBetweenMeta, false, isUnderdark)) {
placeCount[2]++;
}
}
else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta > 0) ) { // Sporadics are only 1 per vertical column normally, reduce by 1/7 to compensate
- if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false))
+ if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark))
placeCount[3]++;
}
}
@@ -217,17 +243,17 @@ public class GT_Worldgen_GT_Ore_Layer for (int tZ = nZ; tZ < sZ; tZ++) {
int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity);
if ((aRandom.nextInt(2) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mBetweenMeta > 0) ) { // Between are only 1 per vertical column, reduce by 1/2 to compensate
- if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mBetweenMeta, false, false)) {
+ if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mBetweenMeta, false, isUnderdark)) {
placeCount[2]++;
}
}
else if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mPrimaryMeta > 0) ) {
- if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mPrimaryMeta, false, false)) {
+ if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mPrimaryMeta, false, isUnderdark)) {
placeCount[0]++;
}
}
else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta > 0) ) { // Sporadics are only 1 per vertical column normally, reduce by 1/7 to compensate
- if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false))
+ if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark))
placeCount[3]++;
}
}
@@ -240,27 +266,19 @@ public class GT_Worldgen_GT_Ore_Layer for (int tZ = nZ; tZ < sZ; tZ++) {
int placeZ = Math.max(1, Math.max(MathHelper.abs_int(sZVein - tZ), MathHelper.abs_int(nZVein - tZ))/localDensity);
if ( ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mPrimaryMeta > 0) ) {
- if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mPrimaryMeta, false, false)) {
+ if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mPrimaryMeta, false, isUnderdark)) {
placeCount[0]++;
}
}
else if ((aRandom.nextInt(7) == 0) && ((aRandom.nextInt(placeZ) == 0) || (aRandom.nextInt(placeX) == 0)) && (this.mSporadicMeta > 0) ) { // Sporadics are only 1 per vertical column normally, reduce by 1/7 to compensate
- if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, false))
+ if (GT_TileEntity_Ores.setOreBlock(aWorld, tX, level, tZ, this.mSporadicMeta, false, isUnderdark))
placeCount[3]++;
}
}
}
}
if (debugOrevein) {
- String tDimensionName = aWorld.provider.getDimensionName();
GT_Log.out.println(
- "Generated Orevein:" + this.mWorldGenName +
- " Dimension=" + tDimensionName +
- " mX="+aChunkX/16+
- " mZ="+aChunkZ/16+
- " oreseedX="+ aSeedX/16 +
- " oreseedZ="+ aSeedZ/16 +
- " cY="+tMinY+
" wXVein" + wXVein +
" eXVein" + eXVein +
" nZVein" + nZVein +
diff --git a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java index 60138d955e..a4273e0f21 100644 --- a/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java +++ b/src/main/java/gregtech/common/GT_Worldgen_GT_Ore_SmallPieces.java @@ -45,11 +45,14 @@ public class GT_Worldgen_GT_Ore_SmallPieces return false; } int count=0; - + // For optimal performance, this should be done upstream. Meh + String tDimensionName = aWorld.provider.getDimensionName(); + boolean isUnderdark = tDimensionName.equals("Underdark"); + if (this.mMeta > 0) { int j = Math.max(1, this.mAmount / 2 + aRandom.nextInt(this.mAmount) / 2); for ( int i = 0; i < j; i++) { - GT_TileEntity_Ores.setOreBlock(aWorld, aChunkX + 8 + aRandom.nextInt(16), this.mMinY + aRandom.nextInt(Math.max(1, this.mMaxY - this.mMinY)), aChunkZ + 8 + aRandom.nextInt(16), this.mMeta, true); + GT_TileEntity_Ores.setOreBlock(aWorld, aChunkX + 8 + aRandom.nextInt(16), this.mMinY + aRandom.nextInt(Math.max(1, this.mMaxY - this.mMinY)), aChunkZ + 8 + aRandom.nextInt(16), this.mMeta, true, isUnderdark); count++; } } diff --git a/src/main/java/gregtech/common/GT_Worldgenerator.java b/src/main/java/gregtech/common/GT_Worldgenerator.java index ddc78b031a..750159988a 100644 --- a/src/main/java/gregtech/common/GT_Worldgenerator.java +++ b/src/main/java/gregtech/common/GT_Worldgenerator.java @@ -108,7 +108,13 @@ implements IWorldGenerator { public final IChunkProvider mChunkGenerator;
public final IChunkProvider mChunkProvider;
public final String mBiome;
+ // Used for outputting orevein weights and bins
+ // static int test=0;
+
+
// Local class to track which orevein seeds must be checked when doing chunkified worldgen
+
+
class NearbySeeds {
public int mX;
public int mZ;
@@ -131,6 +137,30 @@ implements IWorldGenerator { this.mBiome = aBiome;
}
+ // How to evaluate oregen distribution
+ // - Enable debugOreveins
+ // - Fly around for a while, or teleport jumping ~320 blocks at a time, with
+ // a 15-30s pause for worldgen to catch up
+ // - Do this across a large area, at least 2000x2000 blocks for good numbers
+ // - Open logs\gregtech.log
+ // - Using notepad++, do a Search | Find - enter "Added" for the search term
+ // - Select Find All In Current Document
+ // - In the Search window, right-click and Select All
+ // - Copy and paste to a new file
+ // - Delete extraneous stuff at top, and blank line at bottom. Line count is
+ // # of total oreveins
+ // - For simple spot checks, use Find All in Current Document for specific
+ // oremixes, ie ore.mix.diamond, to check how many appear in the list.
+ // - For more complex work, import file into Excel, and sort based on oremix
+ // column. Drag select the oremix names, in the bottom right will be how many
+ // entries to add in a seperate tab to calculate %ages.
+ //
+ // When using the ore weights, discount or remove the high altitude veins since
+ // their high weight are offset by their rareness. I usually just use zero for them.
+ // Actual spawn rates will vary based upon the average height of the stone layers
+ // in the dimension. For example veins that range above and below the average height
+ // will be less, and veins that are completely above the average height will be much less.
+
public void worldGenFindVein( int oreseedX, int oreseedZ) {
// Explanation of oreveinseed implementation.
// (long)this.mWorld.getSeed()<<16) Deep Dark does two oregen passes, one with getSeed set to +1 the original world seed. This pushes that +1 off the low bits of oreseedZ, so that the hashes are far apart for the two passes.
@@ -159,6 +189,22 @@ implements IWorldGenerator { int placementAttempts = 0;
boolean oreveinFound = false;
int i;
+
+ // Used for outputting orevein weights and bins
+ /*
+ if( test==0 )
+ {
+ test = 1;
+ GT_Log.out.println(
+ "sWeight = " + GT_Worldgen_GT_Ore_Layer.sWeight
+ );
+ for (GT_Worldgen_GT_Ore_Layer tWorldGen : GT_Worldgen_GT_Ore_Layer.sList) {
+ GT_Log.out.println(
+ ( tWorldGen).mWorldGenName + " mWeight = " + ( tWorldGen).mWeight + " mSize = " + (tWorldGen).mSize
+ );
+ }
+ }
+ */
for( i = 0; (i < oreveinAttempts) && (!oreveinFound) && (placementAttempts<oreveinMaxPlacementAttempts); i++ ) {
int tRandomWeight = oreveinRNG.nextInt(GT_Worldgen_GT_Ore_Layer.sWeight);
for (GT_Worldgen_GT_Ore_Layer tWorldGen : GT_Worldgen_GT_Ore_Layer.sList) {
@@ -171,7 +217,8 @@ implements IWorldGenerator { switch(placementResult) {
case GT_Worldgen_GT_Ore_Layer.ORE_PLACED:
if (debugOrevein) GT_Log.out.println(
- " Added oreveinSeed=" + oreveinSeed +
+ " Added near oreveinSeed=" + oreveinSeed + " " +
+ ( tWorldGen).mWorldGenName +
" tries at oremix=" + i +
" placementAttempts=" + placementAttempts +
" dimensionName=" + tDimensionName
@@ -184,7 +231,26 @@ implements IWorldGenerator { // SHould do retry in this case until out of chances
break;
case GT_Worldgen_GT_Ore_Layer.NO_OVERLAP:
- // Orevein didn't reach this chunk, can't add it yet to the hash
+ if (debugOrevein) GT_Log.out.println(
+ " Added far oreveinSeed=" + oreveinSeed + " " +
+ ( tWorldGen).mWorldGenName +
+ " tries at oremix=" + i +
+ " placementAttempts=" + placementAttempts +
+ " dimensionName=" + tDimensionName
+ );
+ validOreveins.put(oreveinSeed, tWorldGen);
+ oreveinFound = true;
+ break;
+ case GT_Worldgen_GT_Ore_Layer.NO_OVERLAP_AIR_BLOCK:
+ if (debugOrevein) GT_Log.out.println(
+ " No overlap and air block in test spot=" + oreveinSeed + " " +
+ ( tWorldGen).mWorldGenName +
+ " tries at oremix=" + i +
+ " placementAttempts=" + placementAttempts +
+ " dimensionName=" + tDimensionName
+ );
+ // SHould do retry in this case until out of chances
+ placementAttempts++;
break;
}
break; // Try the next orevein
@@ -195,14 +261,14 @@ implements IWorldGenerator { " mX="+ this.mX +
" mZ="+ this.mZ +
" oreseedX="+ oreseedX +
- " oreseedZ="+ oreseedZ
- );
+ " oreseedZ="+ oreseedZ
+ );
e.printStackTrace(GT_Log.err);
}
}
}
}
- // Only add an empty orevein if are unable to place a vein at the oreseed chunk.
+ // Only add an empty orevein if unable to place a vein at the oreseed chunk.
if ((!oreveinFound) && (this.mX == oreseedX) && (this.mZ == oreseedZ)){
if (debugOrevein) GT_Log.out.println(
" Empty oreveinSeed="+ oreveinSeed +
@@ -349,9 +415,9 @@ implements IWorldGenerator { }
}
//if(GT_Values.D1)System.out.println("do asteroid gen: "+this.mX+" "+this.mZ);
- int tX = mX + aRandom.nextInt(16);
+ int tX = mX * 16 + aRandom.nextInt(16);
int tY = 50 + aRandom.nextInt(200 - 50);
- int tZ = mZ + aRandom.nextInt(16);
+ int tZ = mZ * 16 + aRandom.nextInt(16);
if (tDimensionType == 1) {
mSize = aRandom.nextInt((int) (endMaxSize - endMinSize));
//} else if (tDimensionName.equals("Asteroids")) {
diff --git a/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java b/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java index f8b52c8f08..0115d554c0 100644 --- a/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java +++ b/src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java @@ -10,6 +10,7 @@ import gregtech.api.interfaces.tileentity.ITexturedTileEntity; import gregtech.api.objects.GT_CopiedBlockTexture; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.objects.XSTR; +import gregtech.api.util.GT_Log; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java index cb83ee28e0..b0b7f01b09 100644 --- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java +++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java @@ -714,8 +714,8 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { //GT_ModHandler.addCraftingRecipe(ItemList.Field_Generator_IV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WCW", "CGC", "WCW", 'G', ItemList.QuantumStar.get(1L, new Object[0]), 'C', OrePrefixes.circuit.get(Materials.Elite), 'W', OrePrefixes.wireGt16.get(Materials.Osmium)}); GT_ModHandler.addCraftingRecipe(ItemList.Component_Sawblade_Diamond.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{" D ", "DGD", " D ", 'D', OrePrefixes.dustSmall.get(Materials.Diamond), 'G', OrePrefixes.gearGt.get(Materials.CobaltBrass)}); - GT_ModHandler.addCraftingRecipe(ItemList.Component_Grinder_Diamond.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"DSD", "SIS", "DSD", 'I', OreDictNames.craftingIndustrialDiamond, 'D', OrePrefixes.dust.get(Materials.Diamond), 'S', OrePrefixes.plate.get(Materials.Steel)}); - GT_ModHandler.addCraftingRecipe(ItemList.Component_Grinder_Tungsten.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"TST", "SIS", "TST", 'I', OreDictNames.craftingIndustrialDiamond, 'T', OrePrefixes.plate.get(Materials.Tungsten), 'S', OrePrefixes.plate.get(Materials.Steel)}); + GT_ModHandler.addCraftingRecipe(ItemList.Component_Grinder_Diamond.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"DSD", "SIS", "DSD", 'I', OrePrefixes.gem.get(Materials.Diamond), 'D', OrePrefixes.dust.get(Materials.Diamond), 'S', OrePrefixes.plateDouble.get(Materials.Steel)}); + GT_ModHandler.addCraftingRecipe(ItemList.Component_Grinder_Tungsten.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"TST", "SIS", "TST", 'I', OreDictNames.craftingIndustrialDiamond, 'T', OrePrefixes.plate.get(Materials.Tungsten), 'S', OrePrefixes.plateDouble.get(Materials.Steel)}); ItemList.Upgrade_Muffler.set(addItem(tLastID = 727, "Muffler Upgrade", "Makes Machines silent", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.VACUOS, 2L)})); ItemList.Upgrade_Lock.set(addItem(tLastID = 728, "Lock Upgrade", "Protects your Machines", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 4L)})); diff --git a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java index 7365877d6b..ce03f6b505 100644 --- a/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java +++ b/src/main/java/gregtech/common/tileentities/generators/GT_MetaTileEntity_GasTurbine.java @@ -19,7 +19,8 @@ public class GT_MetaTileEntity_GasTurbine public GT_MetaTileEntity_GasTurbine(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, new String[]{ - "Requires flammable Gasses"}); + "Requires flammable Gasses", + "Causes " + (int) (20 * BASE_POLLUTION * Math.pow(2, aTier - 1)) + " Pollution per second"}); onConfigLoad(); } |
