Initial commit
This commit is contained in:
3
Plugins/Old/KillAllMobs/.idea/.gitignore
generated
vendored
Normal file
3
Plugins/Old/KillAllMobs/.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
8
Plugins/Old/KillAllMobs/.idea/artifacts/KillAllMobs.xml
generated
Normal file
8
Plugins/Old/KillAllMobs/.idea/artifacts/KillAllMobs.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<component name="ArtifactManager">
|
||||
<artifact type="jar" name="KillAllMobs">
|
||||
<output-path>$USER_HOME$/Desktop/TestServer/plugins</output-path>
|
||||
<root id="archive" name="KillAllMobs.jar">
|
||||
<element id="module-output" name="KillAllMobs" />
|
||||
</root>
|
||||
</artifact>
|
||||
</component>
|
||||
11
Plugins/Old/KillAllMobs/.idea/libraries/spigot_1_16_4.xml
generated
Normal file
11
Plugins/Old/KillAllMobs/.idea/libraries/spigot_1_16_4.xml
generated
Normal file
@@ -0,0 +1,11 @@
|
||||
<component name="libraryTable">
|
||||
<library name="spigot-1.16.4">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/../spigot-1.16.4.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$PROJECT_DIR$/../spigot-1.16.4.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
6
Plugins/Old/KillAllMobs/.idea/misc.xml
generated
Normal file
6
Plugins/Old/KillAllMobs/.idea/misc.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
8
Plugins/Old/KillAllMobs/.idea/modules.xml
generated
Normal file
8
Plugins/Old/KillAllMobs/.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/KillAllMobs.iml" filepath="$PROJECT_DIR$/KillAllMobs.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
12
Plugins/Old/KillAllMobs/KillAllMobs.iml
Normal file
12
Plugins/Old/KillAllMobs/KillAllMobs.iml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="spigot-1.16.4" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,9 @@
|
||||
name: KillAllMobs
|
||||
version: 1.0
|
||||
api-version: 1.16
|
||||
main: de.craftix.killallmobs.Main
|
||||
|
||||
commands:
|
||||
timer:
|
||||
mobs:
|
||||
position:
|
||||
182
Plugins/Old/KillAllMobs/src/de/craftix/killallmobs/Main.java
Normal file
182
Plugins/Old/KillAllMobs/src/de/craftix/killallmobs/Main.java
Normal file
@@ -0,0 +1,182 @@
|
||||
package de.craftix.killallmobs;
|
||||
|
||||
import de.craftix.killallmobs.commands.Mobs;
|
||||
import de.craftix.killallmobs.commands.Position;
|
||||
import de.craftix.killallmobs.listener.onDeath;
|
||||
import de.craftix.killallmobs.listener.onKill;
|
||||
import de.craftix.killallmobs.listener.onStart;
|
||||
import de.craftix.killallmobs.utils.Config;
|
||||
import de.craftix.killallmobs.utils.MobGUI;
|
||||
import de.craftix.killallmobs.utils.Timer;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.boss.BarColor;
|
||||
import org.bukkit.boss.BarStyle;
|
||||
import org.bukkit.boss.BossBar;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
public class Main extends JavaPlugin {
|
||||
private static Main instance;
|
||||
private static Timer timer;
|
||||
|
||||
public static ArrayList<EntityType> entitys = new ArrayList<>();
|
||||
public static ArrayList<EntityType> killedEntitys = new ArrayList<>();
|
||||
public static EntityType currentEntity;
|
||||
public static BossBar bar;
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
instance = this;
|
||||
timer = new Timer();
|
||||
|
||||
registerCommands();
|
||||
registerListener();
|
||||
registerMobs();
|
||||
|
||||
MobGUI.setup();
|
||||
|
||||
Config.setConfig(this.getConfig());
|
||||
Config.load();
|
||||
|
||||
if (killedEntitys == null) killedEntitys = new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
Config.save();
|
||||
if (bar != null) bar.setVisible(false);
|
||||
}
|
||||
|
||||
private void registerCommands(){
|
||||
getCommand("timer").setExecutor(new de.craftix.killallmobs.commands.Timer());
|
||||
getCommand("mobs").setExecutor(new Mobs());
|
||||
getCommand("position").setExecutor(new Position());
|
||||
}
|
||||
|
||||
private void registerListener(){
|
||||
PluginManager pm = Bukkit.getPluginManager();
|
||||
pm.registerEvents(new onDeath(), this);
|
||||
pm.registerEvents(new onKill(), this);
|
||||
pm.registerEvents(new onStart(), this);
|
||||
pm.registerEvents(new MobGUI(), this);
|
||||
}
|
||||
|
||||
public static Main getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static Timer getTimer() {
|
||||
return timer;
|
||||
}
|
||||
|
||||
public static void win(){
|
||||
timer.stop();
|
||||
for (Player p : Bukkit.getOnlinePlayers()){
|
||||
p.setGameMode(GameMode.SPECTATOR);
|
||||
}
|
||||
Bukkit.broadcastMessage("§6Die Challenge wurde erfolgreich absolviert");
|
||||
}
|
||||
|
||||
public static void loose(){
|
||||
timer.stop();
|
||||
for (Player p : Bukkit.getOnlinePlayers()){
|
||||
p.setGameMode(GameMode.SPECTATOR);
|
||||
}
|
||||
Bukkit.broadcastMessage("§cDie Challenge ist fehlgeschlagen");
|
||||
}
|
||||
|
||||
private void registerMobs(){
|
||||
entitys.add(EntityType.BAT);
|
||||
entitys.add(EntityType.BEE);
|
||||
entitys.add(EntityType.BLAZE);
|
||||
entitys.add(EntityType.CAT);
|
||||
entitys.add(EntityType.CAVE_SPIDER);
|
||||
entitys.add(EntityType.CHICKEN);
|
||||
entitys.add(EntityType.COD);
|
||||
entitys.add(EntityType.COW);
|
||||
entitys.add(EntityType.CREEPER);
|
||||
entitys.add(EntityType.DOLPHIN);
|
||||
entitys.add(EntityType.DONKEY);
|
||||
entitys.add(EntityType.DROWNED);
|
||||
entitys.add(EntityType.ELDER_GUARDIAN);
|
||||
entitys.add(EntityType.ENDER_DRAGON);
|
||||
entitys.add(EntityType.ENDERMAN);
|
||||
entitys.add(EntityType.ENDERMITE);
|
||||
entitys.add(EntityType.EVOKER);
|
||||
entitys.add(EntityType.FOX);
|
||||
entitys.add(EntityType.GHAST);
|
||||
entitys.add(EntityType.GUARDIAN);
|
||||
entitys.add(EntityType.HOGLIN);
|
||||
entitys.add(EntityType.HORSE);
|
||||
entitys.add(EntityType.HUSK);
|
||||
entitys.add(EntityType.IRON_GOLEM);
|
||||
entitys.add(EntityType.LLAMA);
|
||||
entitys.add(EntityType.MAGMA_CUBE);
|
||||
entitys.add(EntityType.MUSHROOM_COW);
|
||||
entitys.add(EntityType.MULE);
|
||||
entitys.add(EntityType.OCELOT);
|
||||
entitys.add(EntityType.PANDA);
|
||||
entitys.add(EntityType.PARROT);
|
||||
entitys.add(EntityType.PHANTOM);
|
||||
entitys.add(EntityType.PIG);
|
||||
entitys.add(EntityType.PIGLIN);
|
||||
entitys.add(EntityType.PIGLIN_BRUTE);
|
||||
entitys.add(EntityType.ZOMBIFIED_PIGLIN);
|
||||
entitys.add(EntityType.POLAR_BEAR);
|
||||
entitys.add(EntityType.PUFFERFISH);
|
||||
entitys.add(EntityType.RABBIT);
|
||||
entitys.add(EntityType.RAVAGER);
|
||||
entitys.add(EntityType.SALMON);
|
||||
entitys.add(EntityType.SHEEP);
|
||||
entitys.add(EntityType.SHULKER);
|
||||
entitys.add(EntityType.SKELETON);
|
||||
entitys.add(EntityType.SKELETON_HORSE);
|
||||
entitys.add(EntityType.SNOWMAN);
|
||||
entitys.add(EntityType.SPIDER);
|
||||
entitys.add(EntityType.SQUID);
|
||||
entitys.add(EntityType.STRAY);
|
||||
entitys.add(EntityType.STRIDER);
|
||||
entitys.add(EntityType.TRADER_LLAMA);
|
||||
entitys.add(EntityType.TROPICAL_FISH);
|
||||
entitys.add(EntityType.TURTLE);
|
||||
entitys.add(EntityType.VILLAGER);
|
||||
entitys.add(EntityType.WANDERING_TRADER);
|
||||
entitys.add(EntityType.WITHER);
|
||||
entitys.add(EntityType.WITHER_SKELETON);
|
||||
entitys.add(EntityType.WOLF);
|
||||
entitys.add(EntityType.ZOGLIN);
|
||||
entitys.add(EntityType.ZOMBIE_VILLAGER);
|
||||
entitys.add(EntityType.WITCH);
|
||||
entitys.add(EntityType.ZOMBIE);
|
||||
entitys.add(EntityType.VINDICATOR);
|
||||
entitys.add(EntityType.VEX);
|
||||
entitys.add(EntityType.SLIME);
|
||||
entitys.add(EntityType.SILVERFISH);
|
||||
entitys.add(EntityType.PILLAGER);
|
||||
}
|
||||
|
||||
public static EntityType getNewMob(){
|
||||
ArrayList<EntityType> remainingEntitys = entitys;
|
||||
for (EntityType e : killedEntitys){
|
||||
remainingEntitys.remove(e);
|
||||
}
|
||||
int rand = new Random().nextInt(remainingEntitys.size() - 1);
|
||||
return remainingEntitys.get(rand);
|
||||
}
|
||||
|
||||
public static void setBossbar(){
|
||||
if (bar != null) bar.removeAll();
|
||||
bar = Bukkit.getServer().createBossBar(currentEntity.name(), BarColor.PURPLE, BarStyle.SOLID);
|
||||
bar.setVisible(true);
|
||||
bar.setProgress(1);
|
||||
for (Player p : Bukkit.getOnlinePlayers()){
|
||||
bar.addPlayer(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package de.craftix.killallmobs.commands;
|
||||
|
||||
import de.craftix.killallmobs.utils.MobGUI;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class Mobs implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender s, Command command, String st, String[] args) {
|
||||
if (!(s instanceof Player)) return true;
|
||||
Player p = (Player)s;
|
||||
if (args.length == 1){
|
||||
int invID = Integer.valueOf(args[0]);
|
||||
MobGUI.showGUI(p, invID);
|
||||
}else MobGUI.showGUI(p, 1);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package de.craftix.killallmobs.commands;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class Position implements CommandExecutor {
|
||||
private HashMap<String, Location> positions = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String s, String[] args) {
|
||||
if (!(sender instanceof Player)) return false;
|
||||
Player p = (Player)sender;
|
||||
if (args.length != 1) return false;
|
||||
if (positions.containsKey(args[0])){
|
||||
Location loc = positions.get(args[0]);
|
||||
p.sendMessage("§aDie Position §6" + args[0] + " §aBefindet sich bei §b" + loc.getBlockX() + " " + loc.getBlockY() + " " + loc.getBlockZ());
|
||||
}else {
|
||||
positions.put(args[0], p.getLocation());
|
||||
p.sendMessage("§aDie Position §6" + args[0] + " §awurde erfolgreich gespeichert");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package de.craftix.killallmobs.commands;
|
||||
|
||||
import de.craftix.killallmobs.Main;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
public class Timer implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String s, String[] args) {
|
||||
if (!sender.hasPermission("challenge.admin")) return true;
|
||||
if (args.length != 1) return true;
|
||||
|
||||
if (args[0].equalsIgnoreCase("start") || args[0].equalsIgnoreCase("resume")) Main.getTimer().start();
|
||||
if (args[0].equalsIgnoreCase("stop")) Main.getTimer().stop();
|
||||
if (args[0].equalsIgnoreCase("reset")) Main.getTimer().reset();
|
||||
if (args[0].equalsIgnoreCase("pause")) Main.getTimer().pause();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package de.craftix.killallmobs.listener;
|
||||
|
||||
import de.craftix.killallmobs.Main;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
|
||||
public class onDeath implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onDeathEvent(PlayerDeathEvent event){
|
||||
if (!Main.getTimer().isStarted) return;
|
||||
Main.loose();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package de.craftix.killallmobs.listener;
|
||||
|
||||
import de.craftix.killallmobs.Main;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.EntityDeathEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
|
||||
public class onKill implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onKillEvent(EntityDeathEvent event){
|
||||
if (event.getEntity().getType().equals(EntityType.PLAYER)) return;
|
||||
if (event.getEntity().getKiller() == null) return;
|
||||
EntityType type = event.getEntity().getType();
|
||||
if (type == Main.currentEntity){
|
||||
Main.killedEntitys.add(type);
|
||||
Bukkit.broadcastMessage("§aEin neues Entity wurde registriert: §6" + type.name());
|
||||
Main.currentEntity = Main.getNewMob();
|
||||
Main.setBossbar();
|
||||
}
|
||||
if (checkIfFinished()) Main.win();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onJoin(PlayerJoinEvent event){
|
||||
Player p = event.getPlayer();
|
||||
if (Main.bar == null) return;
|
||||
Main.bar.addPlayer(p);
|
||||
}
|
||||
|
||||
private boolean checkIfFinished(){
|
||||
if (Main.killedEntitys.size() >= Main.entitys.size()) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package de.craftix.killallmobs.listener;
|
||||
|
||||
import de.craftix.killallmobs.Main;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.entity.FoodLevelChangeEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
|
||||
public class onStart implements Listener {
|
||||
@EventHandler
|
||||
public void onBuild(BlockPlaceEvent event){
|
||||
if (Main.getTimer().isStarted) return;
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onBreak(BlockBreakEvent event){
|
||||
if (Main.getTimer().isStarted) return;
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onInteract(PlayerInteractEvent event){
|
||||
if (Main.getTimer().isStarted) return;
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onDamage(EntityDamageEvent event){
|
||||
if (Main.getTimer().isStarted) return;
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onFood(FoodLevelChangeEvent event){
|
||||
if (Main.getTimer().isStarted) return;
|
||||
event.setCancelled(true);
|
||||
Player p = (Player)event.getEntity();
|
||||
p.setFoodLevel(25);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package de.craftix.killallmobs.utils;
|
||||
|
||||
import de.craftix.killallmobs.Main;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.EntityType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Config {
|
||||
private static FileConfiguration config;
|
||||
|
||||
public static void save(){
|
||||
config.set("KilledEntitys", Main.killedEntitys);
|
||||
Main.getInstance().saveConfig();
|
||||
}
|
||||
|
||||
public static void load(){
|
||||
Main.killedEntitys = (ArrayList<EntityType>) config.getList("KilledEntitys");
|
||||
}
|
||||
|
||||
public static void setConfig(FileConfiguration cfg){
|
||||
config = cfg;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
package de.craftix.killallmobs.utils;
|
||||
|
||||
import de.craftix.killallmobs.Main;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class MobGUI implements Listener {
|
||||
|
||||
private static HashMap<EntityType, ItemStack> items = new HashMap<>();
|
||||
|
||||
public static void showGUI(Player p, int invID){
|
||||
ArrayList<EntityType> remainingMobs = Main.entitys;
|
||||
for (EntityType e : Main.killedEntitys){
|
||||
remainingMobs.remove(e);
|
||||
}
|
||||
|
||||
if (remainingMobs.size() >= 54){
|
||||
Inventory inv1 = Bukkit.createInventory(null, 6*9, "Mobs remaining site 1:");
|
||||
Inventory inv2 = Bukkit.createInventory(null, 6*9, "Mobs remaining site 2:");
|
||||
|
||||
for (int i = 0; i < 54; i++){
|
||||
inv1.setItem(i, items.get(remainingMobs.get(i)));
|
||||
}
|
||||
for (int i = 54; i < remainingMobs.size(); i++){
|
||||
inv2.setItem(i - 54, items.get(remainingMobs.get(i)));
|
||||
}
|
||||
|
||||
if (invID == 1) p.openInventory(inv1);
|
||||
else p.openInventory(inv2);
|
||||
}else {
|
||||
Inventory inv = Bukkit.createInventory(null, 6*9, "Mobs remaining:");
|
||||
for (int i = 0; i < remainingMobs.size(); i++){
|
||||
inv.setItem(i, items.get(remainingMobs.get(i)));
|
||||
}
|
||||
p.openInventory(inv);
|
||||
}
|
||||
}
|
||||
|
||||
public static void setup(){
|
||||
setItem(EntityType.BAT, Material.TORCH);
|
||||
setItem(EntityType.BEE, Material.HONEY_BOTTLE);
|
||||
setItem(EntityType.BLAZE, Material.BLAZE_POWDER);
|
||||
setItem(EntityType.CAT, Material.NAME_TAG);
|
||||
setItem(EntityType.CAVE_SPIDER, Material.SPIDER_EYE);
|
||||
setItem(EntityType.CHICKEN, Material.FEATHER);
|
||||
setItem(EntityType.COD, Material.COOKED_COD);
|
||||
setItem(EntityType.COW, Material.LEATHER);
|
||||
setItem(EntityType.CREEPER, Material.GUNPOWDER);
|
||||
setItem(EntityType.DOLPHIN, Material.DRIED_KELP);
|
||||
setItem(EntityType.DONKEY, Material.SADDLE);
|
||||
setItem(EntityType.DROWNED, Material.TRIDENT);
|
||||
setItem(EntityType.ELDER_GUARDIAN, Material.SPONGE);
|
||||
setItem(EntityType.ENDER_DRAGON, Material.END_CRYSTAL);
|
||||
setItem(EntityType.ENDERMAN, Material.ENDER_PEARL);
|
||||
setItem(EntityType.ENDERMITE, Material.ENDER_EYE);
|
||||
setItem(EntityType.EVOKER, Material.TOTEM_OF_UNDYING);
|
||||
setItem(EntityType.FOX, Material.SWEET_BERRIES);
|
||||
setItem(EntityType.GHAST, Material.GHAST_TEAR);
|
||||
setItem(EntityType.GUARDIAN, Material.PRISMARINE_SHARD);
|
||||
setItem(EntityType.HOGLIN, Material.PORKCHOP);
|
||||
setItem(EntityType.HORSE, Material.IRON_HORSE_ARMOR);
|
||||
setItem(EntityType.HUSK, Material.ROTTEN_FLESH);
|
||||
setItem(EntityType.IRON_GOLEM, Material.POPPY);
|
||||
setItem(EntityType.LLAMA, Material.LEATHER);
|
||||
setItem(EntityType.MAGMA_CUBE, Material.MAGMA_CREAM);
|
||||
setItem(EntityType.MUSHROOM_COW, Material.RED_MUSHROOM);
|
||||
setItem(EntityType.MULE, Material.LEATHER);
|
||||
setItem(EntityType.OCELOT, Material.VINE);
|
||||
setItem(EntityType.PANDA, Material.BAMBOO);
|
||||
setItem(EntityType.PARROT, Material.COOKIE);
|
||||
setItem(EntityType.PHANTOM, Material.PHANTOM_MEMBRANE);
|
||||
setItem(EntityType.PIG, Material.PORKCHOP);
|
||||
setItem(EntityType.PIGLIN, Material.GOLD_INGOT);
|
||||
setItem(EntityType.PIGLIN_BRUTE, Material.IRON_AXE);
|
||||
setItem(EntityType.ZOMBIFIED_PIGLIN, Material.GOLDEN_SWORD);
|
||||
setItem(EntityType.PILLAGER, Material.CROSSBOW);
|
||||
setItem(EntityType.POLAR_BEAR, Material.SNOWBALL);
|
||||
setItem(EntityType.PUFFERFISH, Material.PUFFERFISH);
|
||||
setItem(EntityType.RABBIT, Material.RABBIT_HIDE);
|
||||
setItem(EntityType.RAVAGER, Material.SADDLE);
|
||||
setItem(EntityType.SALMON, Material.COOKED_SALMON);
|
||||
setItem(EntityType.SHEEP, Material.COOKED_MUTTON);
|
||||
setItem(EntityType.SHULKER, Material.SHULKER_SHELL);
|
||||
setItem(EntityType.SILVERFISH, Material.CRACKED_STONE_BRICKS);
|
||||
setItem(EntityType.SKELETON, Material.BONE);
|
||||
setItem(EntityType.SKELETON_HORSE, Material.BONE);
|
||||
setItem(EntityType.SNOWMAN, Material.SNOWBALL);
|
||||
setItem(EntityType.SPIDER, Material.COBWEB);
|
||||
setItem(EntityType.SQUID, Material.INK_SAC);
|
||||
setItem(EntityType.STRAY, Material.SPECTRAL_ARROW);
|
||||
setItem(EntityType.STRIDER, Material.STRING);
|
||||
setItem(EntityType.TRADER_LLAMA, Material.LEAD);
|
||||
setItem(EntityType.TROPICAL_FISH, Material.TROPICAL_FISH);
|
||||
setItem(EntityType.TURTLE, Material.TURTLE_HELMET);
|
||||
setItem(EntityType.VILLAGER, Material.EMERALD);
|
||||
setItem(EntityType.WANDERING_TRADER, Material.TROPICAL_FISH_BUCKET);
|
||||
setItem(EntityType.WITHER, Material.NETHER_STAR);
|
||||
setItem(EntityType.WITHER_SKELETON, Material.COAL);
|
||||
setItem(EntityType.WOLF, Material.BONE);
|
||||
setItem(EntityType.ZOGLIN, Material.ROTTEN_FLESH);
|
||||
setItem(EntityType.ZOMBIE_VILLAGER, Material.CHARCOAL);
|
||||
setItem(EntityType.WITCH, Material.REDSTONE);
|
||||
setItem(EntityType.ZOMBIE, Material.ROTTEN_FLESH);
|
||||
setItem(EntityType.VINDICATOR, Material.IRON_AXE);
|
||||
setItem(EntityType.VEX, Material.IRON_SWORD);
|
||||
setItem(EntityType.SLIME, Material.SLIME_BALL);
|
||||
}
|
||||
|
||||
private static void setItem(EntityType entity, Material mat){
|
||||
ItemStack item = new ItemStack(mat);
|
||||
ItemMeta itemMeta = item.getItemMeta();
|
||||
itemMeta.setDisplayName(entity.name());
|
||||
item.setItemMeta(itemMeta);
|
||||
items.put(entity, item);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onInv(InventoryClickEvent event){
|
||||
if (event.getView().getTitle().contains("Mobs remaining")) event.setCancelled(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package de.craftix.killallmobs.utils;
|
||||
|
||||
import de.craftix.killallmobs.Main;
|
||||
import net.md_5.bungee.api.ChatMessageType;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class Timer {
|
||||
public boolean isStarted;
|
||||
|
||||
private int seconds;
|
||||
private int minutes;
|
||||
private int hours;
|
||||
private int timerID;
|
||||
|
||||
|
||||
public Timer(){
|
||||
seconds = 0;
|
||||
minutes = 0;
|
||||
hours = 0;
|
||||
isStarted = false;
|
||||
}
|
||||
|
||||
public void start(){
|
||||
Main.currentEntity = Main.getNewMob();
|
||||
Main.setBossbar();
|
||||
isStarted = true;
|
||||
timerID = Bukkit.getScheduler().scheduleSyncRepeatingTask(Main.getInstance(), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
seconds++;
|
||||
if (seconds >= 60){
|
||||
seconds = 0;
|
||||
minutes++;
|
||||
}
|
||||
if (minutes >= 60){
|
||||
minutes = 0;
|
||||
hours++;
|
||||
}
|
||||
for (Player p : Bukkit.getOnlinePlayers()){
|
||||
p.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(getFormat(seconds, minutes, hours)));
|
||||
}
|
||||
}
|
||||
}, 0, 20);
|
||||
}
|
||||
|
||||
public void stop(){
|
||||
isStarted = false;
|
||||
Bukkit.getScheduler().cancelTask(timerID);
|
||||
reset();
|
||||
}
|
||||
|
||||
public void pause(){
|
||||
isStarted = false;
|
||||
Bukkit.getScheduler().cancelTask(timerID);
|
||||
}
|
||||
|
||||
public void reset(){
|
||||
seconds = 0;
|
||||
minutes = 0;
|
||||
hours = 0;
|
||||
}
|
||||
|
||||
private String getFormat(int sec, int min, int hour){
|
||||
String secon;
|
||||
String minut;
|
||||
String hor;
|
||||
if (sec < 10){
|
||||
secon = "0" + sec;
|
||||
}else {
|
||||
secon = "" + sec;
|
||||
}
|
||||
|
||||
if (min < 10){
|
||||
minut = "0" + min;
|
||||
}else {
|
||||
minut = "" + min;
|
||||
}
|
||||
|
||||
if (hour < 10) {
|
||||
hor = "0" + hour;
|
||||
}else {
|
||||
hor = "" + hour;
|
||||
}
|
||||
|
||||
return "§6" + hor + ":" + minut + ":" + secon;
|
||||
}
|
||||
|
||||
}
|
||||
9
Plugins/Old/KillAllMobs/src/plugin.yml
Normal file
9
Plugins/Old/KillAllMobs/src/plugin.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
name: KillAllMobs
|
||||
version: 1.0
|
||||
api-version: 1.16
|
||||
main: de.craftix.killallmobs.Main
|
||||
|
||||
commands:
|
||||
timer:
|
||||
mobs:
|
||||
position:
|
||||
Reference in New Issue
Block a user