Fixed gems in a few games

Milk Cow; cannot pickup water, cannot drink milk after end
This commit is contained in:
Chiss 2013-09-14 08:13:21 +10:00
parent 20090406a6
commit 35c10f22a1
6 changed files with 59 additions and 6 deletions

View File

@ -5,6 +5,7 @@ import org.bukkit.ChatColor;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.block.BlockDamageEvent; import org.bukkit.event.block.BlockDamageEvent;
import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.entity.PlayerDeathEvent;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
@ -169,8 +170,25 @@ public class Barbarians extends SoloGame
} }
@EventHandler @EventHandler
public void BlockBreak(BlockDamageEvent event) public void BlockDamage(BlockDamageEvent event)
{ {
event.setInstaBreak(true); event.setInstaBreak(true);
} }
@EventHandler
public void ItemSpawn(ItemSpawnEvent event)
{
event.setCancelled(true);
}
@Override
public double GetKillsGems(Player killer, Player killed, boolean assist)
{
if (GetTeam(killed).equals(_barbs))
{
return 4;
}
return 0;
}
} }

View File

@ -306,4 +306,15 @@ public class DeathTag extends SoloGame
return true; return true;
} }
@Override
public double GetKillsGems(Player killer, Player killed, boolean assist)
{
if (GetTeam(killed).equals(_runners))
{
return 4;
}
return 0;
}
} }

View File

@ -17,6 +17,7 @@ import org.bukkit.entity.Pig;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.entity.Villager; import org.bukkit.entity.Villager;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerBucketFillEvent;
import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerItemConsumeEvent; import org.bukkit.event.player.PlayerItemConsumeEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
@ -25,6 +26,7 @@ import org.bukkit.scoreboard.Objective;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilServer;
@ -313,12 +315,17 @@ public class MilkCow extends SoloGame
@EventHandler @EventHandler
public void DrinkMilk(PlayerItemConsumeEvent event) public void DrinkMilk(PlayerItemConsumeEvent event)
{ {
if (!IsLive())
return;
if (event.getItem().getType() != Material.MILK_BUCKET) if (event.getItem().getType() != Material.MILK_BUCKET)
return; return;
SetScore(event.getPlayer(), GetScore(event.getPlayer())+1); SetScore(event.getPlayer(), GetScore(event.getPlayer())+1);
event.getPlayer().getWorld().playSound(event.getPlayer().getLocation(), Sound.BURP, 2f, 1f); event.getPlayer().getWorld().playSound(event.getPlayer().getLocation(), Sound.BURP, 2f, 1f);
UtilPlayer.health(event.getPlayer(), 8); UtilPlayer.health(event.getPlayer(), 8);
this.AddGems(event.getPlayer(), 0.5, "Milk Drunk", true);
} }
public void SetScore(Player player, double level) public void SetScore(Player player, double level)
@ -479,4 +486,18 @@ public class MilkCow extends SoloGame
return true; return true;
} }
@EventHandler
public void BucketFill(PlayerBucketFillEvent event)
{
if (event.getBlockClicked() == null)
return;
if (event.getBlockClicked().getTypeId() != 8 && event.getBlockClicked().getTypeId() != 9)
return;
event.setCancelled(true);
UtilInv.Update(event.getPlayer());
event.getPlayer().sendBlockChange(event.getBlockClicked().getLocation(), 8, (byte)0);
}
} }

View File

@ -44,7 +44,6 @@ public class KitFarmerJump extends Kit
@Override @Override
public void GiveItems(Player player) public void GiveItems(Player player)
{ {
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_HOE));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BUCKET)); player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BUCKET));
} }
} }

View File

@ -299,4 +299,10 @@ public class SuperSmash extends SoloGame
event.setCancelled(true); event.setCancelled(true);
} }
} }
@Override
public double GetKillsGems(Player killer, Player killed, boolean assist)
{
return 4;
}
} }

View File

@ -132,8 +132,6 @@ public class Spleef extends SoloGame
public void BlockFade(Block block, Player player) public void BlockFade(Block block, Player player)
{ {
this.AddGems(player, 0.015, "Spleef Blocks Broken", true);
UtilPlayer.hunger(player, 1); UtilPlayer.hunger(player, 1);
//Wool and Stained Clay //Wool and Stained Clay
@ -200,9 +198,9 @@ public class Spleef extends SoloGame
} }
@EventHandler @EventHandler
public void DamageUpdate(UpdateEvent event) public void Hunger(UpdateEvent event)
{ {
if (event.getType() != UpdateType.FAST) if (event.getType() != UpdateType.SEC)
return; return;
if (!IsLive()) if (!IsLive())