HexoCraft / AddLight

This plugin allow server admin to add invisible light sources
https://dev.bukkit.org/projects/addlight
3 stars 5 forks source link

Add lights without requiring a player? #13

Closed Cryptite closed 7 years ago

Cryptite commented 7 years ago

The way we intend to use this plugin, it'd be superb if we could call create/removeLight without requiring a Player object. This should be fairly trivial, but right now calling with a null player will throw an exception due to the Permissions checks.

hexosse commented 7 years ago

Do you want to create lights with the API or do you want to create/remove lights from the console?

Cryptite commented 7 years ago

With the API.

On Tue, Sep 12, 2017, 6:08 AM hexosse notifications@github.com wrote:

Do you want to create lights with the API or do you want to create/remove lights from the console?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/HexoCraft/AddLight/issues/13#issuecomment-328820321, or mute the thread https://github.com/notifications/unsubscribe-auth/AAYZaRaj-EskulYqf3vbLEaAz7FMRIiKks5shmZAgaJpZM4PRKhE .

hexosse commented 7 years ago

ok so just use :

  Lights.createLight(final Location location, final int light)
  Lights.createLight(final List<Location> locations, final int light)

and

  Lights.removeLight(final Location location)
  Lights.removeLight(final List<Location> locations)

located in package : com.github.hexocraftapi.lights

You might just want to use my light API : https://github.com/HexoCraftApi/Lights so you don't need to use AddLight plugin.

If this is the case, you can add the API to your plugin

        ...
        <repository>
            <id>hexosse-repo</id>
            <url>https://raw.github.com/hexosse/maven-repo/master/</url>
        </repository>
        ...
        ...
        <dependency>
            <groupId>com.github.hexocraftapi</groupId>
            <artifactId>lights</artifactId>
            <version>[1.0.0, )</version>
        </dependency>
        ...
Cryptite commented 7 years ago

Ah. That works. Didn't know it'd updated to 1.12 so I think I was having some issues with it previously. Thanks!