本文整理汇总了Java中net.minecraft.util.Vec3.rotateAroundY方法的典型用法代码示例。如果您正苦于以下问题:Java Vec3.rotateAroundY方法的具体用法?Java Vec3.rotateAroundY怎么用?Java Vec3.rotateAroundY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.util.Vec3
的用法示例。
在下文中一共展示了Vec3.rotateAroundY方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: entityHurtEvent
import net.minecraft.util.Vec3; //导入方法依赖的package包/类
@SubscribeEvent
public void entityHurtEvent(LivingHurtEvent event) {
if (!EtFuturum.enableDmgIndicator)
return;
int amount = MathHelper.floor_float(Math.min(event.entityLiving.getHealth(), event.ammount) / 2F);
if (amount <= 0)
return;
// If the attacker is a player spawn the hearts aligned and facing it
if (event.source instanceof EntityDamageSource) {
EntityDamageSource src = (EntityDamageSource) event.source;
Entity attacker = src.getSourceOfDamage();
if (attacker instanceof EntityPlayer && !(attacker instanceof FakePlayer)) {
EntityPlayer player = (EntityPlayer) attacker;
Vec3 look = player.getLookVec();
look.rotateAroundY((float) Math.PI / 2);
for (int i = 0; i < amount; i++) {
double x = event.entityLiving.posX - amount * 0.35 * look.xCoord / 2 + i * 0.35 * look.xCoord;
double y = event.entityLiving.posY + 1.5 + event.entityLiving.worldObj.rand.nextGaussian() * 0.05;
double z = event.entityLiving.posZ - amount * 0.35 * look.zCoord / 2 + i * 0.35 * look.zCoord;
EtFuturum.networkWrapper.sendToAllAround(new BlackHeartParticlesMessage(x, y, z), new TargetPoint(player.worldObj.provider.dimensionId, x, y, z, 64));
}
}
}
}