- Remove all dependence on UtilShapes

This commit is contained in:
AlexTheCoder 2016-04-18 19:59:55 -04:00
parent 34399db6e8
commit 10aba533f3
3 changed files with 23 additions and 19 deletions

View File

@ -659,6 +659,7 @@ public class MinecraftLeague extends TeamGame
_lastIncrease = System.currentTimeMillis(); _lastIncrease = System.currentTimeMillis();
_lastOreReset = System.currentTimeMillis(); _lastOreReset = System.currentTimeMillis();
_lastGrindReset = System.currentTimeMillis() - UtilTime.convert(30, TimeUnit.SECONDS, TimeUnit.MILLISECONDS); _lastGrindReset = System.currentTimeMillis() - UtilTime.convert(30, TimeUnit.SECONDS, TimeUnit.MILLISECONDS);
Manager.GetExplosion().setEnabled(false);
Manager.GetExplosion().SetTemporaryDebris(false); Manager.GetExplosion().SetTemporaryDebris(false);
Manager.GetExplosion().SetDebris(true); Manager.GetExplosion().SetDebris(true);
Manager.GetDamage().SetEnabled(false); Manager.GetDamage().SetEnabled(false);
@ -672,6 +673,7 @@ public class MinecraftLeague extends TeamGame
if (event.GetState() == GameState.End) if (event.GetState() == GameState.End)
{ {
Manager.GetExplosion().setEnabled(true);
Manager.GetExplosion().SetDebris(false); Manager.GetExplosion().SetDebris(false);
Manager.GetExplosion().SetTemporaryDebris(true); Manager.GetExplosion().SetTemporaryDebris(true);
Manager.GetDamage().SetEnabled(true); Manager.GetDamage().SetEnabled(true);

View File

@ -1,11 +1,9 @@
package nautilus.game.arcade.game.games.minecraftleague.variation.wither.data; package nautilus.game.arcade.game.games.minecraftleague.variation.wither.data;
import java.util.List;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
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;
import mineplex.core.common.util.UtilShapes;
import mineplex.core.common.util.UtilTextMiddle; import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.hologram.Hologram; import mineplex.core.hologram.Hologram;
import nautilus.game.arcade.game.GameTeam; import nautilus.game.arcade.game.GameTeam;
@ -28,7 +26,7 @@ public class TeamAltar
private GameTeam _team; private GameTeam _team;
private Location _center; private Location _center;
private List<Location> _protected; //private List<Location> _protected;
private Location[] _skullSpots; private Location[] _skullSpots;
@ -41,8 +39,8 @@ public class TeamAltar
_center = center; _center = center;
spawnSoulsand(); spawnSoulsand();
_protected = UtilShapes.getSphereBlocks(center, 7, 7, false); //_protected = UtilShapes.getSphereBlocks(center, 7, 7, false);
Location labelLoc = center.clone().add(0/*.5*/, 5, 0.5); Location labelLoc = center.clone().add(0/*.5*/, 5, 0.5);
String labelStr = team.GetColor() + team.getDisplayName() + "'s Altar"; String labelStr = team.GetColor() + team.getDisplayName() + "'s Altar";
@ -52,7 +50,8 @@ public class TeamAltar
public boolean isInsideAltar(Location location) public boolean isInsideAltar(Location location)
{ {
return _protected.contains(location); return UtilMath.offset(_center, location) <= 7;
//return _protected.contains(location);
} }
public void spawnSoulsand() public void spawnSoulsand()

View File

@ -10,11 +10,11 @@ import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilItem; import mineplex.core.common.util.UtilItem;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilShapes;
import mineplex.core.common.util.UtilTextMiddle; import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilTime.TimeUnit; import mineplex.core.common.util.UtilTime.TimeUnit;
@ -68,7 +68,7 @@ public class WitherMinionManager implements Listener
private ItemStack _witherItem; private ItemStack _witherItem;
private WitherSkeletonTimer _sbTimer; private WitherSkeletonTimer _sbTimer;
private MapZone _skellyZone; //private MapZone _skellyZone;
private Block _cb; private Block _cb;
private Material _changed = Material.AIR; private Material _changed = Material.AIR;
@ -86,9 +86,9 @@ public class WitherMinionManager implements Listener
_witherItem = new ItemBuilder(Material.SKULL_ITEM).setTitle(C.cDRedB + "Wither Skeleton Head").setData((short) 1).setLore(C.cGray + "Bring this back", C.cGray + "to your team's Altar", C.cGray + "To summon a Wither!").build(); _witherItem = new ItemBuilder(Material.SKULL_ITEM).setTitle(C.cDRedB + "Wither Skeleton Head").setData((short) 1).setLore(C.cGray + "Bring this back", C.cGray + "to your team's Altar", C.cGray + "To summon a Wither!").build();
_sbTimer = new WitherSkeletonTimer(host.Host.GetScoreboard()); _sbTimer = new WitherSkeletonTimer(host.Host.GetScoreboard());
host.Host.ExtraSb.put(_sbTimer, host); host.Host.ExtraSb.put(_sbTimer, host);
_skellyZone = new MapZone(spawns.get(0), new int[] {0, 0, 0}); //_skellyZone = new MapZone(spawns.get(0), new int[] {0, 0, 0});
_skellyZone.setValid(false); //_skellyZone.setValid(false);
host.Host.MapZones.add(_skellyZone); //host.Host.MapZones.add(_skellyZone);
Bukkit.getPluginManager().registerEvents(this, host.Manager.getPlugin()); Bukkit.getPluginManager().registerEvents(this, host.Manager.getPlugin());
} }
@ -136,8 +136,8 @@ public class WitherMinionManager implements Listener
if (!respawn) if (!respawn)
{ {
UtilTextMiddle.display("", C.cGray + "A Wither Skeleton has spawned!"); UtilTextMiddle.display("", C.cGray + "A Wither Skeleton has spawned!");
_skellyZone.setCenter(chosen); //_skellyZone.setCenter(chosen);
_skellyZone.setValid(true); //_skellyZone.setValid(true);
//_host.Host.Objective.setMainObjective(new GrabSkullObjective()); //_host.Host.Objective.setMainObjective(new GrabSkullObjective());
} }
_selected = -1; _selected = -1;
@ -161,7 +161,7 @@ public class WitherMinionManager implements Listener
_spawned = false; _spawned = false;
_entity.remove(); _entity.remove();
_lastDied = System.currentTimeMillis(); _lastDied = System.currentTimeMillis();
_skellyZone.setValid(false); //_skellyZone.setValid(false);
_entity = null; _entity = null;
} }
if (_cb != null) if (_cb != null)
@ -332,7 +332,7 @@ public class WitherMinionManager implements Listener
event.getDrops().clear(); event.getDrops().clear();
event.getDrops().add(_witherItem.clone()); event.getDrops().add(_witherItem.clone());
event.setDroppedExp(10); event.setDroppedExp(10);
_skellyZone.setValid(false); //_skellyZone.setValid(false);
_cb.setType(_changed); _cb.setType(_changed);
_cb = null; _cb = null;
@ -424,7 +424,8 @@ public class WitherMinionManager implements Listener
for (Location loc : _spawns) for (Location loc : _spawns)
{ {
if (UtilShapes.getSphereBlocks(loc, 6, 6, false).contains(event.getBlock().getLocation())) //if (UtilShapes.getSphereBlocks(loc, 6, 6, false).contains(event.getBlock().getLocation()))
if (UtilMath.offset(loc, event.getBlock().getLocation()) <= 6)
event.setCancelled(true); event.setCancelled(true);
} }
} }
@ -437,7 +438,8 @@ public class WitherMinionManager implements Listener
for (Location loc : _spawns) for (Location loc : _spawns)
{ {
if (UtilShapes.getSphereBlocks(loc, 6, 6, false).contains(event.getBlock().getLocation())) //if (UtilShapes.getSphereBlocks(loc, 6, 6, false).contains(event.getBlock().getLocation()))
if (UtilMath.offset(loc, event.getBlock().getLocation()) <= 6)
event.setCancelled(true); event.setCancelled(true);
} }
} }
@ -464,7 +466,8 @@ public class WitherMinionManager implements Listener
for (Location loc : _spawns) for (Location loc : _spawns)
{ {
if (UtilShapes.getSphereBlocks(loc, 5, 5, false).contains(event.getBlock().getLocation())) //if (UtilShapes.getSphereBlocks(loc, 5, 5, false).contains(event.getBlock().getLocation()))
if (UtilMath.offset(loc, event.getBlock().getLocation()) <= 6)
event.setCancelled(true); event.setCancelled(true);
} }
} }