Ejemplo n.º 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));
 }
Ejemplo n.º 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;
  }
Ejemplo n.º 3
0
 public static void onLivingJump(EntityLiving entity) {
   MinecraftForge.EVENT_BUS.post(new LivingJumpEvent(entity));
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 5
0
 public static boolean onLivingDeath(EntityLiving entity, DamageSource src) {
   return MinecraftForge.EVENT_BUS.post(new LivingDeathEvent(entity, src));
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 7
0
 public static boolean onLivingAttack(EntityLiving entity, DamageSource src, int amount) {
   return MinecraftForge.EVENT_BUS.post(new LivingAttackEvent(entity, src, amount));
 }
Ejemplo n.º 8
0
 public static boolean onLivingUpdate(EntityLiving entity) {
   return MinecraftForge.EVENT_BUS.post(new LivingUpdateEvent(entity));
 }
Ejemplo n.º 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));
 }