Skip to content

Commit

Permalink
Release 1.1 (still no points limit but who asked?)
Browse files Browse the repository at this point in the history
Ayo it's working! I think...
Ok we're gonna say it is!
  • Loading branch information
Ghosty920 committed Oct 23, 2022
1 parent 3a4aa01 commit 54a1ea3
Show file tree
Hide file tree
Showing 28 changed files with 954 additions and 53 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
.mtj.tmp/

# Package Files #
*.jar
# *.jar I need it #
*.war
*.nar
*.ear
*.zip
# *.zip I need it too uwu #
*.tar.gz
*.rar

Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,26 @@ This project is finally here after... 2 days of work WOW GG MYSELF!

## What is the goal?
The goal? Go in the opposite "goal", a little hole.
You have chests all around the map (not on the map you can download below, because my friend finds them "too OP", why not), with stuff in. Use it to go to the other base, kill enemies, do your chores...
You have chests all around the map (not on the map you can download below, because my friend finds them "too OP", why not, feel free to add chests by yourself), with stuff in. Use it to go to the other base, kill enemies, do your goal...
Once you have 5 points (not in the actual version, later) you win!
It's that easy.
You can break any block on the map, place any block... You're free.

## How to install it?
- Have a spigot server
- Download the plugin from here (i'll add a link later)
- Download the plugin from [here](https://github.com/GhostCode920/Towers/blob/main/librairies/Towers.jar).
- Place it into your plugins folder
- (Download the default map from [here](https://github.com/GhostCode920/Towers/blob/main/librairies/Towers_Map.zip) [the config is already configured for it, feel free to edit it]).
- Restart your server
- Edit the config as you want
- Restart your server
- Do /join and play with your friends (if you have some)

## What librairies am I using?
I am using Spigot 1.8.8, lombok and GameAPI made by myself.
I will add them in this repository later.
They are in the librairies folder.

## Other things
[![Code size](https://img.shields.io/github/languages/code-size/GhostCode920/Towers?color=f&label=Code%20size)]()
[![Total lines](https://img.shields.io/tokei/lines/github/GhostCode920/Towers?color=3355ff&label=Total%20lines)]()
If you have any feedback, suggestion or bugs, please contact me on my discord (it is on my profile) ^^
Binary file added librairies/GameAPI.jar
Binary file not shown.
Binary file added librairies/Towers.jar
Binary file not shown.
Binary file added librairies/Towers_Map.zip
Binary file not shown.
21 changes: 21 additions & 0 deletions librairies/about_it.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## config.yml
The default config.
A config for 4 players on the map in [Towers_Map.zip](https://github.com/GhostCode920/Towers/blob/main/librairies/Towers_Map.zip)

## GameAPI.jar
The API I created and used to make the game.
You don't need to install it to use the plugin.

## lombok.jar
Used to have the @Getter, @Setter, @AllArgsConstructor... classes and make the code cleaner.
You will need it if you want to edit the code.

## spigot.jar
The spigot build I use. It is 1.8.8.

## Towers.jar
It contains the compiled plugin.
All librairies are already in (GameAPI too, you don't need it on your server for it to works)

## Towers_Map.zip
The Map used for the Game with the [default config](https://github.com/GhostCode920/Towers/blob/main/librairies/config.yml).
92 changes: 92 additions & 0 deletions librairies/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
game-config:
max-players: 4
map-name: "Towers"
first-timer:
min-players: 2 # for 2 players, just put 3 here, so it isn't called
seconds: 60
fast-timer:
min-players: 4
seconds: 10


locations:
waiting-spawn:
x: 0.5
y: 201.0
z: 0.5
yaw: 90.0
pitch: 0.0
spawn-protection-radius: 4 # nobody can break/place blocks in that radius (radius of the cube lol)
blues-spawn:
x: -83.5
y: 92.0
z: 0.5
yaw: -90.0
pitch: 0.0
reds-spawn:
x: 84.5
y: 92.0
z: 0.5
yaw: 90.0
pitch: 0.0

goals:
block-type: ENDER_PORTAL_FRAME # all avaible blocks here: https://helpch.at/docs/1.8.8/org/bukkit/Material.html; Don't put an item or it won't work
check-radius: 1 # 0 = only the block, 1 = all blocks around (not above and under), 2 = all blocks around and all the blocks around the blocks...
no-block-radius: 3 # same as above but with all possible y
blue-goal: # The middle block of where the blues need to go to goal
x: 84
y: 100
z: 0
red-goal: # The middle block of where the reds need to go to goal
x: -84
y: 100
z: 0

build-height-limit: 140

number-of-instances: 1

# this can be modified or totally deleted using the API included in the plugin
bungeecord:
enabled: true
if-enabled:
return-server: lobby
else:
return-world: lobby



messages:
prefix: "§c[Towers] "
join: "§a+ %name% §7(%online%/%max%)"
leave: "§c- %name% §7(%online%/%max%)"
leave-in-game: "%color%%name% §cdisconnected! He may rejoin later."
team-select: "§aYou joined the %color%%team% Team§a!"
no-game: "§cThere is no game avaible now. Please try later."
joining: "§bAdding you into a game..."
players-only: "§cThis command is reserved to players."
died-unknown: "%color%%name% §edied."
died-player: "%color%%name% §ewas killed by %killer%."
no-build: "§cYou cannot build here!"
score: "%color%%name% §escore a point! §9%bluepoints%§7-§c%redpoints%"
build-height-limit: "§cYou cannot build that high."
countdown-cancelled: "§cCountdown cancelled. Not enough players to start the game."
countdown-multiple: "§aStarting in §e§l%timer% seconds§a."
countdown-one-second: "§aStarting in §e§l1 second§a."
countdown-zero: "§2Game started! GLHF"
teams: # it isn't recommanded to change teams color right now (example: from blue to yellow), because the armor color WON'T change. Thanks!
blue:
name: "Blue"
color: "§9"
red:
name: "Red"
color: "§c"
scoreboard:
title: "§c§lTowers"
blue-points: "%color%%team% Points§7: §b%bluepoints%"
red-points: "%color%%team% Points§7: §b%redpoints%"
current-team: "§7Your team: %color%%team%"
kills: "§7Kills: §b%kills%"
deaths: "§7Deaths: §b%deaths%"
server-ip: "§bBy GhostCode#1832 (big ad)"
Binary file added librairies/lombok.jar
Binary file not shown.
Binary file added librairies/spigot.jar
Binary file not shown.
35 changes: 18 additions & 17 deletions src/config.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
game-config:
max-players: 2
max-players: 4
map-name: "Towers"
first-timer:
min-players: 3
seconds: 30
min-players: 2 # for 2 players, just put 3 here, so it isn't called
seconds: 60
fast-timer:
min-players: 2
min-players: 4
seconds: 10


locations:
waiting-spawn:
x: 0.5
y: 238.0
z: 1152.5
y: 201.0
z: 0.5
yaw: 90.0
pitch: 0.0
spawn-protection-radius: 4 # nobody can break/place blocks in that radius (radius of the cube lol)
blues-spawn:
x: -83.5
y: 192.0
z: 1152.5
y: 92.0
z: 0.5
yaw: -90.0
pitch: 0.0
reds-spawn:
x: 84.5
y: 192.0
z: 1152.5
y: 92.0
z: 0.5
yaw: 90.0
pitch: 0.0

goals:
block-type: end_portal_frame
block-type: ENDER_PORTAL_FRAME # all avaible blocks here: https://helpch.at/docs/1.8.8/org/bukkit/Material.html; Don't put an item or it won't work
check-radius: 1 # 0 = only the block, 1 = all blocks around (not above and under), 2 = all blocks around and all the blocks around the blocks...
no-block-radius: 3 # same as above but with all possible y
blue-goal: # The middle block of where the blues need to go to goal
x: 84
y: 200
z: 1152
y: 100
z: 0
red-goal: # The middle block of where the reds need to go to goal
x: -84
y: 200
z: 1152
y: 100
z: 0

# Coming soon I guess
build-height-limit: 255
build-height-limit: 140

number-of-instances: 1

Expand All @@ -70,6 +70,7 @@ messages:
died-player: "%color%%name% §ewas killed by %killer%."
no-build: "§cYou cannot build here!"
score: "%color%%name% §escore a point! §9%bluepoints%§7-§c%redpoints%"
build-height-limit: "§cYou cannot build that high."
countdown-cancelled: "§cCountdown cancelled. Not enough players to start the game."
countdown-multiple: "§aStarting in §e§l%timer% seconds§a."
countdown-one-second: "§aStarting in §e§l1 second§a."
Expand Down
11 changes: 11 additions & 0 deletions src/dev/ghosty/gameapi/Game.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package dev.ghosty.gameapi;

import dev.ghosty.gameapi.config.Config;

public interface Game {

public GameInfo getGameInfo();

public Config getConfiguration();

}
54 changes: 54 additions & 0 deletions src/dev/ghosty/gameapi/GameInfo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package dev.ghosty.gameapi;

import javax.annotation.Nonnegative;

public interface GameInfo {

/**
* <p>The game name
* <p>Example: Bedwars
*/
public String gameName();

/**
* <p>The maximum of players that can be in the game
* <p>Example: 16
*/
@Nonnegative
public int maxPlayers();

/**
* <p>The minimum of players to get the slow timer starting
* <p>Example: 8
* @see GameInfo#slowTimer()
*/
@Nonnegative
public int minPlayersForSlowTimer();
/**
* <p>The timer for when there is {@link GameInfo#minPlayersForSlowTimer() X} players in the game
* <p>Example: 90
* <p>The returned value must be in seconds
* @see GameInfo#minPlayersForSlowTimer()
*/
@Nonnegative
public int slowTimer();
/**
* <p>The minimum of players to get the fast timer starting
* <p>Example: 12
* @see GameInfo#fastTimer()
*/
@Nonnegative
public int minPlayersForFastTimer();
/**
* <p>The fast timer for when there is {@link GameInfo#minPlayersForFastTimer() X} players in the game
* <p>Example: 15
* <p>The returned value must be in seconds
* @see GameInfo#minPlayersForFastTimer()
*/
@Nonnegative
public int fastTimer();

@Nonnegative
public int numberOfInstances();

}
15 changes: 15 additions & 0 deletions src/dev/ghosty/gameapi/config/Config.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package dev.ghosty.gameapi.config;

import org.bukkit.configuration.file.FileConfiguration;

public final class Config extends Configuration {

public Config(String pluginName) {
super("plugins/"+pluginName+"/config.yml");
}

public Config(FileConfiguration config) {
super(config);
}

}
Loading

0 comments on commit 54a1ea3

Please sign in to comment.