Пример #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));
 }