TAG_End tag.
32 | *
33 | * @author Graham Edgecombe
34 | */
35 | public final class EndTag extends Tag {
36 |
37 | /**
38 | * Creates the tag.
39 | */
40 | public EndTag() {
41 | super("");
42 | }
43 |
44 | @Override
45 | public Object getValue() {
46 | return null;
47 | }
48 |
49 | @Override
50 | public String toString() {
51 | return "TAG_End";
52 | }
53 |
54 | }
--------------------------------------------------------------------------------
/src/main/java/com/larryTheCoder/events/SkyBlockPlayerEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Adapted from the Wizardry License
3 | *
4 | * Copyright (c) 2016-2020 larryTheCoder and contributors
5 | *
6 | * Permission is hereby granted to any persons and/or organizations
7 | * using this software to copy, modify, merge, publish, and distribute it.
8 | * Said persons and/or organizations are not allowed to use the software or
9 | * any derivatives of the work for commercial use or any other means to generate
10 | * income, nor are they allowed to claim this software as their own.
11 | *
12 | * The persons and/or organizations are also disallowed from sub-licensing
13 | * and/or trademarking this software without explicit permission from larryTheCoder.
14 | *
15 | * Any persons and/or organizations using this software must disclose their
16 | * source code and have it publicly available, include this license,
17 | * provide sufficient credit to the original authors of the project (IE: larryTheCoder),
18 | * as well as provide a link to the original project.
19 | *
20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR
22 | * PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
25 | * USE OR OTHER DEALINGS IN THE SOFTWARE.
26 | */
27 |
28 | package com.larryTheCoder.events;
29 |
30 | import cn.nukkit.Player;
31 | import com.larryTheCoder.cache.IslandData;
32 | import lombok.Getter;
33 |
34 | public class SkyBlockPlayerEvent extends SkyBlockEvent {
35 |
36 | /**
37 | * The player class
38 | */
39 | @Getter
40 | private final Player player;
41 |
42 | public SkyBlockPlayerEvent(Player player, IslandData island) {
43 | super(island);
44 |
45 | this.player = player;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/main/java/com/larryTheCoder/events/IslandCalculateLevelEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Adapted from the Wizardry License
3 | *
4 | * Copyright (c) 2016-2020 larryTheCoder and contributors
5 | *
6 | * Permission is hereby granted to any persons and/or organizations
7 | * using this software to copy, modify, merge, publish, and distribute it.
8 | * Said persons and/or organizations are not allowed to use the software or
9 | * any derivatives of the work for commercial use or any other means to generate
10 | * income, nor are they allowed to claim this software as their own.
11 | *
12 | * The persons and/or organizations are also disallowed from sub-licensing
13 | * and/or trademarking this software without explicit permission from larryTheCoder.
14 | *
15 | * Any persons and/or organizations using this software must disclose their
16 | * source code and have it publicly available, include this license,
17 | * provide sufficient credit to the original authors of the project (IE: larryTheCoder),
18 | * as well as provide a link to the original project.
19 | *
20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR
22 | * PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
25 | * USE OR OTHER DEALINGS IN THE SOFTWARE.
26 | */
27 |
28 | package com.larryTheCoder.events;
29 |
30 | import cn.nukkit.event.Cancellable;
31 | import com.larryTheCoder.cache.IslandData;
32 |
33 | /**
34 | * An island level calculation event. This event will be called before
35 | * the island is being calculated, you can cancel this event if its needed.
36 | */
37 | public class IslandCalculateLevelEvent extends SkyBlockEvent implements Cancellable {
38 | public IslandCalculateLevelEvent(IslandData island) {
39 | super(island);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/main/java/com/larryTheCoder/utils/Pair.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Adapted from the Wizardry License
3 | *
4 | * Copyright (c) 2016-2020 larryTheCoder and contributors
5 | *
6 | * Permission is hereby granted to any persons and/or organizations
7 | * using this software to copy, modify, merge, publish, and distribute it.
8 | * Said persons and/or organizations are not allowed to use the software or
9 | * any derivatives of the work for commercial use or any other means to generate
10 | * income, nor are they allowed to claim this software as their own.
11 | *
12 | * The persons and/or organizations are also disallowed from sub-licensing
13 | * and/or trademarking this software without explicit permission from larryTheCoder.
14 | *
15 | * Any persons and/or organizations using this software must disclose their
16 | * source code and have it publicly available, include this license,
17 | * provide sufficient credit to the original authors of the project (IE: larryTheCoder),
18 | * as well as provide a link to the original project.
19 | *
20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR
22 | * PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
25 | * USE OR OTHER DEALINGS IN THE SOFTWARE.
26 | */
27 | package com.larryTheCoder.utils;
28 |
29 | public class Pair {
30 | private final int left;
31 | private final int right;
32 |
33 | public Pair(int left, int right) {
34 | this.left = left;
35 | this.right = right;
36 | }
37 |
38 | public int getLeft() {
39 | return left;
40 | }
41 |
42 | public int getRight() {
43 | return right;
44 | }
45 |
46 | @Override
47 | public boolean equals(Object o) {
48 | if (o == null)
49 | return false;
50 | if (!(o instanceof Pair))
51 | return false;
52 | Pair pairo = (Pair) o;
53 | return (this.left == pairo.getLeft()) && (this.right == pairo.getRight());
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/src/main/java/com/larryTheCoder/utils/BlockUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Adapted from the Wizardry License
3 | *
4 | * Copyright (c) 2016-2020 larryTheCoder and contributors
5 | *
6 | * Permission is hereby granted to any persons and/or organizations
7 | * using this software to copy, modify, merge, publish, and distribute it.
8 | * Said persons and/or organizations are not allowed to use the software or
9 | * any derivatives of the work for commercial use or any other means to generate
10 | * income, nor are they allowed to claim this software as their own.
11 | *
12 | * The persons and/or organizations are also disallowed from sub-licensing
13 | * and/or trademarking this software without explicit permission from larryTheCoder.
14 | *
15 | * Any persons and/or organizations using this software must disclose their
16 | * source code and have it publicly available, include this license,
17 | * provide sufficient credit to the original authors of the project (IE: larryTheCoder),
18 | * as well as provide a link to the original project.
19 | *
20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR
22 | * PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
25 | * USE OR OTHER DEALINGS IN THE SOFTWARE.
26 | */
27 | package com.larryTheCoder.utils;
28 |
29 | import cn.nukkit.block.Block;
30 |
31 | import java.util.Arrays;
32 | import java.util.Collection;
33 |
34 | /**
35 | * @author larryTheCoder
36 | */
37 | public enum BlockUtil {
38 | ;
39 | private static final CollectionTAG_Int tag.
32 | *
33 | * @author Graham Edgecombe
34 | */
35 | public final class IntTag extends Tag {
36 |
37 | /**
38 | * The value.
39 | */
40 | private final int value;
41 |
42 | /**
43 | * Creates the tag.
44 | *
45 | * @param name The name.
46 | * @param value The value.
47 | */
48 | public IntTag(String name, int value) {
49 | super(name);
50 | this.value = value;
51 | }
52 |
53 | @Override
54 | public Integer getValue() {
55 | return value;
56 | }
57 |
58 | @Override
59 | public String toString() {
60 | String name = getName();
61 | String append = "";
62 | if (name != null && !name.equals("")) {
63 | append = "(\"" + this.getName() + "\")";
64 | }
65 | return "TAG_Int" + append + ": " + value;
66 | }
67 |
68 | }
--------------------------------------------------------------------------------
/src/main/java/org/jnbt/ByteTag.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Adapted from the Wizardry License
3 | *
4 | * Copyright (c) 2016-2020 larryTheCoder and contributors
5 | *
6 | * Permission is hereby granted to any persons and/or organizations
7 | * using this software to copy, modify, merge, publish, and distribute it.
8 | * Said persons and/or organizations are not allowed to use the software or
9 | * any derivatives of the work for commercial use or any other means to generate
10 | * income, nor are they allowed to claim this software as their own.
11 | *
12 | * The persons and/or organizations are also disallowed from sub-licensing
13 | * and/or trademarking this software without explicit permission from larryTheCoder.
14 | *
15 | * Any persons and/or organizations using this software must disclose their
16 | * source code and have it publicly available, include this license,
17 | * provide sufficient credit to the original authors of the project (IE: larryTheCoder),
18 | * as well as provide a link to the original project.
19 | *
20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR
22 | * PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
25 | * USE OR OTHER DEALINGS IN THE SOFTWARE.
26 | */
27 |
28 | package org.jnbt;
29 |
30 | /**
31 | * The TAG_Byte tag.
32 | *
33 | * @author Graham Edgecombe
34 | */
35 | public final class ByteTag extends Tag {
36 |
37 | /**
38 | * The value.
39 | */
40 | private final byte value;
41 |
42 | /**
43 | * Creates the tag.
44 | *
45 | * @param name The name.
46 | * @param value The value.
47 | */
48 | public ByteTag(String name, byte value) {
49 | super(name);
50 | this.value = value;
51 | }
52 |
53 | @Override
54 | public Byte getValue() {
55 | return value;
56 | }
57 |
58 | @Override
59 | public String toString() {
60 | String name = getName();
61 | String append = "";
62 | if (name != null && !name.equals("")) {
63 | append = "(\"" + this.getName() + "\")";
64 | }
65 | return "TAG_Byte" + append + ": " + value;
66 | }
67 |
68 | }
--------------------------------------------------------------------------------
/src/main/java/org/jnbt/LongTag.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Adapted from the Wizardry License
3 | *
4 | * Copyright (c) 2016-2020 larryTheCoder and contributors
5 | *
6 | * Permission is hereby granted to any persons and/or organizations
7 | * using this software to copy, modify, merge, publish, and distribute it.
8 | * Said persons and/or organizations are not allowed to use the software or
9 | * any derivatives of the work for commercial use or any other means to generate
10 | * income, nor are they allowed to claim this software as their own.
11 | *
12 | * The persons and/or organizations are also disallowed from sub-licensing
13 | * and/or trademarking this software without explicit permission from larryTheCoder.
14 | *
15 | * Any persons and/or organizations using this software must disclose their
16 | * source code and have it publicly available, include this license,
17 | * provide sufficient credit to the original authors of the project (IE: larryTheCoder),
18 | * as well as provide a link to the original project.
19 | *
20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR
22 | * PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
25 | * USE OR OTHER DEALINGS IN THE SOFTWARE.
26 | */
27 |
28 | package org.jnbt;
29 |
30 | /**
31 | * The TAG_Long tag.
32 | *
33 | * @author Graham Edgecombe
34 | */
35 | public final class LongTag extends Tag {
36 |
37 | /**
38 | * The value.
39 | */
40 | private final long value;
41 |
42 | /**
43 | * Creates the tag.
44 | *
45 | * @param name The name.
46 | * @param value The value.
47 | */
48 | public LongTag(String name, long value) {
49 | super(name);
50 | this.value = value;
51 | }
52 |
53 | @Override
54 | public Long getValue() {
55 | return value;
56 | }
57 |
58 | @Override
59 | public String toString() {
60 | String name = getName();
61 | String append = "";
62 | if (name != null && !name.equals("")) {
63 | append = "(\"" + this.getName() + "\")";
64 | }
65 | return "TAG_Long" + append + ": " + value;
66 | }
67 |
68 | }
--------------------------------------------------------------------------------
/src/main/java/org/jnbt/FloatTag.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Adapted from the Wizardry License
3 | *
4 | * Copyright (c) 2016-2020 larryTheCoder and contributors
5 | *
6 | * Permission is hereby granted to any persons and/or organizations
7 | * using this software to copy, modify, merge, publish, and distribute it.
8 | * Said persons and/or organizations are not allowed to use the software or
9 | * any derivatives of the work for commercial use or any other means to generate
10 | * income, nor are they allowed to claim this software as their own.
11 | *
12 | * The persons and/or organizations are also disallowed from sub-licensing
13 | * and/or trademarking this software without explicit permission from larryTheCoder.
14 | *
15 | * Any persons and/or organizations using this software must disclose their
16 | * source code and have it publicly available, include this license,
17 | * provide sufficient credit to the original authors of the project (IE: larryTheCoder),
18 | * as well as provide a link to the original project.
19 | *
20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR
22 | * PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
25 | * USE OR OTHER DEALINGS IN THE SOFTWARE.
26 | */
27 |
28 | package org.jnbt;
29 |
30 | /**
31 | * The TAG_Float tag.
32 | *
33 | * @author Graham Edgecombe
34 | */
35 | public final class FloatTag extends Tag {
36 |
37 | /**
38 | * The value.
39 | */
40 | private final float value;
41 |
42 | /**
43 | * Creates the tag.
44 | *
45 | * @param name The name.
46 | * @param value The value.
47 | */
48 | public FloatTag(String name, float value) {
49 | super(name);
50 | this.value = value;
51 | }
52 |
53 | @Override
54 | public Float getValue() {
55 | return value;
56 | }
57 |
58 | @Override
59 | public String toString() {
60 | String name = getName();
61 | String append = "";
62 | if (name != null && !name.equals("")) {
63 | append = "(\"" + this.getName() + "\")";
64 | }
65 | return "TAG_Float" + append + ": " + value;
66 | }
67 |
68 | }
--------------------------------------------------------------------------------
/src/main/java/org/jnbt/ShortTag.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Adapted from the Wizardry License
3 | *
4 | * Copyright (c) 2016-2020 larryTheCoder and contributors
5 | *
6 | * Permission is hereby granted to any persons and/or organizations
7 | * using this software to copy, modify, merge, publish, and distribute it.
8 | * Said persons and/or organizations are not allowed to use the software or
9 | * any derivatives of the work for commercial use or any other means to generate
10 | * income, nor are they allowed to claim this software as their own.
11 | *
12 | * The persons and/or organizations are also disallowed from sub-licensing
13 | * and/or trademarking this software without explicit permission from larryTheCoder.
14 | *
15 | * Any persons and/or organizations using this software must disclose their
16 | * source code and have it publicly available, include this license,
17 | * provide sufficient credit to the original authors of the project (IE: larryTheCoder),
18 | * as well as provide a link to the original project.
19 | *
20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR
22 | * PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
25 | * USE OR OTHER DEALINGS IN THE SOFTWARE.
26 | */
27 |
28 | package org.jnbt;
29 |
30 | /**
31 | * The TAG_Short tag.
32 | *
33 | * @author Graham Edgecombe
34 | */
35 | public final class ShortTag extends Tag {
36 |
37 | /**
38 | * The value.
39 | */
40 | private final short value;
41 |
42 | /**
43 | * Creates the tag.
44 | *
45 | * @param name The name.
46 | * @param value The value.
47 | */
48 | public ShortTag(String name, short value) {
49 | super(name);
50 | this.value = value;
51 | }
52 |
53 | @Override
54 | public Short getValue() {
55 | return value;
56 | }
57 |
58 | @Override
59 | public String toString() {
60 | String name = getName();
61 | String append = "";
62 | if (name != null && !name.equals("")) {
63 | append = "(\"" + this.getName() + "\")";
64 | }
65 | return "TAG_Short" + append + ": " + value;
66 | }
67 |
68 | }
--------------------------------------------------------------------------------
/src/main/java/org/jnbt/DoubleTag.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Adapted from the Wizardry License
3 | *
4 | * Copyright (c) 2016-2020 larryTheCoder and contributors
5 | *
6 | * Permission is hereby granted to any persons and/or organizations
7 | * using this software to copy, modify, merge, publish, and distribute it.
8 | * Said persons and/or organizations are not allowed to use the software or
9 | * any derivatives of the work for commercial use or any other means to generate
10 | * income, nor are they allowed to claim this software as their own.
11 | *
12 | * The persons and/or organizations are also disallowed from sub-licensing
13 | * and/or trademarking this software without explicit permission from larryTheCoder.
14 | *
15 | * Any persons and/or organizations using this software must disclose their
16 | * source code and have it publicly available, include this license,
17 | * provide sufficient credit to the original authors of the project (IE: larryTheCoder),
18 | * as well as provide a link to the original project.
19 | *
20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR
22 | * PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
25 | * USE OR OTHER DEALINGS IN THE SOFTWARE.
26 | */
27 |
28 | package org.jnbt;
29 |
30 | /**
31 | * The TAG_Double tag.
32 | *
33 | * @author Graham Edgecombe
34 | */
35 | public final class DoubleTag extends Tag {
36 |
37 | /**
38 | * The value.
39 | */
40 | private final double value;
41 |
42 | /**
43 | * Creates the tag.
44 | *
45 | * @param name The name.
46 | * @param value The value.
47 | */
48 | public DoubleTag(String name, double value) {
49 | super(name);
50 | this.value = value;
51 | }
52 |
53 | @Override
54 | public Double getValue() {
55 | return value;
56 | }
57 |
58 | @Override
59 | public String toString() {
60 | String name = getName();
61 | String append = "";
62 | if (name != null && !name.equals("")) {
63 | append = "(\"" + this.getName() + "\")";
64 | }
65 | return "TAG_Double" + append + ": " + value;
66 | }
67 |
68 | }
--------------------------------------------------------------------------------
/src/main/java/org/jnbt/StringTag.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Adapted from the Wizardry License
3 | *
4 | * Copyright (c) 2016-2020 larryTheCoder and contributors
5 | *
6 | * Permission is hereby granted to any persons and/or organizations
7 | * using this software to copy, modify, merge, publish, and distribute it.
8 | * Said persons and/or organizations are not allowed to use the software or
9 | * any derivatives of the work for commercial use or any other means to generate
10 | * income, nor are they allowed to claim this software as their own.
11 | *
12 | * The persons and/or organizations are also disallowed from sub-licensing
13 | * and/or trademarking this software without explicit permission from larryTheCoder.
14 | *
15 | * Any persons and/or organizations using this software must disclose their
16 | * source code and have it publicly available, include this license,
17 | * provide sufficient credit to the original authors of the project (IE: larryTheCoder),
18 | * as well as provide a link to the original project.
19 | *
20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR
22 | * PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
25 | * USE OR OTHER DEALINGS IN THE SOFTWARE.
26 | */
27 |
28 | package org.jnbt;
29 |
30 | /**
31 | * The TAG_String tag.
32 | *
33 | * @author Graham Edgecombe
34 | */
35 | public final class StringTag extends Tag {
36 |
37 | /**
38 | * The value.
39 | */
40 | private final String value;
41 |
42 | /**
43 | * Creates the tag.
44 | *
45 | * @param name The name.
46 | * @param value The value.
47 | */
48 | public StringTag(String name, String value) {
49 | super(name);
50 | this.value = value;
51 | }
52 |
53 | @Override
54 | public String getValue() {
55 | return value;
56 | }
57 |
58 | @Override
59 | public String toString() {
60 | String name = getName();
61 | String append = "";
62 | if (name != null && !name.equals("")) {
63 | append = "(\"" + this.getName() + "\")";
64 | }
65 | return "TAG_String" + append + ": " + value;
66 | }
67 |
68 | }
--------------------------------------------------------------------------------
/src/main/java/com/larryTheCoder/events/IslandEnterEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Adapted from the Wizardry License
3 | *
4 | * Copyright (c) 2016-2020 larryTheCoder and contributors
5 | *
6 | * Permission is hereby granted to any persons and/or organizations
7 | * using this software to copy, modify, merge, publish, and distribute it.
8 | * Said persons and/or organizations are not allowed to use the software or
9 | * any derivatives of the work for commercial use or any other means to generate
10 | * income, nor are they allowed to claim this software as their own.
11 | *
12 | * The persons and/or organizations are also disallowed from sub-licensing
13 | * and/or trademarking this software without explicit permission from larryTheCoder.
14 | *
15 | * Any persons and/or organizations using this software must disclose their
16 | * source code and have it publicly available, include this license,
17 | * provide sufficient credit to the original authors of the project (IE: larryTheCoder),
18 | * as well as provide a link to the original project.
19 | *
20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR
22 | * PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
25 | * USE OR OTHER DEALINGS IN THE SOFTWARE.
26 | */
27 | package com.larryTheCoder.events;
28 |
29 | import cn.nukkit.Player;
30 | import cn.nukkit.level.Location;
31 | import com.larryTheCoder.cache.IslandData;
32 | import lombok.Getter;
33 |
34 | /**
35 | * Fired when a player enters an island's area
36 | *
37 | * @author larryTheCoder
38 | * @author tastybento
39 | */
40 | public class IslandEnterEvent extends SkyBlockPlayerEvent {
41 |
42 | /**
43 | * Location of where the player entered the island or tried to enter
44 | */
45 | @Getter
46 | private final Location location;
47 |
48 | /**
49 | * Called to create the event
50 | *
51 | * @param island The island where the player is entering to
52 | * @param loc Location of where the player entered the island or tried to enter
53 | */
54 | public IslandEnterEvent(Player player, IslandData island, Location loc) {
55 | super(player, island);
56 | this.location = loc;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/main/java/com/larryTheCoder/events/IslandExitEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Adapted from the Wizardry License
3 | *
4 | * Copyright (c) 2016-2020 larryTheCoder and contributors
5 | *
6 | * Permission is hereby granted to any persons and/or organizations
7 | * using this software to copy, modify, merge, publish, and distribute it.
8 | * Said persons and/or organizations are not allowed to use the software or
9 | * any derivatives of the work for commercial use or any other means to generate
10 | * income, nor are they allowed to claim this software as their own.
11 | *
12 | * The persons and/or organizations are also disallowed from sub-licensing
13 | * and/or trademarking this software without explicit permission from larryTheCoder.
14 | *
15 | * Any persons and/or organizations using this software must disclose their
16 | * source code and have it publicly available, include this license,
17 | * provide sufficient credit to the original authors of the project (IE: larryTheCoder),
18 | * as well as provide a link to the original project.
19 | *
20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR
22 | * PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
25 | * USE OR OTHER DEALINGS IN THE SOFTWARE.
26 | */
27 | package com.larryTheCoder.events;
28 |
29 | import cn.nukkit.Player;
30 | import cn.nukkit.level.Location;
31 | import com.larryTheCoder.cache.IslandData;
32 | import lombok.Getter;
33 |
34 | /**
35 | * Fired when a player exits an island's protected area
36 | *
37 | * @author larryTheCoder
38 | * @author tastybento
39 | */
40 | public class IslandExitEvent extends SkyBlockPlayerEvent {
41 |
42 | /**
43 | * Location of where the player exited the island's protected area.
44 | */
45 | @Getter
46 | private final Location location;
47 |
48 | /**
49 | * @param player The player who is leaving the island
50 | * @param island The island that the player is leaving
51 | * @param location Location of where the player exited the island's protected area
52 | */
53 | public IslandExitEvent(Player player, IslandData island, Location location) {
54 | super(player, island);
55 | this.location = location;
56 | }
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/src/main/java/org/jnbt/NBTConstants.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Adapted from the Wizardry License
3 | *
4 | * Copyright (c) 2016-2020 larryTheCoder and contributors
5 | *
6 | * Permission is hereby granted to any persons and/or organizations
7 | * using this software to copy, modify, merge, publish, and distribute it.
8 | * Said persons and/or organizations are not allowed to use the software or
9 | * any derivatives of the work for commercial use or any other means to generate
10 | * income, nor are they allowed to claim this software as their own.
11 | *
12 | * The persons and/or organizations are also disallowed from sub-licensing
13 | * and/or trademarking this software without explicit permission from larryTheCoder.
14 | *
15 | * Any persons and/or organizations using this software must disclose their
16 | * source code and have it publicly available, include this license,
17 | * provide sufficient credit to the original authors of the project (IE: larryTheCoder),
18 | * as well as provide a link to the original project.
19 | *
20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR
22 | * PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
25 | * USE OR OTHER DEALINGS IN THE SOFTWARE.
26 | */
27 |
28 | package org.jnbt;
29 |
30 | import java.nio.charset.Charset;
31 | import java.nio.charset.StandardCharsets;
32 |
33 | /**
34 | * A class which holds constant values.
35 | *
36 | * @author Graham Edgecombe
37 | */
38 | public final class NBTConstants {
39 |
40 | /**
41 | * The character set used by NBT (UTF-8).
42 | */
43 | public static final Charset CHARSET = StandardCharsets.UTF_8;
44 |
45 | /**
46 | * Tag type constants.
47 | */
48 | public static final int
49 | TYPE_END = 0x0,
50 | TYPE_BYTE = 0x1,
51 | TYPE_SHORT = 0x2,
52 | TYPE_INT = 0x3,
53 | TYPE_LONG = 0x4,
54 | TYPE_FLOAT = 0x5,
55 | TYPE_DOUBLE = 0x6,
56 | TYPE_BYTE_ARRAY = 0x7,
57 | TYPE_STRING = 0x8,
58 | TYPE_LIST = 0x9,
59 | TYPE_COMPOUND = 0xa;
60 |
61 | /**
62 | * Default private constructor.
63 | */
64 | private NBTConstants() {
65 |
66 | }
67 |
68 | }
--------------------------------------------------------------------------------
/src/main/java/com/larryTheCoder/utils/integration/economy/EconomyAPI.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Adapted from the Wizardry License
3 | *
4 | * Copyright (c) 2016-2020 larryTheCoder and contributors
5 | *
6 | * Permission is hereby granted to any persons and/or organizations
7 | * using this software to copy, modify, merge, publish, and distribute it.
8 | * Said persons and/or organizations are not allowed to use the software or
9 | * any derivatives of the work for commercial use or any other means to generate
10 | * income, nor are they allowed to claim this software as their own.
11 | *
12 | * The persons and/or organizations are also disallowed from sub-licensing
13 | * and/or trademarking this software without explicit permission from larryTheCoder.
14 | *
15 | * Any persons and/or organizations using this software must disclose their
16 | * source code and have it publicly available, include this license,
17 | * provide sufficient credit to the original authors of the project (IE: larryTheCoder),
18 | * as well as provide a link to the original project.
19 | *
20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR
22 | * PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
25 | * USE OR OTHER DEALINGS IN THE SOFTWARE.
26 | */
27 | package com.larryTheCoder.utils.integration.economy;
28 |
29 | import cn.nukkit.Player;
30 |
31 | /**
32 | * @author larryTheCoder
33 | */
34 | public class EconomyAPI implements Economy {
35 |
36 | @Override
37 | public boolean reduceMoney(Player p, double amount) {
38 | double money = me.onebone.economyapi.EconomyAPI.getInstance().myMoney(p);
39 | if (money < amount) {
40 | int ret = me.onebone.economyapi.EconomyAPI.getInstance().reduceMoney(p, amount);
41 | return ret == me.onebone.economyapi.EconomyAPI.RET_SUCCESS;
42 | }
43 | return false;
44 | }
45 |
46 | @Override
47 | public boolean addMoney(Player p, double amount) {
48 | return me.onebone.economyapi.EconomyAPI.getInstance().addMoney(p, amount, true) == me.onebone.economyapi.EconomyAPI.RET_SUCCESS;
49 | }
50 |
51 | @Override
52 | public double getMoney(Player p) {
53 | return me.onebone.economyapi.EconomyAPI.getInstance().myMoney(p);
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/src/main/java/com/larryTheCoder/utils/integration/luckperms/InternalPermission.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Adapted from the Wizardry License
3 | *
4 | * Copyright (c) 2016-2020 larryTheCoder and contributors
5 | *
6 | * Permission is hereby granted to any persons and/or organizations
7 | * using this software to copy, modify, merge, publish, and distribute it.
8 | * Said persons and/or organizations are not allowed to use the software or
9 | * any derivatives of the work for commercial use or any other means to generate
10 | * income, nor are they allowed to claim this software as their own.
11 | *
12 | * The persons and/or organizations are also disallowed from sub-licensing
13 | * and/or trademarking this software without explicit permission from larryTheCoder.
14 | *
15 | * Any persons and/or organizations using this software must disclose their
16 | * source code and have it publicly available, include this license,
17 | * provide sufficient credit to the original authors of the project (IE: larryTheCoder),
18 | * as well as provide a link to the original project.
19 | *
20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR
22 | * PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
25 | * USE OR OTHER DEALINGS IN THE SOFTWARE.
26 | */
27 |
28 | package com.larryTheCoder.utils.integration.luckperms;
29 |
30 | import cn.nukkit.Player;
31 | import cn.nukkit.Server;
32 | import cn.nukkit.command.CommandSender;
33 | import cn.nukkit.permission.PermissionAttachmentInfo;
34 |
35 | import java.util.HashMap;
36 | import java.util.Map;
37 |
38 | public class InternalPermission extends Permission {
39 |
40 | @Override
41 | public boolean hasPermission(CommandSender player, String permission) {
42 | return player.hasPermission(permission);
43 | }
44 |
45 | @Override
46 | public MapTAG_Byte_Array tag.
32 | *
33 | * @author Graham Edgecombe
34 | */
35 | public final class ByteArrayTag extends Tag {
36 |
37 | /**
38 | * The value.
39 | */
40 | private final byte[] value;
41 |
42 | /**
43 | * Creates the tag.
44 | *
45 | * @param name The name.
46 | * @param value The value.
47 | */
48 | public ByteArrayTag(String name, byte[] value) {
49 | super(name);
50 | this.value = value;
51 | }
52 |
53 | @Override
54 | public byte[] getValue() {
55 | return value;
56 | }
57 |
58 | @Override
59 | public String toString() {
60 | StringBuilder hex = new StringBuilder();
61 | for (byte b : value) {
62 | String hexDigits = Integer.toHexString(b).toUpperCase();
63 | if (hexDigits.length() == 1) {
64 | hex.append("0");
65 | }
66 | hex.append(hexDigits).append(" ");
67 | }
68 | String name = getName();
69 | String append = "";
70 | if (name != null && !name.equals("")) {
71 | append = "(\"" + this.getName() + "\")";
72 | }
73 | return "TAG_Byte_Array" + append + ": " + hex.toString();
74 | }
75 |
76 | }
--------------------------------------------------------------------------------
/src/main/java/com/larryTheCoder/database/config/AbstractConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Adapted from the Wizardry License
3 | *
4 | * Copyright (c) 2016-2020 larryTheCoder and contributors
5 | *
6 | * Permission is hereby granted to any persons and/or organizations
7 | * using this software to copy, modify, merge, publish, and distribute it.
8 | * Said persons and/or organizations are not allowed to use the software or
9 | * any derivatives of the work for commercial use or any other means to generate
10 | * income, nor are they allowed to claim this software as their own.
11 | *
12 | * The persons and/or organizations are also disallowed from sub-licensing
13 | * and/or trademarking this software without explicit permission from larryTheCoder.
14 | *
15 | * Any persons and/or organizations using this software must disclose their
16 | * source code and have it publicly available, include this license,
17 | * provide sufficient credit to the original authors of the project (IE: larryTheCoder),
18 | * as well as provide a link to the original project.
19 | *
20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR
22 | * PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
25 | * USE OR OTHER DEALINGS IN THE SOFTWARE.
26 | */
27 | package com.larryTheCoder.database.config;
28 |
29 | import org.sql2o.Sql2o;
30 |
31 | import java.sql.SQLException;
32 |
33 | /**
34 | * @author larryTheCoder
35 | */
36 | public interface AbstractConfig {
37 |
38 | Sql2o forceConnection();
39 |
40 | /**
41 | * Opens a connection with the database.
42 | *
43 | * @return Opened connection
44 | * @throws SQLException if the connection can not be opened
45 | * @throws ClassNotFoundException if the driver cannot be found
46 | */
47 | Sql2o openConnection() throws SQLException, ClassNotFoundException;
48 |
49 | /**
50 | * Checks if a connection is open with the database.
51 | *
52 | * @return true if the connection is open
53 | * @throws SQLException if the connection cannot be checked
54 | */
55 | boolean checkConnection() throws SQLException;
56 |
57 | /**
58 | * Gets the connection with the database.
59 | *
60 | * @return Connection with the database, null if none
61 | */
62 | Sql2o getConnection();
63 |
64 | /**
65 | * Closes the connection with the database.
66 | *
67 | * @return true if successful
68 | * @throws SQLException if the connection cannot be closed
69 | */
70 | boolean closeConnection() throws SQLException;
71 | }
72 |
--------------------------------------------------------------------------------
/src/main/java/org/jnbt/CompoundTag.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Adapted from the Wizardry License
3 | *
4 | * Copyright (c) 2016-2020 larryTheCoder and contributors
5 | *
6 | * Permission is hereby granted to any persons and/or organizations
7 | * using this software to copy, modify, merge, publish, and distribute it.
8 | * Said persons and/or organizations are not allowed to use the software or
9 | * any derivatives of the work for commercial use or any other means to generate
10 | * income, nor are they allowed to claim this software as their own.
11 | *
12 | * The persons and/or organizations are also disallowed from sub-licensing
13 | * and/or trademarking this software without explicit permission from larryTheCoder.
14 | *
15 | * Any persons and/or organizations using this software must disclose their
16 | * source code and have it publicly available, include this license,
17 | * provide sufficient credit to the original authors of the project (IE: larryTheCoder),
18 | * as well as provide a link to the original project.
19 | *
20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR
22 | * PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
25 | * USE OR OTHER DEALINGS IN THE SOFTWARE.
26 | */
27 |
28 | package org.jnbt;
29 |
30 | import java.util.Collections;
31 | import java.util.Map;
32 |
33 | /**
34 | * The TAG_Compound tag.
35 | *
36 | * @author Graham Edgecombe
37 | */
38 | public final class CompoundTag extends Tag {
39 |
40 | /**
41 | * The value.
42 | */
43 | private final MapTAG_List tag.
35 | *
36 | * @author Graham Edgecombe
37 | */
38 | public final class ListTag extends Tag {
39 |
40 | /**
41 | * The type.
42 | */
43 | private final Class extends Tag> type;
44 |
45 | /**
46 | * The value.
47 | */
48 | private final List43 | * SubCommand was a class where commands are being separated from the base command. 44 | * However, if a new command need to be added, a new class extending SubCommand class is needed 45 | * in order to have full functionality of the command. 46 | *
47 | * This class adds all commands into few different categories where the commands can be added
48 | * or removed within category class at the same time without having to create another SubCommand class.
49 | */
50 | public abstract class SubCategory {
51 |
52 | @Getter
53 | private final ASkyBlock plugin;
54 |
55 | protected SubCategory(ASkyBlock plugin) {
56 | Preconditions.checkNotNull(plugin, "ASkyBlock cannot be nullified");
57 |
58 | this.plugin = plugin;
59 | }
60 |
61 | protected LocaleInstance getLocale(Player key) {
62 | return plugin.getLocale(key);
63 | }
64 |
65 | protected String getPrefix() {
66 | return plugin.getPrefix();
67 | }
68 |
69 | public List
42 | * The commands are as follows:
43 | * - /is chat => Allows members to chat within their member teams.
44 | * - /is messages => Get the news from a server/leader.
45 | *
46 | * This category is TBD.
47 | */
48 | public class ChatCategory extends SubCategory {
49 |
50 | public ChatCategory(ASkyBlock plugin) {
51 | super(plugin);
52 | }
53 |
54 | @Override
55 | public List