Merge branch 'master' of ssh://184.154.0.242:7999/min/Mineplex
This commit is contained in:
commit
81e605930f
@ -4,21 +4,24 @@ import java.lang.reflect.Field;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.server.v1_7_R4.EntityBat;
|
||||
import net.minecraft.server.v1_7_R4.EntityCreature;
|
||||
import net.minecraft.server.v1_7_R4.EntityEnderDragon;
|
||||
import net.minecraft.server.v1_7_R4.EntityHuman;
|
||||
import net.minecraft.server.v1_7_R4.EntityInsentient;
|
||||
import net.minecraft.server.v1_7_R4.EntityLiving;
|
||||
import net.minecraft.server.v1_7_R4.EntityTrackerEntry;
|
||||
import net.minecraft.server.v1_7_R4.Navigation;
|
||||
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityHeadRotation;
|
||||
import net.minecraft.server.v1_7_R4.PathfinderGoal;
|
||||
import net.minecraft.server.v1_7_R4.PathfinderGoalLookAtPlayer;
|
||||
import net.minecraft.server.v1_7_R4.PathfinderGoalMoveTowardsRestriction;
|
||||
import net.minecraft.server.v1_7_R4.PathfinderGoalRandomLookaround;
|
||||
import net.minecraft.server.v1_7_R4.PathfinderGoalSelector;
|
||||
import net.minecraft.server.v1_7_R4.WorldServer;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
@ -32,6 +35,7 @@ import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Giant;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.Vector;
|
||||
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature;
|
||||
import org.bukkit.craftbukkit.v1_7_R4.CraftWorld;
|
||||
|
||||
@ -582,6 +586,36 @@ public class UtilEnt
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean CreatureLook(Entity ent, Entity target)
|
||||
{
|
||||
return CreatureLook(ent, target instanceof LivingEntity ? ((LivingEntity) target).getEyeLocation() : target.getLocation());
|
||||
}
|
||||
|
||||
public static boolean CreatureLook(Entity ent, Location target)
|
||||
{
|
||||
Vector vec = UtilAlg.getTrajectory(ent.getLocation(), target);
|
||||
|
||||
return CreatureLook(ent, UtilAlg.GetPitch(vec), UtilAlg.GetYaw(vec));
|
||||
}
|
||||
|
||||
public static boolean CreatureLook(Entity ent, float pitch, float yaw)
|
||||
{
|
||||
if (!(ent instanceof LivingEntity))
|
||||
return false;
|
||||
|
||||
EntityLiving ec = ((CraftLivingEntity) ent).getHandle();
|
||||
Location loc = ent.getLocation();
|
||||
|
||||
ec.setPositionRotation(loc.getX(), loc.getY(), loc.getZ(), yaw, pitch);
|
||||
ec.al = true;
|
||||
|
||||
EntityTrackerEntry entry = (EntityTrackerEntry) ((WorldServer) ec.world).tracker.trackedEntities.get(ec.getId());
|
||||
|
||||
entry.broadcast(new PacketPlayOutEntityHeadRotation(ec, (byte) (ec.yaw * 256.0F / 360.0F)));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void CreatureMove(Entity ent, Location target, float speed)
|
||||
{
|
||||
if (!(ent instanceof Creature))
|
||||
|
@ -60,7 +60,6 @@ public class UpdateRank extends CommandBase<CoreClientManager>
|
||||
|
||||
final Rank rank = tempRank;
|
||||
|
||||
if (rank == Rank.ADMIN || rank == Rank.YOUTUBE || rank == Rank.TWITCH || rank == Rank.MODERATOR || rank == Rank.JNR_DEV || rank == Rank.HELPER || rank == Rank.ALL || rank == Rank.MAPDEV || rank == Rank.SNR_MODERATOR)
|
||||
if (rank == Rank.ADMIN || rank == Rank.YOUTUBE || rank == Rank.TWITCH || rank == Rank.MODERATOR || rank == Rank.JNR_DEV || rank == Rank.HELPER || rank == Rank.ALL || rank == Rank.MAPDEV || rank == Rank.SNR_MODERATOR)
|
||||
{
|
||||
if (!testServer && rank.Has(Rank.ADMIN) && !Plugin.hasRank(caller, Rank.LT))
|
||||
|
@ -278,7 +278,7 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
||||
return _voteStreak;
|
||||
}
|
||||
|
||||
public void handleVote(final Player player, final int gemsRecieved)
|
||||
public void handleVote(final Player player, final int gemsReceived)
|
||||
{
|
||||
final int accountId = _clientManager.getAccountId(player);
|
||||
|
||||
@ -297,11 +297,14 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
BonusClientData oldData = Get(player);
|
||||
if (oldData != null) data.setHologram(oldData.getHologram());
|
||||
Set(player, data);
|
||||
|
||||
_statsManager.incrementStat(player, "Global.DailyVote", 1);
|
||||
addPendingExplosion(player, player.getName());
|
||||
UtilPlayer.message(player, F.main("Carl", "Thanks for voting for Mineplex!"));
|
||||
UtilPlayer.message(player, F.main("Carl", "You received " + F.elem(gemsRecieved + " Gems") + " and " + F.elem("1 Carl Spinner Ticket") + "!"));
|
||||
UtilPlayer.message(player, F.main("Carl", "You received " + F.elem(gemsReceived + " Gems") + " and " + F.elem("1 Carl Spinner Ticket") + "!"));
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -482,7 +485,7 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
||||
{
|
||||
final BonusClientData clientData = Get(player);
|
||||
|
||||
if (clientData.getTickets() > 0)
|
||||
if (Recharge.Instance.use(player, "Carl Spin", 5000, false, false) && clientData.getTickets() > 0)
|
||||
{
|
||||
CarlSpinnerEvent event = new CarlSpinnerEvent(player);
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
|
@ -532,8 +532,6 @@ public class Hologram
|
||||
if (newText.equals(_hologramText))
|
||||
return this;
|
||||
|
||||
_makeSpawnPackets = true;
|
||||
|
||||
if (isInUse())
|
||||
{
|
||||
int[] destroy1_7 = new int[0];
|
||||
@ -632,6 +630,7 @@ public class Hologram
|
||||
}
|
||||
|
||||
_hologramText = newText;
|
||||
makeSpawnPackets();
|
||||
|
||||
return this;
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ import org.bukkit.Location;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Bat;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Firework;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Slime;
|
||||
@ -358,7 +359,7 @@ public class SoccerManager extends MiniPlugin
|
||||
|
||||
if (inPlayerArena(ent))
|
||||
{
|
||||
if (ent instanceof Bat || ent instanceof WitherSkull || ent instanceof TNTPrimed)
|
||||
if (ent instanceof Bat || ent instanceof WitherSkull || ent instanceof TNTPrimed || ent instanceof Firework)
|
||||
{
|
||||
ent.remove();
|
||||
continue;
|
||||
|
@ -81,14 +81,22 @@ public class EventModule extends MiniPlugin
|
||||
{
|
||||
if (!event.getMessage().toLowerCase().startsWith("/sethost "))
|
||||
return;
|
||||
|
||||
boolean allowed = Manager.GetClients().Get(event.getPlayer()).GetRank().Has(event.getPlayer(), Rank.JNR_DEV, true);
|
||||
|
||||
boolean eventTestServer = _plugin.getConfig().getString("serverstatus.name").equalsIgnoreCase("SMTestServer-1");
|
||||
|
||||
if (!allowed)
|
||||
{
|
||||
allowed = _plugin.getConfig().getString("serverstatus.name").equalsIgnoreCase("SMTestServer-1") &&
|
||||
Manager.GetClients().Get(event.getPlayer()).GetRank().Has(event.getPlayer(), Rank.SNR_MODERATOR, true);
|
||||
}
|
||||
|
||||
if (!Manager.GetClients().Get(event.getPlayer()).GetRank().Has(event.getPlayer(), Rank.JNR_DEV, true)
|
||||
&& !event.getPlayer().isOp() &&
|
||||
(!eventTestServer && !Manager.GetClients().Get(event.getPlayer()).GetRank().Has(event.getPlayer(), Rank.SNR_MODERATOR, true)))
|
||||
if (!allowed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Manager.GetServerConfig().HostName = event.getMessage().split(" ")[1];
|
||||
|
||||
event.getPlayer().sendMessage("Set host to: " + event.getMessage().split(" ")[1]);
|
||||
|
@ -837,6 +837,9 @@ public class HideSeek extends TeamGame
|
||||
@EventHandler
|
||||
public void UseBoost(PlayerInteractEvent event)
|
||||
{
|
||||
if (!IsLive())
|
||||
return;
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (!UtilEvent.isAction(event, ActionType.R))
|
||||
@ -901,6 +904,9 @@ public class HideSeek extends TeamGame
|
||||
@EventHandler
|
||||
public void UseMeow(PlayerInteractEvent event)
|
||||
{
|
||||
if (!IsLive())
|
||||
return;
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (!UtilEvent.isAction(event, ActionType.R))
|
||||
@ -927,6 +933,9 @@ public class HideSeek extends TeamGame
|
||||
@EventHandler
|
||||
public void UseFirework(PlayerInteractEvent event)
|
||||
{
|
||||
if (!IsLive())
|
||||
return;
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (!UtilEvent.isAction(event, ActionType.R))
|
||||
|
Loading…
Reference in New Issue
Block a user