Fixed new classes not appearing in repository

This commit is contained in:
AlexTheCoder 2015-08-03 18:45:16 -04:00
parent b53b98d6e3
commit a86fdc3c21
3 changed files with 150 additions and 0 deletions

View File

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

View File

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

View File

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