Removed Minigames stuff
This commit is contained in:
parent
f83f8f88b7
commit
9857bc5bd5
4 changed files with 45 additions and 179 deletions
7
pom.xml
7
pom.xml
|
@ -152,11 +152,8 @@
|
||||||
<artifactId>votifier</artifactId>
|
<artifactId>votifier</artifactId>
|
||||||
<version>1.9</version>
|
<version>1.9</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<!-- <dependency> <groupId>au.com.mineauz</groupId> <artifactId>Minigames</artifactId>
|
||||||
<groupId>au.com.mineauz</groupId>
|
<version>1.8.0</version> </dependency> -->
|
||||||
<artifactId>Minigames</artifactId>
|
|
||||||
<version>1.8.0</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.milkbowl.vault</groupId>
|
<groupId>net.milkbowl.vault</groupId>
|
||||||
<artifactId>VaultAPI</artifactId>
|
<artifactId>VaultAPI</artifactId>
|
||||||
|
|
|
@ -1,90 +0,0 @@
|
||||||
package buttondevteam.chat.commands.ucmds;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.command.CommandSender;
|
|
||||||
import org.bukkit.entity.Ocelot;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
import org.bukkit.inventory.meta.SkullMeta;
|
|
||||||
import org.bukkit.potion.PotionEffect;
|
|
||||||
import org.bukkit.potion.PotionEffectType;
|
|
||||||
|
|
||||||
import au.com.mineauz.minigames.MinigamePlayer;
|
|
||||||
import au.com.mineauz.minigames.Minigames;
|
|
||||||
import buttondevteam.chat.PluginMain;
|
|
||||||
|
|
||||||
import com.earth2me.essentials.Mob;
|
|
||||||
import com.earth2me.essentials.Mob.MobException;
|
|
||||||
|
|
||||||
public class KittycannonCommand extends UCommandBase {
|
|
||||||
|
|
||||||
private static Random random = new Random();
|
|
||||||
|
|
||||||
public static String KittyCannonMinigame = "KittyCannon";
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String[] GetHelpText(String alias) {
|
|
||||||
return new String[] { "§6---- Kittycannon ----",
|
|
||||||
"This command is designed for the Kittycannon minigame" };
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
|
|
||||||
Player player = (Player) sender;
|
|
||||||
MinigamePlayer mp = Minigames.plugin.pdata.getMinigamePlayer(player);
|
|
||||||
if (!(mp.isInMinigame() && mp.getMinigame().getName(false)
|
|
||||||
.equalsIgnoreCase(KittyCannonMinigame))) {
|
|
||||||
sender.sendMessage("§cYou can only use KittyCannon in it's minigame!");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
final Mob cat = Mob.OCELOT;
|
|
||||||
final Ocelot ocelot = (Ocelot) cat.spawn(player.getWorld(),
|
|
||||||
player.getServer(), player.getEyeLocation());
|
|
||||||
if (ocelot == null) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
final ArrayList<String> lore = new ArrayList<>();
|
|
||||||
lore.add(player.getName());
|
|
||||||
final int i = random.nextInt(Ocelot.Type.values().length);
|
|
||||||
ocelot.setCatType(Ocelot.Type.values()[i]);
|
|
||||||
ocelot.setTamed(true);
|
|
||||||
ocelot.setBaby();
|
|
||||||
ocelot.addPotionEffect(new PotionEffect(
|
|
||||||
PotionEffectType.DAMAGE_RESISTANCE, 5, 5));
|
|
||||||
ocelot.setVelocity(player.getEyeLocation().getDirection()
|
|
||||||
.multiply(2));
|
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(PluginMain.Instance,
|
|
||||||
new Runnable() {
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
final Location loc = ocelot.getLocation();
|
|
||||||
ocelot.remove();
|
|
||||||
loc.getWorld().createExplosion(loc, 0F);
|
|
||||||
final ItemStack head = new ItemStack(
|
|
||||||
Material.SKULL_ITEM, 1, (short) 3, (byte) 3);
|
|
||||||
SkullMeta im = (SkullMeta) head.getItemMeta();
|
|
||||||
im.setDisplayName("§rOcelot Head");
|
|
||||||
im.setOwner("MHF_Ocelot");
|
|
||||||
im.setLore(lore);
|
|
||||||
head.setItemMeta(im);
|
|
||||||
loc.getWorld().dropItem(loc, head);
|
|
||||||
}
|
|
||||||
}, 20);
|
|
||||||
} catch (MobException e) {
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String GetUCommandPath() {
|
|
||||||
return "kittycannon";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -10,8 +10,6 @@ import com.palmergames.bukkit.towny.Towny;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.block.Block;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
|
@ -20,22 +18,15 @@ import org.bukkit.event.entity.PlayerDeathEvent;
|
||||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||||
import org.bukkit.event.player.PlayerChatTabCompleteEvent;
|
import org.bukkit.event.player.PlayerChatTabCompleteEvent;
|
||||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
|
||||||
import org.bukkit.event.player.PlayerMoveEvent;
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
import org.bukkit.event.player.PlayerPickupItemEvent;
|
|
||||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||||
import org.bukkit.event.server.ServerCommandEvent;
|
import org.bukkit.event.server.ServerCommandEvent;
|
||||||
import org.bukkit.help.HelpTopic;
|
import org.bukkit.help.HelpTopic;
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
import org.bukkit.inventory.meta.SkullMeta;
|
|
||||||
import org.bukkit.potion.PotionEffect;
|
import org.bukkit.potion.PotionEffect;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
import au.com.mineauz.minigames.MinigamePlayer;
|
|
||||||
import au.com.mineauz.minigames.Minigames;
|
|
||||||
import buttondevteam.chat.ChatPlayer;
|
import buttondevteam.chat.ChatPlayer;
|
||||||
import buttondevteam.chat.ChatProcessing;
|
import buttondevteam.chat.ChatProcessing;
|
||||||
import buttondevteam.chat.PluginMain;
|
import buttondevteam.chat.PluginMain;
|
||||||
import buttondevteam.chat.commands.ucmds.KittycannonCommand;
|
|
||||||
import buttondevteam.lib.TBMCPlayer;
|
import buttondevteam.lib.TBMCPlayer;
|
||||||
import buttondevteam.lib.TBMCPlayer.InfoTarget;
|
import buttondevteam.lib.TBMCPlayer.InfoTarget;
|
||||||
import buttondevteam.lib.chat.Channel;
|
import buttondevteam.lib.chat.Channel;
|
||||||
|
@ -210,8 +201,8 @@ public class PlayerListener implements Listener {
|
||||||
public void onPlayerDeath(PlayerDeathEvent e) {
|
public void onPlayerDeath(PlayerDeathEvent e) {
|
||||||
if (e.getEntity().getName().equals("Alpha_Bacca44"))
|
if (e.getEntity().getName().equals("Alpha_Bacca44"))
|
||||||
AlphaDeaths++;
|
AlphaDeaths++;
|
||||||
MinigamePlayer mgp = Minigames.plugin.pdata.getMinigamePlayer(e.getEntity());
|
// MinigamePlayer mgp = Minigames.plugin.pdata.getMinigamePlayer(e.getEntity());
|
||||||
if ((mgp != null && !mgp.isInMinigame()) && new Random().nextBoolean()) { // Don't store Fs for NPCs
|
if (/* (mgp != null && !mgp.isInMinigame()) && */ new Random().nextBoolean()) { // Don't store Fs for NPCs
|
||||||
if (Ftimer != null)
|
if (Ftimer != null)
|
||||||
Ftimer.cancel();
|
Ftimer.cancel();
|
||||||
ActiveF = true;
|
ActiveF = true;
|
||||||
|
@ -240,29 +231,6 @@ public class PlayerListener implements Listener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onPlayerItemPickup(PlayerPickupItemEvent e) {
|
|
||||||
MinigamePlayer mp = Minigames.plugin.pdata.getMinigamePlayer(e.getPlayer());
|
|
||||||
|
|
||||||
if (!(mp.isInMinigame()
|
|
||||||
&& mp.getMinigame().getName(false).equalsIgnoreCase(KittycannonCommand.KittyCannonMinigame)))
|
|
||||||
return;
|
|
||||||
ItemStack item = e.getItem().getItemStack();
|
|
||||||
if (!item.getType().equals(Material.SKULL_ITEM) && !item.getType().equals(Material.SKULL))
|
|
||||||
return;
|
|
||||||
SkullMeta meta = (SkullMeta) item.getItemMeta();
|
|
||||||
if (!meta.getDisplayName().equals("§rOcelot Head") || !meta.getOwner().equals("MHF_Ocelot"))
|
|
||||||
return;
|
|
||||||
if (meta.getLore() == null || meta.getLore().size() == 0)
|
|
||||||
return;
|
|
||||||
ItemStack hat = e.getPlayer().getInventory().getHelmet();
|
|
||||||
if (!(hat != null && (hat.getType().equals(Material.SKULL) || hat.getType().equals(Material.SKULL_ITEM))
|
|
||||||
&& ((SkullMeta) hat.getItemMeta()).getDisplayName().equals("§rWolf Head")))
|
|
||||||
e.getPlayer().damage(1f * item.getAmount(), Bukkit.getPlayer(meta.getLore().get(0)));
|
|
||||||
e.getItem().remove();
|
|
||||||
e.setCancelled(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public void onVotifierEvent(VotifierEvent event) {
|
public void onVotifierEvent(VotifierEvent event) {
|
||||||
|
@ -293,24 +261,6 @@ public class PlayerListener implements Listener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onPlayerInteract(PlayerInteractEvent e) {
|
|
||||||
MinigamePlayer mp = Minigames.plugin.pdata.getMinigamePlayer(e.getPlayer());
|
|
||||||
if (mp == null)
|
|
||||||
return;
|
|
||||||
if (mp.isInMinigame() && mp.getMinigame().getName(false).equalsIgnoreCase("twohundred")) {
|
|
||||||
Block block = e.getClickedBlock();
|
|
||||||
if (block == null)
|
|
||||||
return;
|
|
||||||
if (block.getType() == Material.ENDER_CHEST) {
|
|
||||||
e.setCancelled(true);
|
|
||||||
e.getPlayer().sendMessage("§You are not allowed to use enderchests here.");
|
|
||||||
PluginMain.Instance.getLogger()
|
|
||||||
.warning(e.getPlayer().getName() + " tried to use an enderchest in twohundred.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Channel ConsoleChannel = Channel.GlobalChat;
|
public static Channel ConsoleChannel = Channel.GlobalChat;
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
|
|
|
@ -1,32 +1,41 @@
|
||||||
name: ButtonChat
|
name: ButtonChat
|
||||||
main: buttondevteam.chat.PluginMain
|
main: buttondevteam.chat.PluginMain
|
||||||
version: 4.0
|
version: 4.0
|
||||||
commands:
|
commands:
|
||||||
u:
|
u:
|
||||||
description: Auto-flair system. Accept or ignore flair.
|
description: Auto-flair system. Accept or ignore flair.
|
||||||
ooc:
|
ooc:
|
||||||
description: Send message in Out-of-Character.
|
description: Send message in Out-of-Character.
|
||||||
alias: nrp
|
alias: nrp
|
||||||
unlol:
|
unlol:
|
||||||
description: Unlaugh the last laugh.
|
description: Unlaugh the last laugh.
|
||||||
alias: unlaugh
|
alias: unlaugh
|
||||||
mwiki:
|
mwiki:
|
||||||
description: Search the wiki.
|
description: Search the wiki.
|
||||||
dontrunthiscmd:
|
dontrunthiscmd: null
|
||||||
tableflip:
|
tableflip:
|
||||||
description: Flip a table.
|
description: Flip a table.
|
||||||
unflip:
|
unflip:
|
||||||
description: Unflip a flip.
|
description: Unflip a flip.
|
||||||
chatonly:
|
chatonly:
|
||||||
description: Enable chat only mode. Useful for chat clients.
|
description: Enable chat only mode. Useful for chat clients.
|
||||||
shrug:
|
shrug:
|
||||||
description: Shrug.
|
description: Shrug.
|
||||||
yeehaw:
|
yeehaw:
|
||||||
description: This command makes you yeehaw.
|
description: This command makes you yeehaw.
|
||||||
author: NorbiPeti
|
author: NorbiPeti
|
||||||
depend: [Essentials, Towny, Minigames, Votifier, WorldGuard, WorldEdit, ProtocolLib, Vault, ButtonCore]
|
depend:
|
||||||
permissions:
|
- Essentials
|
||||||
tbmc.admin:
|
- Towny
|
||||||
description: Gives access to /un- commands and /u admin commands
|
- Votifier
|
||||||
tbmc.rainbow:
|
- WorldGuard
|
||||||
description: Gives access to rainbow colors (/u c).
|
- WorldEdit
|
||||||
|
- Vault
|
||||||
|
- ButtonCore
|
||||||
|
soft-depend:
|
||||||
|
- Minigames
|
||||||
|
permissions:
|
||||||
|
tbmc.admin:
|
||||||
|
description: Gives access to /un- commands and /u admin commands
|
||||||
|
tbmc.rainbow:
|
||||||
|
description: Gives access to rainbow colors (/u c).
|
Loading…
Reference in a new issue