Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
4aac057956
@ -60,7 +60,8 @@ public class UpdateRank extends CommandBase<CoreClientManager>
|
||||
|
||||
final Rank rank = tempRank;
|
||||
|
||||
if (rank == Rank.ADMIN || rank == Rank.YOUTUBE || rank == Rank.TWITCH || rank == Rank.MODERATOR || rank == Rank.HELPER || rank == Rank.ALL || rank == Rank.MAPDEV || rank == Rank.SNR_MODERATOR || rank == Rank.JNR_DEV || rank == Rank.DEVELOPER)
|
||||
if (rank == Rank.ADMIN || rank == Rank.YOUTUBE || rank == Rank.TWITCH || rank == Rank.MODERATOR || rank == Rank.JNR_DEV || rank == Rank.HELPER || rank == Rank.ALL || rank == Rank.MAPDEV || rank == Rank.SNR_MODERATOR)
|
||||
if (rank == Rank.ADMIN || rank == Rank.YOUTUBE || rank == Rank.TWITCH || rank == Rank.MODERATOR || rank == Rank.JNR_DEV || rank == Rank.HELPER || rank == Rank.ALL || rank == Rank.MAPDEV || rank == Rank.SNR_MODERATOR)
|
||||
{
|
||||
if (!testServer && rank.Has(Rank.ADMIN) && !Plugin.hasRank(caller, Rank.LT))
|
||||
{
|
||||
@ -122,4 +123,4 @@ public class UpdateRank extends CommandBase<CoreClientManager>
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -662,7 +662,7 @@ public enum Achievement
|
||||
new int[]{20},
|
||||
AchievementCategory.BOMB_LOBBERS),
|
||||
|
||||
BOMB_LOBBERS_SNIPER("Sniper", 10000,
|
||||
BOMB_LOBBERS_SNIPER("Sniper", 1000,
|
||||
new String[]{"Bomb Lobbers.Direct Hit"},
|
||||
new String[]{"Get 50 direct hits"},
|
||||
new int[]{50},
|
||||
|
@ -224,6 +224,11 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
|
||||
UtilPlayer.message(from, C.cPurple + to.getName() + " is often AFK or minimized, due to plugin development.");
|
||||
UtilPlayer.message(from, C.cPurple + "Please be patient if he does not reply instantly.");
|
||||
}
|
||||
|
||||
if(to.getName().equals("ishh"))
|
||||
{
|
||||
UtilPlayer.message(from, C.cPurple + "Hi, my name is ishh. If I don't respond to your message, please be patient and try again later!");
|
||||
}
|
||||
|
||||
// Log
|
||||
// Logger().logChat("Private Message", from, to.getName(), message);
|
||||
|
@ -1,6 +1,7 @@
|
||||
package mineplex.core.projectile;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
@ -13,6 +14,7 @@ import org.bukkit.Effect;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.inventory.InventoryPickupItemEvent;
|
||||
@ -75,10 +77,63 @@ public class ProjectileManager extends MiniPlugin
|
||||
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle,
|
||||
Sound sound, float soundVolume, float soundPitch, ParticleType particle, float pX, float pY, float pZ, float pS, int pC, UpdateType effectRate, float hitboxMult)
|
||||
{
|
||||
_thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback,
|
||||
_thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback,
|
||||
expireTime, hitPlayer, hitBlock, idle, false,
|
||||
sound, soundVolume, soundPitch, null, 0, effectRate, particle, pX, pY, pZ, pS, pC, hitboxMult));
|
||||
}
|
||||
|
||||
// WITH CAN HIT PLAYERS LIST:
|
||||
public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback,
|
||||
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, float hitboxGrow, List<Player> canHit)
|
||||
{
|
||||
_thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback,
|
||||
expireTime, hitPlayer, hitBlock, idle, false,
|
||||
null, 1f, 1f, null, 0, null, null, 0F, 0F, 0F, 0F, 1, hitboxGrow, canHit));
|
||||
}
|
||||
|
||||
public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback,
|
||||
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, boolean pickup, float hitboxGrow, List<Player> canHit)
|
||||
{
|
||||
_thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback,
|
||||
expireTime, hitPlayer, hitBlock, idle, pickup,
|
||||
null, 1f, 1f, null, 0, null, null, 0F, 0F, 0F, 0F, 1, hitboxGrow, canHit));
|
||||
}
|
||||
|
||||
public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback,
|
||||
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle,
|
||||
Sound sound, float soundVolume, float soundPitch, Effect effect, int effectData, UpdateType effectRate , float hitboxGrow, List<Player> canHit)
|
||||
{
|
||||
_thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback,
|
||||
expireTime, hitPlayer, hitBlock, idle, false,
|
||||
sound, soundVolume, soundPitch, effect, effectData, effectRate, null, 0F, 0F, 0F, 0F, 1, hitboxGrow, canHit));
|
||||
}
|
||||
|
||||
public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback,
|
||||
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle,
|
||||
Sound sound, float soundVolume, float soundPitch, ParticleType particle, Effect effect, int effectData, UpdateType effectRate, float hitboxGrow, List<Player> canHit)
|
||||
{
|
||||
_thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback,
|
||||
expireTime, hitPlayer, hitBlock, idle, false,
|
||||
sound, soundVolume, soundPitch, effect, effectData, effectRate, particle, 0F, 0F, 0F, 0F, 1, hitboxGrow, canHit));
|
||||
}
|
||||
|
||||
public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback,
|
||||
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle,
|
||||
Sound sound, float soundVolume, float soundPitch, ParticleType particle, UpdateType effectRate, float hitboxMult, List<Player> canHit)
|
||||
{
|
||||
_thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback,
|
||||
expireTime, hitPlayer, hitBlock, idle, false,
|
||||
sound, soundVolume, soundPitch, null, 0, effectRate, particle, 0F, 0F, 0F, 0F, 1, hitboxMult, canHit));
|
||||
}
|
||||
|
||||
public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback,
|
||||
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle,
|
||||
Sound sound, float soundVolume, float soundPitch, ParticleType particle, float pX, float pY, float pZ, float pS, int pC, UpdateType effectRate, float hitboxMult, List<Player> canHit)
|
||||
{
|
||||
_thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback,
|
||||
expireTime, hitPlayer, hitBlock, idle, false,
|
||||
sound, soundVolume, soundPitch, null, 0, effectRate, particle, pX, pY, pZ, pS, pC, hitboxMult, canHit));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void Update(UpdateEvent event)
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mineplex.core.projectile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
@ -55,13 +57,51 @@ public class ProjectileUser
|
||||
private UpdateType _effectRate = UpdateType.TICK;
|
||||
|
||||
private double _hitboxGrow;
|
||||
|
||||
private List<Player> _canHit;
|
||||
|
||||
public ProjectileUser(ProjectileManager throwInput, Entity thrown, LivingEntity thrower, IThrown callback,
|
||||
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, boolean pickup,
|
||||
Sound sound, float soundVolume, float soundPitch,
|
||||
Effect effect, int effectData, UpdateType effectRate,
|
||||
ParticleType particle, float particleX, float particleY,
|
||||
float particleZ, float particleS, int particleC, double hitboxMult)
|
||||
{
|
||||
Throw = throwInput;
|
||||
|
||||
_thrown = thrown;
|
||||
_thrower = thrower;
|
||||
_callback = callback;
|
||||
|
||||
_expireTime = expireTime;
|
||||
_hitPlayer = hitPlayer;
|
||||
_hitBlock = hitBlock;
|
||||
_idle = idle;
|
||||
_pickup = pickup;
|
||||
|
||||
_sound = sound;
|
||||
_soundVolume = soundVolume;
|
||||
_soundPitch = soundPitch;
|
||||
_particle = particle;
|
||||
_particleX = particleX;
|
||||
_particleY = particleY;
|
||||
_particleZ = particleZ;
|
||||
_particleS = particleS;
|
||||
_particleC = particleC;
|
||||
_effect = effect;
|
||||
_effectData = effectData;
|
||||
_effectRate = effectRate;
|
||||
|
||||
_hitboxGrow = hitboxMult;
|
||||
_canHit = null;
|
||||
}
|
||||
|
||||
public ProjectileUser(ProjectileManager throwInput, Entity thrown, LivingEntity thrower, IThrown callback,
|
||||
long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, boolean pickup,
|
||||
Sound sound, float soundVolume, float soundPitch,
|
||||
Effect effect, int effectData, UpdateType effectRate,
|
||||
ParticleType particle, float particleX, float particleY,
|
||||
float particleZ, float particleS, int particleC, double hitboxMult)
|
||||
float particleZ, float particleS, int particleC, double hitboxMult, List<Player> canHit)
|
||||
{
|
||||
Throw = throwInput;
|
||||
|
||||
@ -89,6 +129,7 @@ public class ProjectileUser
|
||||
_effectRate = effectRate;
|
||||
|
||||
_hitboxGrow = hitboxMult;
|
||||
_canHit = canHit;
|
||||
}
|
||||
|
||||
public void Effect(UpdateEvent event)
|
||||
@ -152,11 +193,22 @@ public class ProjectileUser
|
||||
if (ent.equals(_thrower))
|
||||
continue;
|
||||
|
||||
//Creative or Spec
|
||||
//Creative or Spec or No Hit
|
||||
if (ent instanceof Player)
|
||||
if (((Player)ent).getGameMode() == GameMode.CREATIVE || UtilPlayer.isSpectator(ent))
|
||||
{
|
||||
if (((Player)ent).getGameMode() == GameMode.CREATIVE)
|
||||
continue;
|
||||
|
||||
if (UtilPlayer.isSpectator(ent))
|
||||
continue;
|
||||
|
||||
if (_canHit != null)
|
||||
{
|
||||
if (!_canHit.contains(((Player)ent)))
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
//float f1 = (float)(nmsEntity.boundingBox.a() * 0.6f);
|
||||
AxisAlignedBB axisalignedbb1 = ((CraftEntity)ent).getHandle().boundingBox.grow(1F, 1F, 1F);
|
||||
MovingObjectPosition entityCollisionPosition = axisalignedbb1.a(vec3d, vec3d1);
|
||||
|
@ -13,7 +13,7 @@ public class GiveStatCommand extends CommandBase<StatsManager>
|
||||
{
|
||||
public GiveStatCommand(StatsManager plugin)
|
||||
{
|
||||
super(plugin, Rank.OWNER, "givestat");
|
||||
super(plugin, Rank.ADMIN, "givestat");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -157,12 +157,12 @@ public class KothManager extends MiniPlugin
|
||||
if (bottom.getVehicle() != null)
|
||||
bottom = bottom.getVehicle();
|
||||
|
||||
UtilAction.velocity(bottom, UtilAlg.getTrajectory(bounce, player.getLocation()), 1, false, 0, 0.4, 1, true);
|
||||
UtilAction.velocity(bottom, UtilAlg.getTrajectory2d(bounce, player.getLocation()), 1.2, false, 0, 0.6, 1, true);
|
||||
|
||||
if (Recharge.Instance.use(player, "KOTH Eject", 5000, false, false))
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Football", "You must be wearing a Team Outfit."));
|
||||
UtilPlayer.message(player, F.main("Football", "Type " + F.elem("/team red|yellow|green|blue") + "!"));
|
||||
UtilPlayer.message(player, F.main("KOTH", "You must be wearing a Team Outfit."));
|
||||
UtilPlayer.message(player, F.main("KOTH", "Type " + F.elem("/team red|yellow|green|blue") + "!"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -419,19 +419,18 @@ public class SoccerManager extends MiniPlugin
|
||||
if (bottom.getVehicle() != null)
|
||||
bottom = bottom.getVehicle();
|
||||
|
||||
UtilAction.velocity(bottom, UtilAlg.getTrajectory(bounce, player.getLocation()), 1, false, 0, 0.4, 1, true);
|
||||
UtilAction.velocity(bottom, UtilAlg.getTrajectory2d(bounce, player.getLocation()), 1, false, 0, 0.8, 1, true);
|
||||
|
||||
if (Recharge.Instance.use(player, "Soccer Eject", 5000, false, false))
|
||||
{
|
||||
if (_active.size() >= 8)
|
||||
if (_active.size() < 8)
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Soccer", "You must be wearing Red/Blue Team Outfit."));
|
||||
UtilPlayer.message(player, F.main("Soccer", "Type " + F.elem("/team red") + " or " + F.elem("/team blue") + "!"));
|
||||
}
|
||||
else
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Soccer", "You must be wearing Red/Blue Team Outfit."));
|
||||
UtilPlayer.message(player, F.main("Soccer", "Type " + F.elem("/team red") + " or " + F.elem("/team blue") + "!"));
|
||||
UtilPlayer.message(player, F.main("Soccer", "The game is currently full!"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -494,6 +493,9 @@ public class SoccerManager extends MiniPlugin
|
||||
{
|
||||
if (_active.contains(event.getPlayer()))
|
||||
event.setCancelled(true);
|
||||
|
||||
if (_ball != null && event.getRightClicked().equals(_ball))
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -355,4 +355,4 @@ public class WorldManager extends MiniPlugin
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -74,7 +74,7 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
|
||||
|
||||
if (_onMainPage)
|
||||
{
|
||||
addButton(4, ItemStackFactory.Instance.CreateStack(Material.DIAMOND_BLOCK, (byte) 0, 1, C.cGreen + "Click to Join instantly!"), new IButton() {
|
||||
addButton(4, ItemStackFactory.Instance.CreateStack(Material.DIAMOND_BLOCK, (byte) 0, 1, C.cGreen + "Click to join instantly!"), new IButton() {
|
||||
|
||||
@Override
|
||||
public void onClick(Player player, ClickType clickType) {
|
||||
|
@ -1,5 +1,6 @@
|
||||
package mineplex.mapparser.command;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
@ -77,6 +78,18 @@ public class MapCommand extends BaseCommand
|
||||
message(player, "That map is being backed up now. Try again soon");
|
||||
return true;
|
||||
}
|
||||
|
||||
//Delete UID
|
||||
File file = new File(worldName + "/uid.dat");
|
||||
if (file.exists())
|
||||
{
|
||||
System.out.println("Deleting uid.dat for " + worldName);
|
||||
file.delete();
|
||||
}
|
||||
else
|
||||
{
|
||||
System.out.println("Could not delete uid.dat for " + worldName);
|
||||
}
|
||||
|
||||
World world = getPlugin().GetMapWorld(worldName);
|
||||
if (world == null)
|
||||
|
@ -130,11 +130,6 @@ public class BombLobbers extends TeamGame implements IThrown
|
||||
_kills.put(player, _kills.containsKey(player) ? _kills.get(player) + 1 : 1);
|
||||
}
|
||||
|
||||
public void addAssist(Player player)
|
||||
{
|
||||
_kills.put(player, _kills.containsKey(player) ? _kills.get(player) + .5 : .5);
|
||||
}
|
||||
|
||||
public double getKills(Player player)
|
||||
{
|
||||
if (_kills.containsKey(player))
|
||||
@ -172,10 +167,6 @@ public class BombLobbers extends TeamGame implements IThrown
|
||||
{
|
||||
addKill(killer);
|
||||
}
|
||||
else
|
||||
{
|
||||
addAssist(killer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -228,11 +219,23 @@ public class BombLobbers extends TeamGame implements IThrown
|
||||
tnt.setFuseTicks(60);
|
||||
|
||||
UtilAction.velocity(tnt, player.getLocation().getDirection(), 2.0D, false, 0.0D, 0.1D, 10.0D, false);
|
||||
Manager.GetProjectile().AddThrow(tnt, player, this, -1L, true, false, true, .2F);
|
||||
|
||||
|
||||
ArrayList<Player> canHit = new ArrayList<Player>();
|
||||
for (Player pos : GetPlayers(true))
|
||||
{
|
||||
if (GetTeam(player).HasPlayer(pos))
|
||||
continue;
|
||||
|
||||
canHit.add(pos);
|
||||
}
|
||||
|
||||
Manager.GetProjectile().AddThrow(tnt, player, this, -1L, true, false, true, .2F, canHit);
|
||||
|
||||
Manager.getPlugin().getServer().getPluginManager().callEvent(new TNTThrowEvent(player, tnt));
|
||||
|
||||
_tnt.put(tnt, new BombToken(player));
|
||||
|
||||
AddGems(player, 0.5, "TNT Thrown", true, true);
|
||||
}
|
||||
|
||||
public Player getThrower(TNTPrimed tnt)
|
||||
@ -562,6 +565,8 @@ public class BombLobbers extends TeamGame implements IThrown
|
||||
UtilAction.velocity(target, UtilAlg.getTrajectory2d(data.GetThrown().getLocation(), target.getLocation()), .2, false, 0, 0.2, .4, true);
|
||||
|
||||
Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, DamageCause.PROJECTILE, 10.0, false, false, false, "Throwing TNT", "Throwing TNT Direct Hit");
|
||||
|
||||
AddGems((Player) data.GetThrower(), 4.0, "Direct Hit", true, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -4,6 +4,33 @@ import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilGear;
|
||||
import mineplex.core.common.util.UtilInv;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.core.visibility.VisibilityManager;
|
||||
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.GameType;
|
||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
import nautilus.game.arcade.game.GameTeam;
|
||||
import nautilus.game.arcade.game.GameTeam.PlayerState;
|
||||
import nautilus.game.arcade.game.SoloGame;
|
||||
import nautilus.game.arcade.game.games.milkcow.MilkRemoveEvent.RemoveType;
|
||||
import nautilus.game.arcade.game.games.milkcow.kits.KitCow;
|
||||
import nautilus.game.arcade.game.games.milkcow.kits.KitFarmerJump;
|
||||
import nautilus.game.arcade.game.games.milkcow.kits.KitSturdyFarmhand;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.kit.NullKit;
|
||||
import net.minecraft.server.v1_7_R4.EntityCreature;
|
||||
import net.minecraft.server.v1_7_R4.Navigation;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
@ -25,31 +52,6 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.scoreboard.DisplaySlot;
|
||||
import org.bukkit.scoreboard.Objective;
|
||||
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilGear;
|
||||
import mineplex.core.common.util.UtilInv;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.core.visibility.VisibilityManager;
|
||||
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.GameType;
|
||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
import nautilus.game.arcade.game.GameTeam;
|
||||
import nautilus.game.arcade.game.SoloGame;
|
||||
import nautilus.game.arcade.game.GameTeam.PlayerState;
|
||||
import nautilus.game.arcade.game.games.milkcow.kits.*;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.kit.NullKit;
|
||||
import net.minecraft.server.v1_7_R4.EntityCreature;
|
||||
import net.minecraft.server.v1_7_R4.Navigation;
|
||||
|
||||
public class MilkCow extends SoloGame
|
||||
{
|
||||
private GameTeam _farmers;
|
||||
@ -73,6 +75,7 @@ public class MilkCow extends SoloGame
|
||||
new Kit[]
|
||||
{
|
||||
new KitFarmerJump(manager),
|
||||
new KitSturdyFarmhand(manager),
|
||||
new NullKit(manager),
|
||||
new KitCow(manager),
|
||||
},
|
||||
@ -112,7 +115,7 @@ public class MilkCow extends SoloGame
|
||||
{
|
||||
if (team.GetColor() == ChatColor.RED)
|
||||
{
|
||||
if (kit.GetName().contains("Farmer"))
|
||||
if (kit.GetName().contains("Farm"))
|
||||
team.GetRestrictedKits().add(kit);
|
||||
}
|
||||
else
|
||||
@ -288,13 +291,17 @@ public class MilkCow extends SoloGame
|
||||
SetPlayerTeam(player, _cows, true);
|
||||
|
||||
//Kit
|
||||
Kit newKit = GetKits()[2];
|
||||
Kit newKit = GetKits()[3];
|
||||
|
||||
SetKit(player, newKit, false);
|
||||
newKit.ApplyKit(player);
|
||||
|
||||
//Refresh
|
||||
VisibilityManager.Instance.refreshPlayerToAll(player);
|
||||
|
||||
//Turn off flight
|
||||
player.setAllowFlight(false);
|
||||
player.setFlying(false);
|
||||
|
||||
if (forced)
|
||||
{
|
||||
@ -345,7 +352,9 @@ public class MilkCow extends SoloGame
|
||||
@EventHandler
|
||||
public void LoseMilk(PlayerDeathEvent event)
|
||||
{
|
||||
SetScore(event.getEntity(), Math.max(0, GetScore(event.getEntity()) - 5));
|
||||
MilkRemoveEvent e = new MilkRemoveEvent(event.getEntity(), 5, RemoveType.DEATH);
|
||||
Bukkit.getPluginManager().callEvent(e);
|
||||
SetScore(event.getEntity(), Math.max(0, GetScore(event.getEntity()) - e.GetMilk()));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -0,0 +1,56 @@
|
||||
package nautilus.game.arcade.game.games.milkcow;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
public class MilkRemoveEvent extends Event
|
||||
{
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private Player _player;
|
||||
private int _milk;
|
||||
private RemoveType _cause;
|
||||
|
||||
public MilkRemoveEvent(Player player, int milk, RemoveType cause)
|
||||
{
|
||||
_player = player;
|
||||
_milk = milk;
|
||||
_cause = cause;
|
||||
}
|
||||
|
||||
public HandlerList getHandlers()
|
||||
{
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList()
|
||||
{
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public Player GetPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public int GetMilk()
|
||||
{
|
||||
return _milk;
|
||||
}
|
||||
|
||||
public RemoveType GetCause()
|
||||
{
|
||||
return _cause;
|
||||
}
|
||||
|
||||
public void SetMilk(int milk)
|
||||
{
|
||||
_milk = milk;
|
||||
}
|
||||
|
||||
public static enum RemoveType
|
||||
{
|
||||
FLING, DEATH;
|
||||
}
|
||||
|
||||
}
|
@ -33,7 +33,7 @@ public class KitCow extends AbbreviatedKit
|
||||
new PerkKnockbackMultiplier(4),
|
||||
new PerkCharge(),
|
||||
new PerkCowBomb(),
|
||||
new PerkSeismicCow(),
|
||||
new PerkSeismicCow("Body Slam"),
|
||||
},
|
||||
EntityType.COW,
|
||||
null);
|
||||
@ -67,7 +67,7 @@ public class KitCow extends AbbreviatedKit
|
||||
new String[]
|
||||
{
|
||||
ChatColor.RESET + "Charge with great power, flinging",
|
||||
ChatColor.RESET + "filthy farmers out of your way!",
|
||||
ChatColor.RESET + "filthy farmers out of your way, making them drop the milk in their buckets!",
|
||||
}));
|
||||
|
||||
//Disguise
|
||||
|
@ -0,0 +1,51 @@
|
||||
package nautilus.game.arcade.game.games.milkcow.kits;
|
||||
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
import nautilus.game.arcade.kit.KitAvailability;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
import nautilus.game.arcade.kit.perks.PerkIronSkin;
|
||||
import nautilus.game.arcade.kit.perks.PerkNoSpillMilk;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class KitSturdyFarmhand extends Kit
|
||||
{
|
||||
public KitSturdyFarmhand(ArcadeManager manager)
|
||||
{
|
||||
super(manager, "Sturdy Farmhand", KitAvailability.Gem, 2000,
|
||||
|
||||
new String[]
|
||||
{
|
||||
"Been working on the ranch so long, even a charging bull can't faze him!"
|
||||
},
|
||||
|
||||
new Perk[]
|
||||
{
|
||||
new PerkNoSpillMilk(manager),
|
||||
new PerkIronSkin(2),
|
||||
},
|
||||
|
||||
EntityType.ZOMBIE,
|
||||
new ItemStack(Material.IRON_SPADE));
|
||||
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void FireItemResist(UpdateEvent event)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void GiveItems(Player player)
|
||||
{
|
||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BUCKET));
|
||||
}
|
||||
}
|
@ -1875,7 +1875,11 @@ public class MineStrike extends TeamGame
|
||||
ChatColor color = ChatColor.GRAY;
|
||||
if (winner != null)
|
||||
{
|
||||
winnerLine= winner.GetColor() + C.Bold + winner.GetName() + " has won the round!";
|
||||
if(winner.GetName().contains("Bombers")) {
|
||||
winnerLine= winner.GetColor() + C.Bold + winner.GetName() + " have won the round!";
|
||||
} else {
|
||||
winnerLine= winner.GetColor() + C.Bold + winner.GetName() + " has won the round!";
|
||||
}
|
||||
addScore(winner);
|
||||
drawScoreboard();
|
||||
color = winner.GetColor();
|
||||
|
@ -79,6 +79,8 @@ public class Quiver extends SoloGame
|
||||
this.PrepareFreeze = false;
|
||||
this.BlockBreakAllow.add(102);
|
||||
this.BlockBreakAllow.add(20);
|
||||
this.BlockBreakAllow.add(Material.STAINED_GLASS_PANE.getId());
|
||||
this.BlockBreakAllow.add(Material.STAINED_GLASS.getId());
|
||||
|
||||
this.DeathSpectateSecs = 1;
|
||||
|
||||
|
@ -178,14 +178,14 @@ public class Spleef extends SoloGame
|
||||
BlockFade(event.getBlock(), event.getPlayer(), false);
|
||||
|
||||
//Snowball
|
||||
if (GetKit(event.getPlayer()) instanceof KitSnowballer)
|
||||
if (GetKit(event.getPlayer()) instanceof KitSnowballer && event.getBlock().getType() != Material.BEDROCK)
|
||||
if (!UtilInv.contains(event.getPlayer(), Material.SNOW_BALL, (byte)0, 16))
|
||||
event.getPlayer().getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.SNOW_BALL));
|
||||
}
|
||||
|
||||
public void BlockFade(Block block, Player player, boolean slowDamage)
|
||||
{
|
||||
if (block.getTypeId() == 7)
|
||||
if (block.getType() == Material.BEDROCK || block.getType() == Material.LAVA || block.getType() == Material.STATIONARY_LAVA)
|
||||
return;
|
||||
|
||||
//Prevent Super Hunger from Bow
|
||||
|
@ -31,6 +31,7 @@ import nautilus.game.arcade.stats.BehindEnemyLinesStatTracker;
|
||||
import nautilus.game.arcade.stats.BlockShreadStatTracker;
|
||||
import nautilus.game.arcade.stats.TheComebackStatTracker;
|
||||
import net.minecraft.server.v1_7_R4.EntityArrow;
|
||||
import net.minecraft.server.v1_7_R4.Item;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
@ -43,17 +44,15 @@ import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftArrow;
|
||||
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
import org.bukkit.event.block.BlockEvent;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.entity.EntityShootBowEvent;
|
||||
import org.bukkit.event.entity.ItemSpawnEvent;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||
|
||||
@ -114,6 +113,7 @@ public class TurfForts extends TeamGame
|
||||
|
||||
new Kit[]
|
||||
{
|
||||
|
||||
new KitMarksman(manager),
|
||||
new KitInfiltrator(manager),
|
||||
new KitShredder(manager),
|
||||
@ -125,6 +125,7 @@ public class TurfForts extends TeamGame
|
||||
"",
|
||||
"Each kill advances your turf forwards.",
|
||||
"Take over all the turf to win!"
|
||||
|
||||
});
|
||||
|
||||
this.StrictAntiHack = true;
|
||||
@ -268,7 +269,7 @@ public class TurfForts extends TeamGame
|
||||
EndCheck();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void BowCancel(EntityShootBowEvent event)
|
||||
{
|
||||
@ -280,13 +281,21 @@ public class TurfForts extends TeamGame
|
||||
((Player) event.getEntity()).updateInventory();
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void BlockBreak(BlockBreakEvent event)
|
||||
{
|
||||
if (event.isCancelled()) // this statement might save just a small amount of time
|
||||
return;
|
||||
|
||||
if(getArcadeManager().isSpectator(event.getPlayer())) event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
@EventHandler
|
||||
public void BlockPlace(BlockPlaceEvent event)
|
||||
{
|
||||
//Remoeved and replaced by ignoreCancelled = true
|
||||
//if (event.isCancelled())
|
||||
// return;
|
||||
if (event.isCancelled())
|
||||
return;
|
||||
|
||||
GameTeam team = GetTeam(event.getPlayer());
|
||||
if (team == null)
|
||||
@ -325,17 +334,6 @@ public class TurfForts extends TeamGame
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void BlockBreak(BlockBreakEvent event)
|
||||
{
|
||||
if (!IsAlive(event.getPlayer()))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -343,7 +341,7 @@ public class TurfForts extends TeamGame
|
||||
{
|
||||
if (event.getEntity().getShooter() == null)
|
||||
return;
|
||||
|
||||
|
||||
if (!(event.getEntity() instanceof Arrow))
|
||||
return;
|
||||
|
||||
@ -359,7 +357,6 @@ public class TurfForts extends TeamGame
|
||||
|
||||
Manager.getPlugin().getServer().getScheduler().scheduleSyncDelayedTask(Manager.getPlugin(), new Runnable()
|
||||
{
|
||||
|
||||
public void run()
|
||||
{
|
||||
try
|
||||
@ -379,22 +376,21 @@ public class TurfForts extends TeamGame
|
||||
int z = fieldZ.getInt(entityArrow);
|
||||
|
||||
Block block = arrow.getWorld().getBlockAt(x, y, z);
|
||||
|
||||
|
||||
if (block.getTypeId() == 35)
|
||||
{
|
||||
if (block.getData() == 14 /* && team.GetColor() != ChatColor.RED */)
|
||||
if (block.getData() == 14 && team.GetColor() != ChatColor.RED)
|
||||
{
|
||||
block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, Material.REDSTONE_BLOCK.getId());
|
||||
}
|
||||
else if (block.getData() == 3 /* && team.GetColor() != ChatColor.AQUA */)
|
||||
else if (block.getData() == 3 && team.GetColor() != ChatColor.AQUA)
|
||||
{
|
||||
block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, Material.LAPIS_BLOCK.getId());
|
||||
}
|
||||
|
||||
|
||||
Bukkit.getPluginManager().callEvent(new ShredBlockEvent(block, arrow));
|
||||
|
||||
|
||||
block.setType(Material.AIR);
|
||||
|
||||
block.breakNaturally();
|
||||
}
|
||||
|
||||
arrow.remove();
|
||||
@ -669,8 +665,7 @@ public class TurfForts extends TeamGame
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@EventHandler
|
||||
public void ItemRemoval(UpdateEvent event)
|
||||
{
|
||||
@ -689,37 +684,7 @@ public class TurfForts extends TeamGame
|
||||
ent.remove();
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
//Added by TheMineBench.
|
||||
@EventHandler
|
||||
public void blockBreak(BlockBreakEvent event) {
|
||||
|
||||
Block block = event.getBlock();
|
||||
|
||||
GameTeam team = GetTeam(event.getPlayer());
|
||||
GameTeam otherTeam = GetOtherTeam(team);
|
||||
|
||||
if (block.getType().equals(Material.WOOL) && (block.getData() == 14 && team.GetColor() != ChatColor.RED) || (block.getData() == 3 && team.GetColor() != ChatColor.AQUA))
|
||||
{
|
||||
UtilPlayer.message(event.getPlayer(), F.main("Game", "You cannot break the " + F.elem(otherTeam.GetColor() + otherTeam.GetName()) + " team's blocks!"));
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public GameTeam GetOtherTeam(GameTeam team) {
|
||||
return team.GetColor() == ChatColor.RED ? GetTeam(ChatColor.AQUA) : GetTeam(ChatColor.RED);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onItem(ItemSpawnEvent e) {
|
||||
if (e.getEntityType().equals(EntityType.DROPPED_ITEM)) {
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void EndCheck()
|
||||
{
|
||||
@ -749,7 +714,7 @@ public class TurfForts extends TeamGame
|
||||
if (player.isOnline())
|
||||
AddGems(player, 10, "Participation", false, false);
|
||||
}
|
||||
|
||||
|
||||
//End
|
||||
SetState(GameState.End);
|
||||
}
|
||||
@ -758,4 +723,4 @@ public class TurfForts extends TeamGame
|
||||
{
|
||||
return _enemyTurf.get(player);
|
||||
}
|
||||
}
|
||||
}
|
@ -2,23 +2,29 @@ package nautilus.game.arcade.kit.perks;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilInv;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import nautilus.game.arcade.game.games.milkcow.MilkRemoveEvent;
|
||||
import nautilus.game.arcade.game.games.milkcow.MilkRemoveEvent.RemoveType;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Cow;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
|
||||
public class PerkCharge extends Perk
|
||||
{
|
||||
public PerkCharge()
|
||||
@ -74,6 +80,19 @@ public class PerkCharge extends Perk
|
||||
|
||||
//Sound
|
||||
player.getWorld().playSound(player.getLocation(), Sound.ZOMBIE_WOOD, 0.75f, 1f);
|
||||
|
||||
if (cur instanceof Player)
|
||||
{
|
||||
MilkRemoveEvent e = new MilkRemoveEvent((Player)cur, 1, RemoveType.FLING);
|
||||
Bukkit.getPluginManager().callEvent(e);
|
||||
ItemStack bucket = e.GetPlayer().getInventory().getItem(0);
|
||||
if ((bucket.getType() == Material.MILK_BUCKET) && e.GetMilk() >= 0)
|
||||
{
|
||||
bucket.setType(Material.BUCKET);
|
||||
e.GetPlayer().getInventory().setItem(0, bucket);
|
||||
}
|
||||
UtilInv.Update(e.GetPlayer());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,40 +1,42 @@
|
||||
package nautilus.game.arcade.kit.perks;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.disguise.disguises.DisguiseBase;
|
||||
import mineplex.core.disguise.disguises.DisguiseCreeper;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
import nautilus.game.arcade.kit.SmashPerk;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class PerkCreeperExplode extends SmashPerk
|
||||
{
|
||||
private HashMap<Player, Long> _active = new HashMap<Player, Long>();
|
||||
@ -144,7 +146,15 @@ public class PerkCreeperExplode extends SmashPerk
|
||||
player.getWorld().playSound(player.getLocation(), Sound.EXPLODE, (float)(2 + Math.random()*4), (float)(Math.random() + 0.2));
|
||||
|
||||
//Blocks
|
||||
Manager.GetExplosion().BlockExplosion(UtilBlock.getInRadius(player.getLocation(), 12).keySet(), player.getLocation(), false);
|
||||
Collection<Block> blocks = UtilBlock.getInRadius(player.getLocation(), 12).keySet();
|
||||
Iterator<Block> iter = blocks.iterator();
|
||||
|
||||
while (iter.hasNext()) {
|
||||
Block b = iter.next();
|
||||
|
||||
if(b.getType() == Material.STATIONARY_LAVA || b.getType() == Material.LAVA || b.getType() == Material.BEDROCK) iter.remove();;
|
||||
}
|
||||
Manager.GetExplosion().BlockExplosion(blocks, player.getLocation(), false);
|
||||
|
||||
//Remove Spawns
|
||||
Iterator<Location> spawnIterator = Manager.GetGame().GetTeam(player).GetSpawns().iterator();
|
||||
|
@ -0,0 +1,43 @@
|
||||
package nautilus.game.arcade.kit.perks;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.game.games.milkcow.MilkRemoveEvent;
|
||||
import nautilus.game.arcade.game.games.milkcow.MilkRemoveEvent.RemoveType;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
|
||||
public class PerkNoSpillMilk extends Perk
|
||||
{
|
||||
|
||||
public PerkNoSpillMilk(ArcadeManager manager)
|
||||
{
|
||||
super("Steady Hands", new String[]
|
||||
{
|
||||
C.cGray + "Lose less milk when you die",
|
||||
C.cGray + "Don't lose your bucket of milk when cows run into you",
|
||||
});
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onLoseMilk(MilkRemoveEvent event)
|
||||
{
|
||||
Player player = event.GetPlayer();
|
||||
|
||||
if (!Kit.HasKit(player))
|
||||
return;
|
||||
|
||||
if (event.GetCause() == RemoveType.DEATH)
|
||||
{
|
||||
if (event.GetMilk() > 3)
|
||||
event.SetMilk(3);
|
||||
}
|
||||
|
||||
if (event.GetCause() == RemoveType.FLING)
|
||||
{
|
||||
event.SetMilk(-1);
|
||||
}
|
||||
}
|
||||
}
|
@ -32,6 +32,14 @@ public class PerkSeismicCow extends Perk
|
||||
{
|
||||
private HashMap<LivingEntity, Long> _live = new HashMap<LivingEntity, Long>();
|
||||
|
||||
public PerkSeismicCow(String displayName)
|
||||
{
|
||||
super(displayName, new String[]
|
||||
{
|
||||
C.cYellow + "Right-Click" + C.cGray + " with Shovel to " + C.cGreen + "Seismic Slam"
|
||||
});
|
||||
}
|
||||
|
||||
public PerkSeismicCow()
|
||||
{
|
||||
super("Seismic Slam", new String[]
|
||||
|
Loading…
Reference in New Issue
Block a user