name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
MagicPlugin_BaseSpell_onCast_rdh | /**
* Called when this spell is cast.
*
* <p>This is where you do your work!
*
* <p>If parameters were passed to this spell, either via a variant or the command line,
* they will be passed in here.
*
* @param parameters
* Any parameters that were passed to this spell
* @return The SpellResult of this cast.
... | 3.26 |
MagicPlugin_BaseSpell_getPlayerFacing_rdh | /**
* Get the direction the player is facing as a BlockFace.
*
* @return a BlockFace representing the direction the player is facing
*/
public BlockFace getPlayerFacing() {return getFacing(getLocation());
} | 3.26 |
MagicPlugin_BaseSpell_onPlayerDeath_rdh | /**
* Listener method, called on player move for registered spells.
*
* @param event
* The original entity death event
*/
public void onPlayerDeath(EntityDeathEvent event) {
} | 3.26 |
MagicPlugin_BaseSpell_isUnderwater_rdh | /**
* Check to see if the player is underwater
*
* @return true if the player is underwater
*/
public boolean isUnderwater() {
Block playerBlock = getPlayerBlock();if (playerBlock == null)return false;
playerBlock = playerBlock.getRelative(BlockFace.UP);
Block eyeBlock = playerBlock.getRelative(BlockFa... | 3.26 |
MagicPlugin_BaseSpell_isOkToStandIn_rdh | /* Ground / location search and test functions */
// Material
@Deprecated
public boolean
isOkToStandIn(Material mat) {
if (isHalfBlock(mat)) {
return false;
}
return passthroughMaterials.testMaterial(mat) && (!unsafeMaterials.testMaterial(mat));
} | 3.26 |
MagicPlugin_BaseSpell_isPassthrough_rdh | // Material
@Deprecated
public boolean isPassthrough(Material mat) {
return (passthroughMaterials != null) && passthroughMaterials.testMaterial(mat);
} | 3.26 |
MagicPlugin_BaseSpell_getConsumeReduction_rdh | //
// CostReducer Implementation
//
@Override
public float getConsumeReduction() {
CostReducer reducer = (mageClass != null) ? mageClass : currentCast != null ? currentCast.getWand() : mage;
if (reducer == null) {
reducer = mage;
}
if (reducer == null) {
return consumeReduction;
}
return consumeReduction + reducer.... | 3.26 |
MagicPlugin_BaseSpell_getPlayerBlock_rdh | /**
* Get the block the player is standing on.
*
* @return The Block the player is standing on
*/
@Nullable
public Block getPlayerBlock() {
Location location = getLocation();
if (location == null)
return null;
if (!CompatibilityLib.getCompatibilityUtils().isChunkLoaded(location))
return... | 3.26 |
MagicPlugin_BaseSpell_isBypassRegionPermission_rdh | /**
*
* @return Whether or not this spell can bypass region permissions such as custom world-guard flags.
*/public boolean isBypassRegionPermission() {
return bypassRegionPermission;
} | 3.26 |
MagicPlugin_BaseSpell_sendMessage_rdh | /**
* Send a message to a player.
*
* <p>Use this to send messages to the player that are important.
*
* @param message
* The message to send
*/
@Override
public void sendMessage(String message) {
sendMessage(mage, message);
} | 3.26 |
MagicPlugin_BaseSpell_isOkToStandOn_rdh | // Material
@Deprecated
public boolean isOkToStandOn(Material mat) {
if (isHalfBlock(mat))
{
return true;
}
return ((mat != Material.AIR) && (!unsafeMaterials.testMaterial(mat))) && (!passthroughMaterials.testMaterial(mat));
} | 3.26 |
MagicPlugin_BaseSpell_createSpell_rdh | //
// Public API Implementation
//
@Nullable
@Override@Deprecated
public Spell createSpell() {return createMageSpell(null);
} | 3.26 |
MagicPlugin_ModernMythicMobManager_getActiveMob_rdh | // Not in the API...
@SuppressWarnings("unchecked")
public Optional<ActiveMob> getActiveMob(UUID id) {
try {
MobManager manager = api.getMobManager();
Method getActiveMobMethod = manager.getClass().getMethod("getActiveMob", UUID.class);
if (getActiveMobMethod != null) {
return ((Optional<ActiveMob>) (getActiveMobMethod... | 3.26 |
MagicPlugin_MageSpell_save_rdh | /**
* This method is no longer used, and was never called correctly.
* Spells should use getVariables instead if they need to store custom data.
*/
@Deprecated
default void save(SpellData spellData) {
} | 3.26 |
MagicPlugin_CompatibilityLib_isLegacy_rdh | // This is here as a bit of a hack, MaterialAndData needs to know how to parse materials, but this is used
// by the MaterialSetTest test framework, where we don't actually have a server and can't really
// initialize CompatibilityLib.
// Kind of ugly, but this sidesteps the problem.
public static boolean isLegacy(Mate... | 3.26 |
MagicPlugin_MagicPlugin_onDisable_rdh | /* Help commands */
@Override
public void onDisable() {
if ((controller != null) && controller.isLoaded()) {
// Safety fallback in case we've missed some pending batches from logged out mages
controller.onShutdown();
controller.undoScheduled();
controller.save();
controller.... | 3.26 |
MagicPlugin_MagicPlugin_getPlugin_rdh | /* API Implementation */
@Override
public Plugin getPlugin() {
return this;
} | 3.26 |
MagicPlugin_SelectorAction_getSelectorOption_rdh | // This is mainly here for MagicMeta interrogation
public SelectorConfiguration getSelectorOption(ConfigurationSection section) {
return new SelectorConfiguration(section);
} | 3.26 |
MagicPlugin_MageConversation_sayNextLine_rdh | /**
* Returns true when finished
*/
public boolean sayNextLine(List<String> dialog) {
Player target
= targetPlayer.get();
if ((target == null)
|| (nextLine >= dialog.size())) {
return true;
}
String configuredLines = dialog.get(nextLine);
if (!configuredLines.isE... | 3.26 |
MagicPlugin_EntityExtraData_isSplittable_rdh | // Here for slime-like mobs
public boolean isSplittable() {
return true;
} | 3.26 |
MagicPlugin_PlayerController_onPlayerPreLogin_rdh | // TODO: Why not MONITOR?
@EventHandler(priority = EventPriority.HIGHEST)
public void onPlayerPreLogin(AsyncPlayerPreLoginEvent event) {
if (event.getLoginResult() != Result.ALLOWED) {
// Did not emit any events prior to this, nothing to clean up
return;
}
controller.onPreLogin(event);
} | 3.26 |
MagicPlugin_TextUtils_m0_rdh | // This is mainly meant for colors, since it only uses 6 characters for RGB
public static String m0(int i) {
return String.format("%06X", i);
} | 3.26 |
MagicPlugin_SkriptManager_get_rdh | // Eclipse bug
@SuppressWarnings("null")
@Nullable
@Override
public Entity get(final EarnEvent e) {return e.getMage().getEntity();
} | 3.26 |
MagicPlugin_SkriptManager_m0_rdh | // Eclipse bug
@SuppressWarnings("null")
@Nullable
@Override
public Entity m0(final StartCastEvent e) {
return e.getMage().getEntity();
} | 3.26 |
MagicPlugin_SpellResult_isFree_rdh | /**
* Determine if this result is a free cast or not.
*
* @return True if this cast should not consume costs.
*/
public boolean isFree() {
return free;
} | 3.26 |
MagicPlugin_SpellResult_isFailure_rdh | /**
* Determine if this result is a failure or not.
*
* <p>Note that a spell result can be neither failure nor
* success.
*
* @return True if this cast was a failure.
*/
public boolean isFailure() {
return failure;
} | 3.26 |
MagicPlugin_SpellResult_isSuccess_rdh | /**
* Determine if this result is a success or not,
* possibly counting no_target as a success.
*
* @return True if this cast was a success.
*/
public boolean isSuccess(boolean castOnNoTarget) {
if (((this == SpellResult.NO_TARGET) || (this == SpellResult.NO_ACTION)) || (this == SpellResult.STOP)) {
... | 3.26 |
MagicPlugin_Currency_hasMinValue_rdh | /**
* Check to see if this currency has a lower limit for player balances.
*
* @return true if this currency should be limited, typically to prevent negative balances.
*/
default boolean hasMinValue() {
return false;
} | 3.26 |
MagicPlugin_Currency_getMinValue_rdh | /**
* Get the minimum value for this currency.
* Player balances will be capped to this value.
* Only has an effect if @hasMinValue returns true.
*
* @return The minimum for player balances of this currency, typically 0 if set
*/
default double getMinValue() {
return 0;
} | 3.26 |
MagicPlugin_ColorHD_convertHSBtoRGB_rdh | // Borrowed from Sun AWT Color class
public static int[] convertHSBtoRGB(float hue, float saturation, float brightness) {
int r = 0;
int g = 0;
int b = 0;
if (saturation == 0) {
r = g = b = ((int) ((brightness * 255.0F) + 0.5F));
... | 3.26 |
MagicPlugin_Messages_getSpace_rdh | /**
* This relies on the negative space font RP:
* https://github.com/AmberWat/NegativeSpaceFont
*/
@Nonnull
@Override
public String getSpace(int pixels) {
if (pixels == 0) {
return "";
}
if (spaceAmounts.containsKey(pixels)) {
return spaceAmounts.get(pixels);
}
int totalPixels = pixels;
int absPixels = Math.abs(pi... | 3.26 |
MagicPlugin_UndoRegistry_removeDamage_rdh | /**
* Subtract some amount of damage
*
* @param block
* The block to remove damage from.
* @return The amount of damage remaining, or null if no damage was removed.
*/
@Nullable
public Double removeDamage(BlockData block) {
double amount = block.getDamage();
if (amount <= 0)
return null;
Do... | 3.26 |
MagicPlugin_MageData_getLastDeathLocation_rdh | /**
* Data can be saved asynchronously, and Locations' Worlds can be invalidated if the server unloads a world.
* So do not call this method during saving.
*/
@Nullable
public Location getLastDeathLocation() {
return lastDeathLocation == null ? null : lastDeathLocation.asLocation();
} | 3.26 |
MagicPlugin_BoundingBox_scaleFromBase_rdh | /**
* Scale this BoundingBox, but keep the min-Y value constant.
*
* <p>Useful for scaling entity AABB's.
*
* @return the scaled BB (this object)
*/
public BoundingBox scaleFromBase(double scale, double scaleY) {
if ((scale <=
0) || (scale == 1))
return this;
Vector center = this.... | 3.26 |
MagicPlugin_BoundingBox_intersectsLine_rdh | // Source:
// [url]http://www.gamedev.net/topic/338987-aabb---line-segment-intersection-test/[/url]
public boolean intersectsLine(Vector p1, Vector p2) {
final double epsilon = 1.0E-4F;
p1 = p1.clone();
p2 = p2.clone();
Vector d = p2.subtract(p1).multiply(0.5);
Vector e = max.clone().subtract(min)... | 3.26 |
MagicPlugin_MagicConfigCommandExecutor_m0_rdh | /**
* Note that this gets called asynchronously
*/
protected void m0(CommandSender sender, String session) {
final Plugin plugin =
magic.getPlugin();
plugin.getServer().getScheduler().runTask(plugin, new Runnable() {
@Override
public void run() {
Mage mage = controller.getMage(sender); sessions.put(mage.getId(), ses... | 3.26 |
MagicPlugin_TargetingSpell_m0_rdh | // Material
@Deprecated
public boolean m0(Material mat) {
return reflectiveMaterials.testMaterial(mat);
} | 3.26 |
MagicPlugin_BlockSpell_goLeft_rdh | /**
* A helper function to go change a given direction to the direction "to the right".
*
* <p>There's probably some better matrix-y, math-y way to do this.
* It'd be nice if this was in BlockFace.
*
* @param direction
* The current direction
* @return The direction to the left
*/
public static BlockFace goL... | 3.26 |
MagicPlugin_BlockSpell_goRight_rdh | /**
* A helper function to go change a given direction to the direction "to the right".
*
* <p>There's probably some better matrix-y, math-y way to do this.
* It'd be nice if this was in BlockFace.
*
* @param direction
* The current direction
* @return The direction to the right
*/
public static BlockFace go... | 3.26 |
MagicPlugin_BlockController_onChunkUnload_rdh | // Is cancellable in <1.13
@EventHandler(ignoreCancelled = true)public void onChunkUnload(ChunkUnloadEvent e) {
controller.pauseMagicBlocks(e.getChunk());
} | 3.26 |
MagicPlugin_Base64Coder_encode_rdh | /**
* Encodes a byte array into Base64 format.
* No blanks or line breaks are inserted in the output.
*
* @param in
* An array containing the data bytes to be encoded.
* @param iOff
* Offset of the first byte in <code>in</code> to be processed.
* @param iLen
* Number of bytes to process in <code>in</code... | 3.26 |
MagicPlugin_Base64Coder_decodeLines_rdh | /**
* Decodes a byte array from Base64 format and ignores line separators, tabs and blanks.
* CR, LF, Tab and Space characters are ignored in the input data.
* This method is compatible with <code>sun.misc.BASE64Decoder.decodeBuffer(String)</code>.
*
* @param s
... | 3.26 |
MagicPlugin_Base64Coder_encodeLines_rdh | /**
* Encodes a byte array into Base 64 format and breaks the output into lines.
*
* @param in
* An array containing the data bytes to be encoded.
* @param iOff
* Offset of the first byte in <code>in</code> to be processed.
* @param iLen
* Number of bytes to be processed in <code>in</code>, starting at <c... | 3.26 |
MagicPlugin_Base64Coder_encodeString_rdh | /**
* Encodes a string into Base64 format.
* No blanks or line breaks are inserted.
*
* @param s
* A String to be encoded.
* @return A String containing the Base64 encoded data.
*/
public static String encodeString(String s) {
return new String(encode(s.getBytes(StandardCharsets.UTF_8)));
} | 3.26 |
MagicPlugin_Base64Coder_decode_rdh | /**
* Decodes a byte array from Base64 format.
* No blanks or line breaks are allowed within the Base64 encoded input data.
*
* @param in
* A character array containing the Base64 encoded data.
* @param iOff
* Offset of the first character in <code>in</code> to be processed.
* @param iLen
* Number of cha... | 3.26 |
MagicPlugin_Base64Coder_decodeString_rdh | /**
* Decodes a string from Base64 format.
* No blanks or line breaks are allowed within the Base64 encoded input data.
*
* @param s
* A Base64 String to be decoded.
* @return A String containing the ... | 3.26 |
MagicPlugin_TranslatingConfigurationSection_createSection_rdh | /**
* Borrowed from Bukkit's MemorySection
*/
@Override
public ConfigurationSection createSection(String path) {
Validate.notEmpty(path, "Cannot create section at empty path");
Configuration root = getRoot();
if (root == null) {
throw new IllegalStateException("Cannot create section without a root");
}
final char sep... | 3.26 |
MagicPlugin_Mage_getArrowToLaunch_rdh | /**
* Get the item slot of the arrow that will be fired from a bow.
* -1 : Main hand
* -2 : Offhand
* >=0 : Inventory slot
*
* @return null if the player is not holding an arrow
*/
@Nullable
public Integer getArrowToLaunch() {
Player player = getPlayer();
PlayerInventory v641 = (player == null) ? null : player.... | 3.26 |
MagicPlugin_Mage_getConversations_rdh | /**
* This isa non-API method that returns the live version of the conversation map
*/
@Nonnull
public Map<Player, MageConversation> getConversations()
{
return conversations;
} | 3.26 |
MagicPlugin_Mage_doSetCurrency_rdh | // Returns the change, which may have been capped by min or max
private double doSetCurrency(String
key, double newValue) {
Currency currency = initCurrency(key);
return doSetCurrency(currency, key, newValue);
} | 3.26 |
MagicPlugin_Mage_castMessage_rdh | /**
* Send a message to this Mage when a spell is cast.
*
* @param message
* The message to send
*/
@Override
public void castMessage(String message) {
if (!controller.showCastMessages())return;
sendMessage(controller.getCastMessagePrefix(), message);
} | 3.26 |
MagicPlugin_Mage_getProjectileWand_rdh | // Gets the main hand wand if it is a bow or crossbow, otherwise gets the offhand wand
public Wand getProjectileWand() {
Wand wand = getActiveWand();
if (wand != null) {
Material wandIcon = wand.getIcon().getMaterial();
if (!DefaultMaterials.isBow(wandIcon)) {wand = null; }
}
if (wand ... | 3.26 |
MagicPlugin_Mage_getPendingBatches_rdh | /* API Implementation */
@Overridepublic Collection<Batch> getPendingBatches() {
Collection<Batch> pending = new ArrayList<>();
pending.addAll(pendingBatches);
return pending;
} | 3.26 |
MagicPlugin_Mage_sendMessage_rdh | /**
* Send a message to this Mage.
* <p/>
* Use this to send messages to the player that are important.
*
* @param message
* The message to send
*/
@Override
public void sendMessage(String message) {
sendMessage(controller.getMessagePrefix(), message);
} | 3.26 |
MagicPlugin_Targeting_getNextBlock_rdh | /**
* Move "steps" forward along line of vision and returns the block there
*
* @return The block at the new location
*/
@Nullable
protected Block getNextBlock() {
previousPreviousBlock = previousBlock;
previousBlock = currentBlock; if ((f0 == null) || (!f0.hasNext())) {
currentBlock = null;
} e... | 3.26 |
MagicPlugin_Targeting_findTarget_rdh | /**
* Returns the block at the cursor, or null if out of range
*
* @return The target block
*/
protected Target findTarget(MageContext context, double range) {
if (targetType == TargetType.NONE) {
return new Target(source);
}
... | 3.26 |
MagicPlugin_Targeting_getPreviousBlock_rdh | /**
* Returns the previous block along the line of vision
*
* @return The block
*/
public Block getPreviousBlock() {
return previousBlock;
} | 3.26 |
MagicPlugin_Wand_getExpToLevel_rdh | // Taken from NMS HumanEntity
public static int getExpToLevel(int expLevel) {
return expLevel >= 30 ? 112 + ((expLevel - 30) * 9) : expLevel >= 15 ? 37 + ((expLevel - 15) * 5) : 7 + (expLevel * 2);
} | 3.26 |
MagicPlugin_Wand_isLost_rdh | /* Public API Implementation */
@Override
public boolean isLost(LostWand lostWand) {
return (this.id != null) && this.id.equals(lostWand.getId());
} | 3.26 |
MagicPlugin_Wand_updateHotbarCount_rdh | // Update the hotbars inventory list to match the most recently configured value
// This will be followed with checkHotbarCount, after the inventories have been built
// This catches the case of the hotbar count having changed so we can preserve the location
// of spells in the main inventories.
protected void updateHo... | 3.26 |
MagicPlugin_Wand_checkSpellLevelsAndInventory_rdh | /**
* Covers the special case of a wand having spell levels and inventory slots that came from configs,
* but now we've modified the spells list and need to figure out if we also need to persist the levels and
* slots separately.
*
* <p>This should all be moved to CasterProperties at some point to handle the same ... | 3.26 |
MagicPlugin_Wand_checkHotbarCount_rdh | // This catches the hotbar_count having changed since the last time the inventory was built
// in which case we want to add a new hotbar inventory without re-arranging the main inventories
// newly added hotbars will be empty, spells in removed hotbars will be added to the end of the inventories.
protected void checkHo... | 3.26 |
MagicPlugin_Wand_setMage_rdh | // This should be used sparingly, if at all... currently only
// used when applying an upgrade to a wand while not held
public void setMage(Mage mage) {
this.mage = mage;
} | 3.26 |
MagicPlugin_Wand_wasInventoryOpen_rdh | // Somewhat hacky method to handle inventory close event knowing that this was a wand inventory that just closed.
public boolean wasInventoryOpen() {
return inventoryWasOpen;
} | 3.26 |
MagicPlugin_MapController_m0_rdh | /**
* Force reload of a player headshot.
*/
@Override
public void
m0(String worldName,
String playerName) {
String url = CompatibilityLib.getSkinUtils().getOnlineSkinURL(playerName);
if (url != null) {
m1(worldName, url, 8, 8, 8, 8);
}
} | 3.26 |
MagicPlugin_MapController_createMap_rdh | // This is copied from MagicController, which I'm still trying to keep out of this class. Shrug?
public ItemStack createMap(int mapId) {
short durability = (CompatibilityLib.isCurrentVersion()) ? 0 : ((short) (mapId));
ItemStack mapItem = CompatibilityLib.getDeprecatedUtils().createItemStack(DefaultMaterials.getFille... | 3.26 |
MagicPlugin_MapController_resetAll_rdh | /**
* Resets all internal data.
*
* <p>Can be called prior to save() to permanently delete all map images.
* Can also be called prior to load() to load a fresh config file.
*/
public void resetAll() {
for (URLMap map : f0.values()) {
map.reset();
}
} | 3.26 |
MagicPlugin_MapController_getAll_rdh | // Public API
@Override
public List<URLMap> getAll() {
return new ArrayList<>(idMap.values());
} | 3.26 |
MagicPlugin_MapController_m1_rdh | /**
* Force reload of the specific url and cropping.
*/
public void m1(String worldName, String url, int x, int y, int width, int height) {
get(worldName, url, x, y, width, height).reload();
} | 3.26 |
MagicPlugin_MapController_resend_rdh | /**
* Force resending all maps to a specific player.
*/
public void resend(String playerName) {for (URLMap map : f0.values()) {
map.resendTo(playerName);
}
} | 3.26 |
MagicPlugin_MapController_save_rdh | /**
* Saves the configuration file.
*
* <p>This is called automatically as changes are made, but you can call it in onDisable to be safe.
*/
public void save(boolean asynchronous) {
if (!loaded) {
if (plugin == null) {
Bukkit.getLogger().warning("[Magic] Attempted to save image map data before initializ... | 3.26 |
MagicPlugin_MapController_getMapItem_rdh | /**
* A helper function to get an ItemStack from a MapView.
*
* @param name
* The display name to give the new item. Optional.
*/
public ItemStack getMapItem(String name, int mapId) {ItemStack newMapItem = createMap(mapId);
if (name
!= null) {
ItemMeta meta = newMapItem.getItemMeta();
meta.setDisplayName(name)... | 3.26 |
MagicPlugin_MapController_getPlayerPortrait_rdh | /**
* Get an ItemStack that is a headshot of a player's skin.
*/
@Nullable
@Override
public ItemStack getPlayerPortrait(String worldName, String playerName, Integer priority, String photoLabel) {
photoLabel = (photoLabel == null) ? playerName : photoLabel;
String url = CompatibilityLib.getSkinUtils().getOnlineSkinUR... | 3.26 |
MagicPlugin_MapController_getURLItem_rdh | /**
* Get a new ItemStack for the specified url with a specific cropping.
*/
@Override
public ItemStack getURLItem(String world, String url, String name, int x, int y, int width, int height, Integer priority) {
MapView mapView = getURL(world, url, name, x, y, null, null, width, height, priority);
return getMapItem(n... | 3.26 |
MagicPlugin_SpellAction_load_rdh | /**
* This mechanism never worked properly and is no longer called.
* Actions that need to store data should interact with CastContext.getVariables instead.
*/
@Deprecateddefault void load(Mage mage, ConfigurationSection data) {
} | 3.26 |
MagicPlugin_SpellAction_save_rdh | /**
* This mechanism never worked properly and is no longer called.
* Actions that need to store data should interact with CastContext.getVariables instead.
*/
@Deprecated
default void save(Mage mage, ConfigurationSection data) {
} | 3.26 |
MagicPlugin_CraftingController_isCraftingSlot_rdh | // Borrowed from InventoryView and pruned,
// TODO: Switch to InventoryView.getSlotType when dropping 1.9 compat
public final boolean isCraftingSlot(InventoryView view, int slot) {
if ((slot >= 0) && (slot < view.getTopInventory().getSize())) {
if ((view.getType() == InventoryType.WORKBENCH) || (view.getType() == ... | 3.26 |
MagicPlugin_BlockFace_getModZ_rdh | /**
* Get the amount of Z-coordinates to modify to get the represented block
*
* @return Amount of Z-coordinates to modify
*/
public int getModZ() {
return
modZ;
} | 3.26 |
MagicPlugin_BlockFace_getModY_rdh | /**
* Get the amount of Y-coordinates to modify to get the represented block
*
* @return Amount of Y-coordinates to modify
*/
public int getModY() {
return modY;
} | 3.26 |
MagicPlugin_EnteredStateTracker_touch_rdh | /**
* This is just here to avoid compiler warnings by giving the user something to call
*/
public void touch() {
} | 3.26 |
MagicPlugin_PreLoadEvent_registerCurrency_rdh | /**
* Register a custom currency, which can be used in shops, spell worth/earns and casting costs.
*
* @param currency
* A currency instance to register
*/
public void registerCurrency(Currency currency) {
currencies.add(currency);
} | 3.26 |
MagicPlugin_PreLoadEvent_registerPVPManager_rdh | /**
* Register a PVPManager, for controlling whether or not players can harm other players with magic.
*
* @param manager
* The manager to add.
*/
public void registerPVPManager(PVPManager manager) {
pvpManagers.add(manager);
} | 3.26 |
MagicPlugin_PreLoadEvent_registerCastPermissionManager_rdh | /**
* Register a CastPermissionManager, for controlling whether or not players can cast spells in
* specific regions.
*
* @param manager
* The manager to add.
*/
public void registerCastPermissionManager(CastPermissionManager manager) {
castManagers.add(manager);
} | 3.26 |
MagicPlugin_PreLoadEvent_registerBlockBuildManager_rdh | /**
* Register a BlockBuildManager, for controlling whether or not players can place blocks with magic.
*
* @param manager
* The manager to add.
*/
public void registerBlockBuildManager(BlockBuildManager manager) {
blockBuildManager.add(manager);
} | 3.26 |
MagicPlugin_PreLoadEvent_registerAttributeProvider_rdh | /**
* Register an AttributeProvider, for adding custom attribute support to spells and mages.
*
* @param provider
* The provider to add.
*/
public void registerAttributeProvider(AttributeProvider provider) {
attributeProviders.add(provider);} | 3.26 |
MagicPlugin_PreLoadEvent_registerPlayerWarpManager_rdh | /**
* Register a PlayerWarpManager, for providing warps to be used in the Recall menu.
* The name of the manager as registered corresponds with the "allow_player_warps" map in the recall
* spell configuration.
*
* @param key
* The name of the manager
* @param manager
* The manager to add
*/
public void
r... | 3.26 |
MagicPlugin_PreLoadEvent_registerRequirementsProcessor_rdh | /**
* Register a RequirementsProcessor for handling a specific type of requirement.
*
* <p>Requirement types are 1:1 with processors, each type may only have one processor associated with it.
*
* <p>Processors must be re-registered with each load.
*
* <p>Example requirement block, which might appear in a spell, ... | 3.26 |
MagicPlugin_PreLoadEvent_registerTeamProvider_rdh | /**
* Register a TeamProvider, to be able to make decisions about who players and mobs can target.
*
* @param provider
* The provider to add.
*/
public void registerTeamProvider(TeamProvider provider) {
teamProviders.add(provider);
} | 3.26 |
MagicPlugin_PreLoadEvent_registerEntityTargetingManager_rdh | /**
* Register an EntityTargetingProvider, for determining when one entity may target another with spells.
*
* @param manager
* The manager to add.
*/
public void registerEntityTargetingManager(EntityTargetingManager manager) {
f0.add(manager);
} | 3.26 |
MagicPlugin_PreLoadEvent_registerBlockBlockManager_rdh | /**
* Register a BlockBreakManager, for controlling whether or not players can break blocks with magic.
*
* @param manager
* The manager to add.
*/
public void registerBlockBlockManager(BlockBreakManager manager) {
blockBreakManagers.add(manager);
} | 3.26 |
MagicPlugin_BlinkSpell_delayTeleport_rdh | /**
* Delay tp by one tick, mainly for effects.
*/
protected void delayTeleport(final Entity entity, final Location location) {
registerMoved(entity);Bukkit.getScheduler().scheduleSyncDelayedTask(controller.getPlugin(), new Runnable() {
@Override
public void run() {
entity.teleport(location);
... | 3.26 |
MagicPlugin_ActionFactory_construct_rdh | /**
* Constructs a new action from a class name.
*
* @param actionClassName
* The class name of the action.
* @return The constructed action.
* @throws ActionFactoryException
* If no action could be constructed.
*/public static
BaseSpellAction construct(String actionClassName)
throws ActionFactoryException ... | 3.26 |
MagicPlugin_ActionFactory_m0_rdh | /**
* Unregister a resolver.
*
* @param actionResolver
* The action resolver to remove.
* @throws NullPointerException
* When actionResolver is null.
*/
public static void m0(ActionResolver actionResolver) {
Preconditions.checkNotNull(actionResolver);
Iterator<ActionResolver> it = resolvers.iterato... | 3.26 |
MagicPlugin_ActionFactory_getActionResolvers_rdh | /**
*
* @return An unmodifiable list of action resolvers.
*/
public static List<ActionResolver> getActionResolvers() {
return Collections.unmodifiableList(resolvers);
} | 3.26 |
MagicPlugin_ActionFactory_registerResolver_rdh | /**
* Registers an action resolver.
*
* @param actionResolver
* The action resolver to register.
* @param highPriority
* When this is set to true, the resolver is registered such that
* it is used before any of the currently registered resolvers.
* @throws NullPointerException
* When actionResolver is ... | 3.26 |
MagicPlugin_MagicSpawnHandler_process_rdh | /**
* Returns true if the spawn should be cancelled
*/ public boolean process(Plugin plugin, LivingEntity entity) {
List<SpawnRule> entityRules = entityTypeMap.get(entity.getType());
SpawnResult result = processRules(plugin, entity,
entityRules);
if (result == SpawnResult.STOP)
return false;
if (result != Spaw... | 3.26 |
MagicPlugin_URLMap_render_rdh | // Render method override
@Override
public void render(MapView mapView, MapCanvas canvas, Player player) {
if (((animated && (frameTimes != null))
&& (frameTimes.size() > 0)) && controller.isAnimationAllowed()) {
long now = System.currentTimeMillis();
long delay = frameTim... | 3.26 |
MagicPlugin_CompoundAction_addAction_rdh | // These are here for legacy spell support
// via programmatic action building
public void
addAction(SpellAction action) {
addAction(action, null);
} | 3.26 |
MagicPlugin_CustomProjectileAction_m0_rdh | // This is used by EntityProjectile when first spawning the entity
protected Location m0(Location location) {
if (startDistance != 0) {
Vector velocity = location.getDirection().clone().normalize();
location.add(velocity.clone().multiply(startDistance));
}
return location;
} | 3.26 |
MagicPlugin_DirectionUtils_goLeft_rdh | /**
* A helper function to go change a given direction to the direction "to the right".
*
* <p>There's probably some better matrix-y, math-y way to do this.
* It'd be nice if this was in BlockFace.
*
* @param direction
* The current direction
* @return The direction to the left
*/
public static BlockFace goL... | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.