コード例 #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));
 }
コード例 #10
0
ファイル: BaseMod.java プロジェクト: nevercast/SGCraft
 // @Mod.Init
 public void init(FMLInitializationEvent e) {
   MinecraftForge.EVENT_BUS.register(this);
   if (client != null) client.init(e);
 }