Search in sources :

Example 1 with ColourAndCoords

use of WayofTime.alchemicalWizardry.api.ColourAndCoords 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)

Example 2 with ColourAndCoords

use of WayofTime.alchemicalWizardry.api.ColourAndCoords in project BloodMagic by WayofTime.

the class TEReagentConduit method compileListForReagentTargets.

public List<ColourAndCoords> compileListForReagentTargets(Map<Reagent, List<Int3>> map) {
    List<ColourAndCoords> list = new LinkedList();
    for (Entry<Reagent, List<Int3>> entry : map.entrySet()) {
        if (entry.getValue() != null) {
            Reagent reagent = entry.getKey();
            if (reagent == null) {
                continue;
            }
            List<Int3> coords = entry.getValue();
            for (Int3 coord : coords) {
                if (coord == null) {
                    continue;
                }
                list.add(new ColourAndCoords(reagent.getColourRed(), reagent.getColourGreen(), reagent.getColourBlue(), reagent.getColourIntensity(), coord.xCoord, coord.yCoord, coord.zCoord));
            }
        }
    }
    return list;
}
Also used : Int3(WayofTime.alchemicalWizardry.api.Int3) NBTTagList(net.minecraft.nbt.NBTTagList) List(java.util.List) LinkedList(java.util.LinkedList) ColourAndCoords(WayofTime.alchemicalWizardry.api.ColourAndCoords) LinkedList(java.util.LinkedList)

Aggregations

ColourAndCoords (WayofTime.alchemicalWizardry.api.ColourAndCoords)2 Int3 (WayofTime.alchemicalWizardry.api.Int3)1 EntityParticleBeam (WayofTime.alchemicalWizardry.common.entity.projectile.EntityParticleBeam)1 SideOnly (cpw.mods.fml.relauncher.SideOnly)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 Minecraft (net.minecraft.client.Minecraft)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 NBTTagList (net.minecraft.nbt.NBTTagList)1 World (net.minecraft.world.World)1