-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Phase 1: Implementing more events for DEVs
Accidentally did an oopsies with Caching... Bump API core to 31, v0.5.2-BETA Fixed a probable memory leak, perhaps. IslandLevelCalculations are now LIVE! GET MORE BLOCKS.
- Loading branch information
1 parent
e61fee6
commit bdc607b
Showing
19 changed files
with
289 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
src/main/java/com/larryTheCoder/events/IslandCalculateFinishEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Adapted from the Wizardry License | ||
* | ||
* Copyright (c) 2016-2020 larryTheCoder and contributors | ||
* | ||
* Permission is hereby granted to any persons and/or organizations | ||
* using this software to copy, modify, merge, publish, and distribute it. | ||
* Said persons and/or organizations are not allowed to use the software or | ||
* any derivatives of the work for commercial use or any other means to generate | ||
* income, nor are they allowed to claim this software as their own. | ||
* | ||
* The persons and/or organizations are also disallowed from sub-licensing | ||
* and/or trademarking this software without explicit permission from larryTheCoder. | ||
* | ||
* Any persons and/or organizations using this software must disclose their | ||
* source code and have it publicly available, include this license, | ||
* provide sufficient credit to the original authors of the project (IE: larryTheCoder), | ||
* as well as provide a link to the original project. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, | ||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR | ||
* PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE | ||
* USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
package com.larryTheCoder.events; | ||
|
||
import cn.nukkit.event.Cancellable; | ||
import com.larryTheCoder.cache.IslandData; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
/** | ||
* An event in which the island has successfully calculates their island | ||
* level, this event will be called so that the developers can modify the amount of | ||
* scores that the player's island will get. | ||
*/ | ||
public class IslandCalculateFinishEvent extends SkyBlockEvent implements Cancellable { | ||
|
||
@Getter | ||
private final int lastLevel; | ||
@Getter @Setter | ||
private int islandLevel; | ||
|
||
public IslandCalculateFinishEvent(IslandData island, int islandLevel, int lastLevel) { | ||
super(island); | ||
|
||
this.islandLevel = islandLevel; | ||
this.lastLevel = lastLevel; | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
src/main/java/com/larryTheCoder/events/IslandCalculateLevelEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Adapted from the Wizardry License | ||
* | ||
* Copyright (c) 2016-2020 larryTheCoder and contributors | ||
* | ||
* Permission is hereby granted to any persons and/or organizations | ||
* using this software to copy, modify, merge, publish, and distribute it. | ||
* Said persons and/or organizations are not allowed to use the software or | ||
* any derivatives of the work for commercial use or any other means to generate | ||
* income, nor are they allowed to claim this software as their own. | ||
* | ||
* The persons and/or organizations are also disallowed from sub-licensing | ||
* and/or trademarking this software without explicit permission from larryTheCoder. | ||
* | ||
* Any persons and/or organizations using this software must disclose their | ||
* source code and have it publicly available, include this license, | ||
* provide sufficient credit to the original authors of the project (IE: larryTheCoder), | ||
* as well as provide a link to the original project. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, | ||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR | ||
* PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE | ||
* USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
package com.larryTheCoder.events; | ||
|
||
import cn.nukkit.event.Cancellable; | ||
import com.larryTheCoder.cache.IslandData; | ||
|
||
/** | ||
* An island level calculation event. This event will be called before | ||
* the island is being calculated, you can cancel this event if its needed. | ||
*/ | ||
public class IslandCalculateLevelEvent extends SkyBlockEvent implements Cancellable { | ||
public IslandCalculateLevelEvent(IslandData island) { | ||
super(island); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/main/java/com/larryTheCoder/events/IslandTeleportEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Adapted from the Wizardry License | ||
* | ||
* Copyright (c) 2016-2020 larryTheCoder and contributors | ||
* | ||
* Permission is hereby granted to any persons and/or organizations | ||
* using this software to copy, modify, merge, publish, and distribute it. | ||
* Said persons and/or organizations are not allowed to use the software or | ||
* any derivatives of the work for commercial use or any other means to generate | ||
* income, nor are they allowed to claim this software as their own. | ||
* | ||
* The persons and/or organizations are also disallowed from sub-licensing | ||
* and/or trademarking this software without explicit permission from larryTheCoder. | ||
* | ||
* Any persons and/or organizations using this software must disclose their | ||
* source code and have it publicly available, include this license, | ||
* provide sufficient credit to the original authors of the project (IE: larryTheCoder), | ||
* as well as provide a link to the original project. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, | ||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR | ||
* PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE | ||
* USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
package com.larryTheCoder.events; | ||
|
||
import cn.nukkit.Player; | ||
import cn.nukkit.event.Cancellable; | ||
import cn.nukkit.level.Location; | ||
import com.larryTheCoder.cache.IslandData; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
/** | ||
* This event will be called when the player are attempting to teleport to the | ||
* desired island location. The island can be the player's island or another island. | ||
*/ | ||
public class IslandTeleportEvent extends SkyBlockPlayerEvent implements Cancellable { | ||
|
||
@Getter @Setter | ||
private Location teleportLocation; | ||
|
||
public IslandTeleportEvent(Player player, IslandData island, Location targetLocation) { | ||
super(player, island); | ||
|
||
this.teleportLocation = targetLocation; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/main/java/com/larryTheCoder/events/SkyBlockPlayerEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Adapted from the Wizardry License | ||
* | ||
* Copyright (c) 2016-2020 larryTheCoder and contributors | ||
* | ||
* Permission is hereby granted to any persons and/or organizations | ||
* using this software to copy, modify, merge, publish, and distribute it. | ||
* Said persons and/or organizations are not allowed to use the software or | ||
* any derivatives of the work for commercial use or any other means to generate | ||
* income, nor are they allowed to claim this software as their own. | ||
* | ||
* The persons and/or organizations are also disallowed from sub-licensing | ||
* and/or trademarking this software without explicit permission from larryTheCoder. | ||
* | ||
* Any persons and/or organizations using this software must disclose their | ||
* source code and have it publicly available, include this license, | ||
* provide sufficient credit to the original authors of the project (IE: larryTheCoder), | ||
* as well as provide a link to the original project. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, | ||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR | ||
* PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE | ||
* USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
package com.larryTheCoder.events; | ||
|
||
import cn.nukkit.Player; | ||
import com.larryTheCoder.cache.IslandData; | ||
import lombok.Getter; | ||
|
||
public class SkyBlockPlayerEvent extends SkyBlockEvent { | ||
|
||
/** | ||
* The player class | ||
*/ | ||
@Getter | ||
private final Player player; | ||
|
||
public SkyBlockPlayerEvent(Player player, IslandData island) { | ||
super(island); | ||
|
||
this.player = player; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.