-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Angeschossen
authored and
Angeschossen
committed
Aug 19, 2020
1 parent
c62a2de
commit 9057b80
Showing
17 changed files
with
70 additions
and
231 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
2 changes: 1 addition & 1 deletion
2
src/main/java/me/angeschossen/lands/api/events/war/WarDeclareEvent.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
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
65 changes: 0 additions & 65 deletions
65
src/main/java/me/angeschossen/lands/api/nation/Nation.java
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
src/main/java/me/angeschossen/lands/api/nation/NationManagementSetting.java
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
src/main/java/me/angeschossen/lands/api/war/LandWarStats.java
This file was deleted.
Oops, something went wrong.
40 changes: 0 additions & 40 deletions
40
src/main/java/me/angeschossen/lands/api/war/NationInvite.java
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,34 +1,37 @@ | ||
package me.angeschossen.lands.api.war; | ||
|
||
import me.angeschossen.lands.api.role.enums.RoleSetting; | ||
import me.angeschossen.lands.api.war.entity.WarEntity; | ||
import me.angeschossen.lands.api.war.entity.WarStats; | ||
import me.angeschossen.lands.api.war.enums.WarSetting; | ||
import org.bukkit.Material; | ||
import org.bukkit.entity.Player; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.util.Set; | ||
|
||
public interface War { | ||
|
||
boolean canAction(Player player, RoleSetting landsAction, @Nullable Material material, boolean sendMessage); | ||
boolean canAction(@NotNull Player player, @NotNull RoleSetting landsAction, @Nullable Material material, boolean sendMessage); | ||
|
||
boolean toggleRoleAction(RoleSetting landsAction); | ||
boolean toggleRoleAction(@NotNull RoleSetting landsAction); | ||
|
||
boolean toggleSetting(WarSetting warSetting); | ||
boolean toggleSetting(@NotNull WarSetting warSetting); | ||
|
||
int getId(); | ||
@NotNull | ||
Set<RoleSetting> getRoleSettings(); | ||
|
||
Set<RoleSetting> getRoleActions(); | ||
|
||
boolean isParticipating(WarEntity entity); | ||
boolean isParticipating(@NotNull WarEntity entity); | ||
|
||
boolean isEndingSoon(); | ||
|
||
boolean attackersWin(); | ||
|
||
@Nullable | ||
WarEntity getWinner(); | ||
|
||
@NotNull | ||
WarStats getAttackerStats(); | ||
|
||
@NotNull | ||
WarStats getDefenderStats(); | ||
} |
36 changes: 0 additions & 36 deletions
36
src/main/java/me/angeschossen/lands/api/war/WarEntity.java
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
10 changes: 4 additions & 6 deletions
10
...chossen/lands/api/war/WarDeclaration.java → ...s/api/war/declaration/WarDeclaration.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 |
---|---|---|
@@ -1,19 +1,17 @@ | ||
package me.angeschossen.lands.api.war; | ||
package me.angeschossen.lands.api.war.declaration; | ||
|
||
import me.angeschossen.lands.api.war.War; | ||
import me.angeschossen.lands.api.war.enums.WarTeam; | ||
|
||
|
||
public interface WarDeclaration { | ||
|
||
void stop(); | ||
|
||
void setTribute(double tribute); | ||
|
||
double getTribute(); | ||
|
||
double getMaxTribute(WarTeam warTeam); | ||
|
||
boolean isValid(); | ||
|
||
boolean startsSoon(); | ||
|
||
War start(); | ||
} |
48 changes: 48 additions & 0 deletions
48
src/main/java/me/angeschossen/lands/api/war/entity/WarEntity.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,48 @@ | ||
package me.angeschossen.lands.api.war.entity; | ||
|
||
import me.angeschossen.lands.api.holders.BalanceHolder; | ||
import me.angeschossen.lands.api.player.LandPlayer; | ||
import me.angeschossen.lands.api.war.enums.WarEntityType; | ||
import me.angeschossen.lands.api.war.enums.WarTeam; | ||
import org.bukkit.entity.Player; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.util.Collection; | ||
import java.util.UUID; | ||
|
||
public interface WarEntity extends BalanceHolder { | ||
|
||
@Nullable | ||
WarTeam getWarTeam(); | ||
|
||
@NotNull | ||
UUID getOwnerUID(); | ||
|
||
@NotNull | ||
Collection<Player> getOnlinePlayers(); | ||
|
||
@NotNull | ||
Collection<? extends LandPlayer> getOnlineLandPlayers(); | ||
|
||
boolean leaveWar(); | ||
|
||
void addWarShieldTime(long seconds); | ||
|
||
boolean hasWarShield(); | ||
|
||
long getWarShield(); | ||
|
||
boolean hasWarEntity(@NotNull WarEntity entity); | ||
|
||
boolean isInWar(); | ||
|
||
WarEntityType getType(); | ||
|
||
boolean isWarField(); | ||
|
||
@NotNull | ||
WarStats getStats(); | ||
|
||
boolean isTrusted(@NotNull UUID uuid); | ||
} |
3 changes: 1 addition & 2 deletions
3
.../angeschossen/lands/api/war/WarStats.java → ...hossen/lands/api/war/entity/WarStats.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
4 changes: 0 additions & 4 deletions
4
src/main/java/me/angeschossen/lands/api/war/enums/WarManagementSetting.java
This file was deleted.
Oops, something went wrong.
23 changes: 1 addition & 22 deletions
23
src/main/java/me/angeschossen/lands/api/war/enums/WarSetting.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 |
---|---|---|
@@ -1,26 +1,5 @@ | ||
package me.angeschossen.lands.api.war.enums; | ||
|
||
public enum WarSetting { | ||
|
||
FRIENDLY_FIRE(1); | ||
|
||
private final int id; | ||
|
||
WarSetting(int id) { | ||
this.id = id; | ||
} | ||
|
||
public int getId() { | ||
return id; | ||
} | ||
|
||
public static WarSetting getById(int id) throws IllegalArgumentException{ | ||
for (WarSetting warSetting : values()) { | ||
if (warSetting.getId() == id) { | ||
return warSetting; | ||
} | ||
} | ||
|
||
throw new IllegalArgumentException("No warsetting with id " + id + " found."); | ||
} | ||
FRIENDLY_FIRE | ||
} |
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
package me.angeschossen.lands.api.war.enums; | ||
|
||
public enum WarTeam { | ||
|
||
ATTACKER, DEFENDER, NEUTRAL | ||
} |
6 changes: 0 additions & 6 deletions
6
src/main/java/me/angeschossen/lands/api/war/enums/WarType.java
This file was deleted.
Oops, something went wrong.