From 21c3369f6f5753231dd61c6f2606645626eae37b Mon Sep 17 00:00:00 2001
From: Shin <86329731+Shin-Ideal@users.noreply.github.com>
Date: Sat, 21 Dec 2024 14:38:43 +0900
Subject: [PATCH] =?UTF-8?q?=E4=BB=96plugin=E3=81=AB=E5=BD=B1=E9=9F=BF?=
=?UTF-8?q?=E3=81=8C=E3=81=A7=E3=82=8B=E4=B8=8D=E5=85=B7=E5=90=88=E3=82=92?=
=?UTF-8?q?=E4=BF=AE=E6=AD=A3=E3=80=81=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92?=
=?UTF-8?q?=E4=B8=80=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 2 +-
.../{Fly.java => FlyCommandExecutor.java} | 15 +++-
...age.java => FlyManageCommandExecutor.java} | 29 ++++----
.../LobbyFlyPlugin/ConfigManager.java | 25 -------
.../LobbyFlyPlugin/ListenerManager.java | 69 -------------------
.../Listeners/BackFromVoidListener.java | 40 +++++++++++
.../Listeners/Back_From_Void_Listener.java | 32 ---------
.../Listeners/DisableAllDamageListener.java | 32 +++++++++
.../Listeners/DisableFallDamageListener.java | 35 ++++++++++
.../Disable_All_Damage_Listener.java | 18 -----
.../Disable_Fall_Damage_Listener.java | 21 ------
.../Listeners/HorizonLimitListener.java | 50 ++++++++++++++
.../Listeners/Horizon_Limit_Listener.java | 48 -------------
.../Listeners/JoinFlyListener.java | 42 +++++++++++
.../Listeners/JoinTpSpawnListener.java | 33 +++++++++
.../Listeners/Join_Fly_Listener.java | 37 ----------
.../Listeners/Join_Tp_Spawn_Listener.java | 25 -------
.../LobbyFlyPlugin/LobbyFlyPlugin.java | 48 +++++++++----
src/main/resources/plugin.yml | 6 +-
19 files changed, 299 insertions(+), 308 deletions(-)
rename src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/CommandExecutors/{Fly.java => FlyCommandExecutor.java} (50%)
rename src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/CommandExecutors/{FlyManage.java => FlyManageCommandExecutor.java} (56%)
delete mode 100644 src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/ConfigManager.java
delete mode 100644 src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/ListenerManager.java
create mode 100644 src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/BackFromVoidListener.java
delete mode 100644 src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/Back_From_Void_Listener.java
create mode 100644 src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/DisableAllDamageListener.java
create mode 100644 src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/DisableFallDamageListener.java
delete mode 100644 src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/Disable_All_Damage_Listener.java
delete mode 100644 src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/Disable_Fall_Damage_Listener.java
create mode 100644 src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/HorizonLimitListener.java
delete mode 100644 src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/Horizon_Limit_Listener.java
create mode 100644 src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/JoinFlyListener.java
create mode 100644 src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/JoinTpSpawnListener.java
delete mode 100644 src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/Join_Fly_Listener.java
delete mode 100644 src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/Join_Tp_Spawn_Listener.java
diff --git a/pom.xml b/pom.xml
index 38d7737..e018c36 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
com.github.Shin_Ideal
LobbyFlyPlugin
- 1.0-SNAPSHOT
+ 2.0.0
8
diff --git a/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/CommandExecutors/Fly.java b/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/CommandExecutors/FlyCommandExecutor.java
similarity index 50%
rename from src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/CommandExecutors/Fly.java
rename to src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/CommandExecutors/FlyCommandExecutor.java
index be4a48a..eb2f2fa 100644
--- a/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/CommandExecutors/Fly.java
+++ b/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/CommandExecutors/FlyCommandExecutor.java
@@ -1,19 +1,28 @@
package com.github.Shin_Ideal.LobbyFlyPlugin.CommandExecutors;
+import com.github.Shin_Ideal.LobbyFlyPlugin.LobbyFlyPlugin;
+import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
-public class Fly implements CommandExecutor {
+public class FlyCommandExecutor implements CommandExecutor {
+
+ private final LobbyFlyPlugin Instance;
+
+ public FlyCommandExecutor() {
+ Instance = LobbyFlyPlugin.getInstance();
+ }
+
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
- if(!(sender instanceof Player)) {
+ if (!(sender instanceof Player)) {
return false;
}
Player player = (Player) sender;
player.setAllowFlight(!player.getAllowFlight());
+ player.sendMessage(Instance.getPluginMessagePrefix() + "Fly is " + (player.getAllowFlight() ? ChatColor.GREEN + "enable" : ChatColor.RED + "disable"));
return true;
}
-
}
diff --git a/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/CommandExecutors/FlyManage.java b/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/CommandExecutors/FlyManageCommandExecutor.java
similarity index 56%
rename from src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/CommandExecutors/FlyManage.java
rename to src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/CommandExecutors/FlyManageCommandExecutor.java
index 8f44e64..a528776 100644
--- a/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/CommandExecutors/FlyManage.java
+++ b/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/CommandExecutors/FlyManageCommandExecutor.java
@@ -1,27 +1,31 @@
package com.github.Shin_Ideal.LobbyFlyPlugin.CommandExecutors;
-import com.github.Shin_Ideal.LobbyFlyPlugin.ConfigManager;
-import com.github.Shin_Ideal.LobbyFlyPlugin.ListenerManager;
+import com.github.Shin_Ideal.LobbyFlyPlugin.LobbyFlyPlugin;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
-public class FlyManage implements CommandExecutor {
+public class FlyManageCommandExecutor implements CommandExecutor {
+
+ private final LobbyFlyPlugin Instance;
+
+ public FlyManageCommandExecutor() {
+ Instance = LobbyFlyPlugin.getInstance();
+ }
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
- if(args.length==0){
+ if (args.length == 0) {
sendHelp(sender);
return true;
- }else {
- switch (args[0]){
+ } else {
+ switch (args[0]) {
case "help":
sendHelp(sender);
break;
case "reload":
- reload();
- sender.sendMessage("reloaded!");
+ reload(sender);
break;
default:
@@ -32,14 +36,13 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
return true;
}
- private void sendHelp(CommandSender sender){
+ private void sendHelp(CommandSender sender) {
sender.sendMessage("/flymanage ");
sender.sendMessage("/flymanage ");
}
- private void reload() {
- ConfigManager.reload();
- ListenerManager.reload();
+ private void reload(CommandSender sender) {
+ Instance.reloadConfig();
+ sender.sendMessage(Instance.getPluginMessagePrefix() + "Config Reloaded!");
}
-
}
diff --git a/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/ConfigManager.java b/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/ConfigManager.java
deleted file mode 100644
index ea957f7..0000000
--- a/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/ConfigManager.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.github.Shin_Ideal.LobbyFlyPlugin;
-
-import org.bukkit.configuration.Configuration;
-
-public class ConfigManager {
-
- private static Configuration config;
-
- public static void Init(){
- LobbyFlyPlugin plugin = LobbyFlyPlugin.getPlugin();
- plugin.saveDefaultConfig();
- config=plugin.getConfig();
- }
-
- public static Configuration getConfig(){
- return config;
- }
-
- public static void reload() {
- LobbyFlyPlugin plugin = LobbyFlyPlugin.getPlugin();
- plugin.reloadConfig();
- config=plugin.getConfig();
- }
-
-}
diff --git a/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/ListenerManager.java b/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/ListenerManager.java
deleted file mode 100644
index 6a00088..0000000
--- a/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/ListenerManager.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package com.github.Shin_Ideal.LobbyFlyPlugin;
-
-import com.github.Shin_Ideal.LobbyFlyPlugin.Listeners.*;
-import org.bukkit.configuration.Configuration;
-import org.bukkit.event.HandlerList;
-
-public class ListenerManager {
-
- public static void Init(){
- UpdateListener();
- }
-
- public static void Fina(){
- HandlerList.unregisterAll();
- }
-
- private static void UpdateListener(){
- LobbyFlyPlugin plugin = LobbyFlyPlugin.getPlugin();
- Configuration config = ConfigManager.getConfig();
-
- HandlerList.unregisterAll();
-
- if(config.getBoolean("join-fly.enable")){
- plugin.getServer().getPluginManager().registerEvents(new Join_Fly_Listener(),plugin);
- Join_Fly_Listener.setAdd_y_location(config.getDouble("join-fly.add-y-location"));
- }
-
- if(config.getBoolean("disable-fall-damage.enable")){
- plugin.getServer().getPluginManager().registerEvents(new Disable_Fall_Damage_Listener(),plugin);
- }
-
- if(config.getBoolean("disable-all-damage.enable")){
- plugin.getServer().getPluginManager().registerEvents(new Disable_All_Damage_Listener(),plugin);
- }
-
- if(config.getBoolean("join-tp-spawn.enable")){
- plugin.getServer().getPluginManager().registerEvents(new Join_Tp_Spawn_Listener(),plugin);
- Join_Tp_Spawn_Listener.setXYZ(
- config.getDouble("join-tp-spawn.add-x"),
- config.getDouble("join-tp-spawn.add-y"),
- config.getDouble("join-tp-spawn.add-z")
- );
- }
-
- if(config.getBoolean("horizon-limit.enable")){
- plugin.getServer().getPluginManager().registerEvents(new Horizon_Limit_Listener(),plugin);
- Horizon_Limit_Listener.setDistance(
- config.getDouble("horizon-limit.x-min-distance"),
- config.getDouble("horizon-limit.x-max-distance"),
- config.getDouble("horizon-limit.z-min-distance"),
- config.getDouble("horizon-limit.z-max-distance")
- );
- }
-
- if(config.getBoolean("back-from-void.enable")){
- plugin.getServer().getPluginManager().registerEvents(new Back_From_Void_Listener(),plugin);
- Back_From_Void_Listener.setXYZ(
- config.getDouble("join-tp-spawn.add-x"),
- config.getDouble("join-tp-spawn.add-y"),
- config.getDouble("join-tp-spawn.add-z")
- );
- }
- }
-
- public static void reload() {
- UpdateListener();
- }
-
-}
diff --git a/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/BackFromVoidListener.java b/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/BackFromVoidListener.java
new file mode 100644
index 0000000..bdf3dff
--- /dev/null
+++ b/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/BackFromVoidListener.java
@@ -0,0 +1,40 @@
+package com.github.Shin_Ideal.LobbyFlyPlugin.Listeners;
+
+import com.github.Shin_Ideal.LobbyFlyPlugin.LobbyFlyPlugin;
+import org.bukkit.configuration.Configuration;
+import org.bukkit.entity.Player;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.EntityDamageEvent;
+
+public class BackFromVoidListener implements Listener {
+
+ private final LobbyFlyPlugin Instance;
+ private final Configuration config;
+
+ public BackFromVoidListener() {
+ Instance = LobbyFlyPlugin.getInstance();
+ config = Instance.getConfig();
+ }
+
+ @EventHandler
+ public void onDamage(EntityDamageEvent event) {
+ if (!config.getBoolean("back-from-void.enable")) {
+ return;
+ }
+
+ if (!(event.getEntity() instanceof Player)) {
+ return;
+ }
+ if (!event.getCause().equals(EntityDamageEvent.DamageCause.VOID)) {
+ return;
+ }
+ Player player = (Player) event.getEntity();
+ player.teleport(player.getWorld().getSpawnLocation().add(
+ config.getDouble("join-tp-spawn.add-x")
+ , config.getDouble("join-tp-spawn.add-y")
+ , config.getDouble("join-tp-spawn.add-z")
+ ));
+ event.setCancelled(true);
+ }
+}
diff --git a/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/Back_From_Void_Listener.java b/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/Back_From_Void_Listener.java
deleted file mode 100644
index 5a6c902..0000000
--- a/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/Back_From_Void_Listener.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package com.github.Shin_Ideal.LobbyFlyPlugin.Listeners;
-
-import org.bukkit.entity.Player;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.EntityDamageEvent;
-
-public class Back_From_Void_Listener implements Listener {
-
- private static double x,y,z;
-
- public static void setXYZ(double addx,double addy,double addz) {
- x = addx;
- y = addy;
- z = addz;
- }
-
- @EventHandler
- public void onDamage(EntityDamageEvent event){
- if(!(event.getEntity() instanceof Player)){
- return;
- }
- if(!event.getCause().equals(EntityDamageEvent.DamageCause.VOID)){
- return;
- }
- Player player = ((Player) event.getEntity()).getPlayer();
-
- player.teleport(player.getWorld().getSpawnLocation().add(x,y,z));
- event.setCancelled(true);
- }
-
-}
diff --git a/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/DisableAllDamageListener.java b/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/DisableAllDamageListener.java
new file mode 100644
index 0000000..1aa575a
--- /dev/null
+++ b/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/DisableAllDamageListener.java
@@ -0,0 +1,32 @@
+package com.github.Shin_Ideal.LobbyFlyPlugin.Listeners;
+
+import com.github.Shin_Ideal.LobbyFlyPlugin.LobbyFlyPlugin;
+import org.bukkit.configuration.Configuration;
+import org.bukkit.entity.Player;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.EntityDamageEvent;
+
+public class DisableAllDamageListener implements Listener {
+
+ private final LobbyFlyPlugin Instance;
+ private final Configuration config;
+
+ public DisableAllDamageListener() {
+ Instance = LobbyFlyPlugin.getInstance();
+ config = Instance.getConfig();
+ }
+
+ @EventHandler
+ public void onDamage(EntityDamageEvent event) {
+ if (!config.getBoolean("disable-all-damage.enable")) {
+ return;
+ }
+
+ if (!(event.getEntity() instanceof Player)) {
+ return;
+ }
+
+ event.setCancelled(true);
+ }
+}
diff --git a/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/DisableFallDamageListener.java b/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/DisableFallDamageListener.java
new file mode 100644
index 0000000..763dc6b
--- /dev/null
+++ b/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/DisableFallDamageListener.java
@@ -0,0 +1,35 @@
+package com.github.Shin_Ideal.LobbyFlyPlugin.Listeners;
+
+import com.github.Shin_Ideal.LobbyFlyPlugin.LobbyFlyPlugin;
+import org.bukkit.configuration.Configuration;
+import org.bukkit.entity.Player;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.Listener;
+import org.bukkit.event.entity.EntityDamageEvent;
+
+public class DisableFallDamageListener implements Listener {
+
+ private final LobbyFlyPlugin Instance;
+ private final Configuration config;
+
+ public DisableFallDamageListener() {
+ Instance = LobbyFlyPlugin.getInstance();
+ config = Instance.getConfig();
+ }
+
+ @EventHandler
+ public void onDamage(EntityDamageEvent event) {
+ if (!config.getBoolean("disable-fall-damage.enable")) {
+ return;
+ }
+
+ if (!(event.getEntity() instanceof Player)) {
+ return;
+ }
+ if (!event.getCause().equals(EntityDamageEvent.DamageCause.FALL)) {
+ return;
+ }
+
+ event.setCancelled(true);
+ }
+}
diff --git a/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/Disable_All_Damage_Listener.java b/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/Disable_All_Damage_Listener.java
deleted file mode 100644
index 70c7567..0000000
--- a/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/Disable_All_Damage_Listener.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.github.Shin_Ideal.LobbyFlyPlugin.Listeners;
-
-import org.bukkit.entity.Player;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.EntityDamageEvent;
-
-public class Disable_All_Damage_Listener implements Listener {
-
- @EventHandler
- public void onDamage(EntityDamageEvent event){
- if(!(event.getEntity() instanceof Player)){
- return;
- }
- event.setCancelled(true);
- }
-
-}
diff --git a/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/Disable_Fall_Damage_Listener.java b/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/Disable_Fall_Damage_Listener.java
deleted file mode 100644
index 4450100..0000000
--- a/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/Disable_Fall_Damage_Listener.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.github.Shin_Ideal.LobbyFlyPlugin.Listeners;
-
-import org.bukkit.entity.Player;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.Listener;
-import org.bukkit.event.entity.EntityDamageEvent;
-
-public class Disable_Fall_Damage_Listener implements Listener {
-
- @EventHandler
- public void onDamage(EntityDamageEvent event){
- if(!(event.getEntity() instanceof Player)){
- return;
- }
- if(!event.getCause().equals(EntityDamageEvent.DamageCause.FALL)){
- return;
- }
- event.setCancelled(true);
- }
-
-}
diff --git a/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/HorizonLimitListener.java b/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/HorizonLimitListener.java
new file mode 100644
index 0000000..079ef03
--- /dev/null
+++ b/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/HorizonLimitListener.java
@@ -0,0 +1,50 @@
+package com.github.Shin_Ideal.LobbyFlyPlugin.Listeners;
+
+import com.github.Shin_Ideal.LobbyFlyPlugin.LobbyFlyPlugin;
+import org.bukkit.configuration.Configuration;
+import org.bukkit.entity.Player;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.Listener;
+import org.bukkit.event.player.PlayerMoveEvent;
+import org.bukkit.util.Vector;
+
+public class HorizonLimitListener implements Listener {
+
+ private final LobbyFlyPlugin Instance;
+ private final Configuration config;
+
+ public HorizonLimitListener() {
+ Instance = LobbyFlyPlugin.getInstance();
+ config = Instance.getConfig();
+ }
+
+ @EventHandler
+ public void onMove(PlayerMoveEvent event) {
+ if (!config.getBoolean("horizon-limit.enable")) {
+ return;
+ }
+
+ Player player = event.getPlayer();
+ Vector player_vector = player.getVelocity();
+ double x = player.getLocation().getX();
+ double z = player.getLocation().getZ();
+
+ double x_min_distance = config.getDouble("horizon-limit.x-min-distance");
+ double x_max_distance = config.getDouble("horizon-limit.x-max-distance");
+ double z_min_distance = config.getDouble("horizon-limit.z-min-distance");
+ double z_max_distance = config.getDouble("horizon-limit.z-max-distance");
+
+ if (x < x_min_distance) {
+ player.setVelocity(player_vector.add(new Vector(1, 0, 0)));
+ }
+ if (x_max_distance < x) {
+ player.setVelocity(player_vector.add(new Vector(-1, 0, 0)));
+ }
+ if (z < z_min_distance) {
+ player.setVelocity(player_vector.add(new Vector(0, 0, 1)));
+ }
+ if (z_max_distance < z) {
+ player.setVelocity(player_vector.add(new Vector(0, 0, -1)));
+ }
+ }
+}
diff --git a/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/Horizon_Limit_Listener.java b/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/Horizon_Limit_Listener.java
deleted file mode 100644
index e03a68f..0000000
--- a/src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/Horizon_Limit_Listener.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package com.github.Shin_Ideal.LobbyFlyPlugin.Listeners;
-
-import org.bukkit.entity.Player;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.Listener;
-import org.bukkit.event.player.PlayerMoveEvent;
-import org.bukkit.util.Vector;
-
-public class Horizon_Limit_Listener implements Listener {
-
- private static double x_min_distance;
- private static double x_max_distance;
- private static double z_min_distance;
- private static double z_max_distance;
-
- public static void setDistance(double xmin,double xman,double zmin,double zmax){
- Horizon_Limit_Listener.x_min_distance = xmin;
- Horizon_Limit_Listener.x_max_distance = xman;
- Horizon_Limit_Listener.z_min_distance = zmin;
- Horizon_Limit_Listener.z_max_distance = zmax;
- }
-
- @EventHandler
- public void onMove(PlayerMoveEvent event){
- Player player = event.getPlayer();
-
- Vector player_vector = player.getVelocity();
- double x = player.getLocation().getX();
- double z = player.getLocation().getZ();
-
- if(x