Base framework

This commit is contained in:
Aubri Seebauer committed 2023-04-20 23:13:28 -04:00
1 parent d97d25e7c6
commit c54512bfb6
7 files changed
+110 -3

No files matched your search

+2 -2
View File
@@ -23,8 +23,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
<plugin>
@@ -0,0 +1,53 @@
package org.aubrithehuman.entitybingo;
import java.util.HashMap;
public class BingoEvent {
private final HashMap<String, Integer> entries;
public BingoEvent() {
this.entries = new HashMap<>();
}
public HashMap<String, Integer> getEntries() {
return entries;
}
/**
* return true if player has not yet made a guess, else return false
*
* @param player player
* @param value value
* @return previous guess
*/
public boolean addEntry(String player, int value) {
if(entries.containsKey(player)) {
entries.put(player, value);
return true;
} else {
entries.put(player, value);
return false;
}
}
public int totalGuesses() {
return this.entries.size();
}
/**
* Return a player based on the entry, if none match then return null;
*
* @param i value
* @return player
*/
public String getByEntry(int i) {
for(String s : entries.keySet()) {
if (entries.get(s) == i) {
return s;
}
}
return null;
}
}
@@ -19,7 +19,7 @@ public final class EntityBingo extends JavaPlugin implements Listener {
DataManager.init();
this.getLogger().info("EntityBingo loaded");
this.getLogger().info("EntityBingo loaded.");
}
@Override
@@ -0,0 +1,33 @@
package org.aubrithehuman.entitybingo.command;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import java.util.List;
public class EntityBingoCommand implements CommandExecutor, TabCompleter {
private final List<String> options = List.of(new String[] {
"scoreboard"
});
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if(args.length >= 1) {
if(args[0].equalsIgnoreCase("scoreboard")) {
}
}
return false;
}
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) {
if(args.length >= 1) {
return options;
}
return null;
}
}
@@ -0,0 +1,15 @@
package org.aubrithehuman.entitybingo.listeners;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
public class ChatListener implements Listener {
@EventHandler(priority = EventPriority.MONITOR)
public void onChat(PlayerCommandPreprocessEvent e) {
}
}
View File
Whitespace-only changes.
+6
View File
@@ -2,3 +2,9 @@ name: EntityBingo
version: '${project.version}'
main: org.aubrithehuman.entitybingo.EntityBingo
api-version: 1.19
commands:
entitybingo:
description: used to display the scoreboard.
usage: /entitybingo
aliases: [eb, entb]