Skip to content

Commit

Permalink
See the README for updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Dseym committed Oct 25, 2020
1 parent db7b999 commit 0ecba2e
Show file tree
Hide file tree
Showing 145 changed files with 1,936 additions and 866 deletions.
2 changes: 1 addition & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="lib" path="C:/programming/minecraft/ProtocolLib.jar"/>
<classpathentry kind="lib" path="C:/Users/kirill/Desktop/игры/spigot 1.12.2/spigot-1.12.2.jar"/>
<classpathentry kind="lib" path="C:/programming/minecraft/ProtocolLib.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
19 changes: 9 additions & 10 deletions .settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
eclipse.preferences.version=1
encoding//src/amongUs/Cameras.java=UTF-8
encoding//src/amongUs/Commands.java=UTF-8
encoding//src/amongUs/Door.java=UTF-8
encoding//src/amongUs/Event.java=UTF-8
encoding//src/amongUs/Game.java=UTF-8
encoding//src/amongUs/Lobby.java=UTF-8
encoding//src/amongUs/Main.java=UTF-8
encoding//src/amongUs/Manhole.java=UTF-8
encoding//src/amongUs/MapGame.java=UTF-8
encoding//src/amongUs/MapManager.java=UTF-8
encoding//src/amongUs/Messages.java=UTF-8
encoding//src/amongUs/PlayerGame.java=UTF-8
encoding//src/amongUs/Vote.java=UTF-8
encoding//src/game/Cameras.java=UTF-8
encoding//src/game/Door.java=UTF-8
encoding//src/game/Game.java=UTF-8
encoding//src/game/Lobby.java=UTF-8
encoding//src/game/Manhole.java=UTF-8
encoding//src/game/MapGame.java=UTF-8
encoding//src/game/MapManager.java=UTF-8
encoding//src/game/PlayerGame.java=UTF-8
encoding//src/game/Vote.java=UTF-8
encoding//src/tasks/Longs.java=UTF-8
encoding//src/tasks/Sabotage.java=UTF-8
encoding//src/tasks/Task.java=UTF-8
Expand Down
32 changes: 19 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,20 @@
## Description
New minecraft mini-game based on the canon of the game Among Us! Complete tasks, look for imposters, or kill if you are an imposter yourself!

### Updates 1.2.1
1. Fixed encoding to UTF-8
2. The messages.yml config is fully added
3. Added the playerOnCount parameter to the game config - the number of players for auto start (value -1 - disable)
4. Added new command /among setting list
5. Fixed many bugs
### Updates 1.3
1. Added the ability to enter the lobby using signs
```
Line1: [AmongUs]
Line2: *nameLobby*
```
2. Added a line to messages.yml (playerNotOwnerLobby)
3. Added automatic game creation in the lobby
4. Added a lobby owner and joining the lobby by the owner's nickname (/among joinNick nick)
5. (For API) Added events for the beginning, end of the game, etc
6. Added colored armor to players
7. Fixed bug

[Version 1.12.1](https://github.com/Dseym/amongUsMinecraft/releases/download/AmongUs1.2/amongUs.jar)
[Version 1.13](https://github.com/Dseym/amongUsMinecraft/releases/download/AmongUs1.3/amongUs.jar)

## Commands
/among help - get all commands
Expand All @@ -25,7 +31,7 @@ New minecraft mini-game based on the canon of the game Among Us! Complete tasks,
5. among.command - send commands while playing

## Messages
In file AmongUs/messages.yml. [Download](https://github.com/Dseym/amongUsMinecraft/releases/download/AmongUs1.2/messages.yml)
In file AmongUs/messages.yml. [Download](https://github.com/Dseym/amongUsMinecraft/releases/download/AmongUs1.3/messages.yml)

## Game config
In file AmongUs/gameConfig/example.yml (you can create your)
Expand Down Expand Up @@ -64,9 +70,9 @@ Video about the plugin (in Russian) - https://youtu.be/lHh4xp_ziro.
4. Now you have the code that you can edit!

## Install for Server
1. Download the compiled [AmongUs](https://github.com/Dseym/amongUsMinecraft/releases/download/AmongUs1.2/amongUs.jar) and upload it to your server.
1. Download the compiled [AmongUs](https://github.com/Dseym/amongUsMinecraft/releases/download/AmongUs1.3/amongUs.jar) and upload it to your server.
2. Download [ProtocolLib](https://www.spigotmc.org/resources/protocollib.1997) and upload it to your server.
3. Upload [world.tar](https://github.com/Dseym/amongUsMinecraft/releases/download/AmongUs1.2/world.tar) on server and unzip.
3. Upload [world.tar](https://github.com/Dseym/amongUsMinecraft/releases/download/AmongUs1.3/world.tar) on server and unzip.
4. Have fun!

If you need to translate the plugin into English, then write to Issues.
Expand All @@ -86,7 +92,7 @@ If you need to translate the plugin into English, then write to Issues.
5. among.command - отправлять команды во время игры

## Сообщения
В файле AmongUs/messages.yml. [Скачать](https://github.com/Dseym/amongUsMinecraft/releases/download/AmongUs1.2/messages.yml)
В файле AmongUs/messages.yml. [Скачать](https://github.com/Dseym/amongUsMinecraft/releases/download/AmongUs1.3/messages.yml)

## Игровой конфиг(gameConfig)
В файле AmongUs/gameConfig/example.yml (вы можете создать свой)
Expand Down Expand Up @@ -125,9 +131,9 @@ spawns:
4. Теперь у Вас есть код для редактирования!

## Установка на сервер
1. Скачайте скомпилированный [AmongUs](https://github.com/Dseym/amongUsMinecraft/releases/download/AmongUs1.2/amongUs.jar) и загрузите на сервер.
1. Скачайте скомпилированный [AmongUs](https://github.com/Dseym/amongUsMinecraft/releases/download/AmongUs1.3/amongUs.jar) и загрузите на сервер.
2. Скачайте [ProtocolLib](https://www.spigotmc.org/resources/protocollib.1997) и загрузите на сервер.
3. Загрузите [world.tar](https://github.com/Dseym/amongUsMinecraft/releases/download/AmongUs1.2/world.tar) на сервер и распакуйте.
3. Загрузите [world.tar](https://github.com/Dseym/amongUsMinecraft/releases/download/AmongUs1.3/world.tar) на сервер и распакуйте.
4. Веселись!

Если нужен перевод на англиский, пишите в Issues.
Binary file removed bin/amongUs/Cameras$1.class
Binary file not shown.
Binary file removed bin/amongUs/Cameras.class
Binary file not shown.
Binary file modified bin/amongUs/Commands.class
Binary file not shown.
Binary file added bin/amongUs/Config.class
Binary file not shown.
Binary file removed bin/amongUs/Door$1.class
Binary file not shown.
Binary file removed bin/amongUs/Event.class
Binary file not shown.
Binary file removed bin/amongUs/Game$1.class
Binary file not shown.
Binary file removed bin/amongUs/Game.class
Binary file not shown.
Binary file added bin/amongUs/Inv.class
Binary file not shown.
Binary file removed bin/amongUs/Lobby.class
Binary file not shown.
Binary file removed bin/amongUs/Main$1$1.class
Binary file not shown.
Binary file removed bin/amongUs/Main$1$2.class
Binary file not shown.
Binary file modified bin/amongUs/Main$1.class
Binary file not shown.
Binary file modified bin/amongUs/Main.class
Binary file not shown.
Binary file removed bin/amongUs/MapManager.class
Binary file not shown.
Binary file modified bin/amongUs/Messages.class
Binary file not shown.
Binary file removed bin/amongUs/PlayerGame.class
Binary file not shown.
Binary file added bin/amongUs/Protocol$1.class
Binary file not shown.
Binary file added bin/amongUs/Protocol$2.class
Binary file not shown.
Binary file added bin/amongUs/Protocol.class
Binary file not shown.
Binary file removed bin/amongUs/Vote$1.class
Binary file not shown.
Binary file removed bin/amongUs/Vote.class
Binary file not shown.
Binary file added bin/events/GameEndEvent.class
Binary file not shown.
Binary file added bin/events/GameStartEvent.class
Binary file not shown.
Binary file added bin/events/LobbyPlayerJoinEvent.class
Binary file not shown.
Binary file added bin/events/LobbyPlayerLeaveEvent.class
Binary file not shown.
Binary file added bin/game/Cameras$1.class
Binary file not shown.
Binary file added bin/game/Cameras.class
Binary file not shown.
Binary file added bin/game/Color.class
Binary file not shown.
Binary file added bin/game/Door$1.class
Binary file not shown.
Binary file renamed bin/amongUs/Door.class → bin/game/Door.class
Binary file not shown.
Binary file added bin/game/Game$1.class
Binary file not shown.
Binary file added bin/game/Game.class
Binary file not shown.
Binary file added bin/game/Kits.class
Binary file not shown.
Binary file added bin/game/Lobby$1.class
Binary file not shown.
Binary file not shown.
Binary file added bin/game/Lobby$3.class
Binary file not shown.
Binary file added bin/game/Lobby.class
Binary file not shown.
Binary file added bin/game/LobbySign$1.class
Binary file not shown.
Binary file added bin/game/LobbySign$2.class
Binary file not shown.
Binary file added bin/game/LobbySign.class
Binary file not shown.
Binary file renamed bin/amongUs/Manhole.class → bin/game/Manhole.class
Binary file not shown.
Binary file not shown.
Binary file added bin/game/MapManager.class
Binary file not shown.
Binary file added bin/game/PlayerGame.class
Binary file not shown.
Binary file added bin/game/Vote$1.class
Binary file not shown.
Binary file renamed bin/amongUs/Vote$2.class → bin/game/Vote$2.class
Binary file not shown.
Binary file added bin/game/Vote.class
Binary file not shown.
Binary file added bin/listeners/CancelListener.class
Binary file not shown.
Binary file added bin/listeners/ClickTaskListener.class
Binary file not shown.
Binary file added bin/listeners/GameEndListener.class
Binary file not shown.
Binary file added bin/listeners/ImpostorListener.class
Binary file not shown.
Binary file added bin/listeners/MeetingListener.class
Binary file not shown.
Binary file added bin/listeners/ReportBodyListener.class
Binary file not shown.
Binary file added bin/listeners/ServerListener.class
Binary file not shown.
Binary file modified bin/tasks/Longs.class
Binary file not shown.
Binary file modified bin/tasks/Sabotage$1.class
Binary file not shown.
Binary file modified bin/tasks/Sabotage.class
Binary file not shown.
Binary file modified bin/tasks/Task$1.class
Binary file not shown.
Binary file modified bin/tasks/Task$2.class
Binary file not shown.
Binary file modified bin/tasks/Task$3.class
Binary file not shown.
Binary file added bin/tasks/Task$4.class
Binary file not shown.
Binary file modified bin/tasks/Task.class
Binary file not shown.
Binary file modified bin/tasks/list/CalibrateDistr$2.class
Binary file not shown.
Binary file modified bin/tasks/list/CalibrateDistr.class
Binary file not shown.
Binary file modified bin/tasks/list/Card$1.class
Binary file not shown.
Binary file modified bin/tasks/list/Card.class
Binary file not shown.
Binary file modified bin/tasks/list/ClearOxygen$1.class
Binary file not shown.
Binary file modified bin/tasks/list/ClearOxygen.class
Binary file not shown.
Binary file modified bin/tasks/list/Energy$1.class
Binary file not shown.
Binary file modified bin/tasks/list/Energy.class
Binary file not shown.
Binary file modified bin/tasks/list/Meteor$1.class
Binary file not shown.
Binary file modified bin/tasks/list/Meteor.class
Binary file not shown.
Binary file modified bin/tasks/list/Rabbish$1.class
Binary file not shown.
Binary file modified bin/tasks/list/Rabbish.class
Binary file not shown.
Binary file modified bin/tasks/list/Reactor$1.class
Binary file not shown.
Binary file modified bin/tasks/list/Reactor.class
Binary file not shown.
Binary file modified bin/tasks/list/Refuel$1.class
Binary file not shown.
Binary file modified bin/tasks/list/Refuel.class
Binary file not shown.
Binary file modified bin/tasks/list/SabotageCommunicate$1.class
Binary file not shown.
Binary file modified bin/tasks/list/SabotageCommunicate$2.class
Binary file not shown.
Binary file modified bin/tasks/list/SabotageCommunicate.class
Binary file not shown.
Binary file modified bin/tasks/list/SabotageElectrical$1.class
Binary file not shown.
Binary file modified bin/tasks/list/SabotageElectrical$2.class
Binary file not shown.
Binary file modified bin/tasks/list/SabotageElectrical.class
Binary file not shown.
Binary file modified bin/tasks/list/SabotageOxygen$1.class
Binary file not shown.
Binary file modified bin/tasks/list/SabotageOxygen$2.class
Binary file not shown.
Binary file modified bin/tasks/list/SabotageOxygen.class
Binary file not shown.
Binary file modified bin/tasks/list/SabotageReactor$1.class
Binary file not shown.
Binary file modified bin/tasks/list/SabotageReactor$2.class
Binary file not shown.
Binary file modified bin/tasks/list/SabotageReactor.class
Binary file not shown.
Binary file modified bin/tasks/list/Scan$1.class
Binary file not shown.
Binary file modified bin/tasks/list/Scan.class
Binary file not shown.
Binary file modified bin/tasks/list/Shield$1.class
Binary file not shown.
Binary file modified bin/tasks/list/Shield.class
Binary file not shown.
Binary file modified bin/tasks/list/ShipWay$1.class
Binary file not shown.
Binary file modified bin/tasks/list/ShipWay.class
Binary file not shown.
Binary file modified bin/tasks/list/StabilizeDrive$1.class
Binary file not shown.
Binary file modified bin/tasks/list/StabilizeDrive.class
Binary file not shown.
Binary file modified bin/tasks/list/StabilizeWay$1.class
Binary file not shown.
Binary file modified bin/tasks/list/StabilizeWay.class
Binary file not shown.
Binary file modified bin/tasks/list/UnlockManifold$1.class
Binary file not shown.
Binary file modified bin/tasks/list/UnlockManifold.class
Binary file not shown.
Binary file modified bin/tasks/list/Wiring$1.class
Binary file not shown.
Binary file modified bin/tasks/list/Wiring.class
Binary file not shown.
2 changes: 1 addition & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: AmongUs
version: 1.2.1
version: 1.3
main: amongUs.Main
commands:
among:
Expand Down
136 changes: 104 additions & 32 deletions src/amongUs/Commands.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
package amongUs;

import java.io.File;
import java.io.IOException;
import java.lang.reflect.Field;

import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;

import game.Game;
import game.Lobby;

public class Commands implements CommandExecutor {

@Override
Expand All @@ -37,6 +38,8 @@ else if(args[0].equalsIgnoreCase("setLobby"))
setLobby(sender, args);
else if(args[0].equalsIgnoreCase("list"))
list(sender);
else if(args[0].equalsIgnoreCase("joinNick"))
joinNick(sender, args);
else if(args[0].equalsIgnoreCase("help"))
help(sender);
else
Expand All @@ -60,6 +63,13 @@ private void list(CommandSender sender) {

private void setLobby(CommandSender sender, String[] args) {

if(!(sender instanceof Player)) {

sender.sendMessage(Main.tagPlugin + Messages.senderNotPl);
return;

}

if(!sender.hasPermission("among.lobby")) {

sender.sendMessage(Main.tagPlugin + Messages.notPerm);
Expand All @@ -84,19 +94,24 @@ private void setLobby(CommandSender sender, String[] args) {
else
lobby.setLoc(loc);

File file = new File(Main.plugin.getDataFolder() + File.separator + "config.yml");
FileConfiguration config = (FileConfiguration) YamlConfiguration.loadConfiguration(file);

config.set(args[1] + ".location", loc.getWorld().getName() + "," + loc.getBlockX() + "," + loc.getBlockY() + "," + loc.getBlockZ());
String key = args[1] + ".location";
String value = loc.getWorld().getName() + "," + loc.getBlockX() + "," + loc.getBlockY() + "," + loc.getBlockZ();

try {config.save(file);} catch (IOException e) {}
Config.saveConfig("config", key, value);

sender.sendMessage(Main.tagPlugin + Messages.success);

}

private void leave(CommandSender sender) {

if(!(sender instanceof Player)) {

sender.sendMessage(Main.tagPlugin + Messages.senderNotPl);
return;

}

Lobby lobby = Lobby.getLobby((Player)sender);
if(lobby == null) {

Expand All @@ -112,27 +127,25 @@ private void leave(CommandSender sender) {

private void join(CommandSender sender, String[] args) {

if(args.length == 1) {

sender.sendMessage(Main.tagPlugin + Messages.lacksArgs);
if(!(sender instanceof Player)) {

sender.sendMessage(Main.tagPlugin + Messages.senderNotPl);
return;

}

Lobby lobby = Lobby.getLobby(args[1]);
if(lobby == null) {
if(args.length == 1) {

sender.sendMessage(Main.tagPlugin + Messages.lobbyNotFound);
sender.sendMessage(Main.tagPlugin + Messages.lacksArgs);

return;

}

Lobby lobby2 = Lobby.getLobby((Player)sender);
if(lobby2 != null) {
Lobby lobby = Lobby.getLobby(args[1]);
if(lobby == null) {

sender.sendMessage(Main.tagPlugin + Messages.plInLobby);
sender.sendMessage(Main.tagPlugin + Messages.lobbyNotFound);

return;

Expand All @@ -144,6 +157,13 @@ private void join(CommandSender sender, String[] args) {

private void setSetting(CommandSender sender, String[] args) {

if(!(sender instanceof Player)) {

sender.sendMessage(Main.tagPlugin + Messages.senderNotPl);
return;

}

Lobby lobby = Lobby.getLobby((Player)sender);
if(lobby == null) {

Expand Down Expand Up @@ -185,7 +205,7 @@ private void setSetting(CommandSender sender, String[] args) {

}

if(!sender.hasPermission("among.setting")) {
if(!sender.hasPermission("among.setting") && !sender.hasPermission("among.setting")) {

sender.sendMessage(Main.tagPlugin + Messages.notPerm);

Expand Down Expand Up @@ -237,6 +257,13 @@ private void setSetting(CommandSender sender, String[] args) {

private void listSettings(CommandSender sender, Lobby lobby) {

if(!(sender instanceof Player)) {

sender.sendMessage(Main.tagPlugin + Messages.senderNotPl);
return;

}

Game game = lobby.getGame();

sender.sendMessage(Main.tagPlugin +
Expand Down Expand Up @@ -291,6 +318,13 @@ private void voteOpenInv(CommandSender sender) {

private void start(CommandSender sender) {

if(!(sender instanceof Player)) {

sender.sendMessage(Main.tagPlugin + Messages.senderNotPl);
return;

}

Lobby lobby = Lobby.getLobby((Player)sender);
if(lobby == null) {

Expand All @@ -300,7 +334,7 @@ private void start(CommandSender sender) {

}

if(!sender.hasPermission("among.start")) {
if(!sender.hasPermission("among.start") && !sender.hasPermission("among.setting")) {

sender.sendMessage(Main.tagPlugin + Messages.notPerm);

Expand Down Expand Up @@ -336,6 +370,13 @@ private void start(CommandSender sender) {

private void create(CommandSender sender, String[] args) {

if(!(sender instanceof Player)) {

sender.sendMessage(Main.tagPlugin + Messages.senderNotPl);
return;

}

Lobby lobby = Lobby.getLobby((Player)sender);
if(lobby == null) {

Expand All @@ -345,7 +386,7 @@ private void create(CommandSender sender, String[] args) {

}

if(!sender.hasPermission("among.create")) {
if(!sender.hasPermission("among.create") && !sender.hasPermission("among.setting")) {

sender.sendMessage(Main.tagPlugin + Messages.notPerm);

Expand All @@ -369,19 +410,11 @@ private void create(CommandSender sender, String[] args) {

}

try {

File fileConfigGame = new File(Main.plugin.getDataFolder() + File.separator + "gameConfig" + File.separator + args[1] + ".yml");
FileConfiguration configGame = (FileConfiguration) YamlConfiguration.loadConfiguration(fileConfigGame);

lobby.createGame(configGame);

} catch (Exception e) {

FileConfiguration configGame = Config.loadGameConfig(args[1]);
if(configGame == null)
sender.sendMessage(Main.tagPlugin + Messages.notFoundConfig);
e.printStackTrace();

}
else
lobby.createGame(configGame);

}

Expand Down Expand Up @@ -439,6 +472,45 @@ private void vote(CommandSender sender, String[] args) {

}

private void joinNick(CommandSender sender, String[] args) {

if(!(sender instanceof Player)) {

sender.sendMessage(Main.tagPlugin + Messages.senderNotPl);
return;

}

if(args.length == 1) {

sender.sendMessage(Main.tagPlugin + Messages.lacksArgs);

return;

}

Player p = Bukkit.getPlayer(args[1]);
if(p == null || Lobby.getLobby(p) == null) {

sender.sendMessage(Main.tagPlugin + Messages.playerNotFound);

return;

}

Lobby lobby = Lobby.getLobbyForOwner(p);
if(lobby == null) {

sender.sendMessage(Main.tagPlugin + Messages.playerNotOwnerLobby);

return;

}

Lobby.getLobbyForOwner(p).join((Player)sender);

}

private void help(CommandSender sender) {

sender.sendMessage(Main.tagPlugin + Messages.helpMenu);
Expand Down
Loading

0 comments on commit 0ecba2e

Please sign in to comment.