build update

This commit is contained in:
Mini-Chiss 2015-05-03 19:10:49 -05:00
parent 1576085d87
commit 7f0e175ba1
2 changed files with 37 additions and 13 deletions

View File

@ -83,11 +83,10 @@ import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.events.PlayerPrepareTeleportEvent;
import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.build.gui.MobShop;
import nautilus.game.arcade.game.games.build.gui.OptionsShop;
import nautilus.game.arcade.game.games.draw.kits.*;
import nautilus.game.arcade.game.games.build.kits.KitBuilder;
import nautilus.game.arcade.kit.Kit;
public class Build extends SoloGame
@ -134,9 +133,7 @@ public class Build extends SoloGame
new Kit[]
{
new KitSlowAndSteady(manager),
new KitSelector(manager),
new KitTools(manager),
new KitBuilder(manager),
},
new String[]
@ -390,10 +387,10 @@ public class Build extends SoloGame
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(160, (byte)5, 1, C.Bold + "+3 " + C.cGreen + C.Bold + "Good"));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(160, (byte)3, 1, C.Bold + "+4 " + C.cAqua + C.Bold + "Amazing"));
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(160, (byte)10, 1, C.Bold + "+5 " + C.cPurple + C.Bold + "WOW! EVERYTHING IS AWESOME!"));
UtilTextMiddle.display(null, C.cYellow + "Click to Vote", 0, 60, 5, player);
}
//Text
UtilTextMiddle.display(null, C.cYellow + "Click to Vote", 0, 60, 5);
_buildStateTime = System.currentTimeMillis();
}
@ -1261,4 +1258,13 @@ public class Build extends SoloGame
}
}
}
@Override
public Location GetSpectatorLocation()
{
if (GetPlayers(true).size() > 0)
return UtilAlg.Random(GetPlayers(true)).getLocation().add(0, 1, 0);
return GetTeamList().get(0).GetSpawn();
}
}

View File

@ -5,6 +5,7 @@ import java.util.HashSet;
import java.util.Iterator;
import mineplex.core.common.util.F;
import mineplex.core.common.util.MapUtil;
import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilBlock;
@ -14,6 +15,7 @@ import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.recharge.Recharge;
import org.bukkit.Location;
import org.bukkit.Material;
@ -23,6 +25,7 @@ import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Ghast;
import org.bukkit.entity.Item;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.inventory.meta.ItemMeta;
@ -122,6 +125,13 @@ public class BuildData
return false;
}
if (entity instanceof LivingEntity)
{
((LivingEntity)entity).setRemoveWhenFarAway(false);
((LivingEntity)entity).setCustomName(UtilEnt.getName(entity));
}
Entities.add(entity);
UtilEnt.Vegetate(entity, true);
UtilEnt.ghost(entity, true, false);
@ -289,16 +299,24 @@ public class BuildData
}
public void setGround(GroundData ground)
{
// TODO chiss
{
if (!Recharge.Instance.use(Player, "Change Ground", 2000, true, false))
{
Player.playSound(Player.getLocation(), Sound.NOTE_BASS_GUITAR, 1f, 0.1f);
return;
}
Material mat = ground.getMaterial();
byte data = ground.getData();
if (mat == Material.LAVA_BUCKET) mat = Material.LAVA;
else if (mat == Material.WATER_BUCKET) mat = Material.WATER;
int y = Math.min(CornerA.getBlockY(), CornerB.getBlockY()) - 1;
for (int x= Math.min(CornerA.getBlockX(), CornerB.getBlockX()) ; x <= Math.max(CornerA.getBlockX(), CornerB.getBlockX()) ; x++)
for (int z= Math.min(CornerA.getBlockZ(), CornerB.getBlockZ()) ; z <= Math.max(CornerA.getBlockZ(), CornerB.getBlockZ()) ; z++)
{
MapUtil.QuickChangeBlockAt(Player.getWorld(), x, y, z, mat, data);
}
}
}