Merge remote-tracking branch 'origin/develop' into bugfix/foo
This commit is contained in:
commit
63897b9b54
@ -0,0 +1,68 @@
|
||||
From 3b4526267e3bd53d9e70578ec1c7a8cd13038e73 Mon Sep 17 00:00:00 2001
|
||||
From: libraryaddict <libraryaddict115@yahoo.co.nz>
|
||||
Date: Fri, 27 Nov 2015 22:26:34 +1300
|
||||
Subject: [PATCH] Server freezing, fix fake yaw/pitch
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 7165579..4f366da 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -5,6 +5,7 @@ import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.Callable;
|
||||
+import com.google.common.primitives.Doubles;
|
||||
|
||||
// CraftBukkit start
|
||||
import org.bukkit.Bukkit;
|
||||
@@ -153,6 +154,12 @@ public abstract class Entity implements ICommandListener {
|
||||
public void setFakeHead(boolean fakeHead)
|
||||
{
|
||||
_fakeHead = fakeHead;
|
||||
+
|
||||
+ if (!isFakeHead())
|
||||
+ {
|
||||
+ this.fakeYaw = yaw;
|
||||
+ this.fakePitch = pitch;
|
||||
+ }
|
||||
}
|
||||
|
||||
public boolean isSilent()
|
||||
@@ -1024,9 +1031,18 @@ public abstract class Entity implements ICommandListener {
|
||||
this.lastX = this.locX = d0;
|
||||
this.lastY = this.locY = d1;
|
||||
this.lastZ = this.locZ = d2;
|
||||
- this.lastYaw = this.yaw = fakeYaw = f;
|
||||
- this.lastPitch = this.pitch = fakePitch = f1;
|
||||
+ this.lastYaw = this.yaw = f;
|
||||
+ this.lastPitch = this.pitch = f1;
|
||||
+
|
||||
+ if (!isFakeHead())
|
||||
+ {
|
||||
+ this.fakeYaw = yaw;
|
||||
+ this.fakePitch = pitch;
|
||||
+ }
|
||||
|
||||
+ if (!Doubles.isFinite(locX) || !Doubles.isFinite(locY) || !Doubles.isFinite(locZ))
|
||||
+ Thread.dumpStack();
|
||||
+
|
||||
if (this instanceof EntityLiving)
|
||||
((EntityLiving) this).aK = f;
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index 5edef3e..d3b1586 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -208,7 +208,7 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList
|
||||
|
||||
public void a(PacketPlayInFlying packetplayinflying) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinflying, this, this.player.u());
|
||||
- if (this.b(packetplayinflying)) {
|
||||
+ if (this.b(packetplayinflying) || !Doubles.isFinite(player.locX) || !Doubles.isFinite(player.locY) || !Doubles.isFinite(player.locZ)) {
|
||||
this.disconnect("Invalid move packet received");
|
||||
} else {
|
||||
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
|
||||
--
|
||||
1.9.5.msysgit.0
|
||||
|
@ -0,0 +1,47 @@
|
||||
From 2522a926e6cc670f4f10657ea5494b5ffe81eb37 Mon Sep 17 00:00:00 2001
|
||||
From: libraryaddict <libraryaddict115@yahoo.co.nz>
|
||||
Date: Tue, 12 Jan 2016 19:56:07 +1300
|
||||
Subject: [PATCH] Sound and vehicle fixes
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 4f366da..fc9cce0 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -1628,11 +1628,13 @@ public abstract class Entity implements ICommandListener {
|
||||
EntityDismountEvent exitEvent1 = null;
|
||||
if (this.vehicle != null) {
|
||||
if ((this.bukkitEntity instanceof LivingEntity) && (entity.getBukkitEntity() instanceof Vehicle))
|
||||
+ {
|
||||
exitEvent = new VehicleExitEvent((Vehicle) this.vehicle.getBukkitEntity(), (LivingEntity) this.bukkitEntity);
|
||||
- pluginManager.callEvent(exitEvent);
|
||||
+ pluginManager.callEvent(exitEvent);
|
||||
|
||||
- if (exitEvent.isCancelled() || this.vehicle != originalVehicle || (this.vehicle != null && this.vehicle.passenger != originalPassenger)) {
|
||||
- return;
|
||||
+ if (exitEvent.isCancelled() || this.vehicle != originalVehicle || (this.vehicle != null && this.vehicle.passenger != originalPassenger)) {
|
||||
+ return;
|
||||
+ }
|
||||
}
|
||||
|
||||
exitEvent1 = new EntityDismountEvent(this.vehicle.getBukkitEntity(), this.bukkitEntity);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftSound.java b/src/main/java/org/bukkit/craftbukkit/CraftSound.java
|
||||
index 0cc8f9b..dd07600 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftSound.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftSound.java
|
||||
@@ -14,9 +14,9 @@ public class CraftSound {
|
||||
set(AMBIENCE_RAIN, "ambient.weather.rain");
|
||||
set(AMBIENCE_THUNDER, "ambient.weather.thunder");
|
||||
// Damage
|
||||
- set(HURT_FLESH, "game.neutral.hurt");
|
||||
- set(FALL_BIG, "game.neutral.hurt.fall.big");
|
||||
- set(FALL_SMALL, "game.neutral.hurt.fall.small");
|
||||
+ set(HURT_FLESH, "game.player.hurt");
|
||||
+ set(FALL_BIG, "game.player.hurt.fall.big");
|
||||
+ set(FALL_SMALL, "game.player.hurt.fall.small");
|
||||
// Dig Sounds
|
||||
set(DIG_WOOL, "dig.cloth");
|
||||
set(DIG_GRASS, "dig.grass");
|
||||
--
|
||||
1.9.5.msysgit.0
|
||||
|
Binary file not shown.
@ -48,10 +48,15 @@ public class CustomDataManager extends MiniDbClientPlugin<PlayerCustomData>
|
||||
return new PlayerCustomData(_repository);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveData(String name, int accountId)
|
||||
public void saveAsync(Player player)
|
||||
{
|
||||
_repository.saveData(name, accountId);
|
||||
final int accountId = getClientManager().getAccountId(player);
|
||||
final String name = player.getName();
|
||||
|
||||
if (accountId == -1)
|
||||
return;
|
||||
|
||||
runAsync(() -> _repository.saveData(name, accountId));
|
||||
}
|
||||
|
||||
public CorePlayer getCorePlayer(Player player)
|
||||
|
@ -27,10 +27,11 @@ public abstract class MineplexPlayer
|
||||
return "";
|
||||
}
|
||||
|
||||
public void put(String key, int data)
|
||||
public void put(String key, int data, boolean save)
|
||||
{
|
||||
key = getKeyPrefix() + key;
|
||||
_customDataManager.Get(getPlayer()).setData(key, data);
|
||||
if (save) _customDataManager.saveAsync(_player);
|
||||
}
|
||||
|
||||
public int get(String key)
|
||||
|
@ -3,6 +3,7 @@ package mineplex.core.customdata.repository;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
@ -71,20 +72,20 @@ public class CustomDataRepository extends RepositoryBase
|
||||
{
|
||||
PlayerCustomData data = _customDataManager.Get(name);
|
||||
|
||||
for (CustomData cd : data.getDataMap().keySet())
|
||||
for (Map.Entry<CustomData, Integer> entry : data.getDataMap().entrySet())
|
||||
{
|
||||
if (executeUpdate(
|
||||
UPDATE_DATA,
|
||||
new ColumnInt("data", data.getDataMap().get(cd)),
|
||||
new ColumnInt("data", entry.getValue()),
|
||||
new ColumnInt("account", accountId),
|
||||
new ColumnInt("customData", cd.getId())) < 1)
|
||||
new ColumnInt("customData", entry.getKey().getId())) < 1)
|
||||
{
|
||||
// Not already in the DB
|
||||
executeUpdate(
|
||||
INSERT_DATA,
|
||||
new ColumnInt("account", accountId),
|
||||
new ColumnInt("customData", cd.getId()),
|
||||
new ColumnInt("data", data.getDataMap().get(cd))
|
||||
new ColumnInt("customData", entry.getKey().getId()),
|
||||
new ColumnInt("data", entry.getValue())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,5 @@
|
||||
package mineplex.core.disguise;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import mineplex.core.MiniPlugin;
|
||||
import mineplex.core.account.CoreClient;
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
@ -15,6 +7,15 @@ import mineplex.core.common.Rank;
|
||||
import mineplex.serverdata.Region;
|
||||
import mineplex.serverdata.redis.RedisDataRepository;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
public class PlayerDisguiseManager extends MiniPlugin
|
||||
{
|
||||
private CoreClientManager _clients;
|
||||
@ -54,6 +55,7 @@ public class PlayerDisguiseManager extends MiniPlugin
|
||||
{
|
||||
DisguisePlayerBean bean = _redis.getElement(client.getAccountId()+client.GetPlayerName());
|
||||
Bukkit.getPluginManager().callEvent(new PlayerCommandPreprocessEvent(event.getPlayer(), "/Disguise " + bean.getDisguisedPlayer()));
|
||||
event.setJoinMessage("");
|
||||
}
|
||||
}
|
||||
}.runTaskLater(getPlugin(), 7);
|
||||
|
@ -130,6 +130,20 @@ public class ItemBatGun extends ItemGadget
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isThrownBat(Bat bat)
|
||||
{
|
||||
for (ArrayList<Bat> batArray : _bats.values())
|
||||
{
|
||||
for (Bat thrownBat : batArray)
|
||||
{
|
||||
if (bat.equals(thrownBat))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void Clear(Player player)
|
||||
{
|
||||
|
@ -22,7 +22,7 @@ public class ItemDuelingSword extends ItemGadget
|
||||
},
|
||||
-3,
|
||||
Material.GOLD_SWORD, (byte)0,
|
||||
1000, new Ammo("Dueling Sword", "10 Swords", Material.WOOD_SWORD, (byte)0, new String[] { C.cWhite + "10 Swords to duel with" }, 1000, 10));
|
||||
1000, new Ammo("Dueling Sword", "10 Swords", Material.WOOD_SWORD, (byte)0, new String[] { C.cWhite + "10 Swords to duel with" }, 1000, 10), true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -27,6 +27,7 @@ import mineplex.core.recharge.Recharge;
|
||||
|
||||
public abstract class ItemGadget extends Gadget
|
||||
{
|
||||
private boolean _preserveStaticItem;
|
||||
private Ammo _ammo;
|
||||
protected long _recharge;
|
||||
|
||||
@ -40,6 +41,14 @@ public abstract class ItemGadget extends Gadget
|
||||
Free = true;
|
||||
}
|
||||
|
||||
public ItemGadget(GadgetManager manager, String name, String[] desc, int cost, Material mat, byte data,
|
||||
long recharge, Ammo ammo, boolean preserveStaticItem)
|
||||
{
|
||||
this(manager, name, desc, cost, mat, data, recharge, ammo);
|
||||
|
||||
_preserveStaticItem = preserveStaticItem;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void EnableCustom(Player player)
|
||||
{
|
||||
@ -81,9 +90,12 @@ public abstract class ItemGadget extends Gadget
|
||||
|
||||
@EventHandler
|
||||
public void orderThatChest(PlayerDropItemEvent event)
|
||||
{
|
||||
{
|
||||
if (IsActive(event.getPlayer()) && event.getItemDrop().getItemStack().getType() == GetDisplayMaterial())
|
||||
{
|
||||
if (_preserveStaticItem)
|
||||
return;
|
||||
|
||||
final Player player = event.getPlayer();
|
||||
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(Manager.getPlugin(), new Runnable()
|
||||
@ -172,4 +184,4 @@ public abstract class ItemGadget extends Gadget
|
||||
}
|
||||
|
||||
public abstract void ActivateCustom(Player player);
|
||||
}
|
||||
}
|
@ -124,7 +124,7 @@ public class ExclusivePreferencesPage extends ShopPageBase<PreferencesManager, E
|
||||
buildPreference(indices[1], Material.PAPER, "Mac Reports", userPreferences.ShowMacReports, _toggleMacReports);
|
||||
buildPreference(indices[2], Material.SADDLE, "Hub Ignore Velocity", userPreferences.IgnoreVelocity, _toggleHubIgnoreVelocity);
|
||||
}
|
||||
else if (rank == Rank.YOUTUBE || rank == Rank.TWITCH || rank == Rank.YOUTUBE_SMALL)
|
||||
else if (rank == Rank.YOUTUBE || rank == Rank.TWITCH)
|
||||
{
|
||||
int[] indices = UtilUI.getIndicesFor(3, 0, 2);
|
||||
|
||||
@ -132,6 +132,12 @@ public class ExclusivePreferencesPage extends ShopPageBase<PreferencesManager, E
|
||||
buildPreference(indices[1], Material.SLIME_BALL, "Hub Forcefield", userPreferences.HubForcefield, _toggleHubForcefield);
|
||||
buildPreference(indices[2], Material.SADDLE, "Hub Ignore Velocity", userPreferences.IgnoreVelocity, _toggleHubIgnoreVelocity);
|
||||
}
|
||||
else if (rank == Rank.YOUTUBE_SMALL)
|
||||
{
|
||||
int[] indices = UtilUI.getIndicesFor(2, 0, 2);
|
||||
buildPreference(indices[0], Material.SLIME_BALL, "Hub Forcefield", userPreferences.HubForcefield, _toggleHubForcefield);
|
||||
buildPreference(indices[1], Material.SADDLE, "Hub Ignore Velocity", userPreferences.IgnoreVelocity, _toggleHubIgnoreVelocity);
|
||||
}
|
||||
}
|
||||
|
||||
private void toggleHubForcefield(org.bukkit.entity.Player player)
|
||||
|
@ -2,6 +2,20 @@ package mineplex.core.punish;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.block.SignChangeEvent;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.AsyncPlayerPreLoginEvent;
|
||||
import org.bukkit.event.player.AsyncPlayerPreLoginEvent.Result;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
|
||||
import mineplex.core.MiniPlugin;
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.account.event.ClientWebResponseEvent;
|
||||
@ -20,18 +34,6 @@ import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.serverdata.commands.ServerCommandManager;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Sound;
|
||||
import com.google.gson.Gson;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.AsyncPlayerPreLoginEvent;
|
||||
import org.bukkit.event.player.AsyncPlayerPreLoginEvent.Result;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class Punish extends MiniPlugin
|
||||
{
|
||||
private HashMap<String, PunishClient> _punishClients;
|
||||
@ -110,6 +112,18 @@ public class Punish extends MiniPlugin
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void PunishSignEvent(SignChangeEvent event)
|
||||
{
|
||||
PunishClient client = GetClient(event.getPlayer().getName());
|
||||
|
||||
if (client != null && client.IsMuted())
|
||||
{
|
||||
event.getPlayer().sendMessage(F.main(getName(), "Shh, you're muted because " + client.GetPunishment(PunishmentSentence.Mute).GetReason() + " by " + client.GetPunishment(PunishmentSentence.Mute).GetAdmin() + " for " + C.cGreen + UtilTime.convertString(client.GetPunishment(PunishmentSentence.Mute).GetRemaining(), 1, TimeUnit.FIT) + "."));
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void banRefresh(UpdateEvent event)
|
||||
{
|
||||
|
@ -158,7 +158,7 @@ public class TreasurePage extends ShopPageBase<TreasureManager, TreasureShop>
|
||||
if (owned > 0)
|
||||
addButton(slot, item, new OpenTreasureButton(getPlayer(), _treasureLocation, treasureType));
|
||||
else if (treasureType.isPurchasable())
|
||||
addButton(slot, item, new BuyChestButton(getPlayer(), _inventoryManager, this, treasureType.getName(), Material.CHEST, treasureType.getPurchasePrice()));
|
||||
addButton(slot, item, new BuyChestButton(getPlayer(), _inventoryManager, this, treasureType.getItemName(), Material.CHEST, treasureType.getPurchasePrice()));
|
||||
else
|
||||
setItem(slot, item);
|
||||
}
|
||||
|
@ -50,18 +50,18 @@ public class ClansLoginManager extends MiniPlugin implements ILoginProcessor
|
||||
|
||||
private void kickPlayer(final String playerName, final String homeServer)
|
||||
{
|
||||
// runSyncLater(new Runnable()
|
||||
// {
|
||||
// @Override
|
||||
// public void run()
|
||||
// {
|
||||
// Player player = UtilPlayer.searchExact(playerName);
|
||||
// if (player != null && player.isOnline() && !player.isOp())
|
||||
// {
|
||||
// player.kickPlayer("This is not your home server. To play clans, connect to " + homeServer);
|
||||
// }
|
||||
// }
|
||||
// }, 20);
|
||||
runSyncLater(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
Player player = UtilPlayer.searchExact(playerName);
|
||||
if (player != null && player.isOnline() && !player.isOp())
|
||||
{
|
||||
player.kickPlayer("This is not your home server. To play clans, connect to " + homeServer);
|
||||
}
|
||||
}
|
||||
}, 20);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -257,7 +257,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
||||
_playerCountManager = new PlayerCountManager(plugin);
|
||||
|
||||
_customDataManager = new CustomDataManager(plugin, clientManager);
|
||||
|
||||
|
||||
_songs = new ArrayList<NoteSong>();
|
||||
|
||||
try
|
||||
|
@ -62,7 +62,7 @@ public class DisguiseCommand extends CommandBase<HubManager> implements Listener
|
||||
|
||||
public DisguiseCommand(HubManager plugin)
|
||||
{
|
||||
super(plugin, Rank.JNR_DEV, new Rank[] {Rank.YOUTUBE, Rank.TWITCH, Rank.YOUTUBE_SMALL}, "disguise");
|
||||
super(plugin, Rank.JNR_DEV, new Rank[] {Rank.YOUTUBE, Rank.TWITCH}, "disguise");
|
||||
|
||||
plugin.getPluginManager().registerEvents(this, Plugin.getPlugin());
|
||||
}
|
||||
@ -111,8 +111,9 @@ public class DisguiseCommand extends CommandBase<HubManager> implements Listener
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
PacketPlayOutRespawn packet = new PacketPlayOutRespawn(0, EnumDifficulty.getById(caller.getWorld().getDifficulty().getValue()), WorldType.NORMAL, EnumGamemode.getById(caller.getGameMode().getValue()));
|
||||
UtilPlayer.sendPacket(caller, packet);
|
||||
// removed "due to Kicked for Flying"
|
||||
//PacketPlayOutRespawn packet = new PacketPlayOutRespawn(0, EnumDifficulty.getById(caller.getWorld().getDifficulty().getValue()), WorldType.NORMAL, EnumGamemode.getById(caller.getGameMode().getValue()));
|
||||
//UtilPlayer.sendPacket(caller, packet);
|
||||
|
||||
for(Player other : UtilServer.getPlayers())
|
||||
{
|
||||
@ -204,7 +205,7 @@ public class DisguiseCommand extends CommandBase<HubManager> implements Listener
|
||||
|
||||
Plugin.GetGadget().removeGadgetType(caller, GadgetType.Item);
|
||||
|
||||
Bukkit.broadcastMessage(ChatColor.DARK_GRAY + "Quit> " + ChatColor.GRAY + _disguisedPlayersNames.get(caller));
|
||||
// Bukkit.broadcastMessage(ChatColor.DARK_GRAY + "Quit> " + ChatColor.GRAY + _disguisedPlayersNames.get(caller));
|
||||
UtilPlayer.message(caller, F.main("Disguise", "Disguise Active: " + ChatColor.RESET + args[0]));
|
||||
|
||||
Field field;
|
||||
@ -222,8 +223,9 @@ public class DisguiseCommand extends CommandBase<HubManager> implements Listener
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
PacketPlayOutRespawn packet = new PacketPlayOutRespawn(0, EnumDifficulty.getById(caller.getWorld().getDifficulty().getValue()), WorldType.NORMAL, EnumGamemode.getById(caller.getGameMode().getValue()));
|
||||
UtilPlayer.sendPacket(caller, packet);
|
||||
// removed "due to Kicked for Flying"
|
||||
//PacketPlayOutRespawn packet = new PacketPlayOutRespawn(0, EnumDifficulty.getById(caller.getWorld().getDifficulty().getValue()), WorldType.NORMAL, EnumGamemode.getById(caller.getGameMode().getValue()));
|
||||
//UtilPlayer.sendPacket(caller, packet);
|
||||
|
||||
tablistRefresh(caller);
|
||||
} catch(Exception e)
|
||||
|
@ -10,6 +10,7 @@ import org.bukkit.event.player.PlayerToggleFlightEvent;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import mineplex.core.MiniPlugin;
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
@ -82,8 +83,9 @@ public class JumpManager extends MiniPlugin
|
||||
{
|
||||
if (player.getGameMode() == GameMode.CREATIVE)
|
||||
continue;
|
||||
|
||||
if (Manager.getPreferences().Get(player).Invisibility)
|
||||
|
||||
Rank rank = Manager.GetClients().Get(player).GetRank();
|
||||
if (Manager.getPreferences().Get(player).Invisibility && (rank.has(Rank.MODERATOR) || rank == Rank.YOUTUBE || rank == Rank.TWITCH))
|
||||
{
|
||||
player.setAllowFlight(true);
|
||||
continue;
|
||||
|
@ -7,6 +7,8 @@ import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftInventoryCrafting;
|
||||
import org.bukkit.entity.Bat;
|
||||
import org.bukkit.entity.EnderDragon;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Horse;
|
||||
@ -16,6 +18,8 @@ import org.bukkit.entity.Wither;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.player.PlayerInteractAtEntityEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import mineplex.core.MiniPlugin;
|
||||
@ -28,8 +32,10 @@ import mineplex.core.common.util.UtilEvent.ActionType;
|
||||
import mineplex.core.common.util.UtilGear;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.event.StackerEvent;
|
||||
import mineplex.core.gadget.gadgets.item.ItemBatGun;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphBlock;
|
||||
import mineplex.core.gadget.types.GadgetType;
|
||||
import mineplex.core.pet.PetManager;
|
||||
import mineplex.core.projectile.IThrown;
|
||||
import mineplex.core.projectile.ProjectileManager;
|
||||
import mineplex.core.projectile.ProjectileUser;
|
||||
@ -94,7 +100,9 @@ public class StackerManager extends MiniPlugin implements IThrown
|
||||
//Parkour Disable
|
||||
if (Manager.GetParkour().InsideParkour(stacker.getLocation()))
|
||||
{
|
||||
UtilPlayer.message(stacker, F.main("Parkour", "You cannot Stack/Throw near Parkour Challenges."));
|
||||
if (!stackee.isCustomNameVisible())
|
||||
UtilPlayer.message(stacker, F.main("Parkour", "You cannot Stack/Throw near Parkour Challenges."));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -120,30 +128,68 @@ public class StackerManager extends MiniPlugin implements IThrown
|
||||
|
||||
if (stackee instanceof Player)
|
||||
{
|
||||
Player stackeePlayer = (Player) stackee;
|
||||
|
||||
if (!Manager.hasPlayerStackingEnabled(stacker))
|
||||
{
|
||||
UtilPlayer.message(stacker, F.main("Stacker", "You have player stacking disabled."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Manager.hasPlayerStackingEnabled(((Player)stackee)))
|
||||
if (!Manager.hasPlayerStackingEnabled((stackeePlayer)))
|
||||
{
|
||||
UtilPlayer.message(stacker, F.main("Stacker", F.name(UtilEnt.getName(stackee)) + " has player stacking disabled."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (Manager.GetTreasure().isOpening((Player) stackee))
|
||||
if (Manager.GetTreasure().isOpening(stackeePlayer))
|
||||
{
|
||||
UtilPlayer.message(stacker, F.main("Stacker", F.main("Stacker", F.name(UtilEnt.getName(stackee)) + " is opening a chest!")));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Inventory top = stackeePlayer.getOpenInventory().getTopInventory();
|
||||
|
||||
if (!(top instanceof CraftInventoryCrafting) && hasItems(top))
|
||||
{
|
||||
String message = F.main("Stacker", F.name(UtilEnt.getName(stackee)) + " cannot be stacked right now.");
|
||||
|
||||
if (top.getHolder() != null)
|
||||
{
|
||||
if (top.getHolder().equals(stackeePlayer))
|
||||
{
|
||||
UtilPlayer.message(stacker, message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
UtilPlayer.message(stacker, message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (stackee instanceof LivingEntity)
|
||||
{
|
||||
if (Manager.getPetManager().getPets().contains(stackee) || stackee instanceof Wither || stackee instanceof EnderDragon || ((LivingEntity)stackee).isCustomNameVisible())
|
||||
ItemBatGun batGun = (ItemBatGun) Manager.GetGadget().getGadget(ItemBatGun.class);
|
||||
|
||||
if (stackee instanceof Bat)
|
||||
{
|
||||
UtilPlayer.message(stacker, F.main("Stacker", "You cannot stack this entity."));
|
||||
Bat bat = (Bat) stackee;
|
||||
|
||||
if (batGun.isThrownBat(bat))
|
||||
return;
|
||||
}
|
||||
|
||||
PetManager petManager = Manager.getPetManager();
|
||||
LivingEntity livingStackee = (LivingEntity) stackee;
|
||||
boolean cannotStack = petManager.getPets().contains(stackee) || stackee instanceof Wither || stackee instanceof EnderDragon;
|
||||
|
||||
if (cannotStack || livingStackee.isCustomNameVisible())
|
||||
{
|
||||
// Prevent from showing this message when players right-click on game npc's.
|
||||
if (cannotStack)
|
||||
UtilPlayer.message(stacker, F.main("Stacker", "You cannot stack this entity."));
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -163,8 +209,8 @@ public class StackerManager extends MiniPlugin implements IThrown
|
||||
|
||||
top.setPassenger(stackee);
|
||||
|
||||
UtilPlayer.message(stacker, F.main("Stacker", "You stacked " + F.name(UtilEnt.getName(stackee) + ".")));
|
||||
UtilPlayer.message(stackee, F.main("Stacker", "You were stacked by " + F.name(stacker.getName() + ".")));
|
||||
UtilPlayer.message(stacker, F.main("Stacker", "You stacked " + F.name(UtilEnt.getName(stackee)) + "."));
|
||||
UtilPlayer.message(stackee, F.main("Stacker", "You were stacked by " + F.name(stacker.getName()) + "."));
|
||||
UtilPlayer.message(stackee, F.main("Stacker", "Push " + F.skill("Crouch") + " to escape!"));
|
||||
|
||||
//Portal Delay
|
||||
@ -224,8 +270,8 @@ public class StackerManager extends MiniPlugin implements IThrown
|
||||
return;
|
||||
}
|
||||
|
||||
UtilPlayer.message(thrower, F.main("Stacker", "You threw " + F.name(UtilEnt.getName(throwee))));
|
||||
UtilPlayer.message(throwee, F.main("Stacker", "You were thrown by " + F.name(thrower.getName())));
|
||||
UtilPlayer.message(thrower, F.main("Stacker", "You threw " + F.name(UtilEnt.getName(throwee)) + "."));
|
||||
UtilPlayer.message(throwee, F.main("Stacker", "You were thrown by " + F.name(thrower.getName()) + "."));
|
||||
|
||||
System.out.println("Stacker throw.");
|
||||
|
||||
@ -274,6 +320,17 @@ public class StackerManager extends MiniPlugin implements IThrown
|
||||
//Portal Delay
|
||||
Manager.SetPortalDelay(target);
|
||||
}
|
||||
|
||||
private boolean hasItems(Inventory inventory)
|
||||
{
|
||||
for (ItemStack item : inventory.getContents())
|
||||
{
|
||||
if (item != null)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Idle(ProjectileUser data)
|
||||
|
@ -20,7 +20,6 @@ public class Burning extends Condition
|
||||
@Override
|
||||
public void Add()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -32,9 +31,9 @@ public class Burning extends Condition
|
||||
@Override
|
||||
public void OnConditionAdd()
|
||||
{
|
||||
if (_ent.getFireTicks() > 0)
|
||||
if (_ent.getFireTicks() > 0 && IsAdd())
|
||||
_ent.setFireTicks(_ent.getFireTicks() + _ticksTotal);
|
||||
else
|
||||
else if (_ent.getFireTicks() < _ticksTotal)
|
||||
_ent.setFireTicks(_ticksTotal);
|
||||
}
|
||||
}
|
||||
}
|
@ -37,10 +37,10 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Projectile;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityCombustByEntityEvent;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.player.PlayerVelocityEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.util.Vector;
|
||||
@ -122,6 +122,15 @@ public class DamageManager extends MiniPlugin
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onEntityCombust(EntityCombustByEntityEvent event)
|
||||
{
|
||||
if (!(event.getCombuster() instanceof Player || event.getCombuster() instanceof Arrow))
|
||||
return;
|
||||
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void removeDemArrowsCrazyMan(EntityDamageEvent event)
|
||||
{
|
||||
@ -307,12 +316,18 @@ public class DamageManager extends MiniPlugin
|
||||
else if (e.equals(Enchantment.ARROW_DAMAGE) || e.equals(Enchantment.DAMAGE_ALL))
|
||||
event.AddMod("Enchant", "Ench Damage", 0.5 * (double)enchants.get(e), true);
|
||||
|
||||
else if (e.equals(Enchantment.ARROW_FIRE) || e.equals(Enchantment.FIRE_ASPECT))
|
||||
else if (e.equals(Enchantment.FIRE_ASPECT))
|
||||
if (_conditionManager != null)
|
||||
_conditionManager.Factory().Ignite("Ench Fire", event.GetDamageeEntity(), damager,
|
||||
1 * (double)enchants.get(e), false, false);
|
||||
4 * (double)enchants.get(e), false, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (event.GetProjectile() instanceof Arrow && event.GetProjectile().getFireTicks() > 0)
|
||||
{
|
||||
if (_conditionManager != null)
|
||||
_conditionManager.Factory().Ignite("Arrow Fire", event.GetDamageeEntity(), damager, 5, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
|
@ -112,8 +112,10 @@ public class DisguiseCommand extends CommandBase<ArcadeManager> implements Liste
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
PacketPlayOutRespawn packet = new PacketPlayOutRespawn(0, EnumDifficulty.getById(caller.getWorld().getDifficulty().getValue()), WorldType.NORMAL, EnumGamemode.getById(caller.getGameMode().getValue()));
|
||||
UtilPlayer.sendPacket(caller, packet);
|
||||
|
||||
// removed "due to Kicked for Flying"
|
||||
//PacketPlayOutRespawn packet = new PacketPlayOutRespawn(0, EnumDifficulty.getById(caller.getWorld().getDifficulty().getValue()), WorldType.NORMAL, EnumGamemode.getById(caller.getGameMode().getValue()));
|
||||
//UtilPlayer.sendPacket(caller, packet);
|
||||
|
||||
for(Player other : UtilServer.getPlayers())
|
||||
{
|
||||
@ -205,7 +207,7 @@ public class DisguiseCommand extends CommandBase<ArcadeManager> implements Liste
|
||||
|
||||
Plugin.getCosmeticManager().getGadgetManager().removeGadgetType(caller, GadgetType.Item);
|
||||
|
||||
Bukkit.broadcastMessage(ChatColor.DARK_GRAY + "Quit> " + ChatColor.GRAY + _disguisedPlayersNames.get(caller));
|
||||
// Bukkit.broadcastMessage(ChatColor.DARK_GRAY + "Quit> " + ChatColor.GRAY + _disguisedPlayersNames.get(caller));
|
||||
UtilPlayer.message(caller, F.main("Disguise", "Disguise Active: " + ChatColor.RESET + args[0]));
|
||||
|
||||
Field field;
|
||||
@ -223,8 +225,9 @@ public class DisguiseCommand extends CommandBase<ArcadeManager> implements Liste
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
PacketPlayOutRespawn packet = new PacketPlayOutRespawn(0, EnumDifficulty.getById(caller.getWorld().getDifficulty().getValue()), WorldType.NORMAL, EnumGamemode.getById(caller.getGameMode().getValue()));
|
||||
UtilPlayer.sendPacket(caller, packet);
|
||||
// removed "due to Kicked for Flying"
|
||||
//PacketPlayOutRespawn packet = new PacketPlayOutRespawn(0, EnumDifficulty.getById(caller.getWorld().getDifficulty().getValue()), WorldType.NORMAL, EnumGamemode.getById(caller.getGameMode().getValue()));
|
||||
//UtilPlayer.sendPacket(caller, packet);
|
||||
|
||||
tablistRefresh(caller);
|
||||
} catch(Exception e)
|
||||
|
@ -180,7 +180,7 @@ public class HotbarEditor extends MiniPlugin
|
||||
save.setRod(save.getEmpty());
|
||||
}
|
||||
|
||||
_host.Manager.getArcadePlayer(player).put("hotbar", save.toDataSaveNumber());
|
||||
_host.Manager.getArcadePlayer(player).put("hotbar", save.toDataSaveNumber(), true);
|
||||
player.sendMessage(F.main("Game", "Saved new hotbar layout!"));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user