This repository has been archived by the owner on Mar 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactoring Party
- Loading branch information
k-egor-smirnov
committed
Jul 30, 2017
1 parent
00fc8c4
commit 686fe9f
Showing
18 changed files
with
743 additions
and
271 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,35 @@ | ||
name: Detour | ||
version: 1.2.6 | ||
version: 1.3.0 | ||
author: AlphaCH1337 | ||
main: ru.alphach1337.detour.Main | ||
main: ru.alphach1337.detour.Detour | ||
commands: | ||
detour: | ||
start: | ||
description: Начинает обход | ||
usage: /start | ||
permission: detour.manage | ||
usage: /detour start | ||
stop: | ||
description: Заканчивает обход | ||
usage: /stop | ||
permission: detour.manage | ||
usage: /detour stop | ||
join: | ||
description: Присоединиться к обходу | ||
usage: /join | ||
permission: detour.join | ||
usage: /detour join | ||
next: | ||
descrption: Следующий игрок | ||
usage: /next | ||
usage: /detour [start, stop, join, next] | ||
permission: detour.manage | ||
usage: /detour next | ||
usage: /detour [start, stop, join, next] | ||
permissions: | ||
detour.*: | ||
description: Дает доступ ко всем командам обхода | ||
children: | ||
detour.manage: true | ||
detour.join: true | ||
detour.manage: | ||
description: Дает доступ к управлению (начать/остановить/переход) обходом | ||
default: false | ||
detour.join: | ||
description: Дает доступ к присоединению к обходу | ||
default: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,35 @@ | ||
name: Detour | ||
version: 1.2.6 | ||
version: 1.3.0 | ||
author: AlphaCH1337 | ||
main: ru.alphach1337.detour.Main | ||
main: ru.alphach1337.detour.Detour | ||
commands: | ||
detour: | ||
start: | ||
description: Начинает обход | ||
usage: /start | ||
permission: detour.manage | ||
usage: /detour start | ||
stop: | ||
description: Заканчивает обход | ||
usage: /stop | ||
permission: detour.manage | ||
usage: /detour stop | ||
join: | ||
description: Присоединиться к обходу | ||
usage: /join | ||
permission: detour.join | ||
usage: /detour join | ||
next: | ||
descrption: Следующий игрок | ||
usage: /next | ||
usage: /detour [start, stop, join, next] | ||
permission: detour.manage | ||
usage: /detour next | ||
usage: /detour [start, stop, join, next] | ||
permissions: | ||
detour.*: | ||
description: Дает доступ ко всем командам обхода | ||
children: | ||
detour.manage: true | ||
detour.join: true | ||
detour.manage: | ||
description: Дает доступ к управлению (начать/остановить/переход) обходом | ||
default: false | ||
detour.join: | ||
description: Дает доступ к присоединению к обходу | ||
default: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package ru.alphach1337.detour; | ||
|
||
import com.connorlinfoot.actionbarapi.ActionBarAPI; | ||
import org.bukkit.*; | ||
import org.bukkit.Material; | ||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.configuration.file.FileConfiguration; | ||
import org.bukkit.craftbukkit.libs.jline.internal.Log; | ||
import org.bukkit.entity.*; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.Listener; | ||
import org.bukkit.event.block.Action; | ||
import org.bukkit.event.player.PlayerInteractEvent; | ||
import org.bukkit.event.player.PlayerJoinEvent; | ||
import org.bukkit.event.player.PlayerQuitEvent; | ||
import org.bukkit.inventory.ItemStack; | ||
import org.bukkit.inventory.meta.ItemMeta; | ||
import org.bukkit.plugin.java.JavaPlugin; | ||
import ru.alphach1337.detour.commands.*; | ||
import ru.alphach1337.detour.events.EventListener; | ||
|
||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
|
||
|
||
public class Detour extends JavaPlugin implements Listener { | ||
private ArrayList<Player> party = new ArrayList<>(); | ||
|
||
private boolean isDetour = false; | ||
|
||
@Override | ||
public void onEnable() { | ||
getServer().getPluginManager().registerEvents(new EventListener(), this); | ||
|
||
this.getConfig().addDefault("allowOffline", false); | ||
this.getConfig().addDefault("hoursToAllowDetour", 12); | ||
this.getConfig().options().copyDefaults(true); | ||
saveConfig(); | ||
|
||
CommandHandler cw = new CommandHandler("detour"); | ||
cw.commands.add(new Join()); | ||
cw.commands.add(new Start()); | ||
cw.commands.add(new Stop()); | ||
cw.commands.add(new Next()); | ||
cw.commands.add(new Party()); | ||
cw.commands.add(new Stick()); | ||
this.getCommand("detour").setExecutor(cw); | ||
} | ||
|
||
@Override | ||
public void onDisable() { | ||
|
||
} | ||
} |
Oops, something went wrong.