Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Angeschossen authored and Angeschossen committed May 21, 2020
1 parent 5298a3c commit 077d23e
Show file tree
Hide file tree
Showing 21 changed files with 173 additions and 269 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
target
*.iml
target
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.github.Angeschossen</groupId>
<artifactId>LandsAPI</artifactId>
<version>4.5.9.4</version>
<version>4.5.9.3</version>
<name>LandsAPI</name>


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package me.angeschossen.lands.api.integration;

import me.angeschossen.lands.api.land.Land;
import me.angeschossen.lands.api.land.LandArea;
import org.bukkit.Location;
import org.bukkit.plugin.Plugin;

Expand All @@ -22,7 +22,7 @@ private IntegrationExample(Plugin yourPlugin) {

//Just a test
private void test(Location location) {
final Land land = landsAddon.getLand("Test");
final LandArea area = landsAddon.getArea(location);
//Do some stuff.
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@

import me.angeschossen.lands.api.land.Land;
import me.angeschossen.lands.api.land.LandArea;
import me.angeschossen.lands.api.land.LandChunk;
import me.angeschossen.lands.api.land.LandWorld;
import me.angeschossen.lands.api.player.LandPlayer;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.plugin.Plugin;
Expand All @@ -19,88 +17,93 @@

public class LandsIntegration implements LandsIntegrator {


@Deprecated
public LandsIntegration(@NotNull String name, boolean isPublic) {
}

@Deprecated
public LandsIntegration(@NotNull Plugin plugin, boolean isPublic) {

}

public LandsIntegration(@NotNull String name) {
}

public LandsIntegration(@NotNull Plugin plugin) {
}


@Override
public @Nullable LandPlayer getLandPlayer(@NotNull UUID playerUUID) {
public LandPlayer getLandPlayer(@NotNull UUID playerUUID) {
return null;
}

@Override
public @Nullable LandWorld getLandWorld(@NotNull World world) {
@Deprecated
public LandWorld getLandWorld(@NotNull String worldName) {
return null;
}

@Override
public boolean isClaimed(@NotNull Location location) {
return false;
}

@Override
public CompletableFuture<Boolean> isClaimed(@NotNull String worldName, int chunkX, int chunkZ) {
public LandWorld getLandWorld(@NotNull World world) {
return null;
}

@Override
public boolean isClaimed(@NotNull World world, int chunkX, int chunkZ) {
public boolean isClaimed(@NotNull Location location) {
return false;
}


@Override
public @Nullable LandChunk getLandChunk(@NotNull Location location) {
return null;
public boolean isClaimed(@NotNull World world, int x, int z) {
return false;
}

@Override
public Land getLand(@NotNull String worldName, @NotNull String landName) {
@Deprecated
public CompletableFuture<Boolean> isClaimed(@NotNull String worldName, int x, int z) {
return null;
}

@Override
public LandWorld getLandWorld(@NotNull String worldName) {
@Deprecated
public Land getLand(@NotNull String worldName, @NotNull String name) {
return null;
}

@Override
@Nullable
public Land getLand(@NotNull String name) {
return null;
}

@Override
public @Nullable Land getLand(@NotNull Location location) {
@Nullable
public Land getLand(@NotNull Location location) {
return null;
}

@Override
public @Nullable Land getLand(@NotNull World world, int chunkX, int chunkZ) {
@Nullable
public Land getLand(@NotNull World world, int x, int z) {
return null;
}

@Override
public @Nullable LandArea getArea(@NotNull Location location) {
@Nullable
public LandArea getArea(@NotNull Location location) {
return null;
}

@Override
public @Nullable Plugin getPlugin() {
@Nullable
public Plugin getPlugin() {
return null;
}

@Override
public @NotNull String getName() {
@NotNull
public String getName() {
return null;
}

Expand All @@ -110,12 +113,14 @@ public void disable() {
}

@Override
@Deprecated
public void disable(@Nullable String hookKey) {

}

@NotNull
@Override
public @NotNull String initialize() {
@Deprecated
public String initialize() {
return null;
}

Expand All @@ -125,11 +130,13 @@ public boolean isEnabled() {
}

@Override
@Deprecated
public boolean getAccess(@NotNull String hookKey) {
return false;
}

@Override
@Deprecated
public boolean isPublic() {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import me.angeschossen.lands.api.land.Land;
import me.angeschossen.lands.api.land.LandArea;
import me.angeschossen.lands.api.land.LandChunk;
import me.angeschossen.lands.api.land.LandWorld;
import me.angeschossen.lands.api.player.LandPlayer;
import org.bukkit.Location;
Expand Down Expand Up @@ -57,16 +56,6 @@ public interface LandsIntegrator {
*/
boolean isClaimed(@NotNull World world, int chunkX, int chunkZ);

/**
* This method is not supported anymore. Please use getLand or getArea instead.
*
* @param location Location
* @return null
*/
@Deprecated
@Nullable
LandChunk getLandChunk(@NotNull Location location);

/**
* Get land.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
public interface ChunkCoordinate {

/**
* Get world
* Get worlds
*
* @return World
*/
Expand Down
1 change: 1 addition & 0 deletions src/main/java/me/angeschossen/lands/api/land/LandArea.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;


import java.util.UUID;

public interface LandArea {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public interface LandWorld {
Land getLand(@NotNull int iD);

/**
* Is landChunk loaded?
* Is landChunks loaded?
*
* @param x X identifier
* @param z Z identifier
Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,23 @@
package me.angeschossen.lands.api.land.enums;



public enum LandSetting {
ENTITY_GRIEFING(0, true, false,true),
TNT_GRIEFING(1, true, false,true),
PISTON_GRIEFING(2, true, false,true),
MONSTER_SPAWN(3, true, false,true),
ANIMAL_SPAWN(4, true, false,true),
WATERFLOW_ALLOW(5, true, false,true),
TITLE_HIDE(6, false, false,false);
ENTITY_GRIEFING(0),
TNT_GRIEFING(1),
PISTON_GRIEFING(2),
MONSTER_SPAWN(3),
ANIMAL_SPAWN(4),
WATERFLOW_ALLOW(5);

private int iD;
private boolean isWilderness;
private boolean allowInWar;
private final boolean displayable, forceEnable;

LandSetting(int iD, boolean displayable, boolean forceEnable, boolean isWilderness) {
LandSetting(int iD) {
this.iD = iD;
this.displayable = displayable;
this.forceEnable = forceEnable;
this.isWilderness = isWilderness;
}

public int getId() {
return iD;
}

public boolean isWilderness() {
return isWilderness;
}

public static LandSetting getByID(int iD) {
for (LandSetting setting : values()) {
if (setting.getId() == iD)
Expand All @@ -39,16 +26,4 @@ public static LandSetting getByID(int iD) {

throw new IllegalArgumentException("No LandSetting with iD '" + iD + "' found.");
}

public boolean isAllowInWar() {
return allowInWar;
}

public boolean isDisplayable() {
return displayable;
}

public boolean isForceEnable() {
return forceEnable;
}
}
17 changes: 2 additions & 15 deletions src/main/java/me/angeschossen/lands/api/land/enums/SortMode.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
package me.angeschossen.lands.api.land.enums;

import org.jetbrains.annotations.NotNull;

public enum SortMode {

SIZE, BALANCE, MEMBERS;

@NotNull
public static SortMode getByName(String name) {
for (SortMode sortMode : values()) {
if (sortMode.toString().equalsIgnoreCase(name)) {
return sortMode;
}
}

return SortMode.BALANCE;
}
}
SIZE, BALANCE, MEMBERS
}
6 changes: 3 additions & 3 deletions src/main/java/me/angeschossen/lands/api/player/Invite.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
import org.jetbrains.annotations.NotNull;

import java.util.UUID;
import java.util.concurrent.CompletableFuture;

public interface Invite {

boolean isWholeLand();

/**
* Get UUID of sender
*
Expand Down Expand Up @@ -39,7 +38,8 @@ public interface Invite {
*
* @return Will return false if invite fails because of max members permission (lands.members.NUMBER).
*/
boolean accept(Player player);
@NotNull
CompletableFuture<Boolean> accept(Player player);

/**
* Deny invite
Expand Down
11 changes: 8 additions & 3 deletions src/main/java/me/angeschossen/lands/api/player/LandPlayer.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package me.angeschossen.lands.api.player;

import me.angeschossen.lands.api.land.Land;
import me.angeschossen.lands.api.land.enums.LandGetMode;
import me.angeschossen.lands.api.role.enums.ManagementSetting;
import me.angeschossen.lands.api.war.War;
import org.bukkit.entity.Player;
Expand Down Expand Up @@ -37,6 +36,14 @@ public interface LandPlayer {
@Nullable
Selection getSelection();

/**
* Get max claims per land.
*
* @return Max claims
*/
@NotNull
int getMaxClaimsPerLand();

/**
* Get support claims per land. Permission: lands.chunks.support.NUMBER
*
Expand Down Expand Up @@ -80,8 +87,6 @@ public interface LandPlayer {

Land getAccessActionLand(ManagementSetting landsAction);

Land getAccessActionLand(ManagementSetting landsAction, LandGetMode landGetMode, boolean sendMessage);

/**
* Set edit land
* /Lands edit
Expand Down
Loading

0 comments on commit 077d23e

Please sign in to comment.