-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from ModularSoftAU/holograms
Implementation of Holograms and product documentation.
- Loading branch information
Showing
11 changed files
with
167 additions
and
37 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 +1,34 @@ | ||
# MobHunt | ||
# Mob Hunt | ||
|
||
## Installation | ||
* Clone this repo. | ||
* Configure your config. | ||
* Run the dbinit. | ||
* Download the latest version of Mob Hunt from our [releases page](https://github.com/ModularSoftAU/MobHunt/releases/) | ||
* Drop the Mob Hunt jar file into your plugins' folder. | ||
* Set all of your point allocations per mob in the `config.yml` under `MobHunt.Points` and define your kill cap under `MobHunt.KillCap` | ||
|
||
## Requirements | ||
* MySQL Database. | ||
|
||
## Soft Dependencies | ||
- [Optional] `DecentHolograms` if you would like to have a holographic live update leaderboard. | ||
|
||
## Gameplay | ||
When a player kills a mob it is logged into a database and a number incremented in their name. | ||
Most amount and unique amount of mobs that a player kills, wins. | ||
|
||
#### Milestones | ||
When a player kills over an X amount of mobs, a message will broadcast to all online players that they have reached a milestone. | ||
The milestones can be changed and modified in the `config.yml` under `Milestones.Messages` and you can change them based on Major and Minor. | ||
|
||
### Holographic Leaderboard | ||
|
||
|
||
## Commands | ||
| Command | Description | Permission | | ||
|-----------------------|----------------------------------------------------------|-----------------| | ||
| /mobstats | Shows a breakdown of the mobs you killed | | | ||
| /mobclear | Clear all mobs from yourself or another player. | `mobhunt.admin` | | ||
| /mobleaderboard [mob] | Show the Top 5 Mob Hunters overall or of a specific mob. | | | ||
| /mobhelp | Helps the player know how to play Mob Hunt. | | |
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
43 changes: 43 additions & 0 deletions
43
src/main/java/org/modularsoft/MobHunt/HologramController.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,43 @@ | ||
package org.modularsoft.MobHunt; | ||
|
||
import eu.decentsoftware.holograms.api.DHAPI; | ||
import eu.decentsoftware.holograms.api.holograms.Hologram; | ||
import org.bukkit.Bukkit; | ||
import org.bukkit.Location; | ||
import org.bukkit.World; | ||
|
||
import java.util.List; | ||
|
||
public class HologramController { | ||
private final MobHuntMain plugin; | ||
private final HunterController hunterController; | ||
|
||
public HologramController(MobHuntMain plugin, HunterController hunterController) { | ||
this.plugin = plugin; | ||
this.hunterController = hunterController; | ||
} | ||
|
||
public void reloadHunterLeaderboard() { | ||
Hologram leaderboardHologram = DHAPI.getHologram("mh_leaderboard"); | ||
if (leaderboardHologram == null) { | ||
double x = plugin.config().getHologramLocationX(); | ||
double y = plugin.config().getHologramLocationY(); | ||
double z = plugin.config().getHologramLocationZ(); | ||
String worldName = plugin.config().getHologramLocationWorld(); | ||
|
||
World world = Bukkit.getWorld(worldName); | ||
if (world == null) { | ||
plugin.getLogger().warning("World '" + worldName + "' not found."); | ||
return; | ||
} | ||
|
||
Location location = new Location(world, x, y, z); | ||
leaderboardHologram = DHAPI.createHologram("mh_leaderboard", location, false); | ||
} | ||
|
||
List<MobHuntQuery.MobHunter> bestHunters = MobHuntQuery.getBestHunters( | ||
plugin, null, 10); | ||
List<String> lines = hunterController.getLeaderboardText(bestHunters); | ||
DHAPI.setHologramLines(leaderboardHologram, lines); | ||
} | ||
} |
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
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
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
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
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
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
Oops, something went wrong.