示例#1
0
 public static boolean onLivingDrops(
     EntityLiving entity,
     DamageSource source,
     ArrayList<EntityItem> drops,
     int lootingLevel,
     boolean recentlyHit,
     int specialDropValue) {
   return MinecraftForge.EVENT_BUS.post(
       new LivingDropsEvent(entity, source, drops, lootingLevel, recentlyHit, specialDropValue));
 }
示例#2
0
  public static EntityItem onPlayerTossEvent(EntityPlayer player, ItemStack item) {
    player.captureDrops = true;
    EntityItem ret = player.dropPlayerItemWithRandomChoice(item, false);
    player.capturedDrops.clear();
    player.captureDrops = false;

    ItemTossEvent event = new ItemTossEvent(ret, player);
    if (MinecraftForge.EVENT_BUS.post(event)) {
      return null;
    }

    player.joinEntityItemWithWorld(event.entityItem);
    return event.entityItem;
  }
示例#3
0
 public static void onLivingJump(EntityLiving entity) {
   MinecraftForge.EVENT_BUS.post(new LivingJumpEvent(entity));
 }
示例#4
0
 public static float onLivingFall(EntityLiving entity, float distance) {
   LivingFallEvent event = new LivingFallEvent(entity, distance);
   return (MinecraftForge.EVENT_BUS.post(event) ? 0.0f : event.distance);
 }
示例#5
0
 public static boolean onLivingDeath(EntityLiving entity, DamageSource src) {
   return MinecraftForge.EVENT_BUS.post(new LivingDeathEvent(entity, src));
 }
示例#6
0
 public static int onLivingHurt(EntityLiving entity, DamageSource src, int amount) {
   LivingHurtEvent event = new LivingHurtEvent(entity, src, amount);
   return (MinecraftForge.EVENT_BUS.post(event) ? 0 : event.ammount);
 }
示例#7
0
 public static boolean onLivingAttack(EntityLiving entity, DamageSource src, int amount) {
   return MinecraftForge.EVENT_BUS.post(new LivingAttackEvent(entity, src, amount));
 }
示例#8
0
 public static boolean onLivingUpdate(EntityLiving entity) {
   return MinecraftForge.EVENT_BUS.post(new LivingUpdateEvent(entity));
 }
示例#9
0
 // Optifine Helper Functions u.u, these are here specifically for Optifine
 // Note: When using Optfine, these methods are invoked using reflection, which
 // incurs a major performance penalty.
 public static void onLivingSetAttackTarget(EntityLiving entity, EntityLiving target) {
   MinecraftForge.EVENT_BUS.post(new LivingSetAttackTargetEvent(entity, target));
 }