Search in sources :

Example 66 with Direction

use of net.minecraft.util.Direction in project Ceramics by KnightMiner.

the class PouringFaucetBlock method addParticles.

/* Display */
/**
 * Adds particles to the faucet
 * @param state    Faucet state
 * @param worldIn  World instance
 * @param pos      Faucet position
 */
private static void addParticles(BlockState state, IWorld worldIn, BlockPos pos) {
    Direction direction = state.get(FACING);
    double x = (double) pos.getX() + 0.5D - 0.3D * (double) direction.getXOffset();
    double y = (double) pos.getY() + 0.5D - 0.3D * (double) direction.getYOffset();
    double z = (double) pos.getZ() + 0.5D - 0.3D * (double) direction.getZOffset();
    worldIn.addParticle(new RedstoneParticleData(1.0F, 0.0F, 0.0F, 0.5f), x, y, z, 0.0D, 0.0D, 0.0D);
}
Also used : RedstoneParticleData(net.minecraft.particles.RedstoneParticleData) Direction(net.minecraft.util.Direction)

Aggregations

Direction (net.minecraft.util.Direction)66 BlockState (net.minecraft.block.BlockState)26 BlockPos (net.minecraft.util.math.BlockPos)21 TileEntity (net.minecraft.tileentity.TileEntity)19 ItemStack (net.minecraft.item.ItemStack)14 Block (net.minecraft.block.Block)11 Nullable (javax.annotation.Nullable)10 World (net.minecraft.world.World)9 Nonnull (javax.annotation.Nonnull)8 PlayerEntity (net.minecraft.entity.player.PlayerEntity)8 CompoundNBT (net.minecraft.nbt.CompoundNBT)6 IPowerBase (com.bluepowermod.api.power.IPowerBase)5 FluidStack (net.minecraftforge.fluids.FluidStack)5 BlutricityStorage (com.bluepowermod.api.power.BlutricityStorage)4 CapabilityBlutricity (com.bluepowermod.api.power.CapabilityBlutricity)4 EnergyHelper (com.bluepowermod.helper.EnergyHelper)4 BPTileEntityType (com.bluepowermod.tile.BPTileEntityType)4 TileMachineBase (com.bluepowermod.tile.TileMachineBase)4 ArrayList (java.util.ArrayList)4 TextureAtlasSprite (net.minecraft.client.renderer.texture.TextureAtlasSprite)4