-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 parent
a01c0b2
commit 21c3369
Showing
19 changed files
with
299 additions
and
308 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
15 changes: 12 additions & 3 deletions
15
.../LobbyFlyPlugin/CommandExecutors/Fly.java → .../CommandExecutors/FlyCommandExecutor.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,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; | ||
} | ||
|
||
} |
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
25 changes: 0 additions & 25 deletions
25
src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/ConfigManager.java
This file was deleted.
Oops, something went wrong.
69 changes: 0 additions & 69 deletions
69
src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/ListenerManager.java
This file was deleted.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/BackFromVoidListener.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,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); | ||
} | ||
} |
32 changes: 0 additions & 32 deletions
32
src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/Back_From_Void_Listener.java
This file was deleted.
Oops, something went wrong.
32 changes: 32 additions & 0 deletions
32
src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/DisableAllDamageListener.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,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); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
src/main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/DisableFallDamageListener.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,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); | ||
} | ||
} |
18 changes: 0 additions & 18 deletions
18
...main/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/Disable_All_Damage_Listener.java
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
...ain/java/com/github/Shin_Ideal/LobbyFlyPlugin/Listeners/Disable_Fall_Damage_Listener.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.