Skip to content

Commit

Permalink
Bump to 2.3.0
Browse files Browse the repository at this point in the history
New Features:
- Ability to only reset chests
- Teambalancing (teamdifference in teamcfg) - only english and german messages available
- "Minimal" Spawn-Style (just the light)
- Splash/lingering potions containing "nade" or "bang" in their displayName can now be thrown like Nades in CS:GO (left click)

Improvements:
- New Capture-Point (Loading-Bar)
- Capture-Point Radius in zonecfg
- Gamemode can be set in zonecfg
- Better flag (it's a banner now)
- "None" Spawn-Style as alias for Invisible
- The potion effect around the flag carrier has been moved a bit
- Concrete is now the team block
- Signs do not fall of (team)-gates

Internal:
- Updated some dependencies
- Capture-Points are set a bit differently
  • Loading branch information
Jakllp committed Dec 31, 2020
1 parent f71a55e commit 7ff1471
Show file tree
Hide file tree
Showing 26 changed files with 756 additions and 292 deletions.
1 change: 1 addition & 0 deletions war/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target/
14 changes: 10 additions & 4 deletions war/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.tommytony</groupId>
<artifactId>war</artifactId>
<version>2.0.0-RC6-SNAPSHOT</version>
<version>2.3.0</version>
<packaging>jar</packaging>
<name>War</name>
<url>http://war.tommytony.com</url>
Expand Down Expand Up @@ -98,7 +98,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<version>LATEST</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -117,13 +117,19 @@
<dependency>
<groupId>com.tommytony</groupId>
<artifactId>worldedit-bukkit</artifactId>
<version>7.0.1</version>
<version>LATEST</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>Vault</artifactId>
<version>1.2.32</version>
<version>LATEST</version>
</dependency>
<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
<version>1.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.bstats</groupId>
Expand Down
62 changes: 11 additions & 51 deletions war/src/main/java/com/tommytony/war/Team.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private void createSpawnVolume(Location teamSpawn) {
int z = teamSpawn.getBlockZ();

TeamSpawnStyle style = this.getTeamConfig().resolveSpawnStyle();
if (style.equals(TeamSpawnStyle.INVISIBLE)) {
if (style.equals(TeamSpawnStyle.INVISIBLE) || style.equals(TeamSpawnStyle.NONE) || style.equals(TeamSpawnStyle.MINIMAL)) {
spawnVolume.setCornerOne(this.warzone.getWorld().getBlockAt(x, y - 1, z));
spawnVolume.setCornerTwo(this.warzone.getWorld().getBlockAt(x, y + 3, z));
} else if (style.equals(TeamSpawnStyle.SMALL)) {
Expand Down Expand Up @@ -112,7 +112,7 @@ public void initializeTeamSpawn(Location teamSpawn) {
ItemStack light = this.warzone.getWarzoneMaterials().getLightBlock();

TeamSpawnStyle style = this.getTeamConfig().resolveSpawnStyle();
if (!style.equals(TeamSpawnStyle.INVISIBLE)) {
if (!style.equals(TeamSpawnStyle.INVISIBLE) && !style.equals(TeamSpawnStyle.NONE) && !style.equals(TeamSpawnStyle.MINIMAL)) {
// first ring
this.setBlock(x + 1, y - 1, z + 1, this.kind);
this.setBlock(x + 1, y - 1, z, this.kind);
Expand Down Expand Up @@ -153,7 +153,12 @@ public void initializeTeamSpawn(Location teamSpawn) {
signDirection = BlockFace.SOUTH_EAST.getOppositeFace();
signBlock = this.warzone.getWorld().getBlockAt(x, y, z).getRelative(Direction.SOUTH()).getRelative(Direction.WEST());
}
} else if (!style.equals(TeamSpawnStyle.INVISIBLE)) {
} else if (style.equals(TeamSpawnStyle.MINIMAL)) {
BlockState lightBlock = this.warzone.getWorld().getBlockAt(x, y - 1, z).getState();
lightBlock.setType(light.getType());
lightBlock.setData(light.getData());
lightBlock.update(true);
} else if (!style.equals(TeamSpawnStyle.INVISIBLE) && !style.equals(TeamSpawnStyle.NONE)) {
// outer ring (FLAT or BIG)
this.setBlock(x + 2, y - 1, z + 2, this.kind);
this.setBlock(x + 2, y - 1, z + 1, this.kind);
Expand Down Expand Up @@ -566,60 +571,15 @@ public void initializeTeamFlag() {
current.update(true);

// flag
BlockState flagBlock = this.warzone.getWorld().getBlockAt(x, y + 1, z).getState();
flagBlock.setType(this.kind.getMaterial());
BlockState flagBlock = this.warzone.getWorld().getBlockAt(x, y, z).getState();
flagBlock.setType(this.kind.getFlag());
flagBlock.update(true);

// Flag post using Orientation
int yaw = 0;
if (this.teamFlag.getYaw() >= 0) {
yaw = (int) (this.teamFlag.getYaw() % 360);
} else {
yaw = (int) (360 + (this.teamFlag.getYaw() % 360));
}
if ((yaw >= 0 && yaw < 45) || (yaw >= 315 && yaw <= 360)) {
current = this.warzone.getWorld().getBlockAt(x, y, z - 1).getState();
current.setType(this.warzone.getWarzoneMaterials().getStandBlock().getType());
current.setData(this.warzone.getWarzoneMaterials().getStandBlock().getData());
current.update(true);
current = this.warzone.getWorld().getBlockAt(x, y + 1, z - 1).getState();
current.setType(this.warzone.getWarzoneMaterials().getStandBlock().getType());
current.setData(this.warzone.getWarzoneMaterials().getStandBlock().getData());
current.update(true);
} else if (yaw >= 45 && yaw < 135) {
current = this.warzone.getWorld().getBlockAt(x + 1, y, z).getState();
current.setType(this.warzone.getWarzoneMaterials().getStandBlock().getType());
current.setData(this.warzone.getWarzoneMaterials().getStandBlock().getData());
current.update(true);
current = this.warzone.getWorld().getBlockAt(x + 1, y + 1, z).getState();
current.setType(this.warzone.getWarzoneMaterials().getStandBlock().getType());
current.setData(this.warzone.getWarzoneMaterials().getStandBlock().getData());
current.update(true);
} else if (yaw >= 135 && yaw < 225) {
current = this.warzone.getWorld().getBlockAt(x, y, z + 1).getState();
current.setType(this.warzone.getWarzoneMaterials().getStandBlock().getType());
current.setData(this.warzone.getWarzoneMaterials().getStandBlock().getData());
current.update(true);
current = this.warzone.getWorld().getBlockAt(x, y + 1, z + 1).getState();
current.setType(this.warzone.getWarzoneMaterials().getStandBlock().getType());
current.setData(this.warzone.getWarzoneMaterials().getStandBlock().getData());
current.update(true);
} else if (yaw >= 225 && yaw < 315) {
current = this.warzone.getWorld().getBlockAt(x - 1, y, z).getState();
current.setType(this.warzone.getWarzoneMaterials().getStandBlock().getType());
current.setData(this.warzone.getWarzoneMaterials().getStandBlock().getData());
current.update(true);
current = this.warzone.getWorld().getBlockAt(x - 1, y + 1, z).getState();
current.setType(this.warzone.getWarzoneMaterials().getStandBlock().getType());
current.setData(this.warzone.getWarzoneMaterials().getStandBlock().getData());
current.update(true);
}
}

public boolean isTeamFlagBlock(Block block) {
if (this.teamFlag != null) {
int flagX = this.teamFlag.getBlockX();
int flagY = this.teamFlag.getBlockY() + 1;
int flagY = this.teamFlag.getBlockY();
int flagZ = this.teamFlag.getBlockZ();
if (block.getX() == flagX && block.getY() == flagY && block.getZ() == flagZ) {
return true;
Expand Down
8 changes: 6 additions & 2 deletions war/src/main/java/com/tommytony/war/War.java
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,12 @@ public void loadWar() {
warzoneDefaultConfig.put(WarzoneConfig.SCOREBOARD, ScoreboardType.NONE);
warzoneDefaultConfig.put(WarzoneConfig.SOUPHEALING, false);
warzoneDefaultConfig.put(WarzoneConfig.ALLOWENDER, true);
warzoneDefaultConfig.put(WarzoneConfig.RESETBLOCKS, true);
warzoneDefaultConfig.put(WarzoneConfig.RESETBLOCKS, false);
warzoneDefaultConfig.put(WarzoneConfig.ONLYRESETCHESTS, false);
warzoneDefaultConfig.put(WarzoneConfig.CAPTUREPOINTTIME, 15);
warzoneDefaultConfig.put(WarzoneConfig.CPRADIUS, 3);
warzoneDefaultConfig.put(WarzoneConfig.PREPTIME, 0);
warzoneDefaultConfig.put(WarzoneConfig.GAMEMODE, "SURVIVAL");

teamDefaultConfig.put(TeamConfig.FLAGMUSTBEHOME, true);
teamDefaultConfig.put(TeamConfig.FLAGPOINTSONLY, false);
Expand All @@ -183,10 +186,11 @@ public void loadWar() {
teamDefaultConfig.put(TeamConfig.MAXSCORE, 10);
teamDefaultConfig.put(TeamConfig.NOHUNGER, false);
teamDefaultConfig.put(TeamConfig.PLAYERLOADOUTASDEFAULT, false);
teamDefaultConfig.put(TeamConfig.RESPAWNTIMER, 0);
teamDefaultConfig.put(TeamConfig.RESPAWNTIMER, 1);
teamDefaultConfig.put(TeamConfig.SATURATION, 10);
teamDefaultConfig.put(TeamConfig.SPAWNSTYLE, TeamSpawnStyle.SMALL);
teamDefaultConfig.put(TeamConfig.TEAMSIZE, 10);
teamDefaultConfig.put(TeamConfig.TEAMDIFFERENCE, 1);
teamDefaultConfig.put(TeamConfig.PERMISSION, "war.player");
teamDefaultConfig.put(TeamConfig.XPKILLMETER, false);
teamDefaultConfig.put(TeamConfig.KILLSTREAK, false);
Expand Down
Loading

0 comments on commit 7ff1471

Please sign in to comment.