Search in sources :

Example 1 with EntityParticleBeam

use of WayofTime.alchemicalWizardry.common.entity.projectile.EntityParticleBeam in project BloodMagic by WayofTime.

the class TEReagentConduit method sendPlayerStuffs.

@SideOnly(Side.CLIENT)
public void sendPlayerStuffs() {
    Minecraft mc = Minecraft.getMinecraft();
    EntityPlayer player = mc.thePlayer;
    World world = mc.theWorld;
    if (SpellHelper.canPlayerSeeAlchemy(player)) {
        for (ColourAndCoords colourSet : this.destinationList) {
            if (!(worldObj.getTileEntity(xCoord + colourSet.xCoord, yCoord + colourSet.yCoord, zCoord + colourSet.zCoord) instanceof IReagentHandler)) {
                continue;
            }
            EntityParticleBeam beam = new EntityParticleBeam(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5);
            double velocity = Math.sqrt(Math.pow(colourSet.xCoord, 2) + Math.pow(colourSet.yCoord, 2) + Math.pow(colourSet.zCoord, 2));
            double wantedVel = 0.3d;
            beam.setVelocity(wantedVel * colourSet.xCoord / velocity, wantedVel * colourSet.yCoord / velocity, wantedVel * colourSet.zCoord / velocity);
            beam.setColour(colourSet.colourRed / 255f, colourSet.colourGreen / 255f, colourSet.colourBlue / 255f);
            beam.setDestination(xCoord + colourSet.xCoord, yCoord + colourSet.yCoord, zCoord + colourSet.zCoord);
            worldObj.spawnEntityInWorld(beam);
        }
    }
}
Also used : EntityPlayer(net.minecraft.entity.player.EntityPlayer) World(net.minecraft.world.World) EntityParticleBeam(WayofTime.alchemicalWizardry.common.entity.projectile.EntityParticleBeam) Minecraft(net.minecraft.client.Minecraft) ColourAndCoords(WayofTime.alchemicalWizardry.api.ColourAndCoords) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Aggregations

ColourAndCoords (WayofTime.alchemicalWizardry.api.ColourAndCoords)1 EntityParticleBeam (WayofTime.alchemicalWizardry.common.entity.projectile.EntityParticleBeam)1 SideOnly (cpw.mods.fml.relauncher.SideOnly)1 Minecraft (net.minecraft.client.Minecraft)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 World (net.minecraft.world.World)1