mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-20 04:09:51 +00:00
Add throwable impact event (#3071)
This commit is contained in:
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));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user