Used armor stands for evolving.

This commit is contained in:
Mysticate 2015-08-20 13:04:22 -04:00
parent 64990ed356
commit 86ad6a09de
2 changed files with 21 additions and 3 deletions

View File

@ -53,6 +53,7 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.block.BlockPhysicsEvent;
import org.bukkit.event.entity.EntityCombustEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerItemHeldEvent;
@ -128,6 +129,8 @@ public class Evolution extends SoloGame
DeathSpectateSecs = 4.0;
VersionRequire1_8 = true;
CreatureAllow = false;
}
public EvolveManager getEvolve()
@ -644,6 +647,12 @@ public class Evolution extends SoloGame
return UtilAlg.getLocationAwayFromOtherLocations(_spawns, allPlayers);
}
@EventHandler
public void onCombust(EntityCombustEvent event)
{
event.setCancelled(true);
}
private void End()
{
ArrayList<EvoToken> tokens = new ArrayList<EvoToken>(_tokens.values());

View File

@ -16,6 +16,7 @@ import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.disguise.disguises.DisguiseArmorStand;
import mineplex.core.hologram.Hologram;
import mineplex.core.hologram.Hologram.HologramTarget;
import mineplex.core.hologram.HologramManager;
@ -46,7 +47,6 @@ import org.bukkit.FireworkEffect.Type;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.craftbukkit.v1_7_R4.CraftWorld;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftZombie;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.entity.Zombie;
@ -75,6 +75,7 @@ public class EvolveData
private final Player _player;
private Zombie _zombie;
private DisguiseArmorStand _disguise;
private final Location _eggLoc;
private final SimpleEntry<Material, Byte> _eggLocData;
@ -147,12 +148,20 @@ public class EvolveData
_zombie = (Zombie) _player.getWorld().spawnEntity(_token.Viewing, EntityType.ZOMBIE);
_manager.Host.CreatureAllowOverride = true;
UtilEnt.Vegetate(_zombie, true);
UtilEnt.ghost(_zombie, true, true);
_disguise = new DisguiseArmorStand(_zombie);
_disguise.setInvisible(true);
_manager.Host.Manager.GetDisguise().disguise(_disguise);
}
private void setupZombie()
{
((CraftZombie) _zombie).getHandle().getControllerLook().a(((CraftZombie) _zombie).getHandle(), _token.Viewing.getYaw(), _token.Viewing.getPitch());
_disguise.setHeadPosition(_token.Viewing.getDirection());
_disguise.UpdateDataWatcher();
_manager.Host.Manager.GetDisguise().updateDisguise(_disguise);
// ((CraftZombie) _zombie).getHandle().getControllerLook().a(((CraftZombie) _zombie).getHandle(), _token.Viewing.getYaw(), _token.Viewing.getPitch());
}
private void setupPlayer()