Fixed gems in a few games
Milk Cow; cannot pickup water, cannot drink milk after end
This commit is contained in:
parent
20090406a6
commit
35c10f22a1
@ -5,6 +5,7 @@ import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.block.BlockDamageEvent;
|
||||
import org.bukkit.event.entity.ItemSpawnEvent;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
@ -169,8 +170,25 @@ public class Barbarians extends SoloGame
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void BlockBreak(BlockDamageEvent event)
|
||||
public void BlockDamage(BlockDamageEvent event)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -306,4 +306,15 @@ public class DeathTag extends SoloGame
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double GetKillsGems(Player killer, Player killed, boolean assist)
|
||||
{
|
||||
if (GetTeam(killed).equals(_runners))
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ import org.bukkit.entity.Pig;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Villager;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.player.PlayerBucketFillEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.event.player.PlayerItemConsumeEvent;
|
||||
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.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;
|
||||
@ -313,12 +315,17 @@ public class MilkCow extends SoloGame
|
||||
@EventHandler
|
||||
public void DrinkMilk(PlayerItemConsumeEvent event)
|
||||
{
|
||||
if (!IsLive())
|
||||
return;
|
||||
|
||||
if (event.getItem().getType() != Material.MILK_BUCKET)
|
||||
return;
|
||||
|
||||
SetScore(event.getPlayer(), GetScore(event.getPlayer())+1);
|
||||
event.getPlayer().getWorld().playSound(event.getPlayer().getLocation(), Sound.BURP, 2f, 1f);
|
||||
UtilPlayer.health(event.getPlayer(), 8);
|
||||
|
||||
this.AddGems(event.getPlayer(), 0.5, "Milk Drunk", true);
|
||||
}
|
||||
|
||||
public void SetScore(Player player, double level)
|
||||
@ -479,4 +486,18 @@ public class MilkCow extends SoloGame
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,6 @@ public class KitFarmerJump extends Kit
|
||||
@Override
|
||||
public void GiveItems(Player player)
|
||||
{
|
||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_HOE));
|
||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BUCKET));
|
||||
}
|
||||
}
|
||||
|
@ -299,4 +299,10 @@ public class SuperSmash extends SoloGame
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public double GetKillsGems(Player killer, Player killed, boolean assist)
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
@ -132,8 +132,6 @@ public class Spleef extends SoloGame
|
||||
|
||||
public void BlockFade(Block block, Player player)
|
||||
{
|
||||
this.AddGems(player, 0.015, "Spleef Blocks Broken", true);
|
||||
|
||||
UtilPlayer.hunger(player, 1);
|
||||
|
||||
//Wool and Stained Clay
|
||||
@ -200,9 +198,9 @@ public class Spleef extends SoloGame
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void DamageUpdate(UpdateEvent event)
|
||||
public void Hunger(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.FAST)
|
||||
if (event.getType() != UpdateType.SEC)
|
||||
return;
|
||||
|
||||
if (!IsLive())
|
||||
|
Loading…
Reference in New Issue
Block a user