diff --git a/mechanical/src/main/java/resonantinduction/mechanical/process/edit/TileBreaker.java b/mechanical/src/main/java/resonantinduction/mechanical/process/edit/TileBreaker.java index b239ce256..bddc07a90 100644 --- a/mechanical/src/main/java/resonantinduction/mechanical/process/edit/TileBreaker.java +++ b/mechanical/src/main/java/resonantinduction/mechanical/process/edit/TileBreaker.java @@ -5,6 +5,7 @@ import java.util.ArrayList; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.packet.Packet; @@ -98,19 +99,28 @@ public class TileBreaker extends TileBase implements IRotatable, IPacketReceiver int candidateMeta = world().getBlockMetadata(check.intX(), check.intY(), check.intZ()); boolean flag = true; + //Get items dropped ArrayList drops = block.getBlockDropped(getWorldObj(), check.intX(), check.intY(), check.intZ(), candidateMeta, 0); for (ItemStack stack : drops) { + //Insert into tile if one exists ItemStack insert = stack.copy(); insert = getInvHandler().storeItem(insert, this.getDirection().getOpposite()); + //If not spit items into world if (insert != null) { getInvHandler().throwItem(this.getDirection().getOpposite(), insert); } } - getWorldObj().destroyBlock(check.intX(), check.intY(), check.intZ(), false); + //Destroy block + ResonantInduction.proxy.renderBlockParticle(worldObj, check.intX(), check.intY(), check.intZ(), new Vector3((Math.random() - 0.5f) * 3, (Math.random() - 0.5f) * 3, (Math.random() - 0.5f) * 3), world().getBlockId(check.intX(), check.intY(), check.intZ()), 1); + + getWorldObj().destroyBlock(check.intX(), check.intY(), check.intZ(), false); + getWorldObj().playAuxSFX(1012, check.intX(), check.intY(), check.intZ(), 0); + + } } } diff --git a/src/main/java/resonantinduction/core/ClientProxy.java b/src/main/java/resonantinduction/core/ClientProxy.java index 0cde2fa1c..a9b5fe4ab 100644 --- a/src/main/java/resonantinduction/core/ClientProxy.java +++ b/src/main/java/resonantinduction/core/ClientProxy.java @@ -11,50 +11,54 @@ import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -/** - * @author Calclavia - * - */ +/** @author Calclavia */ @SideOnly(Side.CLIENT) public class ClientProxy extends CommonProxy { - @Override - public void preInit() - { - MinecraftForge.EVENT_BUS.register(SoundHandler.INSTANCE); - } + @Override + public void preInit() + { + MinecraftForge.EVENT_BUS.register(SoundHandler.INSTANCE); + } - @Override - public boolean isPaused() - { - if (FMLClientHandler.instance().getClient().isSingleplayer() && !FMLClientHandler.instance().getClient().getIntegratedServer().getPublic()) - { - GuiScreen screen = FMLClientHandler.instance().getClient().currentScreen; + @Override + public boolean isPaused() + { + if (FMLClientHandler.instance().getClient().isSingleplayer() && !FMLClientHandler.instance().getClient().getIntegratedServer().getPublic()) + { + GuiScreen screen = FMLClientHandler.instance().getClient().currentScreen; - if (screen != null) - { - if (screen.doesGuiPauseGame()) - { - return true; - } - } - } + if (screen != null) + { + if (screen.doesGuiPauseGame()) + { + return true; + } + } + } - return false; - } + return false; + } - @Override - public boolean isGraphicsFancy() - { - return FMLClientHandler.instance().getClient().gameSettings.fancyGraphics; - } + @Override + public boolean isGraphicsFancy() + { + return FMLClientHandler.instance().getClient().gameSettings.fancyGraphics; + } + + @Override + public void renderBlockParticle(World world, Vector3 position, Vector3 velocity, int blockID, float scale) + { + this.renderBlockParticle(world, position.x, position.y, position.z, velocity, blockID, scale); + } + + @Override + public void renderBlockParticle(World world, double x, double y, double z, Vector3 velocity, int blockID, float scale) + { + EntityFX fx = new EntityDiggingFX(world, x, y, z, velocity.x, velocity.y, velocity.z, Block.blocksList[blockID], 0, 0); + fx.multipleParticleScaleBy(scale); + fx.noClip = true; + FMLClientHandler.instance().getClient().effectRenderer.addEffect(fx); + } - @Override - public void renderBlockParticle(World world, Vector3 position, Vector3 velocity, int blockID, float scale) - { - EntityFX fx = new EntityDiggingFX(world, position.x, position.y, position.z, velocity.x, velocity.y, velocity.z, Block.blocksList[blockID], 0, 0); - fx.multipleParticleScaleBy(scale); - fx.noClip = true; - FMLClientHandler.instance().getClient().effectRenderer.addEffect(fx); - } } diff --git a/src/main/java/resonantinduction/core/CommonProxy.java b/src/main/java/resonantinduction/core/CommonProxy.java index ab4b13284..8da100814 100644 --- a/src/main/java/resonantinduction/core/CommonProxy.java +++ b/src/main/java/resonantinduction/core/CommonProxy.java @@ -23,6 +23,11 @@ public class CommonProxy extends ProxyBase return false; } + public void renderBlockParticle(World world, double x, double y, double z, Vector3 velocity, int blockID, float scale) + { + + } + public void renderBlockParticle(World world, Vector3 position, Vector3 velocity, int blockID, float scale) {