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>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract org.bukkit.advancement.AdvancementaddAdvancement(org.bukkit.NamespacedKey key) abstract voidaddFunction(org.bukkit.NamespacedKey key, List<String> commands) abstract void<T extends org.bukkit.Keyed>
voidaddToRegistry(Class<T> className, org.bukkit.NamespacedKey key, T object) 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) static <T> TforceGetArgument(com.mojang.brigadier.context.CommandContext cmdCtx, String key) abstract List<org.bukkit.NamespacedKey> abstract org.bukkit.block.Biome[]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 Objectstatic <T> TgetFieldAs(Class<?> className, String fieldName, Object instance, Class<T> asType) static <T> TgetFieldAs(Class<?> className, String fieldName, String mojangMappedName, Object instance, Class<T> asType) static <CLW> MockPlatform<CLW> abstract org.bukkit.inventory.ItemFactoryOther stuff *abstract org.bukkit.loot.LootTables[]com.mojang.brigadier.CommandDispatcher<CLW> com.mojang.brigadier.CommandDispatcher<CLW> abstract StringgetNMSParticleNameFromBukkit(org.bukkit.Particle particle) abstract org.bukkit.potion.PotionEffectType[]getRecipes(Class<?> minecraftServerClass) Gets recipes fromdata/minecraft/recipes/<file>.json.<T extends org.bukkit.Keyed>
org.bukkit.Registry<T> getRegistry(Class<T> className) abstract org.bukkit.Sound[]intfinal voidstatic voidstatic voidsetField(Class<?> className, String fieldName, String mojangMappedName, Object instance, Object value) abstract org.bukkit.entity.PlayersetupMockedCraftPlayer(String name) static voidunload()Methods inherited from class dev.jorel.commandapi.CommandAPIBukkit
createDispatcherFile, failWithAdventureComponent, failWithBaseComponents, get, getBrigadierDispatcher, getBrigadierSourceFromCommandSender, getCommandRegistrationStrategy, getCommandSenderFromCommandSource, getConfiguration, getLogger, getMinecraftServer, getPaper, getSenderForCommand, getSuggestionProvider, initializeNBTAPI, newConcreteCommandAPICommand, newConcreteLiteralArgument, newConcreteMultiLiteralArgument, onDisable, onEnable, onLoad, postCommandRegistration, preCommandRegistration, registerBukkitRecipesSafely, registerCommandNode, registerPermission, unregister, 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, createCommandRegistrationStrategy, generateHelpTopic, generateMessageFromJson, getAdvancement, getAdventureChat, getAdventureChatColor, getAdventureChatComponent, getAngle, getAxis, getBiome, getBlockPredicate, getBlockState, getChat, getChatColor, getChatComponent, getDimension, getEnchantment, getEntitySelector, getEntityType, getFloatRange, getFunction, getFunction, getFunctions, getHelpMap, 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
-
Field Details
-
registry
-
-
Constructor Details
-
MockPlatform
protected MockPlatform()
-
-
Method Details
-
getInstance
-
unload
public static void unload() -
getMockBrigadierDispatcher
-
getMockResourcesDispatcher
-
convert
-
convert
-
convert
-
convert
-
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
-
getField
-
setField
-
setField
-
getFieldAs
-
getFieldAs
-
forceGetArgument
public static <T> T forceGetArgument(com.mojang.brigadier.context.CommandContext cmdCtx, String key) -
getItemFactory
public abstract org.bukkit.inventory.ItemFactory getItemFactory()Other stuff * -
addAdvancement
public abstract org.bukkit.advancement.Advancement addAdvancement(org.bukkit.NamespacedKey key) -
addFunction
-
addTag
-
setupMockedCraftPlayer
-
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
-
popFunctionCallbackResult
public int popFunctionCallbackResult() -
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
-
getAllRecipes
-
addToRegistry
public <T extends org.bukkit.Keyed> void addToRegistry(Class<T> className, org.bukkit.NamespacedKey key, T object) -
getRegistry
-