Disable particles in DMT, disable Monster Damage in OITQ, fix teleport out minion despawning, horsman description, ice melting in master builders and energy draining for spider leap in SSM

This commit is contained in:
xXVevzZXx 2016-05-30 14:44:42 +02:00 committed by cnr
parent 8de5280241
commit aa1c599b5e
9 changed files with 141 additions and 17 deletions

View File

@ -38,6 +38,7 @@ import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.build.gui.MobShop;
import nautilus.game.arcade.game.games.build.gui.OptionsShop;
import nautilus.game.arcade.game.games.build.kits.KitBuilder;
import nautilus.game.arcade.game.games.christmas.content.IceMaze;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.BlockBreakStatTracker;
@ -75,6 +76,7 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.block.Action;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockFadeEvent;
import org.bukkit.event.block.BlockFromToEvent;
import org.bukkit.event.block.BlockIgniteEvent;
import org.bukkit.event.block.BlockIgniteEvent.IgniteCause;
@ -1509,6 +1511,12 @@ public class Build extends SoloGame
{
event.blockList().clear();
}
@EventHandler(priority = EventPriority.LOWEST)
public void iceMelt(BlockFadeEvent event)
{
event.setCancelled(true);
}
@EventHandler
public void openMobGui(PlayerInteractEntityEvent event)

View File

@ -100,7 +100,7 @@ public class Draw extends SoloGame
{
//new KitSlowAndSteady(manager),
//new KitSelector(manager),
// new KitTools(manager),
//new KitTools(manager),
new KitArtist(manager)
},
@ -111,11 +111,12 @@ public class Draw extends SoloGame
"Hints are given at top of screen",
});
this.StrictAntiHack = true;
this.Damage = false;
this.HungerSet = 20;
this.WorldTimeSet = 8000;
StrictAntiHack = true;
Damage = false;
HungerSet = 20;
WorldTimeSet = 8000;
AllowParticles = false;
_words = new String[]
{
"Bird", "Volcano", "Sloth", "Love", "Dance", "Hair", "Glasses", "Domino", "Dice", "Computer", "Top Hat",

View File

@ -34,6 +34,7 @@ import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
@ -277,6 +278,14 @@ public class Quiver extends SoloGame
@EventHandler
public void ArrowDamage(CustomDamageEvent event)
{
if (!(event.GetDamagerEntity(true) instanceof Arrow)
&& !(event.GetDamagerEntity(true) instanceof Player)
&& (event.GetDamagerEntity(true) instanceof Entity))
{
event.setCancelled(true);
return;
}
if (event.GetProjectile() == null)
return;

View File

@ -43,12 +43,14 @@ import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.vehicle.VehicleCreateEvent;
import org.bukkit.inventory.FurnaceInventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.FireworkMeta;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.scoreboard.Scoreboard;
import org.bukkit.scoreboard.Team;
@ -63,6 +65,7 @@ import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilItem;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer;
@ -774,6 +777,8 @@ public abstract class SurvivalGames extends Game
{
item = buildCompass(5);
}
handlePickup(item);
chest.getBlockInventory().setItem(UtilMath.r(27), item);
}
@ -808,6 +813,9 @@ public abstract class SurvivalGames extends Game
@EventHandler
public void ItemSpawn(ItemSpawnEvent event)
{
if (event.getEntity().getItemStack().hasItemMeta())
return;
Material mat = event.getEntity().getItemStack().getType();
switch (mat)
@ -1008,6 +1016,32 @@ public abstract class SurvivalGames extends Game
}
}
@EventHandler
public void pickupItems(PlayerPickupItemEvent event)
{
handlePickup(event.getItem().getItemStack());
}
private void handlePickup(ItemStack stack)
{
if (stack.getType() == Material.CARROT
|| stack.getType() == Material.POTATO
|| stack.getType() == Material.WHEAT
|| stack.getType() == Material.CARROT_ITEM
|| stack.getType() == Material.POTATO_ITEM)
{
String name = "Carrot";
if (stack.getType() == Material.POTATO || stack.getType() == Material.POTATO_ITEM)
name = "Potato";
if (stack.getType() == Material.WHEAT)
name = "Wheat";
ItemMeta meta = stack.getItemMeta();
meta.setDisplayName(name);
stack.setItemMeta(meta);
}
}
@EventHandler
public void OpenChest(PlayerInteractEvent event)
{

View File

@ -20,7 +20,7 @@ public class KitHorseman extends Kit
new String[]
{
"Proud owner of a (rapidly growing) horse!"
"Proud owner of a horse!"
},
new Perk[]

View File

@ -14,9 +14,11 @@ import org.bukkit.entity.Player;
import org.bukkit.entity.Horse;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAlg;
@ -160,6 +162,25 @@ public class PerkHorsePet extends Perk
horse.setHealth(Math.min(horse.getMaxHealth(), horse.getHealth()+1));
}
}
@EventHandler
public void modTeleport(PlayerCommandPreprocessEvent event)
{
if (!Manager.GetGame().IsLive())
return;
if (!event.getMessage().toLowerCase().startsWith("/tp") && !event.getMessage().toLowerCase().startsWith("/teleport"))
return;
if (!Manager.GetClients().hasRank(event.getPlayer(), Rank.MODERATOR)
|| Manager.GetClients().hasRank(event.getPlayer(), Rank.DEVELOPER))
return;
if (event.getMessage().split(" ").length < 2)
return;
despawnHorse(event.getPlayer());
}
@EventHandler
public void death(PlayerDeathEvent event)
@ -167,7 +188,12 @@ public class PerkHorsePet extends Perk
if (!Manager.GetGame().IsLive())
return;
Horse horse = _horseMap.remove(event.getEntity());
despawnHorse(event.getEntity());
}
private void despawnHorse(Player player)
{
Horse horse = _horseMap.remove(player);
if (horse == null)
return;

View File

@ -1,5 +1,6 @@
package nautilus.game.arcade.kit.perks;
import mineplex.core.common.Rank;
import mineplex.core.common.util.*;
import mineplex.core.updater.*;
import mineplex.core.updater.event.*;
@ -274,10 +275,34 @@ public class PerkSkeletons extends Perk
event.AddMod("Skeleton Minion", "Damage", damage, false);
}
@EventHandler
public void modTeleport(PlayerCommandPreprocessEvent event)
{
if (!Manager.GetGame().IsLive())
return;
if (!event.getMessage().toLowerCase().startsWith("/tp") && !event.getMessage().toLowerCase().startsWith("/teleport"))
return;
if (!Manager.GetClients().hasRank(event.getPlayer(), Rank.MODERATOR)
|| Manager.GetClients().hasRank(event.getPlayer(), Rank.DEVELOPER))
return;
if (event.getMessage().split(" ").length < 2)
return;
despawnSkels(event.getPlayer());
}
@EventHandler
public void PlayerDeath(PlayerDeathEvent event)
{
ArrayList<Skeleton> skels = _minions.remove(event.getEntity());
despawnSkels(event.getEntity());
}
private void despawnSkels(Player player)
{
ArrayList<Skeleton> skels = _minions.remove(player);
if (skels == null)
return;

View File

@ -110,6 +110,9 @@ public class PerkSpiderLeap extends Perk
//Velocity
UtilAction.velocity(player, 1.0, 0.2, 1.0, true);
//Energy
player.setExp((float) Math.max(0, player.getExp()-(1f/6f)));
//Sound
player.getWorld().playSound(player.getLocation(), Sound.SPIDER_IDLE, 1f, 1.5f);

View File

@ -20,9 +20,11 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.block.Action;
import org.bukkit.event.entity.EntityTargetEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import mineplex.core.common.Rank;
import mineplex.core.common.util.*;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.event.UpdateEvent;
@ -292,23 +294,39 @@ public class PerkWolfPet extends Perk
}
@EventHandler
public void PlayerDeath(PlayerDeathEvent event)
public void modTeleport(PlayerCommandPreprocessEvent event)
{
ArrayList<Wolf> wolves = _wolfMap.remove(event.getEntity());
if (wolves == null)
if (!Manager.GetGame().IsLive())
return;
if (!event.getMessage().toLowerCase().startsWith("/tp") && !event.getMessage().toLowerCase().startsWith("/teleport"))
return;
for (Wolf wolf : wolves)
wolf.remove();
if (!Manager.GetClients().hasRank(event.getPlayer(), Rank.MODERATOR)
|| Manager.GetClients().hasRank(event.getPlayer(), Rank.DEVELOPER))
return;
wolves.clear();
if (event.getMessage().split(" ").length < 2)
return;
despawnWolf(event.getPlayer());
}
@EventHandler
public void PlayerDeath(PlayerDeathEvent event)
{
despawnWolf(event.getEntity());
}
@EventHandler
public void PlayerQuit(PlayerQuitEvent event)
{
ArrayList<Wolf> wolves = _wolfMap.remove(event.getPlayer());
despawnWolf(event.getPlayer());
}
private void despawnWolf(Player player)
{
ArrayList<Wolf> wolves = _wolfMap.remove(player);
if (wolves == null)
return;