Interface IPlatformHelper
public interface IPlatformHelper
-
Method Summary
Modifier and TypeMethodDescriptioncreateFluidStack(net.minecraft.world.level.material.Fluid fluid, long amount, net.minecraft.core.component.DataComponentPatch patch) <T> IFluidStackcreateFluidStack(T stack) createFluidStackMutable(net.minecraft.world.level.material.Fluid fluid, long amount, net.minecraft.core.component.DataComponentPatch patch) <T> IFluidStackcreateFluidStackMutable(T stack) createItemStack(net.minecraft.world.item.ItemStack stack, IngredientConditions conditions, IngredientTransformers transformers) createItemStackMutable(net.minecraft.world.item.ItemStack stack, IngredientConditions conditions, IngredientTransformers transformers) net.minecraft.world.food.FoodProperties.PossibleEffectcreatePossibleEffect(net.minecraft.world.effect.MobEffectInstance effect, float probability) default booleandoCraftingTableRecipesConflict(IRecipeManager<?> manager, net.minecraft.world.item.crafting.Recipe<?> first, net.minecraft.world.item.crafting.Recipe<?> second) Deprecated, for removal: This API element is subject to removal in a future version.use CraftingTableRecipeConflictChecker.checkConflicts directly insteadbooleandoesIngredientRequireTesting(net.minecraft.world.item.crafting.Ingredient ingredient) Stream<com.mojang.authlib.GameProfile> <T extends Annotation>
Stream<? extends Class<?>> findClassesWithAnnotation(Class<T> annotationClass, Consumer<PlatformMod> classProviderConsumer, Predicate<com.mojang.datafixers.util.Either<T, Map<String, Object>>> annotationFilter) Finds classes with the given annotation and applies a filter.default StringfindMappedFieldName(Class<?> clazz, String fieldName, Class<?> fieldType) default StringfindMappedMethodName(Class<?> clazz, String methodName, Class<?> returnType, Class<?>... parameterTypes) default net.minecraft.world.item.ItemStackgetBasicTradeForSale(IBasicItemListing internal) default intgetBasicTradeMaxTrades(IBasicItemListing internal) default net.minecraft.world.item.ItemStackgetBasicTradePrice(IBasicItemListing internal) default net.minecraft.world.item.ItemStackgetBasicTradePrice2(IBasicItemListing internal) default floatgetBasicTradePriceMult(IBasicItemListing internal) default intgetBasicTradeXp(IBasicItemListing internal) net.minecraft.world.level.material.FluidgetBucketContent(net.minecraft.world.item.BucketItem item) net.minecraft.world.item.crafting.IngredientgetCraftTweakerIngredient(IIngredient internal) net.minecraft.nbt.CompoundTaggetCustomData(net.minecraft.world.entity.Entity entity) default Stream<net.minecraft.world.item.ItemStack> getCustomIngredientItems(net.minecraft.world.item.crafting.Ingredient ingredient) 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) net.minecraft.world.item.crafting.IngredientgetIItemStackIngredient(IItemStack internal) net.minecraft.world.item.crafting.Ingredientnet.minecraft.world.item.crafting.IngredientgetIngredientList(List<net.minecraft.world.item.crafting.Ingredient> children) default StringFabric doesn't have an MC formatting sanitizer.Map<net.minecraft.resources.ResourceLocation, ILootModifier> getMods()net.minecraft.nbt.CompoundTaggetPersistentData(net.minecraft.server.level.ServerPlayer player) getPlayerInventory(net.minecraft.world.entity.player.Player player) default IItemStackgetRemainingItem(net.minecraft.world.item.ItemStack stack) default voidinvalidateIngredients(List<net.minecraft.world.item.crafting.Ingredient> ingredients) booleanisCustomIngredient(net.minecraft.world.item.crafting.Ingredient ingredient) booleanbooleanbooleanisFakePlayer(net.minecraft.world.entity.player.Player player) booleanisModLoaded(String modId) default voidsetCompostable(IItemStack stack, Optional<Float> value, boolean undoing)
-
Method Details
-
getLogFormat
Fabric doesn't have an MC formatting sanitizer. -
getPlatformName
String getPlatformName() -
isModLoaded
-
isDevelopmentEnvironment
boolean isDevelopmentEnvironment() -
isDataGen
boolean isDataGen() -
getMods
-
getMod
-
createItemStack
IItemStack createItemStack(net.minecraft.world.item.ItemStack stack, IngredientConditions conditions, IngredientTransformers transformers) -
createItemStackMutable
IItemStack createItemStackMutable(net.minecraft.world.item.ItemStack stack, IngredientConditions conditions, IngredientTransformers transformers) -
createFluidStack
IFluidStack createFluidStack(net.minecraft.world.level.material.Fluid fluid, long amount, net.minecraft.core.component.DataComponentPatch patch) -
createFluidStackMutable
IFluidStack createFluidStackMutable(net.minecraft.world.level.material.Fluid fluid, long amount, net.minecraft.core.component.DataComponentPatch patch) -
createFluidStack
-
createFluidStackMutable
-
getBucketContent
net.minecraft.world.level.material.Fluid getBucketContent(net.minecraft.world.item.BucketItem item) -
getGameDirectory
Path getGameDirectory() -
findClassesWithAnnotation
<T extends Annotation> Stream<? extends Class<?>> findClassesWithAnnotation(Class<T> annotationClass, Consumer<PlatformMod> classProviderConsumer, Predicate<com.mojang.datafixers.util.Either<T, Map<String, Object>>> annotationFilter) Finds classes with the given annotation and applies a filter.- Parameters:
annotationClass- The annotation class to look for.classProviderConsumer- 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
-
findMappedMethodName
-
findMappedFieldName
-
getLootModifiersMap
Map<net.minecraft.resources.ResourceLocation,ILootModifier> getLootModifiersMap() -
getPlayerInventory
-
doCraftingTableRecipesConflict
@Deprecated(forRemoval=true) default boolean doCraftingTableRecipesConflict(IRecipeManager<?> manager, net.minecraft.world.item.crafting.Recipe<?> first, net.minecraft.world.item.crafting.Recipe<?> second) Deprecated, for removal: This API element is subject to removal in a future version.use CraftingTableRecipeConflictChecker.checkConflicts directly instead -
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) -
doesIngredientRequireTesting
boolean doesIngredientRequireTesting(net.minecraft.world.item.crafting.Ingredient ingredient) -
invalidateIngredients
-
getRemainingItem
-
getIngredientAny
net.minecraft.world.item.crafting.Ingredient getIngredientAny() -
getIngredientList
net.minecraft.world.item.crafting.Ingredient getIngredientList(List<net.minecraft.world.item.crafting.Ingredient> children) -
getCraftTweakerIngredient
-
getIItemStackIngredient
-
isCustomIngredient
boolean isCustomIngredient(net.minecraft.world.item.crafting.Ingredient ingredient) -
getCustomIngredientItems
default Stream<net.minecraft.world.item.ItemStack> getCustomIngredientItems(net.minecraft.world.item.crafting.Ingredient ingredient) -
fakePlayers
Stream<com.mojang.authlib.GameProfile> fakePlayers() -
isFakePlayer
boolean isFakePlayer(net.minecraft.world.entity.player.Player player) -
getBasicTradePrice
-
getBasicTradePrice2
-
getBasicTradeForSale
-
getBasicTradeMaxTrades
-
getBasicTradeXp
-
getBasicTradePriceMult
-
createPossibleEffect
net.minecraft.world.food.FoodProperties.PossibleEffect createPossibleEffect(net.minecraft.world.effect.MobEffectInstance effect, float probability) -
setCompostable
-