本文整理汇总了Java中net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent方法的典型用法代码示例。如果您正苦于以下问题:Java LivingEvent.LivingJumpEvent方法的具体用法?Java LivingEvent.LivingJumpEvent怎么用?Java LivingEvent.LivingJumpEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.event.entity.living.LivingEvent
的用法示例。
在下文中一共展示了LivingEvent.LivingJumpEvent方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: stopJump
import net.minecraftforge.event.entity.living.LivingEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void stopJump(LivingEvent.LivingJumpEvent event) {
EntityLivingBase living=event.getEntityLiving();
if ((living.getActivePotionEffect(TF2weapons.stun) != null && living.getActivePotionEffect(TF2weapons.bombmrs) == null)
|| living.getActivePotionEffect(TF2weapons.charging) != null
|| (living.getHeldItemMainhand() != null && living.getHeldItemMainhand().getItem() instanceof ItemMinigun
&& living.hasCapability(TF2weapons.WEAPONS_CAP, null) && living.getCapability(TF2weapons.WEAPONS_CAP, null).chargeTicks > 0)) {
living.isAirBorne = false;
living.motionY -= 0.5f;
if (living.isSprinting()) {
float f = living.rotationYaw * 0.017453292F;
living.motionX += MathHelper.sin(f) * 0.2F;
living.motionZ -= MathHelper.cos(f) * 0.2F;
}
}
}
示例2: onPlayerJump
import net.minecraftforge.event.entity.living.LivingEvent; //导入方法依赖的package包/类
/**
* Used for the Piston Boots to give them their amazing powers.
*
* @param event
*/
@SubscribeEvent
public void onPlayerJump(LivingEvent.LivingJumpEvent event)
{
if (event.entity != null &&
event.entityLiving instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer) event.entity;
if (Wearing.isWearingBoots(player) && player.onGround)
{
ServerActions.pistonBootsJump(player);
}
}
}
示例3: onEntityJump
import net.minecraftforge.event.entity.living.LivingEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onEntityJump(LivingEvent.LivingJumpEvent event)
{
if(event.entityLiving != null && event.entityLiving instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer)event.entityLiving;
if(player.getCurrentArmor(0) != null && player.getCurrentArmor(0).getItem() == AdvancedUtilitiesItems.runningShoes)
{
player.motionY+=0.05D;
}
if(player.getCurrentArmor(1) != null && player.getCurrentArmor(1).getItem() == AdvancedUtilitiesItems.steamLegs)
{
if(player.inventory.armorItemInSlot(1).stackTagCompound != null)
{
NBTTagCompound tag = player.inventory.armorItemInSlot(1).stackTagCompound;
if(tag.getInteger("tankAmount") > 0)
{
player.motionY+=0.05D;
}
}
}
}
}
示例4: onLivingJump
import net.minecraftforge.event.entity.living.LivingEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onLivingJump(LivingEvent.LivingJumpEvent event) {
if (event.getEntityLiving() instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) event.getEntityLiving();
PossessivePlayer possessivePlayer = PossessHandler.get(player);
if (possessivePlayer != null) {
for (EntityPossessHandler handler : PossessHandler.getPossessHandlers(possessivePlayer.getPossessing())) {
handler.onJump(possessivePlayer, player);
}
}
}
}
示例5: jump
import net.minecraftforge.event.entity.living.LivingEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void jump(LivingEvent.LivingJumpEvent event) {
EntityLivingBase entity = event.getEntityLiving();
if (!entity.isPotionActive(this)) return;
PotionEffect effect = entity.getActivePotionEffect(this);
if (effect == null) return;
entity.motionY = effect.getAmplifier() / 3.0;
}
示例6: jump
import net.minecraftforge.event.entity.living.LivingEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void jump(LivingEvent.LivingJumpEvent event)
{
if(!shouldCancelled(event.entityLiving))
{
return;
}
if(event.entityLiving.motionY >= 0)
{
event.entityLiving.motionY *= 4;
}
}
示例7: onPlayerJump
import net.minecraftforge.event.entity.living.LivingEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onPlayerJump(LivingEvent.LivingJumpEvent event) {
if (event.entityLiving instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) event.entityLiving;
boolean hasArmor = player.getCurrentArmor(0) != null && player.getCurrentArmor(0).getItem() == this;
if (hasArmor)
player.motionY += jumpBonus;
}
}
示例8: LivingJumpEvent
import net.minecraftforge.event.entity.living.LivingEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void LivingJumpEvent(LivingEvent.LivingJumpEvent event){
if (event.entityLiving instanceof EntityPlayerMP) {
EntityPlayerMP player = (EntityPlayerMP) event.entityLiving;
if (Skills.LegStrength > 5 && Skills.LegStrength < 50) {
double JumpBuff = (0.1 * (Skills.LegStrength / 10));
player.motionY += JumpBuff;
}
}
}
示例9: makeJumpHigher
import net.minecraftforge.event.entity.living.LivingEvent; //导入方法依赖的package包/类
@EventHandler
public void makeJumpHigher(LivingEvent.LivingJumpEvent event) {
event.entity.motionY *= 5;
DCHLog.warning("set new id superjump");
}
开发者ID:digital-crafting-habitat,项目名称:dch_hack1ng_d4ys_workshop,代码行数:6,代码来源:DigitalCraftingHabitatMod.java
示例10: printJump
import net.minecraftforge.event.entity.living.LivingEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void printJump(LivingEvent.LivingJumpEvent event) {
System.out.println("jump");
}