Add throwable impact event (#3071)

This commit is contained in:
Vincent Lee authored and LexManos committed 2016-07-08 21:12:45 -07:00
1 parent 5eeda79234
commit f76af6103e
3 files changed
+54

No files matched your search

@@ -51,6 +51,7 @@ import net.minecraft.entity.item.EntityMinecartContainer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.Container;
@@ -100,6 +101,7 @@ import net.minecraftforge.event.AnvilUpdateEvent;
import net.minecraftforge.event.ForgeEventFactory;
import net.minecraftforge.event.ServerChatEvent;
import net.minecraftforge.event.entity.EntityTravelToDimensionEvent;
import net.minecraftforge.event.entity.ThrowableImpactEvent;
import net.minecraftforge.event.entity.item.ItemTossEvent;
import net.minecraftforge.event.entity.living.LivingAttackEvent;
import net.minecraftforge.event.entity.living.LivingDeathEvent;
@@ -1133,4 +1135,9 @@ public class ForgeHooks
//TODO: Some registry to support custom LootEntry types?
public static LootEntry deserializeJsonLootEntry(String type, JsonObject json, int weight, int quality, LootCondition[] conditions){ return null; }
public static String getLootEntryType(LootEntry entry){ return null; } //Companion to above function
public static boolean onThrowableImpact(EntityThrowable throwable, RayTraceResult ray)
{
return MinecraftForge.EVENT_BUS.post(new ThrowableImpactEvent(throwable, ray));
}
}