aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus
diff options
context:
space:
mode:
authorAlkalus <draknyte1@hotmail.com>2017-04-01 14:08:24 +1000
committerGitHub <noreply@github.com>2017-04-01 14:08:24 +1000
commitb55016965731c607587bb9891d0975a0e8a80fb9 (patch)
tree88ab34784695424373345b153c6389faf8422337 /src/Java/gtPlusPlus
parent1f1809d36813f134627efa38ecf198132b3d53e5 (diff)
parentaef078aa0db8e3e7ec4ad09ff288a4f3712b4d2d (diff)
downloadGT5-Unofficial-b55016965731c607587bb9891d0975a0e8a80fb9.tar.gz
GT5-Unofficial-b55016965731c607587bb9891d0975a0e8a80fb9.tar.bz2
GT5-Unofficial-b55016965731c607587bb9891d0975a0e8a80fb9.zip
Merge pull request #70 from draknyte1/desktop-changes
Unmerged Desktop Changes
Diffstat (limited to 'src/Java/gtPlusPlus')
-rw-r--r--src/Java/gtPlusPlus/GTplusplus.java19
-rw-r--r--src/Java/gtPlusPlus/core/block/general/HellFire.java471
-rw-r--r--src/Java/gtPlusPlus/core/client/renderer/RenderMiningExplosivesPrimed.java6
-rw-r--r--src/Java/gtPlusPlus/core/entity/EntityPrimedMiningExplosive.java4
-rw-r--r--src/Java/gtPlusPlus/core/entity/InternalEntityRegistry.java7
-rw-r--r--src/Java/gtPlusPlus/core/proxy/ClientProxy.java8
-rw-r--r--src/Java/gtPlusPlus/core/world/explosions/MiningExplosion.java11
7 files changed, 503 insertions, 23 deletions
diff --git a/src/Java/gtPlusPlus/GTplusplus.java b/src/Java/gtPlusPlus/GTplusplus.java
index 1b859d30c3..1f10ccc772 100644
--- a/src/Java/gtPlusPlus/GTplusplus.java
+++ b/src/Java/gtPlusPlus/GTplusplus.java
@@ -13,7 +13,6 @@ import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.*;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.util.GT_Config;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map;
@@ -26,7 +25,7 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.xmod.gregtech.HANDLER_GT;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtTools;
@@ -170,9 +169,8 @@ implements ActionListener
Utils.LOG_INFO("Login Handler Initialized");
handleConfigFile(event);
- proxy.registerTileEntities();
- proxy.registerRenderThings();
- HANDLER_GT.mMaterialProperties = new GT_Config(new Configuration(new File(new File(event.getModConfigurationDirectory(), "GTplusplus"), "MaterialProperties.cfg")));
+
+ //HANDLER_GT.mMaterialProperties = new GT_Config(new Configuration(new File(new File(event.getModConfigurationDirectory(), "GTplusplus"), "MaterialProperties.cfg")));
proxy.preInit(event);
}
@@ -181,9 +179,14 @@ implements ActionListener
public void init(final FMLInitializationEvent event)
{
proxy.init(event);
+
+ Utils.LOG_INFO("[Proxy] Calling Entity registrator.");
proxy.registerEntities();
- //MinecraftForge.EVENT_BUS.register(this);
- //FMLCommonHandler.instance().bus().register(this);
+ Utils.LOG_INFO("[Proxy] Calling Tile Entity registrator.");
+ proxy.registerTileEntities();
+ Utils.LOG_INFO("[Proxy] Calling Render registrator.");
+ proxy.registerRenderThings();
+
proxy.registerNetworkStuff();
}
@@ -200,7 +203,7 @@ implements ActionListener
}
//~
- //ReflectionUtils.becauseIWorkHard();
+ ReflectionUtils.becauseIWorkHard();
//Utils.LOG_INFO("Activating GT OreDictionary Handler, this can take some time.");
Utils.LOG_INFO("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
diff --git a/src/Java/gtPlusPlus/core/block/general/HellFire.java b/src/Java/gtPlusPlus/core/block/general/HellFire.java
new file mode 100644
index 0000000000..344e333e4a
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/block/general/HellFire.java
@@ -0,0 +1,471 @@
+package gtPlusPlus.core.block.general;
+
+import static net.minecraftforge.common.util.ForgeDirection.*;
+
+import java.util.IdentityHashMap;
+import java.util.Map.Entry;
+import java.util.Random;
+
+import com.google.common.collect.Maps;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.xmod.gregtech.api.objects.XSTR;
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockFire;
+import net.minecraft.block.material.MapColor;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.init.Blocks;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+
+public class HellFire extends BlockFire {
+ @Deprecated
+ private final int[] field_149849_a = new int[4096];
+ @Deprecated
+ private final int[] field_149848_b = new int[4096];
+ @SideOnly(Side.CLIENT)
+ private IIcon[] field_149850_M;
+
+ protected HellFire() {
+ this.setTickRandomly(true);
+ this.setBlockTextureName(CORE.MODID + ":" + "");
+ }
+
+ /**
+ * How many world ticks before ticking
+ */
+ @Override
+ public int tickRate(final World world) {
+ return 10;
+ }
+
+ /**
+ * Ticks the block if it's been scheduled
+ */
+ @Override
+ public void updateTick(final World world, final int x, final int y, final int z, Random random) {
+
+ random = new XSTR();
+
+ if (world.getGameRules().getGameRuleBooleanValue("doFireTick")) {
+ final boolean flag = world.getBlock(x, y - 1, z).isFireSource(world, x, y - 1, z, UP);
+
+ if (!this.canPlaceBlockAt(world, x, y, z)) {
+ world.setBlockToAir(x, y, z);
+ }
+
+ if (!flag && world.isRaining()
+ && (world.canLightningStrikeAt(x, y, z) || world.canLightningStrikeAt(x - 1, y, z)
+ || world.canLightningStrikeAt(x + 1, y, z) || world.canLightningStrikeAt(x, y, z - 1)
+ || world.canLightningStrikeAt(x, y, z + 1))) {
+ world.setBlockToAir(x, y, z);
+ }
+ else {
+ final int l = world.getBlockMetadata(x, y, z);
+
+ if (l < 15) {
+ world.setBlockMetadataWithNotify(x, y, z, l + (random.nextInt(3) / 2), 4);
+ }
+
+ world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world) + random.nextInt(10));
+
+ if (!flag && !this.canNeighborBurn(world, x, y, z)) {
+ if (!World.doesBlockHaveSolidTopSurface(world, x, y - 1, z) || (l > 3)) {
+ world.setBlockToAir(x, y, z);
+ }
+ }
+ else if (!flag && !this.canCatchFire(world, x, y - 1, z, UP) && (l == 15) && (random.nextInt(4) == 0)) {
+ world.setBlockToAir(x, y, z);
+ }
+ else {
+ final boolean flag1 = world.isBlockHighHumidity(x, y, z);
+ byte b0 = 0;
+
+ if (flag1) {
+ b0 = -50;
+ }
+
+ this.tryCatchFire(world, x + 1, y, z, 300 + b0, random, l, WEST);
+ this.tryCatchFire(world, x - 1, y, z, 300 + b0, random, l, EAST);
+ this.tryCatchFire(world, x, y - 1, z, 250 + b0, random, l, UP);
+ this.tryCatchFire(world, x, y + 1, z, 250 + b0, random, l, DOWN);
+ this.tryCatchFire(world, x, y, z - 1, 300 + b0, random, l, SOUTH);
+ this.tryCatchFire(world, x, y, z + 1, 300 + b0, random, l, NORTH);
+
+ for (int i1 = x - 1; i1 <= (x + 1); ++i1) {
+ for (int j1 = z - 1; j1 <= (z + 1); ++j1) {
+ for (int k1 = y - 1; k1 <= (y + 4); ++k1) {
+ if ((i1 != x) || (k1 != y) || (j1 != z)) {
+ int l1 = 100;
+
+ if (k1 > (y + 1)) {
+ l1 += (k1 - (y + 1)) * 100;
+ }
+
+ final int i2 = this.getChanceOfNeighborsEncouragingFire(world, i1, k1, j1);
+
+ if (i2 > 0) {
+ int j2 = (i2 + 40 + (world.difficultySetting.getDifficultyId() * 7)) / (l + 30);
+
+ if (flag1) {
+ j2 /= 2;
+ }
+
+ if ((j2 > 0) && (random.nextInt(l1) <= j2)
+ && (!world.isRaining() || !world.canLightningStrikeAt(i1, k1, j1))
+ && !world.canLightningStrikeAt(i1 - 1, k1, z)
+ && !world.canLightningStrikeAt(i1 + 1, k1, j1)
+ && !world.canLightningStrikeAt(i1, k1, j1 - 1)
+ && !world.canLightningStrikeAt(i1, k1, j1 + 1)) {
+ int k2 = l + (random.nextInt(5) / 4);
+
+ if (k2 > 15) {
+ k2 = 15;
+ }
+
+ world.setBlock(i1, k1, j1, this, k2, 3);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private void tryCatchFire(final World world, final int p_149841_2_, final int p_149841_3_, final int p_149841_4_, final int p_149841_5_, final Random p_149841_6_, final int p_149841_7_, final ForgeDirection face) {
+ final int j1 = world.getBlock(p_149841_2_, p_149841_3_, p_149841_4_).getFlammability(world, p_149841_2_,
+ p_149841_3_, p_149841_4_, face);
+
+ if (p_149841_6_.nextInt(p_149841_5_) < j1) {
+ final boolean flag = world.getBlock(p_149841_2_, p_149841_3_, p_149841_4_) == Blocks.tnt;
+
+ if ((p_149841_6_.nextInt(p_149841_7_ + 10) < 5)
+ && !world.canLightningStrikeAt(p_149841_2_, p_149841_3_, p_149841_4_)) {
+ int k1 = p_149841_7_ + (p_149841_6_.nextInt(5) / 4);
+
+ if (k1 > 15) {
+ k1 = 15;
+ }
+
+ world.setBlock(p_149841_2_, p_149841_3_, p_149841_4_, this, k1, 3);
+ }
+ else {
+ world.setBlockToAir(p_149841_2_, p_149841_3_, p_149841_4_);
+ }
+
+ if (flag) {
+ Blocks.tnt.onBlockDestroyedByPlayer(world, p_149841_2_, p_149841_3_, p_149841_4_, 1);
+ }
+ }
+ }
+
+ /**
+ * Returns true if at least one block next to this one can burn.
+ */
+ private boolean canNeighborBurn(final World p_149847_1_, final int p_149847_2_, final int p_149847_3_, final int p_149847_4_) {
+ return this.canCatchFire(p_149847_1_, p_149847_2_ + 1, p_149847_3_, p_149847_4_, WEST)
+ || this.canCatchFire(p_149847_1_, p_149847_2_ - 1, p_149847_3_, p_149847_4_, EAST)
+ || this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_ - 1, p_149847_4_, UP)
+ || this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_ + 1, p_149847_4_, DOWN)
+ || this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ - 1, SOUTH)
+ || this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ + 1, NORTH);
+ }
+
+ /**
+ * Gets the highest chance of a neighbor block encouraging this block to
+ * catch fire
+ */
+ private int getChanceOfNeighborsEncouragingFire(final World p_149845_1_, final int p_149845_2_, final int p_149845_3_, final int p_149845_4_) {
+ final byte b0 = 0;
+
+ if (!p_149845_1_.isAirBlock(p_149845_2_, p_149845_3_, p_149845_4_)) {
+ return 0;
+ }
+ else {
+ int l = b0;
+ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_ + 1, p_149845_3_, p_149845_4_, l, WEST);
+ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_ - 1, p_149845_3_, p_149845_4_, l, EAST);
+ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_ - 1, p_149845_4_, l, UP);
+ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_ + 1, p_149845_4_, l, DOWN);
+ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_, p_149845_4_ - 1, l, SOUTH);
+ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_, p_149845_4_ + 1, l, NORTH);
+ return l;
+ }
+ }
+
+ /**
+ * Checks the specified block coordinate to see if it can catch fire. Args:
+ * blockAccess, x, y, z
+ */
+ @Override
+ @Deprecated
+ public boolean canBlockCatchFire(final IBlockAccess p_149844_1_, final int p_149844_2_, final int p_149844_3_, final int p_149844_4_) {
+ return this.canCatchFire(p_149844_1_, p_149844_2_, p_149844_3_, p_149844_4_, UP);
+ }
+
+ /**
+ * Checks to see if its valid to put this block at the specified
+ * coordinates. Args: world, x, y, z
+ */
+ @Override
+ public boolean canPlaceBlockAt(final World worldObj, final int x, final int y, final int z) {
+ return World.doesBlockHaveSolidTopSurface(worldObj, x, y - 1, z)
+ || this.canNeighborBurn(worldObj, x, y, z);
+ }
+
+ /**
+ * Lets the block know when one of its neighbor changes. Doesn't know which
+ * neighbor changed (coordinates passed are their own) Args: x, y, z,
+ * neighbor Block
+ */
+ @Override
+ public void onNeighborBlockChange(final World worldObj, final int x, final int y, final int z, final Block blockObj) {
+ if (!World.doesBlockHaveSolidTopSurface(worldObj, x, y - 1, z)
+ && !this.canNeighborBurn(worldObj, x, y, z)) {
+ worldObj.setBlockToAir(x, y, z);
+ }
+ }
+
+ /**
+ * Called whenever the block is added into the world. Args: world, x, y, z
+ */
+ @Override
+ public void onBlockAdded(final World world, final int x, final int y, final int z) {
+ if ((world.provider.dimensionId > 0)
+ || !Blocks.portal.func_150000_e(world, x, y, z)) {
+ if (!World.doesBlockHaveSolidTopSurface(world, x, y - 1, z)
+ && !this.canNeighborBurn(world, x, y, z)) {
+ world.setBlockToAir(x, y, z);
+ }
+ else {
+ world.scheduleBlockUpdate(x, y, z, this,
+ this.tickRate(world) + world.rand.nextInt(10));
+ }
+ }
+ }
+
+ /**
+ * A randomly called display update to be able to add particles or other
+ * items for display
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void randomDisplayTick(final World world, final int x, final int y, final int z, Random randomObj) {
+
+ randomObj = new XSTR();
+
+ if (randomObj.nextInt(24) == 0) {
+ world.playSound(x + 0.5F, y + 0.5F, z + 0.5F, "fire.fire",
+ 1.0F + randomObj.nextFloat(), (randomObj.nextFloat() * 0.7F) + 0.3F, false);
+ }
+
+ int l;
+ float f;
+ float f1;
+ float f2;
+
+ if (!World.doesBlockHaveSolidTopSurface(world, x, y - 1, z)
+ && !Blocks.fire.canCatchFire(world, x, y - 1, z, UP)) {
+ if (Blocks.fire.canCatchFire(world, x - 1, y, z, EAST)) {
+ for (l = 0; l < 2; ++l) {
+ f = x + (randomObj.nextFloat() * 0.1F);
+ f1 = y + randomObj.nextFloat();
+ f2 = z + randomObj.nextFloat();
+ world.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ }
+ }
+
+ if (Blocks.fire.canCatchFire(world, x + 1, y, z, WEST)) {
+ for (l = 0; l < 2; ++l) {
+ f = (x + 1) - (randomObj.nextFloat() * 0.1F);
+ f1 = y + randomObj.nextFloat();
+ f2 = z + randomObj.nextFloat();
+ world.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ }
+ }
+
+ if (Blocks.fire.canCatchFire(world, x, y, z - 1, SOUTH)) {
+ for (l = 0; l < 2; ++l) {
+ f = x + randomObj.nextFloat();
+ f1 = y + randomObj.nextFloat();
+ f2 = z + (randomObj.nextFloat() * 0.1F);
+ world.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ }
+ }
+
+ if (Blocks.fire.canCatchFire(world, x, y, z + 1, NORTH)) {
+ for (l = 0; l < 2; ++l) {
+ f = x + randomObj.nextFloat();
+ f1 = y + randomObj.nextFloat();
+ f2 = (z + 1) - (randomObj.nextFloat() * 0.1F);
+ world.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ }
+ }
+
+ if (Blocks.fire.canCatchFire(world, x, y + 1, z, DOWN)) {
+ for (l = 0; l < 2; ++l) {
+ f = x + randomObj.nextFloat();
+ f1 = (y + 1) - (randomObj.nextFloat() * 0.1F);
+ f2 = z + randomObj.nextFloat();
+ world.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ }
+ }
+ }
+ else {
+ for (l = 0; l < 3; ++l) {
+ f = x + randomObj.nextFloat();
+ f1 = y + (randomObj.nextFloat() * 0.5F) + 0.5F;
+ f2 = z + randomObj.nextFloat();
+ world.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D);
+ }
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(final IIconRegister p_149651_1_) {
+ this.field_149850_M = new IIcon[] { p_149651_1_.registerIcon(this.getTextureName() + "_layer_0"),
+ p_149651_1_.registerIcon(this.getTextureName() + "_layer_1") };
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getFireIcon(final int p_149840_1_) {
+ return this.field_149850_M[p_149840_1_];
+ }
+
+ /**
+ * Gets the block's texture. Args: side, meta
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(final int p_149691_1_, final int p_149691_2_) {
+ return this.field_149850_M[0];
+ }
+
+ @Override
+ public MapColor getMapColor(final int p_149728_1_) {
+ return MapColor.snowColor;
+ }
+
+ /*
+ * ================================= Forge Start
+ * ======================================
+ */
+ private static class FireInfo {
+ private int encouragement = 0;
+ private int flammibility = 0;
+ }
+
+ private final IdentityHashMap<Block, FireInfo> blockInfo = Maps.newIdentityHashMap();
+
+ @Override
+ public void setFireInfo(final Block block, final int encouragement, final int flammibility) {
+ if (block == Blocks.air) {
+ throw new IllegalArgumentException("Tried to set air on fire... This is bad.");
+ }
+ final int id = Block.getIdFromBlock(block);
+ this.field_149849_a[id] = encouragement;
+ this.field_149848_b[id] = flammibility;
+
+ final FireInfo info = this.getInfo(block, true);
+ info.encouragement = encouragement;
+ info.flammibility = flammibility;
+ }
+
+ private FireInfo getInfo(final Block block, final boolean garentee) {
+ FireInfo ret = this.blockInfo.get(block);
+ if ((ret == null) && garentee) {
+ ret = new FireInfo();
+ this.blockInfo.put(block, ret);
+ }
+ return ret;
+ }
+
+ @Override
+ public void rebuildFireInfo() {
+ for (int x = 0; x < 4096; x++) {
+ // If we care.. we could detect changes in here and make sure we
+ // keep them, however
+ // it's my thinking that anyone who hacks into the private variables
+ // should DIAF and we don't care about them.
+ this.field_149849_a[x] = 0;
+ this.field_149848_b[x] = 0;
+ }
+
+ for (final Entry<Block, FireInfo> e : this.blockInfo.entrySet()) {
+ final int id = Block.getIdFromBlock(e.getKey());
+ if ((id >= 0) && (id < 4096)) {
+ this.field_149849_a[id] = e.getValue().encouragement;
+ this.field_149848_b[id] = e.getValue().flammibility;
+ }
+ }
+ }
+
+ @Override
+ public int getFlammability(final Block block) {
+ final int id = Block.getIdFromBlock(block);
+ return (id >= 0) && (id < 4096) ? this.field_149848_b[id] : 0;
+ }
+
+ @Override
+ public int getEncouragement(final Block block) {
+ final int id = Block.getIdFromBlock(block);
+ return (id >= 0) && (id < 4096) ? this.field_149849_a[id] : 0;
+ }
+
+ /**
+ * Side sensitive version that calls the block function.
+ *
+ * @param world
+ * The current world
+ * @param x
+ * X Position
+ * @param y
+ * Y Position
+ * @param z
+ * Z Position
+ * @param face
+ * The side the fire is coming from
+ * @return True if the face can catch fire.
+ */
+ @Override
+ public boolean canCatchFire(final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
+ return world.getBlock(x, y, z).isFlammable(world, x, y, z, face);
+ }
+
+ /**
+ * Side sensitive version that calls the block function.
+ *
+ * @param world
+ * The current world
+ * @param x
+ * X Position
+ * @param y
+ * Y Position
+ * @param z
+ * Z Position
+ * @param oldChance
+ * The previous maximum chance.
+ * @param face
+ * The side the fire is coming from
+ * @return The chance of the block catching fire, or oldChance if it is
+ * higher
+ */
+ @Override
+ public int getChanceToEncourageFire(final IBlockAccess world, final int x, final int y, final int z, final int oldChance, final ForgeDirection face) {
+ final int newChance = world.getBlock(x, y, z).getFireSpreadSpeed(world, x, y, z, face);
+ return (newChance > oldChance ? newChance : oldChance);
+ }
+ /*
+ * ================================= Forge Start
+ * ======================================
+ */
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/client/renderer/RenderMiningExplosivesPrimed.java b/src/Java/gtPlusPlus/core/client/renderer/RenderMiningExplosivesPrimed.java
index 7c9a268afb..bbbde96c8e 100644
--- a/src/Java/gtPlusPlus/core/client/renderer/RenderMiningExplosivesPrimed.java
+++ b/src/Java/gtPlusPlus/core/client/renderer/RenderMiningExplosivesPrimed.java
@@ -11,7 +11,6 @@ import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityTNTPrimed;
-import net.minecraft.init.Blocks;
import net.minecraft.util.ResourceLocation;
@SideOnly(Side.CLIENT)
@@ -20,6 +19,7 @@ public class RenderMiningExplosivesPrimed extends Render {
public RenderMiningExplosivesPrimed(){
this.shadowSize = 0.5F;
+ Utils.LOG_INFO("Rendering Mining Explosion. 1");
}
/**
@@ -29,7 +29,7 @@ public class RenderMiningExplosivesPrimed extends Render {
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(final EntityTNTPrimed entity, final double p_76986_2_, final double p_76986_4_, final double p_76986_6_, final float p_76986_8_, final float p_76986_9_){
- Utils.LOG_INFO("Rendering Mining Explosion.");
+ Utils.LOG_INFO("Rendering Mining Explosion. 2");
GL11.glPushMatrix();
GL11.glTranslatef((float)p_76986_2_, (float)p_76986_4_, (float)p_76986_6_);
float f2;
@@ -65,7 +65,7 @@ public class RenderMiningExplosivesPrimed extends Render {
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA);
GL11.glColor4f(1.0F, 1.0F, 1.0F, f2);
- this.blockRenderer.renderBlockAsItem(Blocks.tnt, 0, 1.0F);
+ this.blockRenderer.renderBlockAsItem(ModBlocks.blockMiningExplosive, 0, 1.0F);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_LIGHTING);
diff --git a/src/Java/gtPlusPlus/core/entity/EntityPrimedMiningExplosive.java b/src/Java/gtPlusPlus/core/entity/EntityPrimedMiningExplosive.java
index dabb12e44e..897e330643 100644
--- a/src/Java/gtPlusPlus/core/entity/EntityPrimedMiningExplosive.java
+++ b/src/Java/gtPlusPlus/core/entity/EntityPrimedMiningExplosive.java
@@ -124,10 +124,10 @@ public class EntityPrimedMiningExplosive extends EntityTNTPrimed
private void explode()
{
- final float f = 20.0F;
+ final float f = 100.0F;
ExplosionHandler explode = new ExplosionHandler();
- explode.createExplosion(this.worldObj, this, this.posX, this.posY, this.posZ, f, true, true);
+ explode.createExplosion(this.worldObj, this, this.posX, this.posY, this.posZ, f, false, true);
/*this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, f, true);
this.worldObj.createExplosion(this, this.posX+MathUtils.randDouble(-10, 10), this.posY, this.posZ+MathUtils.randDouble(-10, 10), f+MathUtils.randFloat(-5F, 5F), true);
diff --git a/src/Java/gtPlusPlus/core/entity/InternalEntityRegistry.java b/src/Java/gtPlusPlus/core/entity/InternalEntityRegistry.java
index 565b0177ea..b94f2e7205 100644
--- a/src/Java/gtPlusPlus/core/entity/InternalEntityRegistry.java
+++ b/src/Java/gtPlusPlus/core/entity/InternalEntityRegistry.java
@@ -1,12 +1,13 @@
package gtPlusPlus.core.entity;
-import gtPlusPlus.GTplusplus;
import cpw.mods.fml.common.registry.EntityRegistry;
+import gtPlusPlus.GTplusplus;
+import gtPlusPlus.core.util.Utils;
public class InternalEntityRegistry {
- public static void registerEntities(){
-
+ public static void registerEntities(){
+ Utils.LOG_INFO("Registering GT++ Entities.");
//EntityRegistry.registerModEntity(EntityMiningChargePrimed.class, "MiningCharge", 3, Main.modInstance, 64, 20, true);
EntityRegistry.registerModEntity(EntityPrimedMiningExplosive.class, "MiningCharge", 3, GTplusplus.instance, 64, 20, true);
diff --git a/src/Java/gtPlusPlus/core/proxy/ClientProxy.java b/src/Java/gtPlusPlus/core/proxy/ClientProxy.java
index 3dd8f842c3..cce4aedbd7 100644
--- a/src/Java/gtPlusPlus/core/proxy/ClientProxy.java
+++ b/src/Java/gtPlusPlus/core/proxy/ClientProxy.java
@@ -35,7 +35,6 @@ public class ClientProxy extends CommonProxy{
@Override
public void preInit(final FMLPreInitializationEvent e) {
- // TODO Auto-generated method stub
super.preInit(e);
//Do this weird things for textures.
GTplusplus.loadTextures();
@@ -47,8 +46,6 @@ public class ClientProxy extends CommonProxy{
@Override
public void init(final FMLInitializationEvent e) {
- // TODO Auto-generated method stub
-
if (LoadedMods.PlayerAPI){
this.init_PlayerAPI_INIT();
}
@@ -58,7 +55,6 @@ public class ClientProxy extends CommonProxy{
@Override
public void postInit(final FMLPostInitializationEvent e) {
- // TODO Auto-generated method stub
super.postInit(e);
}
@@ -68,12 +64,12 @@ public class ClientProxy extends CommonProxy{
//RenderingRegistry.registerEntityRenderingHandler(EntityBloodSteelMob.class, new RenderBloodSteelMob(new ModelBloodSteelMob(), 0));
//RenderingRegistry.registerEntityRenderingHandler(EntityBloodSteelHostileMob.class, new RenderBloodSteelMobHostile(new ModelBloodSteelMob(), 0));
//RenderingRegistry.registerEntityRenderingHandler(EntityGrenade.class, new RenderSnowball(ModItems.tutGrenade));
- Utils.LOG_INFO("Registering Renderer for Mining Explosives.");
+ Utils.LOG_INFO("Registering Custom Renderer for Mining Explosives.");
RenderingRegistry.registerEntityRenderingHandler(EntityPrimedMiningExplosive.class, new RenderMiningExplosivesPrimed());
//ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBloodSteelChest.class, new BloodSteelChestRenderer());
//MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.tutChest), new ItemRenderBloodSteelChest());
-
+ Utils.LOG_INFO("Registering Custom Renderer for the Fire Pit.");
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFirepit.class, new FirepitRender());
}
diff --git a/src/Java/gtPlusPlus/core/world/explosions/MiningExplosion.java b/src/Java/gtPlusPlus/core/world/explosions/MiningExplosion.java
index d240c82445..effe4e397f 100644
--- a/src/Java/gtPlusPlus/core/world/explosions/MiningExplosion.java
+++ b/src/Java/gtPlusPlus/core/world/explosions/MiningExplosion.java
@@ -221,13 +221,22 @@ public class MiningExplosion extends Explosion {
d5 *= d7;
this.worldObj.spawnParticle("explode", (d0 + (this.explosionX * 1.0D)) / 2.0D, (d1 + (this.explosionY * 1.0D)) / 2.0D, (d2 + (this.explosionZ * 1.0D)) / 2.0D, d3, d4, d5);
this.worldObj.spawnParticle("smoke", d0, d1, d2, d3, d4, d5);
+ this.worldObj.spawnParticle("smoke", this.explosionX+MathUtils.randDouble(0, 1), this.explosionY+MathUtils.randDouble(0, 1), this.explosionZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("largesmoke", this.explosionX+MathUtils.randDouble(0, 1), this.explosionY+MathUtils.randDouble(0, 1), this.explosionZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("cloud", this.explosionX+MathUtils.randDouble(0, 1), this.explosionY+MathUtils.randDouble(0, 1), this.explosionZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("flame", this.explosionX+MathUtils.randDouble(0, 1), this.explosionY+MathUtils.randDouble(0, 1), this.explosionZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("explode", this.explosionX+MathUtils.randDouble(0, 1), this.explosionY+MathUtils.randDouble(0, 1), this.explosionZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("largeexplode", this.explosionX+MathUtils.randDouble(0, 1), this.explosionY+MathUtils.randDouble(0, 1), this.explosionZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+ this.worldObj.spawnParticle("hugeexplosion", this.explosionX+MathUtils.randDouble(0, 1), this.explosionY+MathUtils.randDouble(0, 1), this.explosionZ+MathUtils.randDouble(0, 1), 0.0D, 0.0D, 0.0D);
+
}
if (block.getMaterial() != Material.air)
{
if (block.canDropFromExplosion(this))
{
- block.dropBlockAsItemWithChance(this.worldObj, i, j, k, this.worldObj.getBlockMetadata(i, j, k), 1.0F / this.explosionSize, 0);
+ //world, x, y, z, world.getBlockMetadata(x, y, z), dropProb, 0
+ block.dropBlockAsItemWithChance(this.worldObj, i, j, k, this.worldObj.getBlockMetadata(i, j, k), 1F, 0);
}
block.onBlockExploded(this.worldObj, i, j, k, this);