aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/world
diff options
context:
space:
mode:
authorJordan Byrne <draknyte1@hotmail.com>2018-01-08 19:08:13 +1000
committerJordan Byrne <draknyte1@hotmail.com>2018-01-08 19:08:13 +1000
commit2b77e70b058ed0a82b3a4a163a04ec5d9ed00c67 (patch)
treeacc168cb6a9f6331252cf5bd24926b46a7a366ee /src/Java/gtPlusPlus/core/world
parentbcd8344c3732f08e331cf048f1f748c5b55f2812 (diff)
downloadGT5-Unofficial-2b77e70b058ed0a82b3a4a163a04ec5d9ed00c67.tar.gz
GT5-Unofficial-2b77e70b058ed0a82b3a4a163a04ec5d9ed00c67.tar.bz2
GT5-Unofficial-2b77e70b058ed0a82b3a4a163a04ec5d9ed00c67.zip
+ Added a recipe to craft Mining Explosives.
+ Added missing file. WorldGen_GT.java. % Tweaked Mining Explosive logic. % Tweaked entity fuse variable in primed mining explosive. % Swapped some XSTR's to CSPRNG's. $ Fixed mining explosives renderer. $ Fixed Tesla Tower attacking Items on the ground.
Diffstat (limited to 'src/Java/gtPlusPlus/core/world')
-rw-r--r--src/Java/gtPlusPlus/core/world/darkworld/gen/gt/WorldGen_GT.java49
-rw-r--r--src/Java/gtPlusPlus/core/world/darkworld/gen/gt/WorldGen_GT_Base.java2
-rw-r--r--src/Java/gtPlusPlus/core/world/explosions/MiningExplosion.java5
3 files changed, 53 insertions, 3 deletions
diff --git a/src/Java/gtPlusPlus/core/world/darkworld/gen/gt/WorldGen_GT.java b/src/Java/gtPlusPlus/core/world/darkworld/gen/gt/WorldGen_GT.java
new file mode 100644
index 0000000000..bbec200c8e
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/world/darkworld/gen/gt/WorldGen_GT.java
@@ -0,0 +1,49 @@
+package gtPlusPlus.core.world.darkworld.gen.gt;
+
+import gregtech.api.GregTech_API;
+import gtPlusPlus.xmod.gregtech.HANDLER_GT;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+import java.util.concurrent.ConcurrentHashMap;
+import net.minecraft.world.World;
+import net.minecraft.world.chunk.IChunkProvider;
+
+public abstract class WorldGen_GT {
+ public final String mWorldGenName;
+ public final boolean mEnabled;
+ private final Map<String, Boolean> mDimensionMap = new ConcurrentHashMap<String, Boolean>();
+
+ public WorldGen_GT(String aName, List aList, boolean aDefault) {
+ this.mWorldGenName = aName;
+ this.mEnabled = HANDLER_GT.sCustomWorldgenFile.get("worldgen", this.mWorldGenName, aDefault);
+ if (this.mEnabled) {
+ aList.add(this);
+ }
+
+ }
+
+ public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX,
+ int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) {
+ return false;
+ }
+
+ public boolean executeCavegen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX,
+ int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) {
+ return false;
+ }
+
+ public boolean isGenerationAllowed(World aWorld, int aDimensionType, int aAllowedDimensionType) {
+ String aDimName = aWorld.provider.getDimensionName();
+ Boolean tAllowed = (Boolean) this.mDimensionMap.get(aDimName);
+ if (tAllowed == null) {
+ boolean tValue = HANDLER_GT.sCustomWorldgenFile.get("worldgen.dimensions." + this.mWorldGenName, aDimName,
+ aDimensionType == aAllowedDimensionType);
+ this.mDimensionMap.put(aDimName, Boolean.valueOf(tValue));
+ return tValue;
+ } else {
+ return tAllowed.booleanValue();
+ }
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/world/darkworld/gen/gt/WorldGen_GT_Base.java b/src/Java/gtPlusPlus/core/world/darkworld/gen/gt/WorldGen_GT_Base.java
index 93c34e6fcc..44d62663bd 100644
--- a/src/Java/gtPlusPlus/core/world/darkworld/gen/gt/WorldGen_GT_Base.java
+++ b/src/Java/gtPlusPlus/core/world/darkworld/gen/gt/WorldGen_GT_Base.java
@@ -6,10 +6,10 @@ import cpw.mods.fml.common.IWorldGenerator;
import cpw.mods.fml.common.registry.GameRegistry;
import gregtech.api.util.GT_Log;
import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.api.objects.XSTR;
import gtPlusPlus.core.material.ELEMENT;
import gtPlusPlus.core.world.darkworld.Dimension_DarkWorld;
import gtPlusPlus.xmod.gregtech.HANDLER_GT;
-import gtPlusPlus.xmod.gregtech.api.objects.XSTR;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
diff --git a/src/Java/gtPlusPlus/core/world/explosions/MiningExplosion.java b/src/Java/gtPlusPlus/core/world/explosions/MiningExplosion.java
index effe4e397f..c632482d4e 100644
--- a/src/Java/gtPlusPlus/core/world/explosions/MiningExplosion.java
+++ b/src/Java/gtPlusPlus/core/world/explosions/MiningExplosion.java
@@ -2,9 +2,10 @@ package gtPlusPlus.core.world.explosions;
import java.util.*;
+import gtPlusPlus.api.objects.CSPRNG;
+import gtPlusPlus.api.objects.XSTR;
import gtPlusPlus.core.entity.EntityPrimedMiningExplosive;
import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.xmod.gregtech.api.objects.XSTR;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.enchantment.EnchantmentProtection;
@@ -21,7 +22,7 @@ public class MiningExplosion extends Explosion {
/** whether or not this explosion spawns smoke particles */
public boolean isSmoking = true;
private final int field_77289_h = 16;
- private final Random explosionRNG = new XSTR();
+ private final Random explosionRNG = CSPRNG.generate(new XSTR());
private final World worldObj;
public double explosionX;
public double explosionY;