Package dev.jorel.commandapi.test
Class MockPlatform<CLW>
java.lang.Object
dev.jorel.commandapi.CommandAPIBukkit<CLW>
dev.jorel.commandapi.test.MockPlatform<CLW>
- All Implemented Interfaces:
dev.jorel.commandapi.CommandAPIPlatform<dev.jorel.commandapi.arguments.Argument<?>,,org.bukkit.command.CommandSender, CLW> dev.jorel.commandapi.nms.NMS<CLW>
public abstract class MockPlatform<CLW>
extends dev.jorel.commandapi.CommandAPIBukkit<CLW>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract org.bukkit.advancement.AdvancementaddAdvancement(org.bukkit.NamespacedKey key) voidaddFunction(org.bukkit.NamespacedKey key, List<String> commands) voidfinal voidaddToHelpMap(Map<String, org.bukkit.help.HelpTopic> helpTopicsToAdd) final Stringconvert(dev.jorel.commandapi.wrappers.ParticleData<?> particle) final Stringconvert(org.bukkit.inventory.ItemStack is) final Stringconvert(org.bukkit.potion.PotionEffectType potion) final Stringconvert(org.bukkit.Sound sound) abstract List<org.bukkit.NamespacedKey>abstract org.bukkit.block.Biome[]final com.mojang.brigadier.CommandDispatcher<CLW>abstract StringgetBukkitPotionEffectTypeName(org.bukkit.potion.PotionEffectType potionEffectType) Converts 1.16.5 and below potion effect names to NamespacedKey names.abstract org.bukkit.enchantments.Enchantment[]Bukkit "enum" lists *abstract org.bukkit.entity.EntityType[]static ObjectHelper methods *static <T> TgetFieldAs(Class<?> className, String fieldName, Object instance, Class<T> asType) static <CLW> MockPlatform<CLW>abstract org.bukkit.inventory.ItemFactoryOther stuff *abstract org.bukkit.loot.LootTables[]abstract StringgetNMSParticleNameFromBukkit(org.bukkit.Particle particle) abstract org.bukkit.potion.PotionEffectType[]getRecipes(Class<?> minecraftServerClass) Gets recipes fromdata/minecraft/recipes/<file>.json.final dev.jorel.commandapi.commandsenders.BukkitCommandSender<? extends org.bukkit.command.CommandSender>getSenderForCommand(com.mojang.brigadier.context.CommandContext<CLW> cmdCtx, boolean forceNative) abstract org.bukkit.Sound[]final booleanisVanillaCommandWrapper(org.bukkit.command.Command command) final voidfinal voidresendPackets(org.bukkit.entity.Player player) static voidstatic voidunload()Methods inherited from class dev.jorel.commandapi.CommandAPIBukkit
createDispatcherFile, failWithAdventureComponent, failWithBaseComponents, get, getBrigadierSourceFromCommandSender, getCommandSenderFromCommandSource, getConfiguration, getLogger, getMinecraftServer, getPaper, getSuggestionProvider, newConcreteCommandAPICommand, newConcreteLiteralArgument, newConcreteMultiLiteralArgument, onDisable, onEnable, onLoad, postCommandRegistration, preCommandRegistration, registerBukkitRecipesSafely, registerCommandNode, registerPermission, unregister, updateRequirements, wrapCommandSenderMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.jorel.commandapi.nms.NMS
_ArgumentAngle, _ArgumentAxis, _ArgumentBlockPredicate, _ArgumentBlockState, _ArgumentChat, _ArgumentChatComponent, _ArgumentChatFormat, _ArgumentDimension, _ArgumentEnchantment, _ArgumentEntity, _ArgumentEntitySummon, _ArgumentFloatRange, _ArgumentIntRange, _ArgumentItemPredicate, _ArgumentItemStack, _ArgumentMathOperation, _ArgumentMinecraftKeyRegistered, _ArgumentMobEffect, _ArgumentNBTCompound, _ArgumentParticle, _ArgumentPosition, _ArgumentPosition2D, _ArgumentProfile, _ArgumentRotation, _ArgumentScoreboardCriteria, _ArgumentScoreboardObjective, _ArgumentScoreboardSlot, _ArgumentScoreboardTeam, _ArgumentScoreholder, _ArgumentSyntheticBiome, _ArgumentTag, _ArgumentTime, _ArgumentUUID, _ArgumentVec2, _ArgumentVec3, compatibleVersions, generateHelpTopic, generateMessageFromJson, getAdvancement, getAdventureChat, getAdventureChatComponent, getAngle, getAxis, getBiome, getBlockPredicate, getBlockState, getChat, getChatColor, getChatComponent, getDimension, getEnchantment, getEntitySelector, getEntityType, getFloatRange, getFunction, getFunction, getFunctions, getIntRange, getItemStack, getItemStackPredicate, getLocation2DBlock, getLocation2DPrecise, getLocationBlock, getLocationPrecise, getLootTable, getMathOperation, getMinecraftKey, getNBTCompound, getObjective, getObjectiveCriteria, getOfflinePlayer, getParticle, getPlayer, getPotionEffect, getRecipe, getRotation, getScoreboardSlot, getScoreHolderMultiple, getScoreHolderSingle, getSimpleCommandMap, getSound, getTag, getTags, getTeam, getTime, getUUID, getWorldForCSS
-
Constructor Details
-
MockPlatform
protected MockPlatform()
-
-
Method Details
-
getInstance
-
unload
public static void unload() -
getBrigadierDispatcher
- Specified by:
getBrigadierDispatcherin interfacedev.jorel.commandapi.CommandAPIPlatform<dev.jorel.commandapi.arguments.Argument<?>,org.bukkit.command.CommandSender, CLW> - Specified by:
getBrigadierDispatcherin interfacedev.jorel.commandapi.nms.NMS<CLW>- Specified by:
getBrigadierDispatcherin classdev.jorel.commandapi.CommandAPIBukkit<CLW>
-
getSenderForCommand
public final dev.jorel.commandapi.commandsenders.BukkitCommandSender<? extends org.bukkit.command.CommandSender> getSenderForCommand(com.mojang.brigadier.context.CommandContext<CLW> cmdCtx, boolean forceNative) -
resendPackets
public final void resendPackets(org.bukkit.entity.Player player) -
addToHelpMap
-
convert
-
convert
-
convert
-
convert
-
isVanillaCommandWrapper
public final boolean isVanillaCommandWrapper(org.bukkit.command.Command command) -
reloadDataPacks
public final void reloadDataPacks()- Specified by:
reloadDataPacksin interfacedev.jorel.commandapi.CommandAPIPlatform<dev.jorel.commandapi.arguments.Argument<?>,org.bukkit.command.CommandSender, CLW> - Specified by:
reloadDataPacksin interfacedev.jorel.commandapi.nms.NMS<CLW>- Specified by:
reloadDataPacksin classdev.jorel.commandapi.CommandAPIBukkit<CLW>
-
getField
Helper methods * -
setField
-
getFieldAs
-
getItemFactory
public abstract org.bukkit.inventory.ItemFactory getItemFactory()Other stuff * -
addAdvancement
public abstract org.bukkit.advancement.Advancement addAdvancement(org.bukkit.NamespacedKey key) -
addFunction
-
addTag
-
getBukkitPotionEffectTypeName
public abstract String getBukkitPotionEffectTypeName(org.bukkit.potion.PotionEffectType potionEffectType) Converts 1.16.5 and below potion effect names to NamespacedKey names. For example, converts "effect.minecraft.speed" into "minecraft:speed"- Parameters:
potionEffectType- the potion effect to get the namespaced key for- Returns:
- a Minecraft namespaced key name for a potion effect
-
getNMSParticleNameFromBukkit
-
getRecipes
public final List<dev.jorel.commandapi.test.MockPlatform.Pair<String,com.google.gson.JsonObject>> getRecipes(Class<?> minecraftServerClass) Gets recipes fromdata/minecraft/recipes/<file>.json. Parses them and returns a list of{name, json}, wherenameis the name of the file without the.jsonextension, andjsonis the parsed JSON result from the file- Parameters:
minecraftServerClass- an instance of MinecraftServer.class- Returns:
- A list of pairs of resource locations (with no namespace) and JSON objects
-
getEnchantments
public abstract org.bukkit.enchantments.Enchantment[] getEnchantments()Bukkit "enum" lists * -
getEntityTypes
public abstract org.bukkit.entity.EntityType[] getEntityTypes() -
getLootTables
public abstract org.bukkit.loot.LootTables[] getLootTables() -
getPotionEffects
public abstract org.bukkit.potion.PotionEffectType[] getPotionEffects() -
getSounds
public abstract org.bukkit.Sound[] getSounds() -
getBiomes
public abstract org.bukkit.block.Biome[] getBiomes() -
getAllItemNames
- Returns:
- A list of all item names, sorted in alphabetical order. Each item
is prefixed with
minecraft:
-
getAllRecipes
-