public class ForgeHooks
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
ForgeHooks.LootTableContext |
(package private) static class |
ForgeHooks.SeedEntry |
Modifier and Type | Field and Description |
---|---|
private static java.lang.ThreadLocal<EntityPlayer> |
craftingPlayer |
private static java.lang.ThreadLocal<java.util.Deque<ForgeHooks.LootTableContext>> |
lootContext |
private static java.lang.ClassValue<java.lang.String> |
registryNames |
(package private) static java.util.List<ForgeHooks.SeedEntry> |
seedList |
private static java.util.Map<DataSerializer<?>,DataSerializerEntry> |
serializerEntries |
private static ForgeRegistry<DataSerializerEntry> |
serializerRegistry |
private static boolean |
toolInit |
(package private) static java.util.regex.Pattern |
URL_PATTERN |
Constructor and Description |
---|
ForgeHooks() |
Modifier and Type | Method and Description |
---|---|
static float |
blockStrength(IBlockState state,
EntityPlayer player,
World world,
BlockPos pos) |
static boolean |
canContinueUsing(ItemStack from,
ItemStack to) |
static boolean |
canHarvestBlock(Block block,
EntityPlayer player,
IBlockAccess world,
BlockPos pos) |
static boolean |
canToolHarvestBlock(IBlockAccess world,
BlockPos pos,
ItemStack stack) |
static NonNullList<ItemStack> |
defaultRecipeGetRemainingItems(InventoryCrafting inv)
Default implementation of IRecipe.func_179532_b {getRemainingItems} because
this is just copy pasted over a lot of recipes.
|
static LootEntry |
deserializeJsonLootEntry(java.lang.String type,
com.google.gson.JsonObject json,
int weight,
int quality,
LootCondition[] conditions) |
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
Item.getCreatorModId(net.minecraft.item.ItemStack) . |
static float |
getEnchantPower(World world,
BlockPos pos) |
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) |
private static ForgeHooks.LootTableContext |
getLootTableContext() |
static double |
getPlayerVisibilityDistance(EntityPlayer player,
double xzDistance,
double maxXZDistance) |
static java.lang.String |
getRegistryName(java.lang.Class<? extends TileEntity> type) |
static DataSerializer<?> |
getSerializer(int id,
IntIdentityHashBiMap<DataSerializer<?>> vanilla) |
static int |
getSerializerId(DataSerializer<?> serializer,
IntIdentityHashBiMap<DataSerializer<?>> vanilla) |
static int |
getTotalArmorValue(EntityPlayer player) |
(package private) static void |
initTools() |
static boolean |
isInsideOfMaterial(Material material,
Entity entity,
BlockPos pos) |
static boolean |
isLivingOnLadder(IBlockState state,
World world,
BlockPos pos,
EntityLivingBase entity) |
static boolean |
isToolEffective(IBlockAccess world,
BlockPos pos,
ItemStack stack) |
static boolean |
loadAdvancements(java.util.Map<ResourceLocation,Advancement.Builder> map) |
private static boolean |
loadAdvancements(java.util.Map<ResourceLocation,Advancement.Builder> map,
ModContainer mod) |
private static void |
loadFactories(ModContainer mod) |
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,
IBlockState blockState) |
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.ArrayList<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 boolean |
onNoteChange(TileEntityNote te,
byte old) |
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(ItemStack itemstack,
EntityPlayer player,
World world,
BlockPos pos,
EnumFacing side,
float hitX,
float hitY,
float hitZ,
EnumHand hand) |
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 |
onThrowableImpact(EntityThrowable throwable,
RayTraceResult ray)
|
static boolean |
onTravelToDimension(Entity entity,
int 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 |
sendRecipeBook(NetHandlerPlayServer connection,
SPacketRecipeBook.State state,
java.util.List<IRecipe> recipes,
java.util.List<IRecipe> display,
boolean isGuiOpen,
boolean isFilteringCraftable) |
private static void |
setActiveModContainer(ModContainer mod) |
static void |
setCraftingPlayer(EntityPlayer player) |
static final java.util.List<ForgeHooks.SeedEntry> seedList
private static boolean toolInit
static final java.util.regex.Pattern URL_PATTERN
private static java.lang.ThreadLocal<EntityPlayer> craftingPlayer
private static java.lang.ThreadLocal<java.util.Deque<ForgeHooks.LootTableContext>> lootContext
private static final java.lang.ClassValue<java.lang.String> registryNames
private static final java.util.Map<DataSerializer<?>,DataSerializerEntry> serializerEntries
private static final ForgeRegistry<DataSerializerEntry> serializerRegistry
@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 Block block, @Nonnull EntityPlayer player, @Nonnull IBlockAccess world, @Nonnull BlockPos pos)
public static boolean canToolHarvestBlock(IBlockAccess world, BlockPos pos, @Nonnull ItemStack stack)
public static float blockStrength(@Nonnull IBlockState state, @Nonnull EntityPlayer player, @Nonnull World world, @Nonnull BlockPos pos)
public static boolean isToolEffective(IBlockAccess world, BlockPos pos, @Nonnull ItemStack stack)
static void initTools()
public static int getTotalArmorValue(EntityPlayer player)
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.ArrayList<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 ItemStack itemstack, @Nonnull EntityPlayer player, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull EnumFacing side, float hitX, float hitY, float hitZ, @Nonnull EnumHand hand)
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 boolean onNoteChange(TileEntityNote te, byte old)
public static NonNullList<ItemStack> defaultRecipeGetRemainingItems(InventoryCrafting inv)
inv
- Crafting inventorypublic static void setCraftingPlayer(EntityPlayer player)
public static EntityPlayer getCraftingPlayer()
public static boolean isInsideOfMaterial(Material material, Entity entity, BlockPos pos)
public static boolean onPlayerAttackTarget(EntityPlayer player, Entity target)
public static boolean onTravelToDimension(Entity entity, int 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)
private static ForgeHooks.LootTableContext getLootTableContext()
@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)
@Deprecated public static boolean onThrowableImpact(EntityThrowable throwable, RayTraceResult ray)
public static boolean onCropsGrowPre(World worldIn, BlockPos pos, IBlockState state, boolean def)
public static void onCropsGrowPost(World worldIn, BlockPos pos, IBlockState state, IBlockState blockState)
public static java.lang.String getRegistryName(java.lang.Class<? extends TileEntity> type)
public static boolean loadAdvancements(java.util.Map<ResourceLocation,Advancement.Builder> map)
private static void loadFactories(ModContainer mod)
@Nullable public static CriticalHitEvent getCriticalHit(EntityPlayer player, Entity target, boolean vanillaCritical, float damageModifier)
private static void setActiveModContainer(ModContainer mod)
private static boolean loadAdvancements(java.util.Map<ResourceLocation,Advancement.Builder> map, ModContainer mod)
public static void sendRecipeBook(NetHandlerPlayServer connection, SPacketRecipeBook.State state, java.util.List<IRecipe> recipes, java.util.List<IRecipe> display, boolean isGuiOpen, boolean isFilteringCraftable)
public static void onAdvancement(EntityPlayerMP player, Advancement advancement)
@Nullable public static java.lang.String getDefaultCreatorModId(@Nonnull ItemStack itemStack)
Item.getCreatorModId(net.minecraft.item.ItemStack)
. Call that method instead.public static boolean onFarmlandTrample(World world, BlockPos pos, IBlockState state, float fallDistance, Entity entity)
@Nullable public static DataSerializer<?> getSerializer(int id, IntIdentityHashBiMap<DataSerializer<?>> vanilla)
public static int getSerializerId(DataSerializer<?> serializer, IntIdentityHashBiMap<DataSerializer<?>> vanilla)