Java Code Examples for org.bukkit.plugin.java.JavaPlugin#getPlugin()

The following examples show how to use org.bukkit.plugin.java.JavaPlugin#getPlugin() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SelectionCommandExecutor.java    From AstralEdit with Apache License 2.0 6 votes vote down vote up
/**
 * Initializes the commandExecutor.
 *
 * @param manager manager
 */
public SelectionCommandExecutor(SelectionManager manager) {
    super("awe", JavaPlugin.getPlugin(AstralEditPlugin.class));

    this.commands.add(new RenderCommand(this.plugin));
    this.commands.add(new AutoFollowCommand(manager));
    this.commands.add(new AutoRotateCommand(manager));
    this.commands.add(new RotateCommand(manager, this.plugin));
    this.commands.add(new UpsidedownCommand(manager, this.plugin));
    this.commands.add(new MoveCommand(manager, this.plugin));
    this.commands.add(new AnglesCommand(manager, this.plugin));
    this.commands.add(new JoinCommand(manager, this.plugin));
    this.commands.add(new TearCommand(manager, this.plugin));
    this.commands.add(new UndoCommand(manager, this.plugin));
    this.commands.add(new HideCommand(manager, this.plugin));
    this.commands.add(new ShowCommand(manager, this.plugin));
    this.commands.add(new ClearCommand(this.plugin, manager));
    this.commands.add(new MirrorCommand(this.plugin, manager));
    this.commands.add(new PlaceCommand(this.plugin, manager));
    this.commands.add(new FlipCommand(this.plugin, manager));
    this.commands.add(new TeleportCommand(manager));
    this.commands.add(new ConvertToBlocksCommand(manager, this.plugin));
    this.commands.add(new ConvertToRenderCommand(this.plugin));
}
 
Example 2
Source File: BukkitPluginResolver.java    From ProjectAres with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public @Nullable <T extends Plugin> T getPlugin(Class<T> cls) {
    try {
        return (T) JavaPlugin.getPlugin(cls.asSubclass(JavaPlugin.class));
    } catch(IllegalArgumentException e) {
        return null;
    }
}
 
Example 3
Source File: HookBentoBox.java    From CombatLogX with GNU General Public License v3.0 5 votes vote down vote up
public static Addon getBSkyBlock() {
    BentoBox bentoBox = JavaPlugin.getPlugin(BentoBox.class);
    AddonsManager manager = bentoBox.getAddonsManager();

    Optional<Addon> addon = manager.getAddonByName("BentoBox");
    return addon.orElse(null);
}
 
Example 4
Source File: ItemLine.java    From Holograms with MIT License 5 votes vote down vote up
@Override
public boolean show() {
    if (isHidden()) {
        HologramPlugin plugin = JavaPlugin.getPlugin(HologramPlugin.class);
        entity = plugin.getEntityController().spawnItemHolder(this, getLocation(), item);
    }
    return true;
}
 
Example 5
Source File: ItemLine.java    From Holograms with MIT License 5 votes vote down vote up
@Override
public double getHeight() {
    HologramPlugin plugin = JavaPlugin.getPlugin(HologramPlugin.class);
    if (plugin.getEntityController().getMinecraftVersion() == MinecraftVersion.V1_8_R1) {
        return 1.60;
    }
    return 0.5;
}
 
Example 6
Source File: TextLine.java    From Holograms with MIT License 5 votes vote down vote up
@Override
public boolean show() {
    if (isHidden()) {
        HologramPlugin plugin = JavaPlugin.getPlugin(HologramPlugin.class);
        nameable = plugin.getEntityController().spawnNameable(this, getLocation());
        nameable.setName(text);
    }
    return true;
}
 
Example 7
Source File: Hologram.java    From Holograms with MIT License 5 votes vote down vote up
@ConstructorProperties({ "id", "location", "persist" })
public Hologram(String id, Location location, boolean persist) {
    Validate.notNull(id, "Hologram id cannot be null");
    Validate.notNull(location, "Hologram location cannot be null");
    this.plugin = JavaPlugin.getPlugin(HologramPlugin.class);
    this.id = id;
    this.location = location;
    this.persist = persist;
}
 
Example 8
Source File: SelectionHolder.java    From AstralEdit with Apache License 2.0 4 votes vote down vote up
private static Plugin getPlugin() {
    return JavaPlugin.getPlugin(AstralEditPlugin.class);
}
 
Example 9
Source File: HookWorldGuard_V6_2.java    From CombatLogX with GNU General Public License v3.0 4 votes vote down vote up
public static WorldGuardPlugin getAPI() {
    return JavaPlugin.getPlugin(WorldGuardPlugin.class);
}
 
Example 10
Source File: HookWorldGuard_V6_1.java    From CombatLogX with GNU General Public License v3.0 4 votes vote down vote up
public static WorldGuardPlugin getAPI() {
    return JavaPlugin.getPlugin(WorldGuardPlugin.class);
}
 
Example 11
Source File: HookGriefPrevention.java    From CombatLogX with GNU General Public License v3.0 4 votes vote down vote up
public static GriefPrevention getAPI() {
    return JavaPlugin.getPlugin(GriefPrevention.class);
}
 
Example 12
Source File: AACAdditionPro.java    From AACAdditionPro with GNU General Public License v3.0 2 votes vote down vote up
/**
 * This will get the object of the plugin registered on the server.
 *
 * @return the active instance of this plugin on the server.
 */
public static AACAdditionPro getInstance()
{
    return JavaPlugin.getPlugin(AACAdditionPro.class);
}