fix: remove court
This commit is contained in:
parent
01aeefaaa3
commit
dca469d8b7
43 changed files with 14 additions and 102 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
|||
target/
|
||||
test_server/
|
||||
server/
|
||||
|
|
BIN
.gradle/8.11.1/checksums/checksums.lock
Normal file
BIN
.gradle/8.11.1/checksums/checksums.lock
Normal file
Binary file not shown.
BIN
.gradle/8.11.1/executionHistory/executionHistory.lock
Normal file
BIN
.gradle/8.11.1/executionHistory/executionHistory.lock
Normal file
Binary file not shown.
BIN
.gradle/8.11.1/fileChanges/last-build.bin
Normal file
BIN
.gradle/8.11.1/fileChanges/last-build.bin
Normal file
Binary file not shown.
BIN
.gradle/8.11.1/fileHashes/fileHashes.bin
Normal file
BIN
.gradle/8.11.1/fileHashes/fileHashes.bin
Normal file
Binary file not shown.
BIN
.gradle/8.11.1/fileHashes/fileHashes.lock
Normal file
BIN
.gradle/8.11.1/fileHashes/fileHashes.lock
Normal file
Binary file not shown.
0
.gradle/8.11.1/gc.properties
Normal file
0
.gradle/8.11.1/gc.properties
Normal file
BIN
.gradle/8.12/checksums/checksums.lock
Normal file
BIN
.gradle/8.12/checksums/checksums.lock
Normal file
Binary file not shown.
BIN
.gradle/8.12/checksums/md5-checksums.bin
Normal file
BIN
.gradle/8.12/checksums/md5-checksums.bin
Normal file
Binary file not shown.
BIN
.gradle/8.12/checksums/sha1-checksums.bin
Normal file
BIN
.gradle/8.12/checksums/sha1-checksums.bin
Normal file
Binary file not shown.
BIN
.gradle/8.12/executionHistory/executionHistory.bin
Normal file
BIN
.gradle/8.12/executionHistory/executionHistory.bin
Normal file
Binary file not shown.
BIN
.gradle/8.12/executionHistory/executionHistory.lock
Normal file
BIN
.gradle/8.12/executionHistory/executionHistory.lock
Normal file
Binary file not shown.
BIN
.gradle/8.12/fileChanges/last-build.bin
Normal file
BIN
.gradle/8.12/fileChanges/last-build.bin
Normal file
Binary file not shown.
BIN
.gradle/8.12/fileHashes/fileHashes.bin
Normal file
BIN
.gradle/8.12/fileHashes/fileHashes.bin
Normal file
Binary file not shown.
BIN
.gradle/8.12/fileHashes/fileHashes.lock
Normal file
BIN
.gradle/8.12/fileHashes/fileHashes.lock
Normal file
Binary file not shown.
BIN
.gradle/8.12/fileHashes/resourceHashesCache.bin
Normal file
BIN
.gradle/8.12/fileHashes/resourceHashesCache.bin
Normal file
Binary file not shown.
0
.gradle/8.12/gc.properties
Normal file
0
.gradle/8.12/gc.properties
Normal file
BIN
.gradle/buildOutputCleanup/buildOutputCleanup.lock
Normal file
BIN
.gradle/buildOutputCleanup/buildOutputCleanup.lock
Normal file
Binary file not shown.
2
.gradle/buildOutputCleanup/cache.properties
Normal file
2
.gradle/buildOutputCleanup/cache.properties
Normal file
|
@ -0,0 +1,2 @@
|
|||
#Fri Apr 18 18:22:42 CEST 2025
|
||||
gradle.version=8.12
|
BIN
.gradle/buildOutputCleanup/outputFiles.bin
Normal file
BIN
.gradle/buildOutputCleanup/outputFiles.bin
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.gradle/configuration-cache/1n0hvhmh2ddtscvbtrbtv3rrd/_.work.bin
Normal file
BIN
.gradle/configuration-cache/1n0hvhmh2ddtscvbtrbtv3rrd/_.work.bin
Normal file
Binary file not shown.
BIN
.gradle/configuration-cache/1n0hvhmh2ddtscvbtrbtv3rrd/work.bin
Normal file
BIN
.gradle/configuration-cache/1n0hvhmh2ddtscvbtrbtv3rrd/work.bin
Normal file
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
fb2c7600-62bf-456a-bf95-881f44d8056¸
|
BIN
.gradle/configuration-cache/configuration-cache.lock
Normal file
BIN
.gradle/configuration-cache/configuration-cache.lock
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0
.gradle/configuration-cache/gc.properties
Normal file
0
.gradle/configuration-cache/gc.properties
Normal file
BIN
.gradle/file-system.probe
Normal file
BIN
.gradle/file-system.probe
Normal file
Binary file not shown.
0
.gradle/vcs-1/gc.properties
Normal file
0
.gradle/vcs-1/gc.properties
Normal file
4
build.sh
4
build.sh
|
@ -1,4 +1,4 @@
|
|||
mvn clean package dependency:copy -DskipTests -DmcVersion=1.21 -DoutputDirectory=test_server/plugins
|
||||
cd test_server
|
||||
mvn clean package dependency:copy -DskipTests -DmcVersion=1.21 -DoutputDirectory=server/plugins
|
||||
cd server
|
||||
java -jar server.jar -nogui
|
||||
cd ../
|
||||
|
|
6
debug.sh
Normal file
6
debug.sh
Normal file
|
@ -0,0 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
cp build/libs/*.jar server/plugins
|
||||
cd server && java -jar server.jar -nogui && cd ..
|
||||
|
||||
|
|
@ -3,6 +3,6 @@ services:
|
|||
civil_test_db:
|
||||
environment:
|
||||
- POSTGRES_PASSWORD=TEST123
|
||||
image: postgres:16.3
|
||||
image: docker.io/postgres:16.3
|
||||
ports:
|
||||
- 5432:5432
|
||||
- 127.0.0.1:5432:5432
|
||||
|
|
|
@ -26,10 +26,6 @@ public class CivilCore extends JavaPlugin {
|
|||
this.bot = new Discord(getConfig().getString("discord.token"), getConfig().getString("discord.channel"), this);
|
||||
this.bot.initialize();
|
||||
|
||||
if (Bukkit.getWorld("court") == null) {
|
||||
new WorldCreator("court").createWorld();
|
||||
}
|
||||
|
||||
try {
|
||||
Class.forName("org.postgresql.Driver");
|
||||
} catch (ClassNotFoundException e) {
|
||||
|
@ -42,9 +38,7 @@ public class CivilCore extends JavaPlugin {
|
|||
e.printStackTrace();
|
||||
}
|
||||
getServer().getPluginManager().registerEvents(new PlayerHandler(this), this);
|
||||
getServer().getPluginManager().registerEvents(new Court(), this);
|
||||
this.getCommand("team").setExecutor(new TeamCommand(this));
|
||||
this.getCommand("court").setExecutor(new Court());
|
||||
this.getCommand("tc").setExecutor(new TeamChatCommand(this));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,89 +0,0 @@
|
|||
package rip.iwakura.civilcore;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
import org.bukkit.event.block.BlockBurnEvent;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.block.BlockSpreadEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.player.PlayerBucketEmptyEvent;
|
||||
|
||||
public class Court implements Listener,CommandExecutor{
|
||||
private World court_world = Bukkit.getWorld("court");
|
||||
|
||||
private Location court_location = new Location(court_world, 4.5, 70.0, 0.5, -90f, 1.0f);
|
||||
|
||||
@EventHandler
|
||||
public void PlayerPlaceWater(PlayerBucketEmptyEvent e) {
|
||||
Player p = (Player) e.getPlayer();
|
||||
if (!p.getLocation().getWorld().getName().equals("court")) return;
|
||||
e.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void PlayerHurt(EntityDamageEvent e) {
|
||||
if (!(e.getEntity() instanceof Player)) return;
|
||||
Player p = (Player) e.getEntity();
|
||||
|
||||
if (!p.getLocation().getWorld().getName().equals("court")) return;
|
||||
|
||||
e.setCancelled(true);
|
||||
|
||||
if (e.getCause() == DamageCause.VOID) {
|
||||
p.teleport(court_location);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void PlayerBreak(BlockBreakEvent e) {
|
||||
if (e.getPlayer().isOp()) return;
|
||||
if (e.getBlock().getWorld().getName().equals(court_world.getName())) e.setCancelled(true);
|
||||
}
|
||||
@EventHandler
|
||||
public void PlayerPlace(BlockPlaceEvent e) {
|
||||
if (e.getPlayer().isOp()) return;
|
||||
if (e.getBlock().getWorld().getName().equals(court_world.getName())) e.setCancelled(true);
|
||||
}
|
||||
@EventHandler
|
||||
public void PlayerBurn(BlockBurnEvent e) {
|
||||
if (e.getBlock().getWorld().getName().equals(court_world.getName())) e.setCancelled(true);
|
||||
}
|
||||
@EventHandler
|
||||
public void FireSpread(BlockSpreadEvent e) {
|
||||
if (e.getBlock().getWorld().getName().equals(court_world.getName())) e.setCancelled(true);
|
||||
}
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("Non-player type.");
|
||||
return true;
|
||||
}
|
||||
|
||||
Player p = (Player) sender;
|
||||
|
||||
switch (args[0]) {
|
||||
case "enter":
|
||||
p.teleport(court_location);
|
||||
break;
|
||||
case "leave":
|
||||
Location loc = p.getBedSpawnLocation();
|
||||
if (loc == null) {
|
||||
loc = Bukkit.getWorld("world").getSpawnLocation();
|
||||
}
|
||||
p.teleport(loc);
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
|
@ -9,9 +9,6 @@ commands:
|
|||
description: Team Manager
|
||||
usage: /<command> <create|destroy|add|remove>
|
||||
permission: "civil.teams"
|
||||
court:
|
||||
description: Court Manager
|
||||
usage: /<command> <enter|leave>
|
||||
tc:
|
||||
description: Team Chat
|
||||
usage: /<command>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue