more bridge tweaks

This commit is contained in:
Cheese 2015-07-01 14:16:56 +10:00
parent 190e58c37e
commit 0650b73374
2 changed files with 19 additions and 9 deletions

5
.gitignore vendored
View File

@ -34,3 +34,8 @@ Debug
/Plugins/Cube/plugin.yml
/Plugins/Cube/src/mastaG/Cube/Cube.java
/Plugins/Libraries/spigot_server.jar
xOlibro
zBench
zMyst
zSotanna
zSotanna2

View File

@ -102,6 +102,7 @@ public class Bridge extends TeamGame implements OreObsfucation
//Mushrooms
private NautHashMap<Location, Long> _mushroomStem = new NautHashMap<Location, Long>();
private NautHashMap<Location, Long> _mushroomTop = new NautHashMap<Location, Long>();
private boolean _stemsGrown = false;
//Ice
private ArrayList<Location> _iceBridge = new ArrayList<Location>();
@ -755,7 +756,7 @@ public class Bridge extends TeamGame implements OreObsfucation
private void BuildLillyPad()
{
for (int i = 0; i < 2; i++)
for (int i = 0; i < 3; i++)
if (_lillyPads != null && !_lillyPads.isEmpty())
{
// Random Block
@ -814,8 +815,12 @@ public class Bridge extends TeamGame implements OreObsfucation
MapUtil.QuickChangeBlockAt(lowestLoc, 100, (byte)15);
}
}
else
{
_stemsGrown = true;
}
else if (_mushroomTop != null && !_mushroomTop.isEmpty())
if (_stemsGrown && _mushroomTop != null && !_mushroomTop.isEmpty())
{
int attempts = 0;
int done = 0;
@ -841,9 +846,6 @@ public class Bridge extends TeamGame implements OreObsfucation
_mushroomTop.remove(loc);
MapUtil.QuickChangeBlockAt(block.getLocation(), 99, (byte)14);
// Sound
loc.getWorld().playEffect(loc, Effect.STEP_SOUND, 99);
done++;
}
@ -853,6 +855,12 @@ public class Bridge extends TeamGame implements OreObsfucation
@EventHandler
public void breakMushroom(BlockBreakEvent event)
{
if (event.isCancelled())
return;
event.setCancelled(true);
event.getBlock().setType(Material.AIR);
if (event.getBlock().getTypeId() == 100 &&
WorldData.GetCustomLocs("21").contains(event.getBlock().getLocation().add(0.5, 0, 0.5)))
{
@ -878,7 +886,7 @@ public class Bridge extends TeamGame implements OreObsfucation
int attempts = 0;
int done = 0;
while (done < 4 && attempts < 500)
while (done < 5 && attempts < 400)
{
attempts++;
@ -903,9 +911,6 @@ public class Bridge extends TeamGame implements OreObsfucation
else
MapUtil.QuickChangeBlockAt(block.getLocation(), Material.ICE);
// Sound
loc.getWorld().playEffect(loc, Effect.STEP_SOUND, Material.ICE);
done++;
}
}