Interface IPlatformHelper
public interface IPlatformHelper
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidaddFoodPropertiesEffect(net.minecraft.world.food.FoodProperties internal, net.minecraft.world.effect.MobEffectInstance effect, float probability) default booleancanItemStacksStack(net.minecraft.world.item.ItemStack first, net.minecraft.world.item.ItemStack second) createMCItemStack(net.minecraft.world.item.ItemStack stack) createMCItemStackMutable(net.minecraft.world.item.ItemStack stack) booleandoCraftingTableRecipesConflict(IRecipeManager manager, net.minecraft.world.item.crafting.Recipe<?> first, net.minecraft.world.item.crafting.Recipe<?> second) default <T extends Annotation>
Stream<? extends Class<?>>findClassesWithAnnotation(Class<T> annotationCls) Finds classes with the given annotationdefault <T extends Annotation>
Stream<? extends Class<?>>findClassesWithAnnotation(Class<T> annotationCls, Consumer<Mod> consumer) Finds classes with the given annotation<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.<T> FieldfindMethod(Class<?> clazz, String methodName, Class<?> returnType, Class<?>... parameterTypes) net.minecraft.world.level.material.FluidgetBucketContent(net.minecraft.world.item.BucketItem item) net.minecraft.nbt.CompoundTaggetCustomData(net.minecraft.world.entity.Entity entity) 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) default StringFabric doesn't have a MC formatting sanitizer.Map<net.minecraft.resources.ResourceLocation,ILootModifier> getMods()default Pathdefault PathgetPathFromGameDirectory(Path path) net.minecraft.nbt.CompoundTaggetPersistentData(net.minecraft.server.level.ServerPlayer player) getPlayerInventory(net.minecraft.world.entity.player.Player player) default Pathdefault Pathnet.minecraft.world.item.crafting.RecipeSerializer<ScriptRecipe>default voidinvalidateIngredients(List<net.minecraft.world.item.crafting.Ingredient> ingredients) booleanbooleanbooleanisModLoaded(String modId) default voidregisterCustomTradeConverters(Map<Class<? extends net.minecraft.world.entity.npc.VillagerTrades.ItemListing>, Function<net.minecraft.world.entity.npc.VillagerTrades.ItemListing, CTTradeObject>> classFunctionMap) default voidremoveFoodPropertiesEffect(net.minecraft.world.food.FoodProperties internal, net.minecraft.world.effect.MobEffect effect) default voidremoveFoodPropertiesEffect(net.minecraft.world.food.FoodProperties internal, net.minecraft.world.effect.MobEffectInstance effect)
-
Method Details
-
getLogFormat
Fabric doesn't have a MC formatting sanitizer. -
getPlatformName
String getPlatformName() -
isModLoaded
-
isDevelopmentEnvironment
boolean isDevelopmentEnvironment() -
isDataGen
boolean isDataGen() -
getMods
-
getMod
-
createMCItemStack
-
createMCItemStackMutable
-
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
-
getPathFromGameDirectory
-
getRelativePathFromGameDirectory
-
getRelativePathFromGameDirectory
-
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
-
findField
-
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
-
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
-