Interface IPlatformHelper


public interface IPlatformHelper
  • Method Details

    • getLogFormat

      default String getLogFormat()
      Fabric doesn't have a MC formatting sanitizer.
    • getPlatformName

      String getPlatformName()
    • isModLoaded

      boolean isModLoaded(String modId)
    • isDevelopmentEnvironment

      boolean isDevelopmentEnvironment()
    • isDataGen

      boolean isDataGen()
    • getMods

      List<Mod> getMods()
    • getMod

      Optional<Mod> getMod(String modid)
    • createMCItemStack

      IItemStack createMCItemStack(net.minecraft.world.item.ItemStack stack)
    • createMCItemStackMutable

      IItemStack createMCItemStackMutable(net.minecraft.world.item.ItemStack stack)
    • getEmptyIItemStack

      IItemStack getEmptyIItemStack()
    • getScriptSerializer

      net.minecraft.world.item.crafting.RecipeSerializer<ScriptRecipe> getScriptSerializer()
    • getBucketContent

      net.minecraft.world.level.material.Fluid getBucketContent(net.minecraft.world.item.BucketItem item)
    • getGameDirectory

      Path getGameDirectory()
    • getPathFromGameDirectory

      default Path getPathFromGameDirectory(Path path)
    • getPathFromGameDirectory

      default Path getPathFromGameDirectory(String path)
    • getRelativePathFromGameDirectory

      default Path getRelativePathFromGameDirectory(Path path)
    • getRelativePathFromGameDirectory

      default Path getRelativePathFromGameDirectory(String path)
    • findClassesWithAnnotation

      default <T extends Annotation> Stream<? extends Class<?>> findClassesWithAnnotation(Class<T> annotationCls)
      Finds classes with the given annotation
      Parameters:
      annotationCls - The annotation class to look for.
      Returns:
      A stream of classes with the annotation
    • findClassesWithAnnotation

      default <T extends Annotation> Stream<? extends Class<?>> findClassesWithAnnotation(Class<T> annotationCls, Consumer<Mod> consumer)
      Finds classes with the given annotation
      Parameters:
      annotationCls - The annotation class to look for.
      consumer - Consumer to collect the given mod that added the class if available.
      Returns:
      A stream of classes with the annotation
    • findClassesWithAnnotation

      <T extends Annotation> Stream<? extends Class<?>> findClassesWithAnnotation(Class<T> annotationCls, Consumer<Mod> consumer, Predicate<com.mojang.datafixers.util.Either<T,Map<String,Object>>> annotationFilter)
      Finds classes with the given annotation and applies a filter.
      Parameters:
      annotationCls - The annotation class to look for.
      consumer - Consumer to collect the given mod that added the class if available.
      annotationFilter - A filter to apply to the search.
      Returns:
      A stream of classes with the annotation
    • findMethod

      Method findMethod(@Nonnull Class<?> clazz, @Nonnull String methodName, @Nonnull Class<?> returnType, @Nonnull Class<?>... parameterTypes)
    • findField

      <T> Field findField(@Nonnull Class<? super T> clazz, @Nonnull String fieldName, @Nonnull String fieldDescription)
    • registerCustomTradeConverters

      default void registerCustomTradeConverters(Map<Class<? extends net.minecraft.world.entity.npc.VillagerTrades.ItemListing>,Function<net.minecraft.world.entity.npc.VillagerTrades.ItemListing,CTTradeObject>> classFunctionMap)
    • getLootModifiersMap

      Map<net.minecraft.resources.ResourceLocation,ILootModifier> getLootModifiersMap()
    • getPlayerInventory

      IInventoryWrapper getPlayerInventory(net.minecraft.world.entity.player.Player player)
    • canItemStacksStack

      default boolean canItemStacksStack(net.minecraft.world.item.ItemStack first, net.minecraft.world.item.ItemStack second)
    • doCraftingTableRecipesConflict

      boolean doCraftingTableRecipesConflict(IRecipeManager manager, net.minecraft.world.item.crafting.Recipe<?> first, net.minecraft.world.item.crafting.Recipe<?> second)
    • getFluidsForDump

      Set<net.minecraft.network.chat.MutableComponent> getFluidsForDump(net.minecraft.world.item.ItemStack stack, net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand)
    • getCustomData

      net.minecraft.nbt.CompoundTag getCustomData(net.minecraft.world.entity.Entity entity)
    • getPersistentData

      net.minecraft.nbt.CompoundTag getPersistentData(net.minecraft.server.level.ServerPlayer player)
    • addFoodPropertiesEffect

      default void addFoodPropertiesEffect(net.minecraft.world.food.FoodProperties internal, net.minecraft.world.effect.MobEffectInstance effect, float probability)
    • removeFoodPropertiesEffect

      default void removeFoodPropertiesEffect(net.minecraft.world.food.FoodProperties internal, net.minecraft.world.effect.MobEffectInstance effect)
    • removeFoodPropertiesEffect

      default void removeFoodPropertiesEffect(net.minecraft.world.food.FoodProperties internal, net.minecraft.world.effect.MobEffect effect)
    • invalidateIngredients

      default void invalidateIngredients(List<net.minecraft.world.item.crafting.Ingredient> ingredients)