public class ForgeHooks
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ForgeHooks.FortuneSeedEntry |
static class |
ForgeHooks.SeedEntry |
Constructor and Description |
---|
ForgeHooks() |
Modifier and Type | Method and Description |
---|---|
static boolean |
canContinueUsing(ItemStack from,
ItemStack to) |
static int |
canEntitySpawn(EntityLiving entity,
IWorld world,
double x,
double y,
double z,
MobSpawnerBaseLogic spawner) |
static boolean |
canHarvestBlock(IBlockState state,
EntityPlayer player,
IBlockReader world,
BlockPos pos) |
static boolean |
canToolHarvestBlock(IWorldReader world,
BlockPos pos,
ItemStack stack) |
static LootEntry |
deserializeJsonLootEntry(java.lang.String type,
com.google.gson.JsonObject json,
int weight,
int quality,
LootCondition[] conditions) |
static <T> void |
deserializeTagAdditions(Tag.Builder<T> builder,
java.util.function.Predicate<ResourceLocation> isValueKnown,
java.util.function.Function<ResourceLocation,T> valueGetter,
com.google.gson.JsonObject json) |
static ItemStack |
getContainerItem(ItemStack stack) |
static EntityPlayer |
getCraftingPlayer() |
static CriticalHitEvent |
getCriticalHit(EntityPlayer player,
Entity target,
boolean vanillaCritical,
float damageModifier) |
static java.lang.String |
getDefaultCreatorModId(ItemStack itemStack)
Used as the default implementation of
IForgeItem.getCreatorModId(net.minecraft.item.ItemStack) . |
static ItemStack |
getGrassSeed(java.util.Random rand,
int fortune) |
static java.lang.String |
getLootEntryType(LootEntry entry) |
static int |
getLootingLevel(Entity target,
Entity killer,
DamageSource cause) |
static int |
getLootingLevel(EntityLivingBase target,
DamageSource cause,
int level) |
static double |
getPlayerVisibilityDistance(EntityPlayer player,
double xzDistance,
double maxXZDistance) |
static DataSerializer<?> |
getSerializer(int id,
IntIdentityHashBiMap<DataSerializer<?>> vanilla) |
static int |
getSerializerId(DataSerializer<?> serializer,
IntIdentityHashBiMap<DataSerializer<?>> vanilla) |
static boolean |
isLivingOnLadder(IBlockState state,
World world,
BlockPos pos,
EntityLivingBase entity) |
static boolean |
isToolEffective(IWorldReader world,
BlockPos pos,
ItemStack stack) |
static LootTable |
loadLootTable(com.google.gson.Gson gson,
ResourceLocation name,
java.lang.String data,
boolean custom,
LootTableManager lootTableManager) |
static ITextComponent |
newChatWithLinks(java.lang.String string) |
static ITextComponent |
newChatWithLinks(java.lang.String string,
boolean allowMissingHeader) |
static void |
onAdvancement(EntityPlayerMP player,
Advancement advancement) |
static boolean |
onAnvilChange(ContainerRepair container,
ItemStack left,
ItemStack right,
IInventory outputSlot,
java.lang.String name,
int baseCost) |
static float |
onAnvilRepair(EntityPlayer player,
ItemStack output,
ItemStack left,
ItemStack right) |
static int |
onBlockBreakEvent(World world,
GameType gameType,
EntityPlayerMP entityPlayer,
BlockPos pos) |
static void |
onCropsGrowPost(World worldIn,
BlockPos pos,
IBlockState state) |
static boolean |
onCropsGrowPre(World worldIn,
BlockPos pos,
IBlockState state,
boolean def) |
static void |
onDifficultyChange(EnumDifficulty difficulty,
EnumDifficulty oldDifficulty) |
static void |
onEmptyClick(EntityPlayer player,
EnumHand hand) |
static void |
onEmptyLeftClick(EntityPlayer player) |
static boolean |
onFarmlandTrample(World world,
BlockPos pos,
IBlockState state,
float fallDistance,
Entity entity) |
static EnumActionResult |
onInteractEntity(EntityPlayer player,
Entity entity,
EnumHand hand) |
static EnumActionResult |
onInteractEntityAt(EntityPlayer player,
Entity entity,
RayTraceResult ray,
EnumHand hand) |
static EnumActionResult |
onInteractEntityAt(EntityPlayer player,
Entity entity,
Vec3d vec3d,
EnumHand hand) |
static EnumActionResult |
onItemRightClick(EntityPlayer player,
EnumHand hand) |
static PlayerInteractEvent.LeftClickBlock |
onLeftClickBlock(EntityPlayer player,
BlockPos pos,
EnumFacing face,
Vec3d hitVec) |
static boolean |
onLivingAttack(EntityLivingBase entity,
DamageSource src,
float amount) |
static float |
onLivingDamage(EntityLivingBase entity,
DamageSource src,
float amount) |
static boolean |
onLivingDeath(EntityLivingBase entity,
DamageSource src) |
static boolean |
onLivingDrops(EntityLivingBase entity,
DamageSource source,
java.util.Collection<EntityItem> drops,
int lootingLevel,
boolean recentlyHit) |
static float[] |
onLivingFall(EntityLivingBase entity,
float distance,
float damageMultiplier) |
static float |
onLivingHurt(EntityLivingBase entity,
DamageSource src,
float amount) |
static void |
onLivingJump(EntityLivingBase entity) |
static LivingKnockBackEvent |
onLivingKnockBack(EntityLivingBase target,
Entity attacker,
float strength,
double ratioX,
double ratioZ) |
static void |
onLivingSetAttackTarget(EntityLivingBase entity,
EntityLivingBase target) |
static boolean |
onLivingUpdate(EntityLivingBase entity) |
static int |
onNoteChange(World world,
BlockPos pos,
IBlockState state,
int old,
int _new) |
static boolean |
onPickBlock(RayTraceResult target,
EntityPlayer player,
World world)
Called when a player uses 'pick block', calls new Entity and Block hooks.
|
static EnumActionResult |
onPlaceItemIntoWorld(ItemUseContext context) |
static boolean |
onPlayerAttack(EntityLivingBase entity,
DamageSource src,
float amount) |
static boolean |
onPlayerAttackTarget(EntityPlayer player,
Entity target) |
static EntityItem |
onPlayerTossEvent(EntityPlayer player,
ItemStack item,
boolean includeName) |
static PlayerInteractEvent.RightClickBlock |
onRightClickBlock(EntityPlayer player,
EnumHand hand,
BlockPos pos,
EnumFacing face,
Vec3d hitVec) |
static ITextComponent |
onServerChatEvent(NetHandlerPlayServer net,
java.lang.String raw,
ITextComponent comp) |
static boolean |
onTravelToDimension(Entity entity,
DimensionType dimension) |
static Vec3d |
rayTraceEyeHitVec(EntityLivingBase entity,
double length) |
static RayTraceResult |
rayTraceEyes(EntityLivingBase entity,
double length) |
static java.lang.String |
readLootEntryName(com.google.gson.JsonObject json,
java.lang.String type) |
static java.lang.String |
readPoolName(com.google.gson.JsonObject json) |
static void |
setBlockToolSetter(org.apache.logging.log4j.util.TriConsumer<Block,ToolType,java.lang.Integer> setter) |
static void |
setCraftingPlayer(EntityPlayer player) |
@Nonnull public static ItemStack getGrassSeed(java.util.Random rand, int fortune)
public static boolean canContinueUsing(@Nonnull ItemStack from, @Nonnull ItemStack to)
public static boolean canHarvestBlock(@Nonnull IBlockState state, @Nonnull EntityPlayer player, @Nonnull IBlockReader world, @Nonnull BlockPos pos)
public static boolean canToolHarvestBlock(IWorldReader world, BlockPos pos, @Nonnull ItemStack stack)
public static boolean isToolEffective(IWorldReader world, BlockPos pos, @Nonnull ItemStack stack)
public static boolean onPickBlock(RayTraceResult target, EntityPlayer player, World world)
public static void onDifficultyChange(EnumDifficulty difficulty, EnumDifficulty oldDifficulty)
public static void onLivingSetAttackTarget(EntityLivingBase entity, EntityLivingBase target)
public static boolean onLivingUpdate(EntityLivingBase entity)
public static boolean onLivingAttack(EntityLivingBase entity, DamageSource src, float amount)
public static boolean onPlayerAttack(EntityLivingBase entity, DamageSource src, float amount)
public static LivingKnockBackEvent onLivingKnockBack(EntityLivingBase target, Entity attacker, float strength, double ratioX, double ratioZ)
public static float onLivingHurt(EntityLivingBase entity, DamageSource src, float amount)
public static float onLivingDamage(EntityLivingBase entity, DamageSource src, float amount)
public static boolean onLivingDeath(EntityLivingBase entity, DamageSource src)
public static boolean onLivingDrops(EntityLivingBase entity, DamageSource source, java.util.Collection<EntityItem> drops, int lootingLevel, boolean recentlyHit)
@Nullable public static float[] onLivingFall(EntityLivingBase entity, float distance, float damageMultiplier)
public static int getLootingLevel(Entity target, @Nullable Entity killer, DamageSource cause)
public static int getLootingLevel(EntityLivingBase target, DamageSource cause, int level)
public static double getPlayerVisibilityDistance(EntityPlayer player, double xzDistance, double maxXZDistance)
public static boolean isLivingOnLadder(@Nonnull IBlockState state, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull EntityLivingBase entity)
public static void onLivingJump(EntityLivingBase entity)
@Nullable public static EntityItem onPlayerTossEvent(@Nonnull EntityPlayer player, @Nonnull ItemStack item, boolean includeName)
@Nullable public static ITextComponent onServerChatEvent(NetHandlerPlayServer net, java.lang.String raw, ITextComponent comp)
public static ITextComponent newChatWithLinks(java.lang.String string)
public static ITextComponent newChatWithLinks(java.lang.String string, boolean allowMissingHeader)
public static int onBlockBreakEvent(World world, GameType gameType, EntityPlayerMP entityPlayer, BlockPos pos)
public static EnumActionResult onPlaceItemIntoWorld(@Nonnull ItemUseContext context)
public static boolean onAnvilChange(ContainerRepair container, @Nonnull ItemStack left, @Nonnull ItemStack right, IInventory outputSlot, java.lang.String name, int baseCost)
public static float onAnvilRepair(EntityPlayer player, @Nonnull ItemStack output, @Nonnull ItemStack left, @Nonnull ItemStack right)
public static void setCraftingPlayer(EntityPlayer player)
public static EntityPlayer getCraftingPlayer()
public static boolean onPlayerAttackTarget(EntityPlayer player, Entity target)
public static boolean onTravelToDimension(Entity entity, DimensionType dimension)
@Nullable public static RayTraceResult rayTraceEyes(EntityLivingBase entity, double length)
@Nullable public static Vec3d rayTraceEyeHitVec(EntityLivingBase entity, double length)
public static EnumActionResult onInteractEntityAt(EntityPlayer player, Entity entity, RayTraceResult ray, EnumHand hand)
public static EnumActionResult onInteractEntityAt(EntityPlayer player, Entity entity, Vec3d vec3d, EnumHand hand)
public static EnumActionResult onInteractEntity(EntityPlayer player, Entity entity, EnumHand hand)
public static EnumActionResult onItemRightClick(EntityPlayer player, EnumHand hand)
public static PlayerInteractEvent.LeftClickBlock onLeftClickBlock(EntityPlayer player, BlockPos pos, EnumFacing face, Vec3d hitVec)
public static PlayerInteractEvent.RightClickBlock onRightClickBlock(EntityPlayer player, EnumHand hand, BlockPos pos, EnumFacing face, Vec3d hitVec)
public static void onEmptyClick(EntityPlayer player, EnumHand hand)
public static void onEmptyLeftClick(EntityPlayer player)
@Nullable public static LootTable loadLootTable(com.google.gson.Gson gson, ResourceLocation name, java.lang.String data, boolean custom, LootTableManager lootTableManager)
public static java.lang.String readPoolName(com.google.gson.JsonObject json)
public static java.lang.String readLootEntryName(com.google.gson.JsonObject json, java.lang.String type)
public static LootEntry deserializeJsonLootEntry(java.lang.String type, com.google.gson.JsonObject json, int weight, int quality, LootCondition[] conditions)
public static java.lang.String getLootEntryType(LootEntry entry)
public static boolean onCropsGrowPre(World worldIn, BlockPos pos, IBlockState state, boolean def)
public static void onCropsGrowPost(World worldIn, BlockPos pos, IBlockState state)
@Nullable public static CriticalHitEvent getCriticalHit(EntityPlayer player, Entity target, boolean vanillaCritical, float damageModifier)
public static void onAdvancement(EntityPlayerMP player, Advancement advancement)
@Nullable public static java.lang.String getDefaultCreatorModId(@Nonnull ItemStack itemStack)
IForgeItem.getCreatorModId(net.minecraft.item.ItemStack)
. Call that method instead.public static boolean onFarmlandTrample(World world, BlockPos pos, IBlockState state, float fallDistance, Entity entity)
public static void setBlockToolSetter(org.apache.logging.log4j.util.TriConsumer<Block,ToolType,java.lang.Integer> setter)
public static int onNoteChange(World world, BlockPos pos, IBlockState state, int old, int _new)
public static int canEntitySpawn(EntityLiving entity, IWorld world, double x, double y, double z, MobSpawnerBaseLogic spawner)
public static <T> void deserializeTagAdditions(Tag.Builder<T> builder, java.util.function.Predicate<ResourceLocation> isValueKnown, java.util.function.Function<ResourceLocation,T> valueGetter, com.google.gson.JsonObject json)
@Nullable public static DataSerializer<?> getSerializer(int id, IntIdentityHashBiMap<DataSerializer<?>> vanilla)
public static int getSerializerId(DataSerializer<?> serializer, IntIdentityHashBiMap<DataSerializer<?>> vanilla)