Removed Minigames stuff

This commit is contained in:
Norbi Peti 2016-11-20 22:29:31 +01:00
parent f83f8f88b7
commit 9857bc5bd5
4 changed files with 45 additions and 179 deletions

View file

@ -152,11 +152,8 @@
<artifactId>votifier</artifactId>
<version>1.9</version>
</dependency>
<dependency>
<groupId>au.com.mineauz</groupId>
<artifactId>Minigames</artifactId>
<version>1.8.0</version>
</dependency>
<!-- <dependency> <groupId>au.com.mineauz</groupId> <artifactId>Minigames</artifactId>
<version>1.8.0</version> </dependency> -->
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>VaultAPI</artifactId>

View file

@ -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";
}
}

View file

@ -10,8 +10,6 @@ import com.palmergames.bukkit.towny.Towny;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
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.PlayerChatTabCompleteEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.event.server.ServerCommandEvent;
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.PotionEffectType;
import au.com.mineauz.minigames.MinigamePlayer;
import au.com.mineauz.minigames.Minigames;
import buttondevteam.chat.ChatPlayer;
import buttondevteam.chat.ChatProcessing;
import buttondevteam.chat.PluginMain;
import buttondevteam.chat.commands.ucmds.KittycannonCommand;
import buttondevteam.lib.TBMCPlayer;
import buttondevteam.lib.TBMCPlayer.InfoTarget;
import buttondevteam.lib.chat.Channel;
@ -210,8 +201,8 @@ public class PlayerListener implements Listener {
public void onPlayerDeath(PlayerDeathEvent e) {
if (e.getEntity().getName().equals("Alpha_Bacca44"))
AlphaDeaths++;
MinigamePlayer mgp = Minigames.plugin.pdata.getMinigamePlayer(e.getEntity());
if ((mgp != null && !mgp.isInMinigame()) && new Random().nextBoolean()) { // Don't store Fs for NPCs
// MinigamePlayer mgp = Minigames.plugin.pdata.getMinigamePlayer(e.getEntity());
if (/* (mgp != null && !mgp.isInMinigame()) && */ new Random().nextBoolean()) { // Don't store Fs for NPCs
if (Ftimer != null)
Ftimer.cancel();
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
@SuppressWarnings("deprecation")
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;
@EventHandler(priority = EventPriority.HIGHEST)

View file

@ -1,32 +1,41 @@
name: ButtonChat
main: buttondevteam.chat.PluginMain
version: 4.0
commands:
u:
description: Auto-flair system. Accept or ignore flair.
ooc:
description: Send message in Out-of-Character.
alias: nrp
unlol:
description: Unlaugh the last laugh.
alias: unlaugh
mwiki:
description: Search the wiki.
dontrunthiscmd:
tableflip:
description: Flip a table.
unflip:
description: Unflip a flip.
chatonly:
description: Enable chat only mode. Useful for chat clients.
shrug:
description: Shrug.
yeehaw:
description: This command makes you yeehaw.
author: NorbiPeti
depend: [Essentials, Towny, Minigames, Votifier, WorldGuard, WorldEdit, ProtocolLib, Vault, ButtonCore]
permissions:
tbmc.admin:
description: Gives access to /un- commands and /u admin commands
tbmc.rainbow:
description: Gives access to rainbow colors (/u c).
name: ButtonChat
main: buttondevteam.chat.PluginMain
version: 4.0
commands:
u:
description: Auto-flair system. Accept or ignore flair.
ooc:
description: Send message in Out-of-Character.
alias: nrp
unlol:
description: Unlaugh the last laugh.
alias: unlaugh
mwiki:
description: Search the wiki.
dontrunthiscmd: null
tableflip:
description: Flip a table.
unflip:
description: Unflip a flip.
chatonly:
description: Enable chat only mode. Useful for chat clients.
shrug:
description: Shrug.
yeehaw:
description: This command makes you yeehaw.
author: NorbiPeti
depend:
- Essentials
- Towny
- Votifier
- WorldGuard
- 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).