Fixed some issues that came up

This commit is contained in:
Sam 2018-07-13 17:40:07 +01:00 committed by Alexander Meech
parent 28e77f78a3
commit 06c18a0fa3
4 changed files with 5 additions and 29 deletions

View File

@ -123,6 +123,7 @@ public class ServerManager extends MiniPlugin
.put("Super Smash Mobs", new String[] {"SSM", "SSM2"}) .put("Super Smash Mobs", new String[] {"SSM", "SSM2"})
.put("Champions", new String[] {"DOM", "CTF"}) .put("Champions", new String[] {"DOM", "CTF"})
.put("Clans", new String[] {"ClansHub", "Clans"}) .put("Clans", new String[] {"ClansHub", "Clans"})
.put("Retro", new String[] {"RETRO"})
.build(); .build();
private final QuickShop _quickShop; private final QuickShop _quickShop;

View File

@ -63,14 +63,14 @@ public class MilkCow extends SoloGame
{ {
private static final int SCORE_TO_WIN = 15; private static final int SCORE_TO_WIN = 15;
private static final int SCORE_DEATH = 5; private static final int SCORE_DEATH = 2;
private static final String[] DESCRIPTION = private static final String[] DESCRIPTION =
{ {
C.cGreen + "Farmers" + C.Reset + " get " + C.cYellow + "1" + C.Reset + " point for drinking milk.", C.cGreen + "Farmers" + C.Reset + " get " + C.cYellow + "1" + C.Reset + " point for drinking milk.",
C.cRed + "Cows" + C.Reset + " defend your herd from the farmers.", C.cRed + "Cows" + C.Reset + " defend your herd from the farmers.",
"", "",
C.cYellow + "Everyone" + C.Reset + " loses " + C.cYellow + SCORE_DEATH + C.Reset + " points for dying.", C.cYellow + "Everyone" + C.Reset + " loses " + C.cYellow + SCORE_DEATH + C.Reset + " points for dying.",
"First player to " + C.cYellow + "15" + C.Reset + " points wins!" "First player to " + C.cYellow + SCORE_TO_WIN + C.Reset + " points wins!"
}; };
private GameTeam _farmers; private GameTeam _farmers;
@ -157,7 +157,7 @@ public class MilkCow extends SoloGame
_cows = new GameTeam(this, "Cow", ChatColor.RED, _farmers.GetSpawns()); _cows = new GameTeam(this, "Cow", ChatColor.RED, _farmers.GetSpawns());
AddTeam(_cows); AddTeam(_cows);
_teamSelector = new RatioSelector(_cows, 0.25); _teamSelector = new RatioSelector(_cows, 0.2);
RestrictKits(); RestrictKits();
} }
@ -229,11 +229,6 @@ public class MilkCow extends SoloGame
Cow cow = target.getWorld().spawn(target, Cow.class); Cow cow = target.getWorld().spawn(target, Cow.class);
if (Math.random() > 0.5)
{
cow.setBaby();
}
_herd.add(cow); _herd.add(cow);
CreatureAllowOverride = false; CreatureAllowOverride = false;

View File

@ -15,12 +15,10 @@ import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.recharge.Recharge; import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.game.games.milkcow.MilkRemoveEvent;
import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.kit.Perk;
public class PerkCharge extends Perk public class PerkCharge extends Perk
@ -72,8 +70,6 @@ public class PerkCharge extends Perk
return; return;
} }
UtilServer.CallEvent(new MilkRemoveEvent(hit, 1));
for (ItemStack itemStack : hit.getInventory().getContents()) for (ItemStack itemStack : hit.getInventory().getContents())
{ {
if (itemStack == null || itemStack.getType() != Material.MILK_BUCKET) if (itemStack == null || itemStack.getType() != Material.MILK_BUCKET)

View File

@ -24,7 +24,6 @@ import org.bukkit.event.entity.EntityChangeBlockEvent;
import org.bukkit.event.entity.EntityDeathEvent; import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.event.entity.EntityInteractEvent; import org.bukkit.event.entity.EntityInteractEvent;
import org.bukkit.event.entity.EntityTargetEvent; import org.bukkit.event.entity.EntityTargetEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
@ -78,7 +77,7 @@ public class TugOfWool extends TeamGame
private static final long PURCHASE_COOLDOWN = TimeUnit.SECONDS.toMillis(5); private static final long PURCHASE_COOLDOWN = TimeUnit.SECONDS.toMillis(5);
private static final int GOLD_SLOT = 8; private static final int GOLD_SLOT = 8;
private static final int MAX_GOLD = 50; private static final int MAX_GOLD = 50;
private static final double GOLD_PER_ANIMAL = 0.2, GOLD_PER_PLAYER = 0.3, GOLD_PER_SEC = 0.05, GOLD_PER_CROP_LOST = 3, GOLD_LOST_DEATH = 0.5; private static final double GOLD_PER_ANIMAL = 0.2, GOLD_PER_PLAYER = 0.3, GOLD_PER_SEC = 0.05, GOLD_PER_CROP_LOST = 3, GOLD_LOST_DEATH = 2;
private final Set<TugTeam> _teams; private final Set<TugTeam> _teams;
private final List<TugItem> _items; private final List<TugItem> _items;
@ -658,19 +657,4 @@ public class TugOfWool extends TeamGame
{ {
return (int) Math.floor(_gold.getOrDefault(player, 0D)); return (int) Math.floor(_gold.getOrDefault(player, 0D));
} }
@EventHandler
public void command(PlayerCommandPreprocessEvent event)
{
if (event.getMessage().startsWith("/speed"))
{
String[] args = event.getMessage().split(" ");
_speed = Float.parseFloat(args[1]);
}
else if (event.getMessage().startsWith("/gold"))
{
String[] args = event.getMessage().split(" ");
incrementGold(event.getPlayer(), Integer.parseInt(args[1]));
}
}
} }