1.3.1 Update

This commit is contained in:
NotAlexNoyle committed 2023-04-11 15:19:32 -04:00
1 parent 2077f3b8ef
commit 0c6eccdfca
7 files changed
+58 -44

No files matched your search

+6
View File
@@ -1,3 +1,9 @@
**1.3.1:**
- Fixed dust particles coming off of egg instead of the block that was hit.
- Fixed match not ending when players get below the minimum level.
**1.3:**
- It is no longer possible to start a match with only 1 player in the lobby.
+3 -5
View File
@@ -38,13 +38,11 @@ The resulting .jar file will be in build/libs/
**Known Bugs:**
- The game does not end in a way that removes all players from the lobby.
- The winner is not removed from the game.
- Match ending is not triggered when a player goes below the minimum floor Y level.
- The lower limit is y=-1 instead of y=-64.
- The splegg shop is non-functional.
- Block destruction particles are displayed for the egg instead of for the block that was hit.
- The splegg shop doesn't work.
**Planned Features:**
+8 -8
View File
@@ -6,7 +6,7 @@ plugins {
}
group = "net.trueog.splegg-og" // Declare bundle identifier.
version = "1.3" // Declare version number.
version = "1.3.1" // Declare version number.
def apiVersion = "1.18.2" // Declare minecraft server target version.
def targetJavaVersion = 17 // Declare java compatibility minimum.
@@ -47,10 +47,10 @@ repositories {
}
maven { // Import Paper Repository (EssentialsX API Dependency)
name "papermc"
url "https://papermc.io/repo/repository/maven-public/"
url "https://papermc.io/repo/repository/maven-public/"
}
maven { // Import Maven Repository.
@@ -82,11 +82,11 @@ dependencies {
shadowJar {
minimize()
minimize() // Pack dependencies into .jar file.
}
jar.dependsOn shadowJar
jar.dependsOn shadowJar // Runs shadowJar.
tasks.jar.configure {
@@ -103,8 +103,8 @@ tasks.shadowJar.configure {
compileJava { // Build Java code.
options.compilerArgs += ["-parameters"] // Pass any parameters specified while executing Gradle wrapper as Java compiler arguments.
options.encoding = 'UTF-8'
options.encoding = 'UTF-8' // Build with UTF-8 encoding always, even on systems without it.
options.fork = true
options.forkOptions.executable = 'javac' // Define Java compiler executable.
}
}
+29 -25
View File
@@ -2,6 +2,7 @@ package events;
import java.util.Iterator;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Particle;
@@ -35,17 +36,11 @@ public class SpleggEvents implements Listener {
Player player = (Player) shooter;
UtilPlayer u = SpleggOG.getPlugin().pm.getPlayer(player);
Block hitBlock = event.getHitBlock();
Location hitLocation = null;
BlockIterator bi = new BlockIterator(hitBlock.getWorld(), event.getEntity().getLocation().toVector(), event.getEntity().getVelocity().normalize(), 0.0D, 4);
if (u.getGame() != null && u.isAlive()) {
// If the egg hit an entity, do this.
if(event.getHitEntity() != null) {
// Cancel the hit.
event.setCancelled(true);
}
BlockIterator bi = new BlockIterator(event.getEntity().getWorld(), event.getEntity().getLocation().toVector(), event.getEntity().getVelocity().normalize(), 0.0D, 4);
Block hit = null;
while(bi.hasNext()) {
@@ -56,14 +51,26 @@ public class SpleggEvents implements Listener {
break;
}
else {
// Get location if it is a block.
hitLocation = hitBlock.getLocation();
// Cancel the collision.
event.setCancelled(true);
// Deletes the egg entity.
event.getEntity().remove();
}
}
if (hit.getType() == Material.TNT) {
event.getEntity().getWorld().createExplosion(event.getEntity().getLocation(), 3.0F);
hitBlock.getWorld().createExplosion(hitLocation, 3.0F);
Iterator<?> entityIterator = event.getEntity().getWorld().getEntities().iterator();
Iterator<?> entityIterator = hitBlock.getWorld().getEntities().iterator();
while(entityIterator.hasNext()) {
Entity drop = (Entity) entityIterator.next();
@@ -71,11 +78,6 @@ public class SpleggEvents implements Listener {
if (drop.getType() == EntityType.DROPPED_ITEM) {
drop.remove();
drop.remove();
drop.remove();
drop.remove();
drop.remove();
drop.remove();
}
@@ -83,10 +85,9 @@ public class SpleggEvents implements Listener {
}
Location hitLocation = hit.getLocation();
if (u.getGame().getFloor().contains(hitLocation)) {
Game game = u.getGame();
if (game.getFloor().contains(hitLocation)) {
Game game = u.getGame();
// If the game is in-progress, do this.
if (game.getStatus() == Status.INGAME) {
@@ -145,19 +146,22 @@ public class SpleggEvents implements Listener {
}
public void playerMove(PlayerMoveEvent event) {
@EventHandler
public void onKnockout(PlayerMoveEvent event) {
Player player = event.getPlayer();
UtilPlayer u = SpleggOG.getPlugin().pm.getPlayer(player);
if (player.getLocation().getY() <= -64) {
Game game = u.getGame();
if (game != null && u.isAlive() && ((double) player.getLocation().getBlockY() < -5.0D || player.getLocation().getBlockY() < game.getLowestPossible()) && game.getStatus() == Status.INGAME) {
SpleggOG.getPlugin().getLogger().info("Player: + " + player.getName() + " should have died.");
player.setHealth(0);
u.getGame().leaveGame(u);
SpleggOG.getPlugin().chat.bc(ChatColor.translateAlternateColorCodes('&', SpleggOG.getPlugin().getConfig().getString("Messages.KnockoutPlayer")).replaceAll("%player%", player.getName()));
SpleggOG.getPlugin().chat.bc(ChatColor.translateAlternateColorCodes('&', SpleggOG.getPlugin().getConfig().getString("Messages.PlayersRemaining")).replaceAll("%count%", String.valueOf(game.getPlayers().size() - 1)), game);
player.setFallDistance(1.0F);
game.leaveGame(u);
}
}
}
+9
View File
@@ -49,6 +49,7 @@ public class Game {
int time;
int y1;
int y2;
int small;
int counter;
int timer;
boolean starting;
@@ -70,6 +71,7 @@ public class Game {
this.lobbycount = 31;
this.y1 = -64;
this.y2 = -64;
this.small = -64;
this.setSign(new LobbySign(map, splegg));
@@ -231,6 +233,12 @@ public class Game {
}
public int getLowestPossible() {
return this.small;
}
public void joinGame(UtilPlayer playerWhoIsJoining) {
Player player = playerWhoIsJoining.getPlayer();
@@ -586,6 +594,7 @@ public class Game {
int maxY = max.getBlockY();
this.y2 = maxY;
int maxZ = max.getBlockZ();
this.small = Math.min(this.y2, this.y2);
for(int x = minX; x <= maxX; ++x) {
+2 -5
View File
@@ -4,16 +4,12 @@ import java.util.HashMap;
import java.util.Iterator;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
import org.bukkit.Material;
import config.Map;
import events.Listeners;
import main.SpleggOG;
import utils.SpleggPlayer;
import utils.UtilPlayer;
import utils.Utils;
public class GameManager {
@@ -79,7 +75,6 @@ public class GameManager {
game.data.clear();
game.floor.clear();
game.setStarting(false);
game.players.clear();
Iterator<?> playersInGame = game.players.values().iterator();
while(playersInGame.hasNext()) {
@@ -96,6 +91,8 @@ public class GameManager {
}
game.players.clear();
SpleggOG.getPlugin().getLogger().info("Map " + game.map.getName() + " was reset.");
}
+1 -1
View File
@@ -1,6 +1,6 @@
name: Splegg-OG
main: main.SpleggOG
version: 1.3
version: 1.3.1
authors: [Hraponssi, MrLuangamer, Theluangamer9416, NotAlexNoyle]
api-version: 1.18
depend: [Vault, WorldEdit]