本文整理汇总了Java中net.minecraft.dispenser.PositionImpl类的典型用法代码示例。如果您正苦于以下问题:Java PositionImpl类的具体用法?Java PositionImpl怎么用?Java PositionImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PositionImpl类属于net.minecraft.dispenser包,在下文中一共展示了PositionImpl类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dispenseStack
import net.minecraft.dispenser.PositionImpl; //导入依赖的package包/类
@Override
public ItemStack dispenseStack(IBlockSource source, ItemStack stack) {
World world = source.getWorld();
BlockPos pos = source.getBlockPos();
Vec3d pos2 = new Vec3d(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5);
Vec3d dir = this.getNearestTargetDirection(world, pos);
if(dir == null) return null;
IPosition ipos = new PositionImpl(pos2.x + dir.x * .75, pos2.y + dir.y * .75, pos2.z + dir.z * .75);
double d0 = ipos.getX();
double d1 = ipos.getY();
double d2 = ipos.getZ();
Random random = world.rand;
double d3 = random.nextGaussian() * 0.05D + dir.x;
double d4 = random.nextGaussian() * 0.05D + dir.y;
double d5 = random.nextGaussian() * 0.05D + dir.z;
world.spawnEntity(new EntitySmallFireball(world, d0, d1, d2, d3, d4, d5));
stack.splitStack(1);
return stack;
}
示例2: getDispensePosition
import net.minecraft.dispenser.PositionImpl; //导入依赖的package包/类
/**
* Get the position where the dispenser at the given Coordinates should dispense to.
*/
public static IPosition getDispensePosition(IBlockSource coords)
{
EnumFacing enumfacing = getFacing(coords.getBlockMetadata());
double d0 = coords.getX() + 0.7D * (double)enumfacing.getFrontOffsetX();
double d1 = coords.getY() + 0.7D * (double)enumfacing.getFrontOffsetY();
double d2 = coords.getZ() + 0.7D * (double)enumfacing.getFrontOffsetZ();
return new PositionImpl(d0, d1, d2);
}
示例3: getDispensePosition
import net.minecraft.dispenser.PositionImpl; //导入依赖的package包/类
/**
* Get the position where the dispenser at the given Coordinates should dispense to.
*/
public static IPosition getDispensePosition(IBlockSource coords)
{
EnumFacing enumfacing = (EnumFacing)coords.getBlockState().getValue(FACING);
double d0 = coords.getX() + 0.7D * (double)enumfacing.getFrontOffsetX();
double d1 = coords.getY() + 0.7D * (double)enumfacing.getFrontOffsetY();
double d2 = coords.getZ() + 0.7D * (double)enumfacing.getFrontOffsetZ();
return new PositionImpl(d0, d1, d2);
}
示例4: getDispensePosition
import net.minecraft.dispenser.PositionImpl; //导入依赖的package包/类
/**
* Get the position where the dispenser at the given Coordinates should dispense to.
*/
public IPosition getDispensePosition(IBlockSource coords) {
EnumFacing enumfacing = this.getFacing(coords.getBlockState());
double d0 = coords.getX() + 0.7D * (double) enumfacing.getFrontOffsetX();
double d1 = coords.getY() + 0.7D * (double) enumfacing.getFrontOffsetY();
double d2 = coords.getZ() + 0.7D * (double) enumfacing.getFrontOffsetZ();
return new PositionImpl(d0, d1, d2);
}
示例5: func_149939_a
import net.minecraft.dispenser.PositionImpl; //导入依赖的package包/类
public static IPosition func_149939_a(IBlockSource p_149939_0_)
{
EnumFacing var1 = func_149937_b(p_149939_0_.getBlockMetadata());
double var2 = p_149939_0_.getX() + 0.7D * (double)var1.getFrontOffsetX();
double var4 = p_149939_0_.getY() + 0.7D * (double)var1.getFrontOffsetY();
double var6 = p_149939_0_.getZ() + 0.7D * (double)var1.getFrontOffsetZ();
return new PositionImpl(var2, var4, var6);
}
示例6: getDispensePosition
import net.minecraft.dispenser.PositionImpl; //导入依赖的package包/类
/**
* Get the position where the dispenser at the given Coordinates should dispense to.
*/
public static IPosition getDispensePosition(IBlockSource coords)
{
EnumFacing enumfacing = (EnumFacing)coords.func_189992_e().getValue(FACING);
double d0 = coords.getX() + 0.7D * (double)enumfacing.getFrontOffsetX();
double d1 = coords.getY() + 0.7D * (double)enumfacing.getFrontOffsetY();
double d2 = coords.getZ() + 0.7D * (double)enumfacing.getFrontOffsetZ();
return new PositionImpl(d0, d1, d2);
}
示例7: func_149939_a
import net.minecraft.dispenser.PositionImpl; //导入依赖的package包/类
public static IPosition func_149939_a(IBlockSource p_149939_0_)
{
EnumFacing enumfacing = func_149937_b(p_149939_0_.getBlockMetadata());
double d0 = p_149939_0_.getX() + 0.7D * (double)enumfacing.getFrontOffsetX();
double d1 = p_149939_0_.getY() + 0.7D * (double)enumfacing.getFrontOffsetY();
double d2 = p_149939_0_.getZ() + 0.7D * (double)enumfacing.getFrontOffsetZ();
return new PositionImpl(d0, d1, d2);
}
示例8: func_82525_a
import net.minecraft.dispenser.PositionImpl; //导入依赖的package包/类
public static IPosition func_82525_a(IBlockSource p_82525_0_) {
EnumFacing var1 = func_100009_j_(p_82525_0_.func_82620_h());
double var2 = p_82525_0_.func_82615_a() + 0.7D * (double)var1.func_82601_c();
double var4 = p_82525_0_.func_82617_b() + 0.7D * (double)var1.func_96559_d();
double var6 = p_82525_0_.func_82616_c() + 0.7D * (double)var1.func_82599_e();
return new PositionImpl(var2, var4, var6);
}
示例9: getIPositionFromBlockSource
import net.minecraft.dispenser.PositionImpl; //导入依赖的package包/类
public static IPosition getIPositionFromBlockSource(IBlockSource par0IBlockSource)
{
EnumFacing enumfacing = getFacing(par0IBlockSource.getBlockMetadata());
double d0 = par0IBlockSource.getX() + 0.7D * (double)enumfacing.getFrontOffsetX();
double d1 = par0IBlockSource.getY() + 0.7D * (double)enumfacing.getFrontOffsetY();
double d2 = par0IBlockSource.getZ() + 0.7D * (double)enumfacing.getFrontOffsetZ();
return new PositionImpl(d0, d1, d2);
}