Testing fixes

This commit is contained in:
Sam 2017-08-08 21:50:19 +01:00
parent bb59a03040
commit 0b38b1b6b6
6 changed files with 29 additions and 5 deletions

View File

@ -9,6 +9,8 @@ import org.bukkit.inventory.ItemStack;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilText;
import mineplex.core.itemstack.ItemBuilder; import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.menu.IconButton; import mineplex.core.menu.IconButton;
import mineplex.core.progression.ProgressiveKit; import mineplex.core.progression.ProgressiveKit;
@ -36,7 +38,7 @@ public class KitUpgradeDetailsButton extends IconButton
for (String detail : details) for (String detail : details)
{ {
lore.add(C.cGray + detail); lore.addAll(UtilText.splitLine(detail, LineFormat.LORE));
} }
lore.add(""); lore.add("");

View File

@ -13,6 +13,7 @@ import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Sound; import org.bukkit.Sound;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -98,6 +99,7 @@ public class CastleSiegeNew extends TeamGame
private static final int DEFENDER_WIN_TIME = UNDEAD_BURN_TIME + 200; private static final int DEFENDER_WIN_TIME = UNDEAD_BURN_TIME + 200;
private static final int WOLF_RESPAWN_TIME = 6; private static final int WOLF_RESPAWN_TIME = 6;
private static final long FENCE_NO_CLIP_TIME = TimeUnit.SECONDS.toMillis(2); private static final long FENCE_NO_CLIP_TIME = TimeUnit.SECONDS.toMillis(2);
private static final int MAX_ARROW_TICKS = 30 * 20;
private final Set<Listener> _listeners = new HashSet<>(); private final Set<Listener> _listeners = new HashSet<>();
@ -134,6 +136,7 @@ public class CastleSiegeNew extends TeamGame
HungerSet = 20; HungerSet = 20;
DeathOut = false; DeathOut = false;
WorldTimeSet = START_TIME; WorldTimeSet = START_TIME;
WorldSoilTrample = true;
BlockBreakAllow.add(Material.FENCE.getId()); BlockBreakAllow.add(Material.FENCE.getId());
BlockPlaceAllow.add(Material.FENCE.getId()); BlockPlaceAllow.add(Material.FENCE.getId());
InventoryClick = true; InventoryClick = true;
@ -289,6 +292,7 @@ public class CastleSiegeNew extends TeamGame
Location location = _kitNPCSpawns.get(i++); Location location = _kitNPCSpawns.get(i++);
Entity entity = kit.SpawnEntity(location); Entity entity = kit.SpawnEntity(location);
UtilEnt.CreatureLook(entity, lookAt); UtilEnt.CreatureLook(entity, lookAt);
UtilEnt.addFlag(entity, UtilEnt.FLAG_ENTITY_COMPONENT);
Manager.GetLobby().addKitLocation(entity, kit, location); Manager.GetLobby().addKitLocation(entity, kit, location);
} }
@ -511,6 +515,23 @@ public class CastleSiegeNew extends TeamGame
} }
} }
@EventHandler
public void removeOldArrows(UpdateEvent event)
{
if (event.getType() != UpdateType.SEC)
{
return;
}
for (Entity entity : WorldData.World.getEntities())
{
if (entity instanceof Arrow && entity.getTicksLived() > MAX_ARROW_TICKS)
{
entity.remove();
}
}
}
@EventHandler @EventHandler
public void pickupArrows(PlayerPickupItemEvent event) public void pickupArrows(PlayerPickupItemEvent event)
{ {

View File

@ -163,7 +163,7 @@ public class CastleSiegeTNTManager implements Listener
@EventHandler @EventHandler
public void updateExpire(UpdateEvent event) public void updateExpire(UpdateEvent event)
{ {
if (event.getType() != UpdateType.TICK) if (event.getType() != UpdateType.TICK || !_host.IsLive())
{ {
return; return;
} }

View File

@ -54,7 +54,7 @@ public class KitHumanMarksman extends KitCastleSiege
private static final String MORE_BARRAGE_ARROWS_2 = increaseNumber("Barrage", "Arrows Fired", 2, "Arrows"); private static final String MORE_BARRAGE_ARROWS_2 = increaseNumber("Barrage", "Arrows Fired", 2, "Arrows");
private static final String[][] UPGRADES = { private static final String[][] UPGRADES = {
{ {
receiveItem("2 Extra Mushroom Stews", 1) receiveItem("Extra Mushroom Stews", 2)
}, },
{ {
reduceCooldown("Fletched Arrows", 1) reduceCooldown("Fletched Arrows", 1)

View File

@ -59,7 +59,7 @@ public class PerkPaladinBoost extends Perk
for (Player nearby : UtilPlayer.getNearby(player.getLocation(), RADIUS)) for (Player nearby : UtilPlayer.getNearby(player.getLocation(), RADIUS))
{ {
if (player.equals(nearby) || !team.HasPlayer(nearby)) if (!team.HasPlayer(nearby))
{ {
continue; continue;
} }

View File

@ -162,7 +162,8 @@ public class ProgressingKitManager implements Listener
{ {
//Odd, someone else is using a kit system. //Odd, someone else is using a kit system.
//Shouldn't ever happen, but we'll be careful. //Shouldn't ever happen, but we'll be careful.
// Work Tim you really are big headed. //
// Wow Tim you really are big headed. - Sam
return; return;
} }
if (!((ProgressingKit) kit).canEquipKit(player)) if (!((ProgressingKit) kit).canEquipKit(player))