当前位置: 首页>>代码示例>>Java>>正文


Java PositionImpl类代码示例

本文整理汇总了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;
}
 
开发者ID:sblectric,项目名称:AdvancedCombat,代码行数:20,代码来源:TrackingDispenserBehavior.java

示例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);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:12,代码来源:BlockDispenser.java

示例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);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:12,代码来源:BlockDispenser.java

示例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);
}
 
开发者ID:PrinceOfAmber,项目名称:Cyclic,代码行数:11,代码来源:BehaviorMinecartDropItem.java

示例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);
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:9,代码来源:BlockDispenser.java

示例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);
}
 
开发者ID:BlazeAxtrius,项目名称:ExpandedRailsMod,代码行数:12,代码来源:BlockDispenser.java

示例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);
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:9,代码来源:BlockDispenser.java

示例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);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:8,代码来源:BlockDispenser.java

示例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);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:9,代码来源:BlockDispenser.java


注:本文中的net.minecraft.dispenser.PositionImpl类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。