diff --git a/Plugins/Core/src/me/chiss/Core/Loot/LootBase.java b/Plugins/Core/src/me/chiss/Core/Loot/LootBase.java index 280874279..518deefd0 100644 --- a/Plugins/Core/src/me/chiss/Core/Loot/LootBase.java +++ b/Plugins/Core/src/me/chiss/Core/Loot/LootBase.java @@ -13,7 +13,7 @@ import mineplex.core.itemstack.ItemStackFactory; import org.bukkit.ChatColor; import org.bukkit.Material; -import org.bukkit.craftbukkit.v1_7_R3.inventory.CraftItemStack; +import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftItemStack; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; diff --git a/Plugins/Core/src/me/chiss/Core/Modules/BlockRegenerateData.java b/Plugins/Core/src/me/chiss/Core/Modules/BlockRegenerateData.java index 8f7f46ef9..98f6bdec2 100644 --- a/Plugins/Core/src/me/chiss/Core/Modules/BlockRegenerateData.java +++ b/Plugins/Core/src/me/chiss/Core/Modules/BlockRegenerateData.java @@ -4,8 +4,8 @@ import java.util.HashSet; import org.bukkit.Chunk; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_7_R3.CraftChunk; -import org.bukkit.craftbukkit.v1_7_R3.CraftWorld; +import org.bukkit.craftbukkit.v1_7_R4.CraftChunk; +import org.bukkit.craftbukkit.v1_7_R4.CraftWorld; public class BlockRegenerateData { @@ -46,7 +46,7 @@ public class BlockRegenerateData //if (_loc.getBlock().getType() == Material.CHEST) // return; - net.minecraft.server.v1_7_R3.Chunk c = ((CraftChunk)_loc.getChunk()).getHandle(); + net.minecraft.server.v1_7_R4.Chunk c = ((CraftChunk)_loc.getChunk()).getHandle(); c.a(_loc.getBlockX() & 0xF, _loc.getBlockY(), _loc.getBlockZ() & 0xF, _id, _data); ((CraftWorld)_loc.getChunk().getWorld()).getHandle().notify(_loc.getBlockX(), _loc.getBlockY(), _loc.getBlockZ()); diff --git a/Plugins/Core/src/me/chiss/Core/Modules/BlockRegenerateSet.java b/Plugins/Core/src/me/chiss/Core/Modules/BlockRegenerateSet.java index ed4448ad0..7404298c1 100644 --- a/Plugins/Core/src/me/chiss/Core/Modules/BlockRegenerateSet.java +++ b/Plugins/Core/src/me/chiss/Core/Modules/BlockRegenerateSet.java @@ -5,7 +5,7 @@ import java.util.HashSet; import org.bukkit.Chunk; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_7_R3.CraftChunk; +import org.bukkit.craftbukkit.v1_7_R4.CraftChunk; public class BlockRegenerateSet { @@ -61,7 +61,7 @@ public class BlockRegenerateSet { for (Chunk chunk : _chunks) { - net.minecraft.server.v1_7_R3.Chunk c = ((CraftChunk)chunk).getHandle(); + net.minecraft.server.v1_7_R4.Chunk c = ((CraftChunk)chunk).getHandle(); c.initLighting(); } } diff --git a/Plugins/Core/src/me/chiss/Core/Modules/PlayerInfo.java b/Plugins/Core/src/me/chiss/Core/Modules/PlayerInfo.java index 9a28547b8..0a3121494 100644 --- a/Plugins/Core/src/me/chiss/Core/Modules/PlayerInfo.java +++ b/Plugins/Core/src/me/chiss/Core/Modules/PlayerInfo.java @@ -7,7 +7,7 @@ import mineplex.core.updater.UpdateType; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilServer; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.block.Action; diff --git a/Plugins/Core/src/me/chiss/Core/Modules/Tester.java b/Plugins/Core/src/me/chiss/Core/Modules/Tester.java index 146f63f15..4a050ae3f 100644 --- a/Plugins/Core/src/me/chiss/Core/Modules/Tester.java +++ b/Plugins/Core/src/me/chiss/Core/Modules/Tester.java @@ -11,24 +11,24 @@ import mineplex.core.fakeEntity.FakeEntityManager; import mineplex.core.fakeEntity.FakePlayer; import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.UpdateType; -import net.minecraft.server.v1_7_R3.EntityInsentient; -import net.minecraft.server.v1_7_R3.EntityLiving; -import net.minecraft.server.v1_7_R3.EntityPlayer; -import net.minecraft.server.v1_7_R3.MathHelper; -import net.minecraft.server.v1_7_R3.Packet28EntityVelocity; -import net.minecraft.server.v1_7_R3.Packet31RelEntityMove; -import net.minecraft.server.v1_7_R3.Packet34EntityTeleport; -import net.minecraft.server.v1_7_R3.PathfinderGoalSelector; +import net.minecraft.server.v1_7_R4.EntityInsentient; +import net.minecraft.server.v1_7_R4.EntityLiving; +import net.minecraft.server.v1_7_R4.EntityPlayer; +import net.minecraft.server.v1_7_R4.MathHelper; +import net.minecraft.server.v1_7_R4.Packet28EntityVelocity; +import net.minecraft.server.v1_7_R4.Packet31RelEntityMove; +import net.minecraft.server.v1_7_R4.Packet34EntityTeleport; +import net.minecraft.server.v1_7_R4.PathfinderGoalSelector; import org.bukkit.Bukkit; import org.bukkit.Effect; import org.bukkit.Location; import org.bukkit.Material; -import org.bukkit.craftbukkit.v1_7_R3.CraftWorld; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftAgeable; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftLivingEntity; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.CraftWorld; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftAgeable; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftLivingEntity; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.Item; diff --git a/Plugins/Core/src/me/chiss/Core/Modules/UpdateThread.java b/Plugins/Core/src/me/chiss/Core/Modules/UpdateThread.java index f3bb94c97..85b84c687 100644 --- a/Plugins/Core/src/me/chiss/Core/Modules/UpdateThread.java +++ b/Plugins/Core/src/me/chiss/Core/Modules/UpdateThread.java @@ -7,8 +7,8 @@ import org.bukkit.util.Vector; import mineplex.core.common.util.UtilAlg; import mineplex.core.fakeEntity.FakeEntity; -import net.minecraft.server.v1_7_R3.EntityPlayer; -import net.minecraft.server.v1_7_R3.Packet28EntityVelocity; +import net.minecraft.server.v1_7_R4.EntityPlayer; +import net.minecraft.server.v1_7_R4.Packet28EntityVelocity; public class UpdateThread extends Thread { diff --git a/Plugins/Core/src/me/chiss/Core/Utility/InventoryUtil.java b/Plugins/Core/src/me/chiss/Core/Utility/InventoryUtil.java index bba1eea17..9a517fdd3 100644 --- a/Plugins/Core/src/me/chiss/Core/Utility/InventoryUtil.java +++ b/Plugins/Core/src/me/chiss/Core/Utility/InventoryUtil.java @@ -2,7 +2,7 @@ package me.chiss.Core.Utility; import java.util.HashMap; -import org.bukkit.craftbukkit.v1_7_R3.inventory.CraftInventory; +import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftInventory; import org.bukkit.inventory.ItemStack; public class InventoryUtil diff --git a/Plugins/Libraries/craftbukkit_official.jar b/Plugins/Libraries/craftbukkit_official.jar index 29f8cef9e..553b3cda4 100644 Binary files a/Plugins/Libraries/craftbukkit_official.jar and b/Plugins/Libraries/craftbukkit_official.jar differ diff --git a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/lobbyBalancer/LobbyBalancer.java b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/lobbyBalancer/LobbyBalancer.java index ff5aebdd5..ab0c1887d 100644 --- a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/lobbyBalancer/LobbyBalancer.java +++ b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/lobbyBalancer/LobbyBalancer.java @@ -39,7 +39,7 @@ public class LobbyBalancer implements Listener, Runnable loadLobbyServers(); _plugin.getProxy().getPluginManager().registerListener(_plugin, this); - _plugin.getProxy().getScheduler().schedule(_plugin, this, 500L, 500L, TimeUnit.MILLISECONDS); + _plugin.getProxy().getScheduler().schedule(_plugin, this, 200L, 200L, TimeUnit.MILLISECONDS); } @EventHandler @@ -70,8 +70,7 @@ public class LobbyBalancer implements Listener, Runnable _bestServerIndex = 0; _maxPlayersToSendToBestServer = 1; - // Since we had to enter our dangerzone, update local data so if we have to enter it again we don't pick the same server over and over - _sortedLobbies.get(_bestServerIndex).incrementPlayerCount(5); + // Since we had to enter our dangerzone, decrease buffer so we try to hit another server bungeeBufferNumber -= 2; if (bungeeBufferNumber <= 0) diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/InventoryUtil.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/InventoryUtil.java index 22c4019e7..e8276ce1d 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/InventoryUtil.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/InventoryUtil.java @@ -2,7 +2,7 @@ package mineplex.core.common.util; import java.util.HashMap; -import org.bukkit.craftbukkit.v1_7_R3.inventory.CraftInventory; +import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftInventory; import org.bukkit.inventory.ItemStack; public class InventoryUtil diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/MapUtil.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/MapUtil.java index 7a122966b..acdf19dc3 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/MapUtil.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/MapUtil.java @@ -7,31 +7,31 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Map; -import net.minecraft.server.v1_7_R3.Block; -import net.minecraft.server.v1_7_R3.BlockContainer; -import net.minecraft.server.v1_7_R3.Blocks; -import net.minecraft.server.v1_7_R3.ChunkCoordIntPair; -import net.minecraft.server.v1_7_R3.ChunkSection; -import net.minecraft.server.v1_7_R3.EnumSkyBlock; -import net.minecraft.server.v1_7_R3.ExceptionWorldConflict; -import net.minecraft.server.v1_7_R3.IContainer; -import net.minecraft.server.v1_7_R3.IProgressUpdate; -import net.minecraft.server.v1_7_R3.MinecraftServer; -import net.minecraft.server.v1_7_R3.PacketPlayOutMapChunkBulk; -import net.minecraft.server.v1_7_R3.PacketPlayOutMultiBlockChange; -import net.minecraft.server.v1_7_R3.RegionFile; -import net.minecraft.server.v1_7_R3.RegionFileCache; -import net.minecraft.server.v1_7_R3.TileEntity; +import net.minecraft.server.v1_7_R4.Block; +import net.minecraft.server.v1_7_R4.BlockContainer; +import net.minecraft.server.v1_7_R4.Blocks; +import net.minecraft.server.v1_7_R4.ChunkCoordIntPair; +import net.minecraft.server.v1_7_R4.ChunkSection; +import net.minecraft.server.v1_7_R4.EnumSkyBlock; +import net.minecraft.server.v1_7_R4.ExceptionWorldConflict; +import net.minecraft.server.v1_7_R4.IContainer; +import net.minecraft.server.v1_7_R4.IProgressUpdate; +import net.minecraft.server.v1_7_R4.MinecraftServer; +import net.minecraft.server.v1_7_R4.PacketPlayOutMapChunkBulk; +import net.minecraft.server.v1_7_R4.PacketPlayOutMultiBlockChange; +import net.minecraft.server.v1_7_R4.RegionFile; +import net.minecraft.server.v1_7_R4.RegionFileCache; +import net.minecraft.server.v1_7_R4.TileEntity; import org.bukkit.Bukkit; import org.bukkit.Chunk; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.World; -import org.bukkit.craftbukkit.v1_7_R3.CraftChunk; -import org.bukkit.craftbukkit.v1_7_R3.CraftServer; -import org.bukkit.craftbukkit.v1_7_R3.CraftWorld; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.CraftChunk; +import org.bukkit.craftbukkit.v1_7_R4.CraftServer; +import org.bukkit.craftbukkit.v1_7_R4.CraftWorld; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.event.world.WorldUnloadEvent; @@ -42,7 +42,7 @@ public class MapUtil { public static void ReplaceOreInChunk(Chunk chunk, Material replacee, Material replacer) { - net.minecraft.server.v1_7_R3.Chunk c = ((CraftChunk) chunk).getHandle(); + net.minecraft.server.v1_7_R4.Chunk c = ((CraftChunk) chunk).getHandle(); for (int x = 0; x < 16; x++) { @@ -89,9 +89,9 @@ public class MapUtil public static void QuickChangeBlockAt(World world, int x, int y, int z, int id, int data) { Chunk chunk = world.getChunkAt(x >> 4, z >> 4); - net.minecraft.server.v1_7_R3.Chunk c = ((CraftChunk) chunk).getHandle(); + net.minecraft.server.v1_7_R4.Chunk c = ((CraftChunk) chunk).getHandle(); - c.a(x & 0xF, y, z & 0xF, Block.e(id), data); + c.a(x & 0xF, y, z & 0xF, Block.getById(id), data); ((CraftWorld) world).getHandle().notify(x, y, z); } @@ -144,19 +144,19 @@ public class MapUtil public static void ChunkBlockChange(World world, int x, int y, int z, int id, byte data) { if (changeChunkBlock(x & 15, y, z & 15, ((CraftWorld) world).getHandle().getChunkAt(x >> 4, z >> 4), - Block.e(id), data)) + Block.getById(id), data)) { ((CraftWorld) world).getHandle().notify(x, y, z); } } - private static boolean changeChunkBlock(int x, int y, int z, net.minecraft.server.v1_7_R3.Chunk chunk, Block block, + private static boolean changeChunkBlock(int x, int y, int z, net.minecraft.server.v1_7_R4.Chunk chunk, Block block, byte data) { return chunk.a(x, y, z, block, data); } - public static void SendChunkForPlayer(net.minecraft.server.v1_7_R3.Chunk chunk, Player player) + public static void SendChunkForPlayer(net.minecraft.server.v1_7_R4.Chunk chunk, Player player) { SendChunkForPlayer(chunk.locX, chunk.locZ, player); } @@ -205,7 +205,7 @@ public class MapUtil Bukkit.getPluginManager().callEvent(new WorldUnloadEvent(((CraftWorld) world).getHandle().getWorld())); - Iterator chunkIterator = ((CraftWorld) world).getHandle().chunkProviderServer.chunks + Iterator chunkIterator = ((CraftWorld) world).getHandle().chunkProviderServer.chunks .values().iterator(); for (Entity entity : world.getEntities()) @@ -215,7 +215,7 @@ public class MapUtil while (chunkIterator.hasNext()) { - net.minecraft.server.v1_7_R3.Chunk chunk = chunkIterator.next(); + net.minecraft.server.v1_7_R4.Chunk chunk = chunkIterator.next(); chunk.removeEntities(); } diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilAction.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilAction.java index 16977a29a..1b870ada9 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilAction.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilAction.java @@ -37,6 +37,6 @@ public class UtilAction //Velocity ent.setFallDistance(0); - ent.setVelocity(vec); + ent.setVelocity(vec); } } diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilDisplay.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilDisplay.java index b340695d5..5917b417d 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilDisplay.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilDisplay.java @@ -3,18 +3,18 @@ package mineplex.core.common.util; import java.lang.reflect.Field; import java.util.HashMap; -import net.minecraft.server.v1_7_R3.DataWatcher; -import net.minecraft.server.v1_7_R3.EntityPlayer; -import net.minecraft.server.v1_7_R3.MathHelper; -import net.minecraft.server.v1_7_R3.Packet; -import net.minecraft.server.v1_7_R3.PacketPlayInClientCommand; -import net.minecraft.server.v1_7_R3.PacketPlayOutEntityDestroy; -import net.minecraft.server.v1_7_R3.PacketPlayOutEntityMetadata; -import net.minecraft.server.v1_7_R3.PacketPlayOutSpawnEntityLiving; +import net.minecraft.server.v1_7_R4.DataWatcher; +import net.minecraft.server.v1_7_R4.EntityPlayer; +import net.minecraft.server.v1_7_R4.MathHelper; +import net.minecraft.server.v1_7_R4.Packet; +import net.minecraft.server.v1_7_R4.PacketPlayInClientCommand; +import net.minecraft.server.v1_7_R4.PacketPlayOutEntityDestroy; +import net.minecraft.server.v1_7_R4.PacketPlayOutEntityMetadata; +import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntityLiving; import org.bukkit.Bukkit; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilEnt.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilEnt.java index 32aa41828..1d7b6eca0 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilEnt.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilEnt.java @@ -4,32 +4,32 @@ import java.lang.reflect.Field; import java.util.HashMap; import java.util.LinkedList; -import net.minecraft.server.v1_7_R3.EntityBat; -import net.minecraft.server.v1_7_R3.EntityCreature; -import net.minecraft.server.v1_7_R3.EntityEnderDragon; -import net.minecraft.server.v1_7_R3.EntityHuman; -import net.minecraft.server.v1_7_R3.EntityInsentient; -import net.minecraft.server.v1_7_R3.Navigation; -import net.minecraft.server.v1_7_R3.PathfinderGoalLookAtPlayer; -import net.minecraft.server.v1_7_R3.PathfinderGoalMoveTowardsRestriction; -import net.minecraft.server.v1_7_R3.PathfinderGoalRandomLookaround; -import net.minecraft.server.v1_7_R3.PathfinderGoalSelector; +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.Navigation; +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 org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.block.BlockFace; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftLivingEntity; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftLivingEntity; import org.bukkit.entity.Creature; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.Giant; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftCreature; -import org.bukkit.craftbukkit.v1_7_R3.CraftWorld; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature; +import org.bukkit.craftbukkit.v1_7_R4.CraftWorld; public class UtilEnt { diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilFirework.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilFirework.java index 52152022e..baa1e6fae 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilFirework.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilFirework.java @@ -2,8 +2,8 @@ package mineplex.core.common.util; import org.bukkit.FireworkEffect; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_7_R3.CraftWorld; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_7_R4.CraftWorld; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftEntity; import org.bukkit.entity.Firework; import org.bukkit.inventory.meta.FireworkMeta; import org.bukkit.util.Vector; diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilParticle.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilParticle.java index 16a6844b6..b737ead33 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilParticle.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilParticle.java @@ -2,10 +2,10 @@ package mineplex.core.common.util; import java.lang.reflect.Field; -import net.minecraft.server.v1_7_R3.PacketPlayOutWorldParticles; +import net.minecraft.server.v1_7_R4.PacketPlayOutWorldParticles; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.Player; public class UtilParticle diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilPlayer.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilPlayer.java index 3a3f1947f..2f37c5229 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilPlayer.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilPlayer.java @@ -9,7 +9,7 @@ import org.bukkit.ChatColor; import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Material; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftEntity; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/WorldUtil.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/WorldUtil.java index cdf49125e..8df6595b3 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/WorldUtil.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/WorldUtil.java @@ -2,23 +2,23 @@ package mineplex.core.common.util; import java.io.File; -import net.minecraft.server.v1_7_R3.ConvertProgressUpdater; -import net.minecraft.server.v1_7_R3.Convertable; -import net.minecraft.server.v1_7_R3.EntityTracker; -import net.minecraft.server.v1_7_R3.EnumDifficulty; -import net.minecraft.server.v1_7_R3.EnumGamemode; -import net.minecraft.server.v1_7_R3.IWorldAccess; -import net.minecraft.server.v1_7_R3.ServerNBTManager; -import net.minecraft.server.v1_7_R3.WorldLoaderServer; -import net.minecraft.server.v1_7_R3.WorldManager; -import net.minecraft.server.v1_7_R3.WorldServer; -import net.minecraft.server.v1_7_R3.WorldSettings; -import net.minecraft.server.v1_7_R3.WorldType; +import net.minecraft.server.v1_7_R4.ConvertProgressUpdater; +import net.minecraft.server.v1_7_R4.Convertable; +import net.minecraft.server.v1_7_R4.EntityTracker; +import net.minecraft.server.v1_7_R4.EnumDifficulty; +import net.minecraft.server.v1_7_R4.EnumGamemode; +import net.minecraft.server.v1_7_R4.IWorldAccess; +import net.minecraft.server.v1_7_R4.ServerNBTManager; +import net.minecraft.server.v1_7_R4.WorldLoaderServer; +import net.minecraft.server.v1_7_R4.WorldManager; +import net.minecraft.server.v1_7_R4.WorldServer; +import net.minecraft.server.v1_7_R4.WorldSettings; +import net.minecraft.server.v1_7_R4.WorldType; import org.bukkit.Bukkit; import org.bukkit.World; import org.bukkit.WorldCreator; -import org.bukkit.craftbukkit.v1_7_R3.CraftServer; +import org.bukkit.craftbukkit.v1_7_R4.CraftServer; import org.bukkit.event.world.WorldInitEvent; import org.bukkit.event.world.WorldLoadEvent; import org.bukkit.generator.ChunkGenerator; @@ -81,7 +81,7 @@ public class WorldUtil System.out.println("Loaded world with dimension : " + dimension); - WorldServer internal = new WorldServer(server.getServer(), new ServerNBTManager(server.getWorldContainer(), name, true), name, dimension, new WorldSettings(creator.seed(), EnumGamemode.a(server.getDefaultGameMode().getValue()), generateStructures, hardcore, type), server.getServer().methodProfiler, creator.environment(), generator); + WorldServer internal = new WorldServer(server.getServer(), new ServerNBTManager(server.getWorldContainer(), name, true), name, dimension, new WorldSettings(creator.seed(), EnumGamemode.getById(server.getDefaultGameMode().getValue()), generateStructures, hardcore, type), server.getServer().methodProfiler, creator.environment(), generator); boolean containsWorld = false; for (World otherWorld : server.getWorlds()) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHackRepository.java b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHackRepository.java index ac5f67281..ec67315dd 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHackRepository.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHackRepository.java @@ -7,7 +7,7 @@ import java.sql.SQLException; import mineplex.core.logger.Logger; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.Player; public class AntiHackRepository diff --git a/Plugins/Mineplex.Core/src/mineplex/core/antistack/AntiStack.java b/Plugins/Mineplex.Core/src/mineplex/core/antistack/AntiStack.java index 28327712f..f22790ffe 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/antistack/AntiStack.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/antistack/AntiStack.java @@ -8,7 +8,7 @@ import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_7_R3.inventory.CraftItemStack; +import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftItemStack; import org.bukkit.entity.Item; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java index d9488af05..bbb0e5533 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java @@ -90,7 +90,7 @@ public class Menu extends ShopPageBase final Gadget gadget = Plugin.getGadgetManager().getActive(Player, GadgetType.Particle); AddButton(36, - new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), F.item(gadget.GetName()), new String[] {}, 1, false, false), + new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), C.mItem + gadget.GetName(), new String[] {}, 1, false, false), new SingleButton() { @Override @@ -108,7 +108,7 @@ public class Menu extends ShopPageBase final Gadget gadget = Plugin.getGadgetManager().getActive(Player, GadgetType.Item); AddButton(38, - new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), F.item(gadget.GetName()), new String[] {}, 1, false, false), + new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), C.mItem + gadget.GetName(), new String[] {}, 1, false, false), new SingleButton() { @Override @@ -123,7 +123,7 @@ public class Menu extends ShopPageBase if (Plugin.getPetManager().hasActivePet(Player.getName())) { - AddButton(40, new ShopItem(Material.MONSTER_EGG, (byte)Plugin.getPetManager().getActivePet(Player.getName()).getType().getTypeId(), F.item(Plugin.getPetManager().getActivePet(Player.getName()).getCustomName()), new String[] {}, 1, false, false), + AddButton(40, new ShopItem(Material.MONSTER_EGG, (byte)Plugin.getPetManager().getActivePet(Player.getName()).getType().getTypeId(), C.mItem + Plugin.getPetManager().getActivePet(Player.getName()).getCustomName(), new String[] {}, 1, false, false), new SingleButton() { @Override @@ -141,7 +141,7 @@ public class Menu extends ShopPageBase final Mount mount = Plugin.getMountManager().getActive(Player); AddButton(42, - new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), F.item(mount.GetName()), new String[] {}, 1, false, false), + new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), C.mItem + mount.GetName(), new String[] {}, 1, false, false), new SingleButton() { @Override @@ -159,7 +159,7 @@ public class Menu extends ShopPageBase final Gadget gadget = Plugin.getGadgetManager().getActive(Player, GadgetType.Morph); AddButton(44, - new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), F.item(gadget.GetName()), new String[] {}, 1, false, false), + new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), C.mItem + gadget.GetName(), new String[] {}, 1, false, false), new SingleButton() { @Override diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java index 58d42c7e1..10d7b25e0 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java @@ -4,13 +4,13 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import net.minecraft.server.v1_7_R3.EntityPlayer; -import net.minecraft.server.v1_7_R3.Items; -import net.minecraft.server.v1_7_R3.PacketPlayOutOpenWindow; -import net.minecraft.server.v1_7_R3.PacketPlayOutSetSlot; +import net.minecraft.server.v1_7_R4.EntityPlayer; +import net.minecraft.server.v1_7_R4.Items; +import net.minecraft.server.v1_7_R4.PacketPlayOutOpenWindow; +import net.minecraft.server.v1_7_R4.PacketPlayOutSetSlot; import org.bukkit.Material; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.Creature; import org.bukkit.entity.Player; @@ -135,7 +135,7 @@ public class PetPage extends ShopPageBase entityPlayer.activeContainer = new AnvilContainer(entityPlayer.inventory, petTagPage.getInventory()); entityPlayer.activeContainer.windowId = containerCounter; entityPlayer.activeContainer.addSlotListener(entityPlayer); - entityPlayer.playerConnection.sendPacket(new PacketPlayOutSetSlot(containerCounter, 0, new net.minecraft.server.v1_7_R3.ItemStack(Items.NAME_TAG))); + entityPlayer.playerConnection.sendPacket(new PacketPlayOutSetSlot(containerCounter, 0, new net.minecraft.server.v1_7_R4.ItemStack(Items.NAME_TAG))); Shop.SetCurrentPageForPlayer(Player, petTagPage); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetTagPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetTagPage.java index 2f3dec95f..7cc873c9f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetTagPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetTagPage.java @@ -17,8 +17,8 @@ import mineplex.core.pet.repository.token.PetChangeToken; import mineplex.core.pet.repository.token.PetToken; import mineplex.core.shop.page.ConfirmationPage; import mineplex.core.shop.page.ShopPageBase; -import net.minecraft.server.v1_7_R3.ItemStack; -import net.minecraft.server.v1_7_R3.Items; +import net.minecraft.server.v1_7_R4.ItemStack; +import net.minecraft.server.v1_7_R4.Items; import org.bukkit.ChatColor; import org.bukkit.Material; @@ -67,7 +67,7 @@ public class PetTagPage extends ShopPageBase UtilPlayer.message(Player, F.main(Plugin.GetName(), ChatColor.RED + "Pet name cannot be longer than 16 characters.")); PlayDenySound(Player); - return; + Shop.OpenPageForPlayer(Player, new PetPage(Plugin, Shop, ClientManager, DonationManager, "Pets", Player)); } PetExtra tag = new PetExtra("Rename " + _pet.GetName() + " to " + _tagName, Material.NAME_TAG, 100); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/creature/Creature.java b/Plugins/Mineplex.Core/src/mineplex/core/creature/Creature.java index 01fc17e7b..b7fdc5d06 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/creature/Creature.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/creature/Creature.java @@ -21,9 +21,11 @@ import org.bukkit.Material; import org.bukkit.entity.*; import org.bukkit.entity.Skeleton.SkeletonType; import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; import org.bukkit.event.entity.CreatureSpawnEvent; import org.bukkit.event.entity.EntityDeathEvent; import org.bukkit.event.entity.EntityExplodeEvent; +import org.bukkit.event.player.PlayerEggThrowEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.util.Vector; @@ -31,7 +33,7 @@ import org.bukkit.util.Vector; public class Creature extends MiniPlugin { private boolean _spawnForce = false; - private boolean _disableCustom = true; + private boolean _disableCustom = false; public Creature(JavaPlugin plugin) { @@ -53,6 +55,15 @@ public class Creature extends MiniPlugin return entity; } + @EventHandler(priority = EventPriority.HIGHEST) + public void eggThrow(PlayerEggThrowEvent event) + { + if (_spawnForce) + return; + + event.setHatching(false); + } + @EventHandler public void Spawn(CreatureSpawnEvent event) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/creature/command/MobCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/creature/command/MobCommand.java index 0663b324d..bd4c44946 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/creature/command/MobCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/creature/command/MobCommand.java @@ -4,7 +4,7 @@ import java.util.HashMap; import java.util.HashSet; import org.bukkit.World; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftLivingEntity; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftLivingEntity; import org.bukkit.entity.Ageable; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java index 552e30ee5..449d03393 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java @@ -5,26 +5,26 @@ import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import net.minecraft.server.v1_7_R3.ChunkAddEntityEvent; -import net.minecraft.server.v1_7_R3.EntityPlayer; -import net.minecraft.server.v1_7_R3.Packet; -import net.minecraft.server.v1_7_R3.PacketPlayOutAnimation; -import net.minecraft.server.v1_7_R3.PacketPlayOutNamedEntitySpawn; -import net.minecraft.server.v1_7_R3.PacketPlayOutSpawnEntity; -import net.minecraft.server.v1_7_R3.PacketPlayOutEntityVelocity; -import net.minecraft.server.v1_7_R3.PacketPlayOutEntityDestroy; -import net.minecraft.server.v1_7_R3.PacketPlayOutRelEntityMove; -import net.minecraft.server.v1_7_R3.PacketPlayOutRelEntityMoveLook; -import net.minecraft.server.v1_7_R3.PacketPlayOutEntityTeleport; -import net.minecraft.server.v1_7_R3.PacketPlayOutEntityMetadata; -import net.minecraft.server.v1_7_R3.PacketPlayOutSpawnEntityLiving; -import net.minecraft.server.v1_7_R3.PacketPlayOutUpdateAttributes; -import net.minecraft.server.v1_7_R3.PacketPlayOutEntityEquipment; -import net.minecraft.server.v1_7_R3.PacketPlayOutNamedSoundEffect; +import net.minecraft.server.v1_7_R4.ChunkAddEntityEvent; +import net.minecraft.server.v1_7_R4.EntityPlayer; +import net.minecraft.server.v1_7_R4.Packet; +import net.minecraft.server.v1_7_R4.PacketPlayOutAnimation; +import net.minecraft.server.v1_7_R4.PacketPlayOutNamedEntitySpawn; +import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntity; +import net.minecraft.server.v1_7_R4.PacketPlayOutEntityVelocity; +import net.minecraft.server.v1_7_R4.PacketPlayOutEntityDestroy; +import net.minecraft.server.v1_7_R4.PacketPlayOutRelEntityMove; +import net.minecraft.server.v1_7_R4.PacketPlayOutRelEntityMoveLook; +import net.minecraft.server.v1_7_R4.PacketPlayOutEntityTeleport; +import net.minecraft.server.v1_7_R4.PacketPlayOutEntityMetadata; +import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntityLiving; +import net.minecraft.server.v1_7_R4.PacketPlayOutUpdateAttributes; +import net.minecraft.server.v1_7_R4.PacketPlayOutEntityEquipment; +import net.minecraft.server.v1_7_R4.PacketPlayOutNamedSoundEffect; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftLivingEntity; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftLivingEntity; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBase.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBase.java index 7bc5b5054..9faba7890 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBase.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBase.java @@ -1,13 +1,13 @@ package mineplex.core.disguise.disguises; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_7_R3.CraftWorld; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_7_R4.CraftWorld; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftEntity; -import net.minecraft.server.v1_7_R3.DataWatcher; -import net.minecraft.server.v1_7_R3.Entity; -import net.minecraft.server.v1_7_R3.Packet; -import net.minecraft.server.v1_7_R3.PacketPlayOutEntityMetadata; +import net.minecraft.server.v1_7_R4.DataWatcher; +import net.minecraft.server.v1_7_R4.Entity; +import net.minecraft.server.v1_7_R4.Packet; +import net.minecraft.server.v1_7_R4.PacketPlayOutEntityMetadata; public abstract class DisguiseBase { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBlock.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBlock.java index d05b21e4b..0894e3642 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBlock.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseBlock.java @@ -2,9 +2,9 @@ package mineplex.core.disguise.disguises; import java.util.Random; -import net.minecraft.server.v1_7_R3.MathHelper; -import net.minecraft.server.v1_7_R3.Packet; -import net.minecraft.server.v1_7_R3.PacketPlayOutSpawnEntity; +import net.minecraft.server.v1_7_R4.MathHelper; +import net.minecraft.server.v1_7_R4.Packet; +import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntity; public class DisguiseBlock extends DisguiseBase { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCreature.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCreature.java index 6c9feade2..ba048dbca 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCreature.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseCreature.java @@ -1,9 +1,9 @@ package mineplex.core.disguise.disguises; -import net.minecraft.server.v1_7_R3.EnumEntitySize; -import net.minecraft.server.v1_7_R3.MathHelper; -import net.minecraft.server.v1_7_R3.Packet; -import net.minecraft.server.v1_7_R3.PacketPlayOutSpawnEntityLiving; +import net.minecraft.server.v1_7_R4.EnumEntitySize; +import net.minecraft.server.v1_7_R4.MathHelper; +import net.minecraft.server.v1_7_R4.Packet; +import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntityLiving; import org.bukkit.entity.*; public abstract class DisguiseCreature extends DisguiseInsentient diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseEnderman.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseEnderman.java index fc7b65e80..ad371f92b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseEnderman.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseEnderman.java @@ -2,9 +2,9 @@ package mineplex.core.disguise.disguises; import java.util.Arrays; -import net.minecraft.server.v1_7_R3.MobEffect; -import net.minecraft.server.v1_7_R3.MobEffectList; -import net.minecraft.server.v1_7_R3.PotionBrewer; +import net.minecraft.server.v1_7_R4.MobEffect; +import net.minecraft.server.v1_7_R4.MobEffectList; +import net.minecraft.server.v1_7_R4.PotionBrewer; import org.bukkit.entity.*; public class DisguiseEnderman extends DisguiseMonster diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseInsentient.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseInsentient.java index b0b44938b..e94302afb 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseInsentient.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseInsentient.java @@ -3,8 +3,8 @@ package mineplex.core.disguise.disguises; import java.util.ArrayList; import java.util.List; -import net.minecraft.server.v1_7_R3.Packet; -import net.minecraft.server.v1_7_R3.PacketPlayOutEntityEquipment; +import net.minecraft.server.v1_7_R4.Packet; +import net.minecraft.server.v1_7_R4.PacketPlayOutEntityEquipment; public abstract class DisguiseInsentient extends DisguiseLiving { @@ -56,11 +56,11 @@ public abstract class DisguiseInsentient extends DisguiseLiving public List getArmorPackets() { List p5 = new ArrayList(); - net.minecraft.server.v1_7_R3.ItemStack[] armorContents = Entity.getEquipment(); + net.minecraft.server.v1_7_R4.ItemStack[] armorContents = Entity.getEquipment(); for (short i=0; i < armorContents.length; i++) { - net.minecraft.server.v1_7_R3.ItemStack armorSlot = armorContents[i]; + net.minecraft.server.v1_7_R4.ItemStack armorSlot = armorContents[i]; if (armorSlot != null) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseMagmaCube.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseMagmaCube.java index b630e81e2..26e80e664 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseMagmaCube.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseMagmaCube.java @@ -1,9 +1,9 @@ package mineplex.core.disguise.disguises; -import net.minecraft.server.v1_7_R3.EnumEntitySize; -import net.minecraft.server.v1_7_R3.MathHelper; -import net.minecraft.server.v1_7_R3.Packet; -import net.minecraft.server.v1_7_R3.PacketPlayOutSpawnEntityLiving; +import net.minecraft.server.v1_7_R4.EnumEntitySize; +import net.minecraft.server.v1_7_R4.MathHelper; +import net.minecraft.server.v1_7_R4.Packet; +import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntityLiving; public class DisguiseMagmaCube extends DisguiseInsentient { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePlayer.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePlayer.java index 9ff5060a7..e1a0b4079 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePlayer.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePlayer.java @@ -2,9 +2,9 @@ package mineplex.core.disguise.disguises; import java.util.UUID; -import net.minecraft.server.v1_7_R3.MathHelper; -import net.minecraft.server.v1_7_R3.Packet; -import net.minecraft.server.v1_7_R3.PacketPlayOutNamedEntitySpawn; +import net.minecraft.server.v1_7_R4.MathHelper; +import net.minecraft.server.v1_7_R4.Packet; +import net.minecraft.server.v1_7_R4.PacketPlayOutNamedEntitySpawn; import net.minecraft.util.com.mojang.authlib.GameProfile; public class DisguisePlayer extends DisguiseHuman diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSlime.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSlime.java index 7bdf084c9..fd1b9e476 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSlime.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseSlime.java @@ -1,9 +1,9 @@ package mineplex.core.disguise.disguises; -import net.minecraft.server.v1_7_R3.EnumEntitySize; -import net.minecraft.server.v1_7_R3.MathHelper; -import net.minecraft.server.v1_7_R3.Packet; -import net.minecraft.server.v1_7_R3.PacketPlayOutSpawnEntityLiving; +import net.minecraft.server.v1_7_R4.EnumEntitySize; +import net.minecraft.server.v1_7_R4.MathHelper; +import net.minecraft.server.v1_7_R4.Packet; +import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntityLiving; public class DisguiseSlime extends DisguiseInsentient { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseWolf.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseWolf.java index cb46cf24e..e083e530e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseWolf.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseWolf.java @@ -1,6 +1,6 @@ package mineplex.core.disguise.disguises; -import net.minecraft.server.v1_7_R3.BlockCloth; +import net.minecraft.server.v1_7_R4.BlockCloth; import org.bukkit.entity.*; public class DisguiseWolf extends DisguiseTameableAnimal diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DummyEntity.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DummyEntity.java index 9855490a6..6220170c5 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DummyEntity.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DummyEntity.java @@ -1,8 +1,8 @@ package mineplex.core.disguise.disguises; -import net.minecraft.server.v1_7_R3.Entity; -import net.minecraft.server.v1_7_R3.NBTTagCompound; -import net.minecraft.server.v1_7_R3.World; +import net.minecraft.server.v1_7_R4.Entity; +import net.minecraft.server.v1_7_R4.NBTTagCompound; +import net.minecraft.server.v1_7_R4.World; public class DummyEntity extends Entity { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakeEntity.java b/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakeEntity.java index ca6635021..7979ef75e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakeEntity.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakeEntity.java @@ -2,22 +2,22 @@ package mineplex.core.fakeEntity; import java.lang.reflect.Field; -import net.minecraft.server.v1_7_R3.BlockCloth; -import net.minecraft.server.v1_7_R3.DataWatcher; -import net.minecraft.server.v1_7_R3.Entity; -import net.minecraft.server.v1_7_R3.EntityLiving; -import net.minecraft.server.v1_7_R3.EntitySlime; -import net.minecraft.server.v1_7_R3.EnumEntitySize; -import net.minecraft.server.v1_7_R3.MathHelper; -import net.minecraft.server.v1_7_R3.Packet; -import net.minecraft.server.v1_7_R3.PacketPlayOutSpawnEntityLiving; -import net.minecraft.server.v1_7_R3.PacketPlayOutEntityDestroy; -import net.minecraft.server.v1_7_R3.PacketPlayOutAttachEntity; -import net.minecraft.server.v1_7_R3.PacketPlayOutEntityMetadata; +import net.minecraft.server.v1_7_R4.BlockCloth; +import net.minecraft.server.v1_7_R4.DataWatcher; +import net.minecraft.server.v1_7_R4.Entity; +import net.minecraft.server.v1_7_R4.EntityLiving; +import net.minecraft.server.v1_7_R4.EntitySlime; +import net.minecraft.server.v1_7_R4.EnumEntitySize; +import net.minecraft.server.v1_7_R4.MathHelper; +import net.minecraft.server.v1_7_R4.Packet; +import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntityLiving; +import net.minecraft.server.v1_7_R4.PacketPlayOutEntityDestroy; +import net.minecraft.server.v1_7_R4.PacketPlayOutAttachEntity; +import net.minecraft.server.v1_7_R4.PacketPlayOutEntityMetadata; import org.bukkit.Bukkit; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_7_R3.CraftWorld; +import org.bukkit.craftbukkit.v1_7_R4.CraftWorld; import org.bukkit.entity.EntityType; public class FakeEntity diff --git a/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakeEntityManager.java b/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakeEntityManager.java index 2d53416d2..eb71ba7cc 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakeEntityManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakeEntityManager.java @@ -3,9 +3,9 @@ package mineplex.core.fakeEntity; import java.util.ArrayList; import java.util.List; -import net.minecraft.server.v1_7_R3.Packet; +import net.minecraft.server.v1_7_R4.Packet; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakeFallingBlock.java b/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakeFallingBlock.java index 2c192ab42..3ac51c076 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakeFallingBlock.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakeFallingBlock.java @@ -1,9 +1,9 @@ package mineplex.core.fakeEntity; -import net.minecraft.server.v1_7_R3.EnumEntitySize; -import net.minecraft.server.v1_7_R3.MathHelper; -import net.minecraft.server.v1_7_R3.Packet; -import net.minecraft.server.v1_7_R3.PacketPlayOutSpawnEntity; +import net.minecraft.server.v1_7_R4.EnumEntitySize; +import net.minecraft.server.v1_7_R4.MathHelper; +import net.minecraft.server.v1_7_R4.Packet; +import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntity; import org.bukkit.Location; import org.bukkit.entity.EntityType; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakeItemDrop.java b/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakeItemDrop.java index f0cffce63..9d950fbf1 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakeItemDrop.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakeItemDrop.java @@ -1,13 +1,13 @@ package mineplex.core.fakeEntity; -import net.minecraft.server.v1_7_R3.DataWatcher; -import net.minecraft.server.v1_7_R3.ItemStack; -import net.minecraft.server.v1_7_R3.MathHelper; -import net.minecraft.server.v1_7_R3.Packet; -import net.minecraft.server.v1_7_R3.PacketPlayOutSpawnEntity; +import net.minecraft.server.v1_7_R4.DataWatcher; +import net.minecraft.server.v1_7_R4.ItemStack; +import net.minecraft.server.v1_7_R4.MathHelper; +import net.minecraft.server.v1_7_R4.Packet; +import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntity; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_7_R3.inventory.CraftItemStack; +import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftItemStack; import org.bukkit.entity.EntityType; public class FakeItemDrop extends FakeEntity @@ -75,7 +75,7 @@ public class FakeItemDrop extends FakeEntity dataWatcher.a(1, Short.valueOf((short)300)); dataWatcher.a(8, Integer.valueOf(0)); dataWatcher.a(9, Byte.valueOf((byte) 0)); - dataWatcher.a(10, new net.minecraft.server.v1_7_R3.ItemStack(_itemStack.getItem(), _itemStack.count)); + dataWatcher.a(10, new net.minecraft.server.v1_7_R4.ItemStack(_itemStack.getItem(), _itemStack.count)); } public void SetItemStack(org.bukkit.inventory.ItemStack itemStack) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakePlayer.java b/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakePlayer.java index 005b980cb..294982312 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakePlayer.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/fakeEntity/FakePlayer.java @@ -3,16 +3,16 @@ package mineplex.core.fakeEntity; import java.lang.reflect.Field; import java.util.UUID; -import net.minecraft.server.v1_7_R3.DataWatcher; -import net.minecraft.server.v1_7_R3.EntitySlime; -import net.minecraft.server.v1_7_R3.MathHelper; -import net.minecraft.server.v1_7_R3.Packet; -import net.minecraft.server.v1_7_R3.PacketPlayOutNamedEntitySpawn; +import net.minecraft.server.v1_7_R4.DataWatcher; +import net.minecraft.server.v1_7_R4.EntitySlime; +import net.minecraft.server.v1_7_R4.MathHelper; +import net.minecraft.server.v1_7_R4.Packet; +import net.minecraft.server.v1_7_R4.PacketPlayOutNamedEntitySpawn; import net.minecraft.util.com.mojang.authlib.GameProfile; import org.bukkit.Bukkit; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_7_R3.CraftWorld; +import org.bukkit.craftbukkit.v1_7_R4.CraftWorld; import org.bukkit.entity.EntityType; public class FakePlayer extends FakeEntity diff --git a/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendManager.java b/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendManager.java index ee08811a0..c9912fcc8 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendManager.java @@ -1,7 +1,7 @@ package mineplex.core.friend; -import net.minecraft.server.v1_7_R3.Packet; -import net.minecraft.server.v1_7_R3.PacketPlayOutPlayerInfo; +import net.minecraft.server.v1_7_R4.Packet; +import net.minecraft.server.v1_7_R4.PacketPlayOutPlayerInfo; import org.bukkit.Bukkit; import org.bukkit.ChatColor; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/friend/ui/LineTracker.java b/Plugins/Mineplex.Core/src/mineplex/core/friend/ui/LineTracker.java index 50776725d..ea3345c95 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/friend/ui/LineTracker.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/friend/ui/LineTracker.java @@ -1,7 +1,7 @@ package mineplex.core.friend.ui; -import net.minecraft.server.v1_7_R3.EntityPlayer; -import net.minecraft.server.v1_7_R3.PacketPlayOutPlayerInfo; +import net.minecraft.server.v1_7_R4.EntityPlayer; +import net.minecraft.server.v1_7_R4.PacketPlayOutPlayerInfo; public class LineTracker { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/friend/ui/TabList.java b/Plugins/Mineplex.Core/src/mineplex/core/friend/ui/TabList.java index ee40c61d0..28c500142 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/friend/ui/TabList.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/friend/ui/TabList.java @@ -2,10 +2,10 @@ package mineplex.core.friend.ui; import java.util.HashSet; -import net.minecraft.server.v1_7_R3.EntityPlayer; +import net.minecraft.server.v1_7_R4.EntityPlayer; import org.bukkit.ChatColor; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.Player; import org.bukkit.event.Listener; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/itemstack/ItemStackFactory.java b/Plugins/Mineplex.Core/src/mineplex/core/itemstack/ItemStackFactory.java index 74633882d..82bda3a8c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/itemstack/ItemStackFactory.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/itemstack/ItemStackFactory.java @@ -16,7 +16,7 @@ import mineplex.core.common.util.UtilTime; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.block.Block; -import org.bukkit.craftbukkit.v1_7_R3.inventory.CraftItemStack; +import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftItemStack; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Monster; import org.bukkit.entity.Player; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/memory/MemoryFix.java b/Plugins/Mineplex.Core/src/mineplex/core/memory/MemoryFix.java index 71275638a..0759877bd 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/memory/MemoryFix.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/memory/MemoryFix.java @@ -2,13 +2,13 @@ package mineplex.core.memory; import java.util.Iterator; -import net.minecraft.server.v1_7_R3.CraftingManager; -import net.minecraft.server.v1_7_R3.IInventory; +import net.minecraft.server.v1_7_R4.CraftingManager; +import net.minecraft.server.v1_7_R4.IInventory; import org.bukkit.Bukkit; import org.bukkit.World; -import org.bukkit.craftbukkit.v1_7_R3.CraftWorld; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.CraftWorld; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.HumanEntity; import org.bukkit.plugin.java.JavaPlugin; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/DragonData.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/DragonData.java index 5343de813..43fa7f373 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/DragonData.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/DragonData.java @@ -5,7 +5,7 @@ import mineplex.core.common.util.UtilEnt; import org.bukkit.Location; import org.bukkit.Sound; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftEnderDragon; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftEnderDragon; import org.bukkit.entity.EnderDragon; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/HorseMount.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/HorseMount.java index cb40ba9a4..30f592634 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/HorseMount.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/HorseMount.java @@ -8,12 +8,12 @@ import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; -import net.minecraft.server.v1_7_R3.EntityCreature; -import net.minecraft.server.v1_7_R3.Navigation; +import net.minecraft.server.v1_7_R4.EntityCreature; +import net.minecraft.server.v1_7_R4.Navigation; import org.bukkit.Location; import org.bukkit.Material; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftCreature; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature; import org.bukkit.entity.Horse.Variant; import org.bukkit.entity.Horse; import org.bukkit.entity.Player; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/movement/Movement.java b/Plugins/Mineplex.Core/src/mineplex/core/movement/Movement.java index 83d2dd520..055225468 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/movement/Movement.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/movement/Movement.java @@ -6,7 +6,7 @@ import mineplex.core.common.util.UtilMath; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.plugin.java.JavaPlugin; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcEntry.java b/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcEntry.java index 7734393b7..0b45053d8 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcEntry.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcEntry.java @@ -1,9 +1,9 @@ package mineplex.core.npc; -import net.minecraft.server.v1_7_R3.EntityCreature; +import net.minecraft.server.v1_7_R4.EntityCreature; import org.bukkit.entity.Entity; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftCreature; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature; import org.bukkit.Location; public class NpcEntry diff --git a/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcManager.java b/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcManager.java index f4cfe42c0..270442f9d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcManager.java @@ -11,15 +11,15 @@ import java.util.HashSet; import java.util.Iterator; import java.util.UUID; -import net.minecraft.server.v1_7_R3.EntityAgeable; -import net.minecraft.server.v1_7_R3.EntityInsentient; +import net.minecraft.server.v1_7_R4.EntityAgeable; +import net.minecraft.server.v1_7_R4.EntityInsentient; import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.World.Environment; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftAgeable; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftCreature; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftLivingEntity; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftAgeable; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftLivingEntity; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/packethandler/IPacketRunnable.java b/Plugins/Mineplex.Core/src/mineplex/core/packethandler/IPacketRunnable.java index cb19dddca..3b456bd40 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/packethandler/IPacketRunnable.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/packethandler/IPacketRunnable.java @@ -2,7 +2,7 @@ package mineplex.core.packethandler; import org.bukkit.entity.Player; -import net.minecraft.server.v1_7_R3.Packet; +import net.minecraft.server.v1_7_R4.Packet; public interface IPacketRunnable { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/packethandler/PacketHandler.java b/Plugins/Mineplex.Core/src/mineplex/core/packethandler/PacketHandler.java index 94aa38296..c0098616f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/packethandler/PacketHandler.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/packethandler/PacketHandler.java @@ -5,9 +5,9 @@ import java.util.HashSet; import mineplex.core.MiniPlugin; import mineplex.core.common.util.NautHashMap; -import net.minecraft.server.v1_7_R3.Packet; +import net.minecraft.server.v1_7_R4.Packet; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/packethandler/PacketVerifier.java b/Plugins/Mineplex.Core/src/mineplex/core/packethandler/PacketVerifier.java index 1364d8f85..4ccd99590 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/packethandler/PacketVerifier.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/packethandler/PacketVerifier.java @@ -1,14 +1,14 @@ package mineplex.core.packethandler; -import net.minecraft.server.v1_7_R3.IPacketVerifier; -import net.minecraft.server.v1_7_R3.Packet; -import net.minecraft.server.v1_7_R3.PacketPlayOutEntityVelocity; -import net.minecraft.server.v1_7_R3.PacketPlayOutRelEntityMove; -import net.minecraft.server.v1_7_R3.PacketPlayOutRelEntityMoveLook; -import net.minecraft.server.v1_7_R3.PacketPlayOutEntityTeleport; +import net.minecraft.server.v1_7_R4.IPacketVerifier; +import net.minecraft.server.v1_7_R4.Packet; +import net.minecraft.server.v1_7_R4.PacketPlayOutEntityVelocity; +import net.minecraft.server.v1_7_R4.PacketPlayOutRelEntityMove; +import net.minecraft.server.v1_7_R4.PacketPlayOutRelEntityMoveLook; +import net.minecraft.server.v1_7_R4.PacketPlayOutEntityTeleport; import net.minecraft.util.io.netty.util.concurrent.GenericFutureListener; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.Player; public class PacketVerifier implements IPacketVerifier diff --git a/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java index 701b669c9..699740c71 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java @@ -18,13 +18,13 @@ import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilServer; import mineplex.core.donation.DonationManager; import mineplex.core.itemstack.ItemStackFactory; -import net.minecraft.server.v1_7_R3.EntityCreature; -import net.minecraft.server.v1_7_R3.EntityHuman; -import net.minecraft.server.v1_7_R3.EntityInsentient; -import net.minecraft.server.v1_7_R3.Navigation; -import net.minecraft.server.v1_7_R3.PathfinderGoalLookAtPlayer; -import net.minecraft.server.v1_7_R3.PathfinderGoalRandomLookaround; -import net.minecraft.server.v1_7_R3.PathfinderGoalSelector; +import net.minecraft.server.v1_7_R4.EntityCreature; +import net.minecraft.server.v1_7_R4.EntityHuman; +import net.minecraft.server.v1_7_R4.EntityInsentient; +import net.minecraft.server.v1_7_R4.Navigation; +import net.minecraft.server.v1_7_R4.PathfinderGoalLookAtPlayer; +import net.minecraft.server.v1_7_R4.PathfinderGoalRandomLookaround; +import net.minecraft.server.v1_7_R4.PathfinderGoalSelector; @@ -39,8 +39,8 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.craftbukkit.libs.com.google.gson.Gson; -import org.bukkit.craftbukkit.v1_7_R3.CraftWorld; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftCreature; +import org.bukkit.craftbukkit.v1_7_R4.CraftWorld; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature; import org.bukkit.entity.Ageable; import org.bukkit.entity.Creature; import org.bukkit.entity.EntityType; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileUser.java b/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileUser.java index aefed811c..83807fbc3 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileUser.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileUser.java @@ -7,19 +7,19 @@ import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.disguise.DisguiseManager; import mineplex.core.disguise.disguises.DisguiseSquid; -import net.minecraft.server.v1_7_R3.AxisAlignedBB; -import net.minecraft.server.v1_7_R3.MathHelper; -import net.minecraft.server.v1_7_R3.MovingObjectPosition; -import net.minecraft.server.v1_7_R3.Vec3D; +import net.minecraft.server.v1_7_R4.AxisAlignedBB; +import net.minecraft.server.v1_7_R4.MathHelper; +import net.minecraft.server.v1_7_R4.MovingObjectPosition; +import net.minecraft.server.v1_7_R4.Vec3D; import org.bukkit.Effect; import org.bukkit.GameMode; import org.bukkit.Sound; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; -import org.bukkit.craftbukkit.v1_7_R3.CraftWorld; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftLivingEntity; +import org.bukkit.craftbukkit.v1_7_R4.CraftWorld; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftLivingEntity; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; @@ -106,7 +106,7 @@ public class ProjectileUser double distanceToEntity = 0.0D; LivingEntity victim = null; - net.minecraft.server.v1_7_R3.Entity nmsEntity = ((CraftEntity)_thrown).getHandle(); + net.minecraft.server.v1_7_R4.Entity nmsEntity = ((CraftEntity)_thrown).getHandle(); Vec3D vec3d = Vec3D.a(nmsEntity.locX, nmsEntity.locY, nmsEntity.locZ); Vec3D vec3d1 = Vec3D.a(nmsEntity.locX + nmsEntity.motX, nmsEntity.locY + nmsEntity.motY, nmsEntity.locZ + nmsEntity.motZ); @@ -121,9 +121,9 @@ public class ProjectileUser for (Object entity : ((CraftWorld)_thrown.getWorld()).getHandle().getEntities(((CraftEntity)_thrown).getHandle(), ((CraftEntity)_thrown).getHandle().boundingBox.a(((CraftEntity)_thrown).getHandle().motX, ((CraftEntity)_thrown).getHandle().motY, ((CraftEntity)_thrown).getHandle().motZ).grow(1.0D, 1.0D, 1.0D))) { - if (entity instanceof net.minecraft.server.v1_7_R3.Entity) + if (entity instanceof net.minecraft.server.v1_7_R4.Entity) { - Entity bukkitEntity = ((net.minecraft.server.v1_7_R3.Entity) entity).getBukkitEntity(); + Entity bukkitEntity = ((net.minecraft.server.v1_7_R4.Entity) entity).getBukkitEntity(); if (bukkitEntity instanceof LivingEntity) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/punish/UI/PunishPage.java b/Plugins/Mineplex.Core/src/mineplex/core/punish/UI/PunishPage.java index 9bef77b4d..1f1d62099 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/punish/UI/PunishPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/punish/UI/PunishPage.java @@ -22,7 +22,7 @@ import mineplex.core.shop.item.ShopItem; import org.bukkit.ChatColor; import org.bukkit.Material; -import org.bukkit.craftbukkit.v1_7_R3.inventory.CraftInventoryCustom; +import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftInventoryCustom; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/shop/item/ISalesPackage.java b/Plugins/Mineplex.Core/src/mineplex/core/shop/item/ISalesPackage.java index c5c7b1bfd..0d7cdb3d5 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/shop/item/ISalesPackage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/shop/item/ISalesPackage.java @@ -5,7 +5,7 @@ import java.util.List; import org.bukkit.entity.Player; import mineplex.core.account.CoreClient; -import net.minecraft.server.v1_7_R3.IInventory; +import net.minecraft.server.v1_7_R4.IInventory; public interface ISalesPackage { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/shop/item/ItemPackage.java b/Plugins/Mineplex.Core/src/mineplex/core/shop/item/ItemPackage.java index 3b00cb800..683a87f0b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/shop/item/ItemPackage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/shop/item/ItemPackage.java @@ -5,10 +5,10 @@ import java.util.List; import mineplex.core.account.CoreClient; import mineplex.core.common.util.InventoryUtil; -import net.minecraft.server.v1_7_R3.IInventory; +import net.minecraft.server.v1_7_R4.IInventory; import org.bukkit.Material; -import org.bukkit.craftbukkit.v1_7_R3.inventory.CraftInventory; +import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftInventory; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/shop/item/ShopItem.java b/Plugins/Mineplex.Core/src/mineplex/core/shop/item/ShopItem.java index 6c1627c38..b10c32986 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/shop/item/ShopItem.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/shop/item/ShopItem.java @@ -1,12 +1,12 @@ package mineplex.core.shop.item; import mineplex.core.common.util.UtilInv; -import net.minecraft.server.v1_7_R3.NBTTagList; -import net.minecraft.server.v1_7_R3.NBTTagString; +import net.minecraft.server.v1_7_R4.NBTTagList; +import net.minecraft.server.v1_7_R4.NBTTagString; import org.bukkit.ChatColor; import org.bukkit.Material; -import org.bukkit.craftbukkit.v1_7_R3.inventory.CraftItemStack; +import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftItemStack; import org.bukkit.inventory.ItemStack; public class ShopItem extends CraftItemStack @@ -122,8 +122,8 @@ public class ShopItem extends CraftItemStack return false; } - net.minecraft.server.v1_7_R3.ItemStack original = ((CraftItemStack)this).getHandle(); - net.minecraft.server.v1_7_R3.ItemStack comparison = ((CraftItemStack)obj).getHandle(); + net.minecraft.server.v1_7_R4.ItemStack original = ((CraftItemStack)this).getHandle(); + net.minecraft.server.v1_7_R4.ItemStack comparison = ((CraftItemStack)obj).getHandle(); return original.tag == null || original.tag.equals(comparison.tag); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/shop/page/AnvilContainer.java b/Plugins/Mineplex.Core/src/mineplex/core/shop/page/AnvilContainer.java index 351ff208f..04c17b00c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/shop/page/AnvilContainer.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/shop/page/AnvilContainer.java @@ -1,16 +1,16 @@ package mineplex.core.shop.page; -import org.bukkit.craftbukkit.v1_7_R3.inventory.CraftInventory; -import org.bukkit.craftbukkit.v1_7_R3.inventory.CraftInventoryDoubleChest; -import org.bukkit.craftbukkit.v1_7_R3.inventory.CraftInventoryPlayer; -import org.bukkit.craftbukkit.v1_7_R3.inventory.CraftInventoryView; +import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftInventory; +import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftInventoryDoubleChest; +import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftInventoryPlayer; +import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftInventoryView; -import net.minecraft.server.v1_7_R3.Container; -import net.minecraft.server.v1_7_R3.EntityHuman; -import net.minecraft.server.v1_7_R3.IInventory; -import net.minecraft.server.v1_7_R3.InventoryLargeChest; -import net.minecraft.server.v1_7_R3.PlayerInventory; -import net.minecraft.server.v1_7_R3.Slot; +import net.minecraft.server.v1_7_R4.Container; +import net.minecraft.server.v1_7_R4.EntityHuman; +import net.minecraft.server.v1_7_R4.IInventory; +import net.minecraft.server.v1_7_R4.InventoryLargeChest; +import net.minecraft.server.v1_7_R4.PlayerInventory; +import net.minecraft.server.v1_7_R4.Slot; public class AnvilContainer extends Container { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/shop/page/ShopPageBase.java b/Plugins/Mineplex.Core/src/mineplex/core/shop/page/ShopPageBase.java index 71f81ef95..709476df9 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/shop/page/ShopPageBase.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/shop/page/ShopPageBase.java @@ -1,8 +1,8 @@ package mineplex.core.shop.page; import org.bukkit.Sound; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; -import org.bukkit.craftbukkit.v1_7_R3.inventory.CraftInventoryCustom; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftInventoryCustom; import org.bukkit.entity.Player; import org.bukkit.event.Listener; import org.bukkit.event.inventory.InventoryClickEvent; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/sound/SoundManager.java b/Plugins/Mineplex.Core/src/mineplex/core/sound/SoundManager.java index 2c8986aad..309607c01 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/sound/SoundManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/sound/SoundManager.java @@ -1,6 +1,6 @@ package mineplex.core.sound; -import net.minecraft.server.v1_7_R3.Packet; +import net.minecraft.server.v1_7_R4.Packet; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java index 7949fcc23..afd0761fd 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java @@ -7,7 +7,7 @@ import org.bukkit.ChatColor; import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Material; -import org.bukkit.craftbukkit.v1_7_R3.CraftWorld; +import org.bukkit.craftbukkit.v1_7_R4.CraftWorld; import org.bukkit.entity.Egg; import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/VisibilityManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/VisibilityManager.java index f0235870d..90f3dabc0 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/VisibilityManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/VisibilityManager.java @@ -4,7 +4,7 @@ import java.util.HashMap; import java.util.HashSet; import org.bukkit.Material; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.inventory.InventoryType; diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Class/ClientClass.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Class/ClientClass.java index a5e33a975..cd853db61 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Class/ClientClass.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Class/ClientClass.java @@ -349,7 +349,7 @@ public class ClientClass for (SkillType type : SkillType.values()) if (caller.isOp() || type != SkillType.Class) if (_skillMap.containsKey(type)) - UtilPlayer.message(caller, F.desc(type.toString(), _skillMap.get(type).GetName())); + UtilPlayer.message(caller, F.desc(type.toString(), _skillMap.get(type).GetName() + " Lvl" + _skillMap.get(type).getLevel(caller))); } public void ResetSkills(Player player) diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/SkillChargeBow.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/SkillChargeBow.java index b39cd391b..268844c55 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/SkillChargeBow.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/SkillChargeBow.java @@ -13,7 +13,7 @@ import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType; import org.bukkit.Material; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftEntity; import org.bukkit.entity.Arrow; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/ItemFactory.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/ItemFactory.java index 7b144a212..fd8b6c3ec 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/ItemFactory.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/ItemFactory.java @@ -53,7 +53,7 @@ public class ItemFactory extends MiniPlugin implements IItemFactory try { - _itemMaxDurability = net.minecraft.server.v1_7_R3.Item.class.getDeclaredField("durability"); + _itemMaxDurability = net.minecraft.server.v1_7_R4.Item.class.getDeclaredField("durability"); _itemMaxDurability.setAccessible(true); } catch (SecurityException e) @@ -189,7 +189,7 @@ public class ItemFactory extends MiniPlugin implements IItemFactory try { - _itemMaxDurability.setInt(net.minecraft.server.v1_7_R3.Item.d(newItem.GetType().getId()), 56); + _itemMaxDurability.setInt(net.minecraft.server.v1_7_R4.Item.getById(newItem.GetType().getId()), 56); } catch (IllegalArgumentException e) { diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/ItemUsable.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/ItemUsable.java index 28725a6e4..c3ce1c928 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/ItemUsable.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/ItemUsable.java @@ -3,7 +3,7 @@ package mineplex.minecraft.game.classcombat.item; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.block.Block; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/ProximityExplosive.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/ProximityExplosive.java index ea3734887..2eba67f72 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/ProximityExplosive.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/ProximityExplosive.java @@ -7,7 +7,7 @@ import org.bukkit.Effect; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.block.Block; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/ProximityZapper.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/ProximityZapper.java index 837c226b3..e5abb0945 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/ProximityZapper.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/ProximityZapper.java @@ -7,7 +7,7 @@ import org.bukkit.Effect; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.block.Block; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/WaterBottle.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/WaterBottle.java index c50c93599..e5b114154 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/WaterBottle.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/WaterBottle.java @@ -4,7 +4,7 @@ import org.bukkit.Effect; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.block.Block; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.event.player.PlayerInteractEvent; diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/shop/ClassCombatShop.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/shop/ClassCombatShop.java index 9986001c7..4c9ea1cbd 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/shop/ClassCombatShop.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/shop/ClassCombatShop.java @@ -1,7 +1,7 @@ package mineplex.minecraft.game.classcombat.shop; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; -import org.bukkit.craftbukkit.v1_7_R3.inventory.CraftInventory; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftInventory; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.player.PlayerQuitEvent; diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatManager.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatManager.java index dcc21e5a4..86363fc9d 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatManager.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatManager.java @@ -3,9 +3,9 @@ package mineplex.minecraft.game.core.combat; import java.util.HashSet; import java.util.Iterator; -import net.minecraft.server.v1_7_R3.ItemStack; +import net.minecraft.server.v1_7_R4.ItemStack; -import org.bukkit.craftbukkit.v1_7_R3.inventory.CraftItemStack; +import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftItemStack; import org.bukkit.entity.Arrow; import org.bukkit.entity.Fireball; import org.bukkit.entity.LivingEntity; diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/condition/ConditionEffect.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/condition/ConditionEffect.java index 7ed533014..2e1073927 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/condition/ConditionEffect.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/condition/ConditionEffect.java @@ -19,7 +19,7 @@ import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.EntityTargetEvent; import org.bukkit.potion.PotionEffectType; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; public class ConditionEffect implements Listener { diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/DamageManager.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/DamageManager.java index f8d9b82e8..a099bd989 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/DamageManager.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/DamageManager.java @@ -17,16 +17,16 @@ import mineplex.core.disguise.DisguiseManager; import mineplex.core.npc.NpcManager; import mineplex.minecraft.game.core.combat.CombatManager; import mineplex.minecraft.game.core.damage.compatibility.NpcProtectListener; -import net.minecraft.server.v1_7_R3.DamageSource; -import net.minecraft.server.v1_7_R3.EntityHuman; -import net.minecraft.server.v1_7_R3.EntityLiving; +import net.minecraft.server.v1_7_R4.DamageSource; +import net.minecraft.server.v1_7_R4.EntityHuman; +import net.minecraft.server.v1_7_R4.EntityLiving; import org.bukkit.EntityEffect; import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftLivingEntity; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftLivingEntity; import org.bukkit.entity.Arrow; import org.bukkit.entity.Fish; import org.bukkit.entity.LivingEntity; @@ -64,7 +64,7 @@ public class DamageManager extends MiniPlugin { _lastDamageByPlayerTime = EntityLiving.class.getDeclaredField("lastDamageByPlayerTime"); _lastDamageByPlayerTime.setAccessible(true); - _k = EntityLiving.class.getDeclaredMethod("h", float.class); + _k = EntityLiving.class.getDeclaredMethod("damageArmor", float.class); _k.setAccessible(true); } catch (final Exception e) @@ -276,7 +276,7 @@ public class DamageManager extends MiniPlugin //Sticky Arrow if (event.GetCause() == DamageCause.PROJECTILE) - ((CraftLivingEntity)event.GetDamageeEntity()).getHandle().p(((CraftLivingEntity)event.GetDamageeEntity()).getHandle().aY() + 1); + ((CraftLivingEntity)event.GetDamageeEntity()).getHandle().p(((CraftLivingEntity)event.GetDamageeEntity()).getHandle().aZ() + 1); //Knockback double knockback = event.GetDamage(); @@ -478,7 +478,7 @@ public class DamageManager extends MiniPlugin { if (!ignoreArmor) { - int j = 25 - entityLiving.aU(); + int j = 25 - entityLiving.aV(); float k = damage * (float)j; _k.invoke(entityLiving, damage); diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/fire/Fire.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/fire/Fire.java index a70460f9e..e5563162e 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/fire/Fire.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/fire/Fire.java @@ -27,7 +27,7 @@ import org.bukkit.event.player.PlayerPickupItemEvent; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.potion.PotionEffectType; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; public class Fire extends MiniPlugin { diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EnchantmentManager.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EnchantmentManager.java deleted file mode 100644 index 2d2933bc9..000000000 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EnchantmentManager.java +++ /dev/null @@ -1,467 +0,0 @@ -package net.minecraft.server.v1_7_R3; - -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Random; -import java.util.Set; - -public class EnchantmentManager -{ - private static final Random random = new Random(); - - public static int getEnchantmentLevel(int paramInt, ItemStack paramItemStack) - { - if (paramItemStack == null) - { - return 0; - } - NBTTagList localNBTTagList = paramItemStack.getEnchantments(); - if (localNBTTagList == null) - { - return 0; - } - for (int i = 0; i < localNBTTagList.size(); i++) - { - int j = localNBTTagList.get(i).getShort("id"); - int k = localNBTTagList.get(i).getShort("lvl"); - if (j == paramInt) - { - return k; - } - } - return 0; - } - - public static Map a(ItemStack paramItemStack) - { - LinkedHashMap localLinkedHashMap = new LinkedHashMap(); - NBTTagList localNBTTagList = paramItemStack.getItem() == Items.ENCHANTED_BOOK ? Items.ENCHANTED_BOOK - .g(paramItemStack) : paramItemStack.getEnchantments(); - if (localNBTTagList != null) - { - for (int i = 0; i < localNBTTagList.size(); i++) - { - int j = localNBTTagList.get(i).getShort("id"); - int k = localNBTTagList.get(i).getShort("lvl"); - - localLinkedHashMap.put(Integer.valueOf(j), Integer.valueOf(k)); - } - } - return localLinkedHashMap; - } - - public static void a(Map paramMap, ItemStack paramItemStack) - { - NBTTagList localNBTTagList = new NBTTagList(); - for (Iterator localIterator = paramMap.keySet().iterator(); localIterator.hasNext();) - { - int i = ((Integer) localIterator.next()).intValue(); - NBTTagCompound localNBTTagCompound = new NBTTagCompound(); - - localNBTTagCompound.setShort("id", (short) i); - localNBTTagCompound.setShort("lvl", (short) ((Integer) paramMap.get(Integer.valueOf(i))).intValue()); - - localNBTTagList.add(localNBTTagCompound); - if (paramItemStack.getItem() == Items.ENCHANTED_BOOK) - { - Items.ENCHANTED_BOOK.a(paramItemStack, - new EnchantmentInstance(i, ((Integer) paramMap.get(Integer.valueOf(i))).intValue())); - } - } - if (localNBTTagList.size() > 0) - { - if (paramItemStack.getItem() != Items.ENCHANTED_BOOK) - { - paramItemStack.a("ench", localNBTTagList); - } - } - else if (paramItemStack.hasTag()) - { - paramItemStack.getTag().remove("ench"); - } - } - - public static int getEnchantmentLevel(int paramInt, ItemStack[] paramArrayOfItemStack) - { - if (paramArrayOfItemStack == null) - { - return 0; - } - int i = 0; - for (ItemStack localItemStack : paramArrayOfItemStack) - { - int m = getEnchantmentLevel(paramInt, localItemStack); - if (m > i) - { - i = m; - } - } - return i; - } - - private static void a(EnchantmentModifier paramEnchantmentModifier, ItemStack paramItemStack) - { - if (paramItemStack == null) - { - return; - } - NBTTagList localNBTTagList = paramItemStack.getEnchantments(); - if (localNBTTagList == null) - { - return; - } - for (int i = 0; i < localNBTTagList.size(); i++) - { - int j = localNBTTagList.get(i).getShort("id"); - int k = localNBTTagList.get(i).getShort("lvl"); - if (Enchantment.byId[j] != null) - { - paramEnchantmentModifier.a(Enchantment.byId[j], k); - } - } - } - - private static void a(EnchantmentModifier paramEnchantmentModifier, ItemStack[] paramArrayOfItemStack) - { - for (ItemStack localItemStack : paramArrayOfItemStack) - { - a(paramEnchantmentModifier, localItemStack); - } - } - - private static EnchantmentModifierProtection b = null; - - public static int a(ItemStack[] paramArrayOfItemStack, DamageSource paramDamageSource) - { - if (b == null) - { - try - { - Constructor constructor = EnchantmentModifierProtection.class.getDeclaredConstructor(); - constructor.setAccessible(true); - b = constructor.newInstance(); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - - b.a = 0; - b.b = paramDamageSource; - - a(b, paramArrayOfItemStack); - if (b.a > 25) - { - b.a = 25; - } - - b.b = null; - - return (b.a + 1 >> 1) + random.nextInt((b.a >> 1) + 1); - } - - private static EnchantmentModifierDamage c = null; - - public static float a(EntityLiving paramEntityLiving1, EntityLiving paramEntityLiving2) - { - return a(paramEntityLiving1.bd(), paramEntityLiving2.getMonsterType()); - } - - public static float a(ItemStack paramItemStack, EnumMonsterType paramEnumMonsterType) - { - if (c == null) - { - try - { - Constructor constructor = EnchantmentModifierDamage.class.getDeclaredConstructor(); - constructor.setAccessible(true); - c = constructor.newInstance(); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - - c.a = 0.0F; - c.b = paramEnumMonsterType; - - a(c, paramItemStack); - - c.b = null; - - return c.a; - } - - private static EnchantmentModifierThorns d = null; - - public static void a(EntityLiving paramEntityLiving, Entity paramEntity) - { - if (d == null) - { - try - { - Constructor constructor = EnchantmentModifierThorns.class.getDeclaredConstructor(); - constructor.setAccessible(true); - d = constructor.newInstance(); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - - d.b = paramEntity; - d.a = paramEntityLiving; - a(d, paramEntityLiving.getEquipment()); - if ((paramEntity instanceof EntityHuman)) - { - a(d, paramEntityLiving.bd()); - } - - d.a = null; - d.b = null; - } - - private static EnchantmentModifierArthropods e = null; - - public static void b(EntityLiving paramEntityLiving, Entity paramEntity) - { - if (e == null) - { - try - { - Constructor constructor = EnchantmentModifierArthropods.class.getDeclaredConstructor(); - constructor.setAccessible(true); - e = constructor.newInstance(); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - - e.a = paramEntityLiving; - e.b = paramEntity; - a(e, paramEntityLiving.getEquipment()); - if ((paramEntityLiving instanceof EntityHuman)) - { - a(e, paramEntityLiving.bd()); - } - - e.a = null; - e.b = null; - } - - public static int getKnockbackEnchantmentLevel(EntityLiving paramEntityLiving1, EntityLiving paramEntityLiving2) - { - return getEnchantmentLevel(Enchantment.KNOCKBACK.id, paramEntityLiving1.bd()); - } - - public static int getFireAspectEnchantmentLevel(EntityLiving paramEntityLiving) - { - return getEnchantmentLevel(Enchantment.FIRE_ASPECT.id, paramEntityLiving.bd()); - } - - public static int getOxygenEnchantmentLevel(EntityLiving paramEntityLiving) - { - return getEnchantmentLevel(Enchantment.OXYGEN.id, paramEntityLiving.getEquipment()); - } - - public static int getDigSpeedEnchantmentLevel(EntityLiving paramEntityLiving) - { - return getEnchantmentLevel(Enchantment.DIG_SPEED.id, paramEntityLiving.bd()); - } - - public static boolean hasSilkTouchEnchantment(EntityLiving paramEntityLiving) - { - return getEnchantmentLevel(Enchantment.SILK_TOUCH.id, paramEntityLiving.bd()) > 0; - } - - public static int getBonusBlockLootEnchantmentLevel(EntityLiving paramEntityLiving) - { - return getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS.id, paramEntityLiving.bd()); - } - - public static int getLuckEnchantmentLevel(EntityLiving paramEntityLiving) - { - return getEnchantmentLevel(Enchantment.LUCK.id, paramEntityLiving.bd()); - } - - public static int getLureEnchantmentLevel(EntityLiving paramEntityLiving) - { - return getEnchantmentLevel(Enchantment.LURE.id, paramEntityLiving.bd()); - } - - public static int getBonusMonsterLootEnchantmentLevel(EntityLiving paramEntityLiving) - { - return getEnchantmentLevel(Enchantment.LOOT_BONUS_MOBS.id, paramEntityLiving.bd()); - } - - public static boolean hasWaterWorkerEnchantment(EntityLiving paramEntityLiving) - { - return getEnchantmentLevel(Enchantment.WATER_WORKER.id, paramEntityLiving.getEquipment()) > 0; - } - - public static ItemStack a(Enchantment paramEnchantment, EntityLiving paramEntityLiving) - { - for (ItemStack localItemStack : paramEntityLiving.getEquipment()) - { - if ((localItemStack != null) && (getEnchantmentLevel(paramEnchantment.id, localItemStack) > 0)) - { - return localItemStack; - } - } - return null; - } - - public static int a(Random paramRandom, int paramInt1, int paramInt2, ItemStack paramItemStack) - { - Item localItem = paramItemStack.getItem(); - int i = localItem.c(); - if (i <= 0) - { - return 0; - } - if (paramInt2 > 15) - { - paramInt2 = 15; - } - int j = paramRandom.nextInt(8) + 1 + (paramInt2 >> 1) + paramRandom.nextInt(paramInt2 + 1); - if (paramInt1 == 0) - { - return Math.max(j / 3, 1); - } - if (paramInt1 == 1) - { - return j * 2 / 3 + 1; - } - return Math.max(j, paramInt2 * 2); - } - - public static ItemStack a(Random paramRandom, ItemStack paramItemStack, int paramInt) - { - List localList = b(paramRandom, paramItemStack, paramInt); - int i = paramItemStack.getItem() == Items.BOOK ? 1 : 0; - if (i != 0) - { - paramItemStack.setItem(Items.ENCHANTED_BOOK); - } - if (localList != null) - { - for (EnchantmentInstance localEnchantmentInstance : (List)localList) - { - if (i != 0) - { - Items.ENCHANTED_BOOK.a(paramItemStack, localEnchantmentInstance); - } - else - { - paramItemStack.addEnchantment(localEnchantmentInstance.enchantment, localEnchantmentInstance.level); - } - } - } - return paramItemStack; - } - - public static List b(Random paramRandom, ItemStack paramItemStack, int paramInt) - { - Item localItem = paramItemStack.getItem(); - int i = localItem.c(); - if (i <= 0) - { - return null; - } - i /= 2; - i = 1 + paramRandom.nextInt((i >> 1) + 1) + paramRandom.nextInt((i >> 1) + 1); - - int j = i + paramInt; - - float f = (paramRandom.nextFloat() + paramRandom.nextFloat() - 1.0F) * 0.15F; - int k = (int) (j * (1.0F + f) + 0.5F); - if (k < 1) - { - k = 1; - } - ArrayList localArrayList = null; - - Map localMap = b(k, paramItemStack); - if ((localMap != null) && (!localMap.isEmpty())) - { - EnchantmentInstance localEnchantmentInstance1 = (EnchantmentInstance) WeightedRandom.a(paramRandom, - localMap.values()); - if (localEnchantmentInstance1 != null) - { - localArrayList = new ArrayList(); - localArrayList.add(localEnchantmentInstance1); - - int m = k; - while (paramRandom.nextInt(50) <= m) - { - Iterator localIterator1 = localMap.keySet().iterator(); - Object localObject; - while (localIterator1.hasNext()) - { - localObject = (Integer) localIterator1.next(); - int n = 1; - for (EnchantmentInstance localEnchantmentInstance2 : (List)localArrayList) - { - if (!localEnchantmentInstance2.enchantment.a(Enchantment.byId[((Integer)localObject).intValue()])) - { - n = 0; - break; - } - } - if (n == 0) - { - localIterator1.remove(); - } - } - if (!localMap.isEmpty()) - { - localObject = (EnchantmentInstance) WeightedRandom.a(paramRandom, localMap.values()); - localArrayList.add(localObject); - } - m >>= 1; - } - } - } - return localArrayList; - } - - public static Map b(int paramInt, ItemStack paramItemStack) - { - Item localItem = paramItemStack.getItem(); - HashMap localHashMap = null; - int i = paramItemStack.getItem() == Items.BOOK ? 1 : 0; - for (Enchantment localEnchantment : Enchantment.byId) - { - if (localEnchantment != null) - { - if ((localEnchantment.slot.canEnchant(localItem)) || (i != 0)) - { - for (int m = localEnchantment.getStartLevel(); m <= localEnchantment.getMaxLevel(); m++) - { - if ((paramInt >= localEnchantment.a(m)) && (paramInt <= localEnchantment.b(m))) - { - if (localHashMap == null) - { - localHashMap = new HashMap(); - } - localHashMap.put(Integer.valueOf(localEnchantment.id), new EnchantmentInstance( - localEnchantment, m)); - } - } - } - } - } - return localHashMap; - } -} diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityBlaze.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityBlaze.java deleted file mode 100644 index 926a820fa..000000000 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityBlaze.java +++ /dev/null @@ -1,162 +0,0 @@ -package net.minecraft.server.v1_7_R3; - -public class EntityBlaze extends EntityMonster { - - private float bp = 0.5F; - private int bq; - private int br; - - public EntityBlaze(World world) { - super(world); - this.fireProof = true; - this.b = 10; - } - - protected void aC() { - super.aC(); - this.getAttributeInstance(GenericAttributes.e).setValue(6.0D); - } - - protected void c() { - super.c(); - this.datawatcher.a(16, new Byte((byte) 0)); - } - - protected String t() { - return "mob.blaze.breathe"; - } - - protected String aS() { - return "mob.blaze.hit"; - } - - protected String aT() { - return "mob.blaze.death"; - } - - public float d(float f) { - return 1.0F; - } - - public void e() { - if (!this.world.isStatic) { - if (this.K()) { - this.damageEntity(DamageSource.DROWN, 1.0F); - } - - --this.bq; - if (this.bq <= 0) { - this.bq = 100; - this.bp = 0.5F + (float) this.random.nextGaussian() * 3.0F; - } - - if (this.bT() != null && this.bT().locY + (double) this.bT().getHeadHeight() > this.locY + (double) this.getHeadHeight() + (double) this.bp) { - this.motY += (0.30000001192092896D - this.motY) * 0.30000001192092896D; - } - } - - if (this.random.nextInt(24) == 0) { - this.world.makeSound(this.locX + 0.5D, this.locY + 0.5D, this.locZ + 0.5D, "fire.fire", 1.0F + this.random.nextFloat(), this.random.nextFloat() * 0.7F + 0.3F); - } - - if (!Vegetated && !this.onGround && this.motY < 0.0D) { - this.motY *= 0.6D; - } - - for (int i = 0; i < 2; ++i) { - this.world.addParticle("largesmoke", this.locX + (this.random.nextDouble() - 0.5D) * (double) this.width, this.locY + this.random.nextDouble() * (double) this.length, this.locZ + (this.random.nextDouble() - 0.5D) * (double) this.width, 0.0D, 0.0D, 0.0D); - } - - super.e(); - } - - protected void a(Entity entity, float f) { - if (Vegetated) - return; - - if (this.attackTicks <= 0 && f < 2.0F && entity.boundingBox.e > this.boundingBox.b && entity.boundingBox.b < this.boundingBox.e) { - this.attackTicks = 20; - this.n(entity); - } else if (f < 30.0F) { - double d0 = entity.locX - this.locX; - double d1 = entity.boundingBox.b + (double) (entity.length / 2.0F) - (this.locY + (double) (this.length / 2.0F)); - double d2 = entity.locZ - this.locZ; - - if (this.attackTicks == 0) { - ++this.br; - if (this.br == 1) { - this.attackTicks = 60; - this.a(true); - } else if (this.br <= 4) { - this.attackTicks = 6; - } else { - this.attackTicks = 100; - this.br = 0; - this.a(false); - } - - if (this.br > 1) { - float f1 = MathHelper.c(f) * 0.5F; - - this.world.a((EntityHuman) null, 1009, (int) this.locX, (int) this.locY, (int) this.locZ, 0); - - for (int i = 0; i < 1; ++i) { - EntitySmallFireball entitysmallfireball = new EntitySmallFireball(this.world, this, d0 + this.random.nextGaussian() * (double) f1, d1, d2 + this.random.nextGaussian() * (double) f1); - - entitysmallfireball.locY = this.locY + (double) (this.length / 2.0F) + 0.5D; - this.world.addEntity(entitysmallfireball); - } - } - } - - this.yaw = (float) (Math.atan2(d2, d0) * 180.0D / 3.1415927410125732D) - 90.0F; - this.bn = true; - } - } - - protected void b(float f) {} - - protected Item getLoot() { - return Items.BLAZE_ROD; - } - - public boolean isBurning() { - return this.bZ(); - } - - protected void dropDeathLoot(boolean flag, int i) { - // CraftBukkit start - java.util.List loot = new java.util.ArrayList(); - - if (flag) { - int j = this.random.nextInt(2 + i); - - if (j > 0) { - loot.add(new org.bukkit.inventory.ItemStack(org.bukkit.craftbukkit.v1_7_R3.util.CraftMagicNumbers.getMaterial(Items.BLAZE_ROD), j)); - } - } - - org.bukkit.craftbukkit.v1_7_R3.event.CraftEventFactory.callEntityDeathEvent(this, loot); - // CraftBukkit end - } - - public boolean bZ() { - return (this.datawatcher.getByte(16) & 1) != 0; - } - - public void a(boolean flag) { - byte b0 = this.datawatcher.getByte(16); - - if (flag) { - b0 = (byte) (b0 | 1); - } else { - b0 &= -2; - } - - this.datawatcher.watch(16, Byte.valueOf(b0)); - } - - protected boolean j_() { - return true; - } -} diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/FoodMetaData.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/FoodMetaData.java deleted file mode 100644 index 01abdced6..000000000 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/FoodMetaData.java +++ /dev/null @@ -1,116 +0,0 @@ -package net.minecraft.server.v1_7_R3; - -public class FoodMetaData { - - // CraftBukkit start - All made public - public int foodLevel = 20; - public float saturationLevel = 7.0F; - public float exhaustionLevel; - public int foodTickTimer; - private EntityHuman entityhuman; - // CraftBukkit end - private int e = 20; - - public FoodMetaData() { throw new AssertionError("Whoopsie, we missed the bukkit."); } // CraftBukkit start - throw an error - - // CraftBukkit start - added EntityHuman constructor - public FoodMetaData(EntityHuman entityhuman) { - org.apache.commons.lang.Validate.notNull(entityhuman); - this.entityhuman = entityhuman; - } - // CraftBukkit end - - public void eat(int i, float f) { - this.foodLevel = Math.min(i + this.foodLevel, 20); - this.saturationLevel = Math.min(this.saturationLevel + (float) i * f * 2.0F, (float) this.foodLevel); - } - - public void a(ItemFood itemfood, ItemStack itemstack) { - // CraftBukkit start - int oldFoodLevel = foodLevel; - - org.bukkit.event.entity.FoodLevelChangeEvent event = org.bukkit.craftbukkit.v1_7_R3.event.CraftEventFactory.callFoodLevelChangeEvent(entityhuman, itemfood.getNutrition(itemstack) + oldFoodLevel); - - if (!event.isCancelled()) { - this.eat(event.getFoodLevel() - oldFoodLevel, itemfood.getSaturationModifier(itemstack)); - } - - ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutUpdateHealth(((EntityPlayer) entityhuman).getBukkitEntity().getScaledHealth(), entityhuman.getFoodData().foodLevel, entityhuman.getFoodData().saturationLevel)); - // CraftBukkit end - } - - public void a(EntityHuman entityhuman) { - EnumDifficulty enumdifficulty = entityhuman.world.difficulty; - - this.e = this.foodLevel; - if (this.exhaustionLevel > 4.0F) { - this.exhaustionLevel -= 4.0F; - if (this.saturationLevel > 0.0F) { - this.saturationLevel = Math.max(this.saturationLevel - 1.0F, 0.0F); - } else if (enumdifficulty != EnumDifficulty.PEACEFUL) { - // CraftBukkit start - org.bukkit.event.entity.FoodLevelChangeEvent event = org.bukkit.craftbukkit.v1_7_R3.event.CraftEventFactory.callFoodLevelChangeEvent(entityhuman, Math.max(this.foodLevel - 1, 0)); - - if (!event.isCancelled()) { - this.foodLevel = event.getFoodLevel(); - } - - ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutUpdateHealth(((EntityPlayer) entityhuman).getBukkitEntity().getScaledHealth(), this.foodLevel, this.saturationLevel)); - // CraftBukkit end - } - } - - if (entityhuman.world.getGameRules().getBoolean("naturalRegeneration") && this.foodLevel >= 18 && entityhuman.bQ()) { - ++this.foodTickTimer; - if (this.foodTickTimer >= 80) { - // CraftBukkit - added RegainReason - entityhuman.heal(1.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.SATIATED); - this.a(3.0F); - this.foodTickTimer = 0; - } - } else if (this.foodLevel <= 0) { - ++this.foodTickTimer; - if (this.foodTickTimer >= 80) { - if (entityhuman.getHealth() > 10.0F || enumdifficulty == EnumDifficulty.HARD || entityhuman.getHealth() > 1.0F && enumdifficulty == EnumDifficulty.NORMAL) { - entityhuman.damageEntity(DamageSource.STARVE, 1.0F); - } - - this.foodTickTimer = 0; - } - } else { - this.foodTickTimer = 0; - } - } - - public void a(NBTTagCompound nbttagcompound) { - if (nbttagcompound.hasKeyOfType("foodLevel", 99)) { - this.foodLevel = nbttagcompound.getInt("foodLevel"); - this.foodTickTimer = nbttagcompound.getInt("foodTickTimer"); - this.saturationLevel = nbttagcompound.getFloat("foodSaturationLevel"); - this.exhaustionLevel = nbttagcompound.getFloat("foodExhaustionLevel"); - } - } - - public void b(NBTTagCompound nbttagcompound) { - nbttagcompound.setInt("foodLevel", this.foodLevel); - nbttagcompound.setInt("foodTickTimer", this.foodTickTimer); - nbttagcompound.setFloat("foodSaturationLevel", this.saturationLevel); - nbttagcompound.setFloat("foodExhaustionLevel", this.exhaustionLevel); - } - - public int a() { - return this.foodLevel; - } - - public boolean c() { - return this.foodLevel < 20; - } - - public void a(float f) { - this.exhaustionLevel = Math.min(this.exhaustionLevel + f, 40.0F); - } - - public float e() { - return this.saturationLevel; - } -} \ No newline at end of file diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PlayerList.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PlayerList.java deleted file mode 100644 index abcf541ca..000000000 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PlayerList.java +++ /dev/null @@ -1,1254 +0,0 @@ -package net.minecraft.server.v1_7_R3; - -import java.io.File; -import java.net.SocketAddress; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import java.util.Map.Entry; - -import net.minecraft.util.com.google.common.base.Charsets; -import net.minecraft.util.com.google.common.collect.Lists; -import net.minecraft.util.com.google.common.collect.Maps; -import net.minecraft.util.com.mojang.authlib.GameProfile; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -// CraftBukkit start -import org.bukkit.craftbukkit.v1_7_R3.CraftServer; -import org.bukkit.craftbukkit.v1_7_R3.CraftWorld; -import org.bukkit.craftbukkit.v1_7_R3.chunkio.ChunkIOExecutor; - -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.TravelAgent; -import org.bukkit.entity.Player; -import org.bukkit.event.player.PlayerChangedWorldEvent; -import org.bukkit.event.player.PlayerPortalEvent; -import org.bukkit.event.player.PlayerJoinEvent; -import org.bukkit.event.player.PlayerLoginEvent; -import org.bukkit.event.player.PlayerQuitEvent; -import org.bukkit.event.player.PlayerRespawnEvent; -import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; -import org.bukkit.util.Vector; -// CraftBukkit end - -public abstract class PlayerList { - - public static final File a = new File("banned-players.json"); - public static final File b = new File("banned-ips.json"); - public static final File c = new File("ops.json"); - public static final File d = new File("whitelist.json"); - private static final Logger g = LogManager.getLogger(); - private static final SimpleDateFormat h = new SimpleDateFormat("yyyy-MM-dd \'at\' HH:mm:ss z"); - private final MinecraftServer server; - public final List players = new java.util.concurrent.CopyOnWriteArrayList(); // CraftBukkit - ArrayList -> CopyOnWriteArrayList: Iterator safety - private final GameProfileBanList j; - private final IpBanList k; - private final OpList operators; - private final WhiteList whitelist; - private final Map n; - public IPlayerFileData playerFileData; // CraftBukkit - private -> public - public boolean hasWhitelist; // CraftBukkit - private -> public - protected int maxPlayers; - private int q; - private EnumGamemode r; - private boolean s; - private int t; - - // CraftBukkit start - private CraftServer cserver; - - public PlayerList(MinecraftServer minecraftserver) { - minecraftserver.server = new CraftServer(minecraftserver, this); - minecraftserver.console = org.bukkit.craftbukkit.v1_7_R3.command.ColouredConsoleSender.getInstance(); - minecraftserver.reader.addCompleter(new org.bukkit.craftbukkit.v1_7_R3.command.ConsoleCommandCompleter(minecraftserver.server)); - this.cserver = minecraftserver.server; - // CraftBukkit end - - this.j = new GameProfileBanList(a); - this.k = new IpBanList(b); - this.operators = new OpList(c); - this.whitelist = new WhiteList(d); - this.n = Maps.newHashMap(); - this.server = minecraftserver; - this.j.a(false); - this.k.a(false); - this.maxPlayers = 8; - } - - public void a(NetworkManager networkmanager, EntityPlayer entityplayer) { - GameProfile gameprofile = entityplayer.getProfile(); - UserCache usercache = this.server.getUserCache(); - GameProfile gameprofile1 = usercache.a(gameprofile.getId()); - String s = gameprofile1 == null ? gameprofile.getName() : gameprofile1.getName(); - - usercache.a(gameprofile); - NBTTagCompound nbttagcompound = this.a(entityplayer); - - entityplayer.spawnIn(this.server.getWorldServer(entityplayer.dimension)); - entityplayer.playerInteractManager.a((WorldServer) entityplayer.world); - String s1 = "local"; - - if (networkmanager.getSocketAddress() != null) { - s1 = networkmanager.getSocketAddress().toString(); - } - - // CraftBukkit - Moved message to after join - // g.info(entityplayer.getName() + "[" + s1 + "] logged in with entity id " + entityplayer.getId() + " at (" + entityplayer.locX + ", " + entityplayer.locY + ", " + entityplayer.locZ + ")"); - WorldServer worldserver = this.server.getWorldServer(entityplayer.dimension); - ChunkCoordinates chunkcoordinates = worldserver.getSpawn(); - - this.a(entityplayer, (EntityPlayer) null, worldserver); - PlayerConnection playerconnection = new PlayerConnection(this.server, networkmanager, entityplayer); - - // CraftBukkit start - Don't send a higher than 60 MaxPlayer size, otherwise the PlayerInfo window won't render correctly. - int maxPlayers = this.getMaxPlayers(); - if (maxPlayers > 60) { - maxPlayers = 60; - } - playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.playerInteractManager.getGameMode(), worldserver.getWorldData().isHardcore(), worldserver.worldProvider.dimension, worldserver.difficulty, maxPlayers, worldserver.getWorldData().getType())); - entityplayer.getBukkitEntity().sendSupportedChannels(); - // CraftBukkit end - playerconnection.sendPacket(new PacketPlayOutCustomPayload("MC|Brand", this.getServer().getServerModName().getBytes(Charsets.UTF_8))); - playerconnection.sendPacket(new PacketPlayOutSpawnPosition(chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z)); - playerconnection.sendPacket(new PacketPlayOutAbilities(entityplayer.abilities)); - playerconnection.sendPacket(new PacketPlayOutHeldItemSlot(entityplayer.inventory.itemInHandIndex)); - entityplayer.getStatisticManager().d(); - entityplayer.getStatisticManager().updateStatistics(entityplayer); - this.a((ScoreboardServer) worldserver.getScoreboard(), entityplayer); - this.server.az(); - /* CraftBukkit start - login message is handled in the event - ChatMessage chatmessage; - - if (!entityplayer.getName().equalsIgnoreCase(s)) { - chatmessage = new ChatMessage("multiplayer.player.joined.renamed", new Object[] { entityplayer.getScoreboardDisplayName(), s}); - } else { - chatmessage = new ChatMessage("multiplayer.player.joined", new Object[] { entityplayer.getScoreboardDisplayName()}); - } - - chatmessage.getChatModifier().setColor(EnumChatFormat.YELLOW); - this.sendMessage(chatmessage); - // CraftBukkit end */ - this.c(entityplayer); - worldserver = this.server.getWorldServer(entityplayer.dimension); // CraftBukkit - Update in case join event changed it - playerconnection.a(entityplayer.locX, entityplayer.locY, entityplayer.locZ, entityplayer.yaw, entityplayer.pitch); - this.b(entityplayer, worldserver); - if (this.server.getResourcePack().length() > 0) { - entityplayer.setResourcePack(this.server.getResourcePack()); - } - - Iterator iterator = entityplayer.getEffects().iterator(); - - while (iterator.hasNext()) { - MobEffect mobeffect = (MobEffect) iterator.next(); - - playerconnection.sendPacket(new PacketPlayOutEntityEffect(entityplayer.getId(), mobeffect)); - } - - entityplayer.syncInventory(); - if (nbttagcompound != null && nbttagcompound.hasKeyOfType("Riding", 10)) { - Entity entity = EntityTypes.a(nbttagcompound.getCompound("Riding"), worldserver); - - if (entity != null) { - entity.n = true; - worldserver.addEntity(entity); - entityplayer.mount(entity); - entity.n = false; - } - } - - // CraftBukkit - Moved from above, added world - g.info(entityplayer.getName() + "[" + s1 + "] logged in with entity id " + entityplayer.getId() + " at ([" + entityplayer.world.worldData.getName() + "] " + entityplayer.locX + ", " + entityplayer.locY + ", " + entityplayer.locZ + ")"); - } - - public void a(ScoreboardServer scoreboardserver, EntityPlayer entityplayer) { // CraftBukkit - protected -> public - HashSet hashset = new HashSet(); - Iterator iterator = scoreboardserver.getTeams().iterator(); - - while (iterator.hasNext()) { - ScoreboardTeam scoreboardteam = (ScoreboardTeam) iterator.next(); - - entityplayer.playerConnection.sendPacket(new PacketPlayOutScoreboardTeam(scoreboardteam, 0)); - } - - for (int i = 0; i < 3; ++i) { - ScoreboardObjective scoreboardobjective = scoreboardserver.getObjectiveForSlot(i); - - if (scoreboardobjective != null && !hashset.contains(scoreboardobjective)) { - List list = scoreboardserver.getScoreboardScorePacketsForObjective(scoreboardobjective); - Iterator iterator1 = list.iterator(); - - while (iterator1.hasNext()) { - Packet packet = (Packet) iterator1.next(); - - entityplayer.playerConnection.sendPacket(packet); - } - - hashset.add(scoreboardobjective); - } - } - } - - public void setPlayerFileData(WorldServer[] aworldserver) { - if (this.playerFileData != null) return; // CraftBukkit - this.playerFileData = aworldserver[0].getDataManager().getPlayerFileData(); - } - - public void a(EntityPlayer entityplayer, WorldServer worldserver) { - WorldServer worldserver1 = entityplayer.r(); - - if (worldserver != null) { - worldserver.getPlayerChunkMap().removePlayer(entityplayer); - } - - worldserver1.getPlayerChunkMap().addPlayer(entityplayer); - worldserver1.chunkProviderServer.getChunkAt((int) entityplayer.locX >> 4, (int) entityplayer.locZ >> 4); - } - - public int d() { - return PlayerChunkMap.getFurthestViewableBlock(this.s()); - } - - public NBTTagCompound a(EntityPlayer entityplayer) { - // CraftBukkit - fix reference to worldserver array - NBTTagCompound nbttagcompound = this.server.worlds.get(0).getWorldData().i(); - NBTTagCompound nbttagcompound1; - - if (entityplayer.getName().equals(this.server.M()) && nbttagcompound != null) { - entityplayer.f(nbttagcompound); - nbttagcompound1 = nbttagcompound; - g.debug("loading single player"); - } else { - nbttagcompound1 = this.playerFileData.load(entityplayer); - } - - return nbttagcompound1; - } - - protected void b(EntityPlayer entityplayer) { - this.playerFileData.save(entityplayer); - ServerStatisticManager serverstatisticmanager = (ServerStatisticManager) this.n.get(entityplayer.getUniqueID()); - - if (serverstatisticmanager != null) { - serverstatisticmanager.b(); - } - } - - public void c(EntityPlayer entityplayer) { - cserver.detectListNameConflict(entityplayer); // CraftBukkit - // this.sendAll(new PacketPlayOutPlayerInfo(entityplayer.getName(), true, 1000)); // CraftBukkit - replaced with loop below - this.players.add(entityplayer); - WorldServer worldserver = this.server.getWorldServer(entityplayer.dimension); - - // CraftBukkit start - PlayerJoinEvent playerJoinEvent = new PlayerJoinEvent(this.cserver.getPlayer(entityplayer), "\u00A7e" + entityplayer.getName() + " joined the game."); - this.cserver.getPluginManager().callEvent(playerJoinEvent); - - String joinMessage = playerJoinEvent.getJoinMessage(); - - if ((joinMessage != null) && (joinMessage.length() > 0)) { - for (IChatBaseComponent line : org.bukkit.craftbukkit.v1_7_R3.util.CraftChatMessage.fromString(joinMessage)) { - this.server.getPlayerList().sendAll(new PacketPlayOutChat(line)); - } - } - this.cserver.onPlayerJoin(playerJoinEvent.getPlayer()); - - ChunkIOExecutor.adjustPoolSize(this.getPlayerCount()); - // CraftBukkit end - - // CraftBukkit start - Only add if the player wasn't moved in the event - if (entityplayer.world == worldserver && !worldserver.players.contains(entityplayer)) { - worldserver.addEntity(entityplayer); - this.a(entityplayer, (WorldServer) null); - } - // CraftBukkit end - - // CraftBukkit start - sendAll above replaced with this loop - PacketPlayOutPlayerInfo packet = new PacketPlayOutPlayerInfo(entityplayer.listName, true, 1000); - for (int i = 0; i < this.players.size(); ++i) { - EntityPlayer entityplayer1 = (EntityPlayer) this.players.get(i); - - if (entityplayer1.getBukkitEntity().canSee(entityplayer.getBukkitEntity())) { - entityplayer1.playerConnection.sendPacket(packet); - } - } - // CraftBukkit end - - for (int i = 0; i < this.players.size(); ++i) { - EntityPlayer entityplayer1 = (EntityPlayer) this.players.get(i); - - // CraftBukkit start - if (!entityplayer.getBukkitEntity().canSee(entityplayer1.getBukkitEntity())) { - continue; - } - // .name -> .listName - entityplayer.playerConnection.sendPacket(new PacketPlayOutPlayerInfo(entityplayer1.listName, true, entityplayer1.ping)); - // CraftBukkit end - } - } - - public void d(EntityPlayer entityplayer) { - entityplayer.r().getPlayerChunkMap().movePlayer(entityplayer); - } - - public String disconnect(EntityPlayer entityplayer) { // CraftBukkit - return string - entityplayer.a(StatisticList.f); - - // CraftBukkit start - Quitting must be before we do final save of data, in case plugins need to modify it - org.bukkit.craftbukkit.v1_7_R3.event.CraftEventFactory.handleInventoryCloseEvent(entityplayer); - - PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(this.cserver.getPlayer(entityplayer), "\u00A7e" + entityplayer.getName() + " left the game."); - this.cserver.getPluginManager().callEvent(playerQuitEvent); - entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage()); - // CraftBukkit end - - this.b(entityplayer); - WorldServer worldserver = entityplayer.r(); - - if (entityplayer.vehicle != null && !(entityplayer.vehicle instanceof EntityPlayer)) { // CraftBukkit - Don't remove players - worldserver.removeEntity(entityplayer.vehicle); - g.debug("removing player mount"); - } - - worldserver.kill(entityplayer); - worldserver.getPlayerChunkMap().removePlayer(entityplayer); - this.players.remove(entityplayer); - this.n.remove(entityplayer.getUniqueID()); - ChunkIOExecutor.adjustPoolSize(this.getPlayerCount()); // CraftBukkit - - // CraftBukkit start - .name -> .listName, replace sendAll with loop - // this.sendAll(new PacketPlayOutPlayerInfo(entityplayer.getName(), false, 9999)); - PacketPlayOutPlayerInfo packet = new PacketPlayOutPlayerInfo(entityplayer.listName, false, 9999); - for (int i = 0; i < this.players.size(); ++i) { - EntityPlayer entityplayer1 = (EntityPlayer) this.players.get(i); - - if (entityplayer1.getBukkitEntity().canSee(entityplayer.getBukkitEntity())) { - entityplayer1.playerConnection.sendPacket(packet); - } else { - entityplayer1.getBukkitEntity().removeDisconnectingPlayer(entityplayer.getBukkitEntity()); - } - } - // This removes the scoreboard (and player reference) for the specific player in the manager - this.cserver.getScoreboardManager().removePlayer(entityplayer.getBukkitEntity()); - - return playerQuitEvent.getQuitMessage(); - // CraftBukkit end - } - - // CraftBukkit start - Whole method, SocketAddress to LoginListener, added hostname to signature, return EntityPlayer - public EntityPlayer attemptLogin(LoginListener loginlistener, GameProfile gameprofile, String hostname) { - // Instead of kicking then returning, we need to store the kick reason - // in the event, check with plugins to see if it's ok, and THEN kick - // depending on the outcome. - SocketAddress socketaddress = loginlistener.networkManager.getSocketAddress(); - - EntityPlayer entity = new EntityPlayer(this.server, this.server.getWorldServer(0), gameprofile, new PlayerInteractManager(this.server.getWorldServer(0))); - Player player = entity.getBukkitEntity(); - PlayerLoginEvent event = new PlayerLoginEvent(player, hostname, ((java.net.InetSocketAddress) socketaddress).getAddress(), ((java.net.InetSocketAddress) loginlistener.networkManager.getRawAddress()).getAddress()); - String s; - - if (this.j.isBanned(gameprofile) && !this.j.get(gameprofile).e()) { // Should be hasExpired - GameProfileBanEntry gameprofilebanentry = (GameProfileBanEntry) this.j.get(gameprofile); - - s = "You are banned from this server!\nReason: " + gameprofilebanentry.getReason(); - if (gameprofilebanentry.getExpires() != null) { - s = s + "\nYour ban will be removed on " + h.format(gameprofilebanentry.getExpires()); - } - - // return s; - if (!gameprofilebanentry.e()) event.disallow(PlayerLoginEvent.Result.KICK_BANNED, s); // Spigot - } else if (!this.isWhitelisted(gameprofile)) { - // return "You are not white-listed on this server!"; - event.disallow(PlayerLoginEvent.Result.KICK_WHITELIST, org.spigotmc.SpigotConfig.whitelistMessage); // Spigot - } else if (this.k.isBanned(socketaddress) && !this.j.get(gameprofile).e()) { // Should be hasExpired - IpBanEntry ipbanentry = this.k.get(socketaddress); - - s = "Your IP address is banned from this server!\nReason: " + ipbanentry.getReason(); - if (ipbanentry.getExpires() != null) { - s = s + "\nYour ban will be removed on " + h.format(ipbanentry.getExpires()); - } - - // return s; - event.disallow(PlayerLoginEvent.Result.KICK_BANNED, s); - } else { - // return this.players.size() >= this.maxPlayers ? "The server is full!" : null; - if (this.players.size() >= this.maxPlayers) { - event.disallow(PlayerLoginEvent.Result.KICK_FULL, org.spigotmc.SpigotConfig.serverFullMessage); // Spigot - } - } - - this.cserver.getPluginManager().callEvent(event); - if (event.getResult() != PlayerLoginEvent.Result.ALLOWED) { - loginlistener.disconnect(event.getKickMessage()); - return null; - } - - return entity; - // CraftBukkit end - } - - public EntityPlayer processLogin(GameProfile gameprofile, EntityPlayer player) { // CraftBukkit - added EntityPlayer - UUID uuid = EntityHuman.a(gameprofile); - ArrayList arraylist = Lists.newArrayList(); - - EntityPlayer entityplayer; - - for (int i = 0; i < this.players.size(); ++i) { - entityplayer = (EntityPlayer) this.players.get(i); - if (entityplayer.getUniqueID().equals(uuid)) { - arraylist.add(entityplayer); - } - } - - Iterator iterator = arraylist.iterator(); - - while (iterator.hasNext()) { - entityplayer = (EntityPlayer) iterator.next(); - entityplayer.playerConnection.disconnect("You logged in from another location"); - } - - /* CraftBukkit start - Object object; - - if (this.server.R()) { - object = new DemoPlayerInteractManager(this.server.getWorldServer(0)); - } else { - object = new PlayerInteractManager(this.server.getWorldServer(0)); - } - - return new EntityPlayer(this.server, this.server.getWorldServer(0), gameprofile, (PlayerInteractManager) object); - // */ - return player; - // CraftBukkit end - } - - // CraftBukkit start - public EntityPlayer moveToWorld(EntityPlayer entityplayer, int i, boolean flag) { - return this.moveToWorld(entityplayer, i, flag, null, true); - } - - public EntityPlayer moveToWorld(EntityPlayer entityplayer, int i, boolean flag, Location location, boolean avoidSuffocation) { - // CraftBukkit end - entityplayer.r().getTracker().untrackPlayer(entityplayer); - // entityplayer.r().getTracker().untrackEntity(entityplayer); // CraftBukkit - entityplayer.r().getPlayerChunkMap().removePlayer(entityplayer); - this.players.remove(entityplayer); - this.server.getWorldServer(entityplayer.dimension).removeEntity(entityplayer); - ChunkCoordinates chunkcoordinates = entityplayer.getBed(); - boolean flag1 = entityplayer.isRespawnForced(); - - /* CraftBukkit start - entityplayer.dimension = i; - Object object; - - if (this.server.R()) { - object = new DemoPlayerInteractManager(this.server.getWorldServer(entityplayer.dimension)); - } else { - object = new PlayerInteractManager(this.server.getWorldServer(entityplayer.dimension)); - } - - EntityPlayer entityplayer1 = new EntityPlayer(this.server, this.server.getWorldServer(entityplayer.dimension), entityplayer.getProfile(), (PlayerInteractManager) object); - // */ - EntityPlayer entityplayer1 = entityplayer; - org.bukkit.World fromWorld = entityplayer1.getBukkitEntity().getWorld(); - entityplayer1.viewingCredits = false; - // CraftBukkit end - - entityplayer1.playerConnection = entityplayer.playerConnection; - entityplayer1.copyTo(entityplayer, flag); - entityplayer1.d(entityplayer.getId()); - // WorldServer worldserver = this.server.getWorldServer(entityplayer.dimension); // CraftBukkit - handled later - - // this.a(entityplayer1, entityplayer, worldserver); // CraftBukkit - removed - ChunkCoordinates chunkcoordinates1; - - // CraftBukkit start - fire PlayerRespawnEvent - if (location == null) { - boolean isBedSpawn = false; - CraftWorld cworld = (CraftWorld) this.server.server.getWorld(entityplayer.spawnWorld); - if (cworld != null && chunkcoordinates != null) { - chunkcoordinates1 = EntityHuman.getBed(cworld.getHandle(), chunkcoordinates, flag1); - if (chunkcoordinates1 != null) { - isBedSpawn = true; - location = new Location(cworld, chunkcoordinates1.x + 0.5, chunkcoordinates1.y, chunkcoordinates1.z + 0.5); - } else { - entityplayer1.setRespawnPosition(null, true); - entityplayer1.playerConnection.sendPacket(new PacketPlayOutGameStateChange(0, 0)); - } - } - - if (location == null) { - cworld = (CraftWorld) this.server.server.getWorlds().get(0); - chunkcoordinates = cworld.getHandle().getSpawn(); - location = new Location(cworld, chunkcoordinates.x + 0.5, chunkcoordinates.y, chunkcoordinates.z + 0.5); - } - - Player respawnPlayer = this.cserver.getPlayer(entityplayer1); - PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location, isBedSpawn); - this.cserver.getPluginManager().callEvent(respawnEvent); - // Spigot Start - if (entityplayer.playerConnection.isDisconnected()) { - return entityplayer; - } - // Spigot End - - location = respawnEvent.getRespawnLocation(); - entityplayer.reset(); - } else { - location.setWorld(this.server.getWorldServer(i).getWorld()); - } - WorldServer worldserver = ((CraftWorld) location.getWorld()).getHandle(); - entityplayer1.setLocation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); - // CraftBukkit end - - worldserver.chunkProviderServer.getChunkAt((int) entityplayer1.locX >> 4, (int) entityplayer1.locZ >> 4); - - while (avoidSuffocation && !worldserver.getCubes(entityplayer1, entityplayer1.boundingBox).isEmpty()) { // CraftBukkit - entityplayer1.setPosition(entityplayer1.locX, entityplayer1.locY + 1.0D, entityplayer1.locZ); - } - - // CraftBukkit start - byte actualDimension = (byte) (worldserver.getWorld().getEnvironment().getId()); - // Force the client to refresh their chunk cache. - entityplayer1.playerConnection.sendPacket(new PacketPlayOutRespawn((byte) (actualDimension >= 0 ? -1 : 0), worldserver.difficulty, worldserver.getWorldData().getType(), entityplayer.playerInteractManager.getGameMode())); - entityplayer1.playerConnection.sendPacket(new PacketPlayOutRespawn(actualDimension, worldserver.difficulty, worldserver.getWorldData().getType(), entityplayer1.playerInteractManager.getGameMode())); - entityplayer1.spawnIn(worldserver); - entityplayer1.dead = false; - entityplayer1.playerConnection.teleport(new Location(worldserver.getWorld(), entityplayer1.locX, entityplayer1.locY, entityplayer1.locZ, entityplayer1.yaw, entityplayer1.pitch)); - entityplayer1.setSneaking(false); - chunkcoordinates1 = worldserver.getSpawn(); - // entityplayer1.playerConnection.a(entityplayer1.locX, entityplayer1.locY, entityplayer1.locZ, entityplayer1.yaw, entityplayer1.pitch); - // CraftBukkit end - entityplayer1.playerConnection.sendPacket(new PacketPlayOutSpawnPosition(chunkcoordinates1.x, chunkcoordinates1.y, chunkcoordinates1.z)); - entityplayer1.playerConnection.sendPacket(new PacketPlayOutExperience(entityplayer1.exp, entityplayer1.expTotal, entityplayer1.expLevel)); - this.b(entityplayer1, worldserver); - // CraftBukkit start - // Don't re-add player to player list if disconnected - if (!entityplayer.playerConnection.isDisconnected()) { - worldserver.getPlayerChunkMap().addPlayer(entityplayer1); - worldserver.addEntity(entityplayer1); - this.players.add(entityplayer1); - } - // Added from changeDimension - this.updateClient(entityplayer1); // Update health, etc... - entityplayer1.updateAbilities(); - Iterator iterator = entityplayer1.getEffects().iterator(); - - while (iterator.hasNext()) { - MobEffect mobeffect = (MobEffect) iterator.next(); - - entityplayer1.playerConnection.sendPacket(new PacketPlayOutEntityEffect(entityplayer1.getId(), mobeffect)); - } - // entityplayer1.syncInventory(); - // CraftBukkit end - entityplayer1.setHealth(entityplayer1.getHealth()); - - // CraftBukkit start - // Don't fire on respawn - if (fromWorld != location.getWorld()) { - PlayerChangedWorldEvent event = new PlayerChangedWorldEvent((Player) entityplayer1.getBukkitEntity(), fromWorld); - Bukkit.getServer().getPluginManager().callEvent(event); - } - - // Save player file again if they were disconnected - if (entityplayer.playerConnection.isDisconnected()) { - this.b(entityplayer1); - } - // CraftBukkit end - - return entityplayer1; - } - - // CraftBukkit start - Replaced the standard handling of portals with a more customised method. - public void changeDimension(EntityPlayer entityplayer, int i, TeleportCause cause) { - WorldServer exitWorld = null; - if (entityplayer.dimension < CraftWorld.CUSTOM_DIMENSION_OFFSET) { // plugins must specify exit from custom Bukkit worlds - // only target existing worlds (compensate for allow-nether/allow-end as false) - for (WorldServer world : this.server.worlds) { - if (world.dimension == i) { - exitWorld = world; - } - } - } - - Location enter = entityplayer.getBukkitEntity().getLocation(); - Location exit = null; - boolean useTravelAgent = false; // don't use agent for custom worlds or return from THE_END - if (exitWorld != null) { - if ((cause == TeleportCause.END_PORTAL) && (i == 0)) { - // THE_END -> NORMAL; use bed if available, otherwise default spawn - exit = ((org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer) entityplayer.getBukkitEntity()).getBedSpawnLocation(); - if (exit == null || ((CraftWorld) exit.getWorld()).getHandle().dimension != 0) { - exit = exitWorld.getWorld().getSpawnLocation(); - } - } else { - // NORMAL <-> NETHER or NORMAL -> THE_END - exit = this.calculateTarget(enter, exitWorld); - useTravelAgent = true; - } - } - - TravelAgent agent = exit != null ? (TravelAgent) ((CraftWorld) exit.getWorld()).getHandle().getTravelAgent() : org.bukkit.craftbukkit.v1_7_R3.CraftTravelAgent.DEFAULT; // return arbitrary TA to compensate for implementation dependent plugins - PlayerPortalEvent event = new PlayerPortalEvent(entityplayer.getBukkitEntity(), enter, exit, agent, cause); - event.useTravelAgent(useTravelAgent); - Bukkit.getServer().getPluginManager().callEvent(event); - if (event.isCancelled() || event.getTo() == null) { - return; - } - - exit = event.useTravelAgent() ? event.getPortalTravelAgent().findOrCreate(event.getTo()) : event.getTo(); - if (exit == null) { - return; - } - exitWorld = ((CraftWorld) exit.getWorld()).getHandle(); - - Vector velocity = entityplayer.getBukkitEntity().getVelocity(); - boolean before = exitWorld.chunkProviderServer.forceChunkLoad; - exitWorld.chunkProviderServer.forceChunkLoad = true; - exitWorld.getTravelAgent().adjustExit(entityplayer, exit, velocity); - exitWorld.chunkProviderServer.forceChunkLoad = before; - - this.moveToWorld(entityplayer, exitWorld.dimension, true, exit, false); // Vanilla doesn't check for suffocation when handling portals, so neither should we - if (entityplayer.motX != velocity.getX() || entityplayer.motY != velocity.getY() || entityplayer.motZ != velocity.getZ()) { - entityplayer.getBukkitEntity().setVelocity(velocity); - } - // CraftBukkit end - } - - public void a(Entity entity, int i, WorldServer worldserver, WorldServer worldserver1) { - // CraftBukkit start - Split into modular functions - Location exit = this.calculateTarget(entity.getBukkitEntity().getLocation(), worldserver1); - this.repositionEntity(entity, exit, true); - } - - // Copy of original a(Entity, int, WorldServer, WorldServer) method with only location calculation logic - public Location calculateTarget(Location enter, World target) { - WorldServer worldserver = ((CraftWorld) enter.getWorld()).getHandle(); - WorldServer worldserver1 = ((CraftWorld) target.getWorld()).getHandle(); - int i = worldserver.dimension; - - double y = enter.getY(); - float yaw = enter.getYaw(); - float pitch = enter.getPitch(); - double d0 = enter.getX(); - double d1 = enter.getZ(); - double d2 = 8.0D; - /* - double d3 = entity.locX; - double d4 = entity.locY; - double d5 = entity.locZ; - float f = entity.yaw; - - worldserver.methodProfiler.a("moving"); - */ - if (worldserver1.dimension == -1) { - d0 /= d2; - d1 /= d2; - /* - entity.setPositionRotation(d0, entity.locY, d1, entity.yaw, entity.pitch); - if (entity.isAlive()) { - worldserver.entityJoinedWorld(entity, false); - } - */ - } else if (worldserver1.dimension != -1 && worldserver1.dimension != 1) { - d0 *= d2; - d1 *= d2; - /* - entity.setPositionRotation(d0, entity.locY, d1, entity.yaw, entity.pitch); - if (entity.isAlive()) { - worldserver.entityJoinedWorld(entity, false); - } - */ - } else { - ChunkCoordinates chunkcoordinates; - - if (i == 1) { - // use default NORMAL world spawn instead of target - worldserver1 = this.server.worlds.get(0); - chunkcoordinates = worldserver1.getSpawn(); - } else { - chunkcoordinates = worldserver1.getDimensionSpawn(); - } - - d0 = (double) chunkcoordinates.x; - y = (double) chunkcoordinates.y; - d1 = (double) chunkcoordinates.z; - yaw = 90.0F; - pitch = 0.0F; - /* - entity.setPositionRotation(d0, entity.locY, d1, 90.0F, 0.0F); - if (entity.isAlive()) { - worldserver.entityJoinedWorld(entity, false); - } - */ - } - - // worldserver.methodProfiler.b(); - if (i != 1) { - // worldserver.methodProfiler.a("placing"); - d0 = (double) MathHelper.a((int) d0, -29999872, 29999872); - d1 = (double) MathHelper.a((int) d1, -29999872, 29999872); - /* - if (entity.isAlive()) { - worldserver1.addEntity(entity); - entity.setPositionRotation(d0, entity.locY, d1, entity.yaw, entity.pitch); - worldserver1.entityJoinedWorld(entity, false); - worldserver1.getTravelAgent().a(entity, d3, d4, d5, f); - } - - worldserver.methodProfiler.b(); - */ - } - - // entity.spawnIn(worldserver1); - return new Location(worldserver1.getWorld(), d0, y, d1, yaw, pitch); - } - - // copy of original a(Entity, int, WorldServer, WorldServer) method with only entity repositioning logic - public void repositionEntity(Entity entity, Location exit, boolean portal) { - int i = entity.dimension; - WorldServer worldserver = (WorldServer) entity.world; - WorldServer worldserver1 = ((CraftWorld) exit.getWorld()).getHandle(); - /* - double d0 = entity.locX; - double d1 = entity.locZ; - double d2 = 8.0D; - double d3 = entity.locX; - double d4 = entity.locY; - double d5 = entity.locZ; - float f = entity.yaw; - */ - - worldserver.methodProfiler.a("moving"); - entity.setPositionRotation(exit.getX(), exit.getY(), exit.getZ(), exit.getYaw(), exit.getPitch()); - if (entity.isAlive()) { - worldserver.entityJoinedWorld(entity, false); - } - /* - if (entity.dimension == -1) { - d0 /= d2; - d1 /= d2; - entity.setPositionRotation(d0, entity.locY, d1, entity.yaw, entity.pitch); - if (entity.isAlive()) { - worldserver.entityJoinedWorld(entity, false); - } - } else if (entity.dimension == 0) { - d0 *= d2; - d1 *= d2; - entity.setPositionRotation(d0, entity.locY, d1, entity.yaw, entity.pitch); - if (entity.isAlive()) { - worldserver.entityJoinedWorld(entity, false); - } - } else { - ChunkCoordinates chunkcoordinates; - - if (i == 1) { - chunkcoordinates = worldserver1.getSpawn(); - } else { - chunkcoordinates = worldserver1.getDimensionSpawn(); - } - - d0 = (double) chunkcoordinates.x; - entity.locY = (double) chunkcoordinates.y; - d1 = (double) chunkcoordinates.z; - entity.setPositionRotation(d0, entity.locY, d1, 90.0F, 0.0F); - if (entity.isAlive()) { - worldserver.entityJoinedWorld(entity, false); - } - } - */ - - worldserver.methodProfiler.b(); - if (i != 1) { - worldserver.methodProfiler.a("placing"); - /* - d0 = (double) MathHelper.a((int) d0, -29999872, 29999872); - d1 = (double) MathHelper.a((int) d1, -29999872, 29999872); - */ - if (entity.isAlive()) { - // entity.setPositionRotation(d0, entity.locY, d1, entity.yaw, entity.pitch) - // worldserver1.getTravelAgent().a(entity, d3, d4, d5, f); - if (portal) { - Vector velocity = entity.getBukkitEntity().getVelocity(); - worldserver1.getTravelAgent().adjustExit(entity, exit, velocity); - entity.setPositionRotation(exit.getX(), exit.getY(), exit.getZ(), exit.getYaw(), exit.getPitch()); - if (entity.motX != velocity.getX() || entity.motY != velocity.getY() || entity.motZ != velocity.getZ()) { - entity.getBukkitEntity().setVelocity(velocity); - } - } - worldserver1.addEntity(entity); - worldserver1.entityJoinedWorld(entity, false); - } - - worldserver.methodProfiler.b(); - } - - entity.spawnIn(worldserver1); - // CraftBukkit end - } - - private int currentPing = 0; - - public void tick() { - if (++this.t > 600) { - this.t = 0; - } - - /* CraftBukkit start - Remove updating of lag to players -- it spams way to much on big servers. - if (this.t < this.players.size()) { - EntityPlayer entityplayer = (EntityPlayer) this.players.get(this.p); - - this.sendAll(new PacketPlayOutPlayerInfo(entityplayer.getName(), true, entityplayer.ping)); - } - // CraftBukkit end */ - // Spigot start - try - { - if ( !players.isEmpty() ) - { - currentPing = ( currentPing + 1 ) % this.players.size(); - EntityPlayer player = (EntityPlayer) this.players.get( currentPing ); - if ( player.lastPing == -1 || Math.abs( player.ping - player.lastPing ) > 20 ) - { - Packet packet = new PacketPlayOutPlayerInfo( player.listName, true, player.ping ); - for ( EntityPlayer splayer : (List) this.players ) - { - if ( splayer.getBukkitEntity().canSee( player.getBukkitEntity() ) ) - { - splayer.playerConnection.sendPacket( packet ); - } - } - player.lastPing = player.ping; - } - } - } catch ( Exception e ) { - // Better safe than sorry :) - } - // Spigot end - } - - public void sendAll(Packet packet) { - for (int i = 0; i < this.players.size(); ++i) { - ((EntityPlayer) this.players.get(i)).playerConnection.sendPacket(packet); - } - } - - public void a(Packet packet, int i) { - for (int j = 0; j < this.players.size(); ++j) { - EntityPlayer entityplayer = (EntityPlayer) this.players.get(j); - - if (entityplayer.dimension == i) { - entityplayer.playerConnection.sendPacket(packet); - } - } - } - - public String b(boolean flag) { - String s = ""; - ArrayList arraylist = Lists.newArrayList(this.players); - - for (int i = 0; i < arraylist.size(); ++i) { - if (i > 0) { - s = s + ", "; - } - - s = s + ((EntityPlayer) arraylist.get(i)).getName(); - if (flag) { - s = s + " (" + ((EntityPlayer) arraylist.get(i)).getUniqueID().toString() + ")"; - } - } - - return s; - } - - public String[] f() { - String[] astring = new String[this.players.size()]; - - for (int i = 0; i < this.players.size(); ++i) { - astring[i] = ((EntityPlayer) this.players.get(i)).getName(); - } - - return astring; - } - - public GameProfile[] g() { - GameProfile[] agameprofile = new GameProfile[this.players.size()]; - - for (int i = 0; i < this.players.size(); ++i) { - agameprofile[i] = ((EntityPlayer) this.players.get(i)).getProfile(); - } - - return agameprofile; - } - - public GameProfileBanList getProfileBans() { - return this.j; - } - - public IpBanList getIPBans() { - return this.k; - } - - public void addOp(GameProfile gameprofile) { - this.operators.add(new OpListEntry(gameprofile, this.server.l())); - - // CraftBukkit start - Player player = server.server.getPlayer(gameprofile.getId()); - if (player != null) { - player.recalculatePermissions(); - } - // CraftBukkit end - } - - public void removeOp(GameProfile gameprofile) { - this.operators.remove(gameprofile); - - // CraftBukkit start - Player player = server.server.getPlayer(gameprofile.getId()); - if (player != null) { - player.recalculatePermissions(); - } - // CraftBukkit end - } - - public boolean isWhitelisted(GameProfile gameprofile) { - return !this.hasWhitelist || this.operators.d(gameprofile) || this.whitelist.d(gameprofile); - } - - public boolean isOp(GameProfile gameprofile) { - // CraftBukkit - fix reference to worldserver array - return this.operators.d(gameprofile) || this.server.N() && this.server.worlds.get(0).getWorldData().allowCommands() && this.server.M().equalsIgnoreCase(gameprofile.getName()) || this.s; - } - - public EntityPlayer getPlayer(String s) { - Iterator iterator = this.players.iterator(); - - EntityPlayer entityplayer; - - do { - if (!iterator.hasNext()) { - return null; - } - - entityplayer = (EntityPlayer) iterator.next(); - } while (!entityplayer.getName().equalsIgnoreCase(s)); - - return entityplayer; - } - - public List a(ChunkCoordinates chunkcoordinates, int i, int j, int k, int l, int i1, int j1, Map map, String s, String s1, World world) { - if (this.players.isEmpty()) { - return Collections.emptyList(); - } else { - Object object = new ArrayList(); - boolean flag = k < 0; - boolean flag1 = s != null && s.startsWith("!"); - boolean flag2 = s1 != null && s1.startsWith("!"); - int k1 = i * i; - int l1 = j * j; - - k = MathHelper.a(k); - if (flag1) { - s = s.substring(1); - } - - if (flag2) { - s1 = s1.substring(1); - } - - for (int i2 = 0; i2 < this.players.size(); ++i2) { - EntityPlayer entityplayer = (EntityPlayer) this.players.get(i2); - - if ((world == null || entityplayer.world == world) && (s == null || flag1 != s.equalsIgnoreCase(entityplayer.getName()))) { - if (s1 != null) { - ScoreboardTeamBase scoreboardteambase = entityplayer.getScoreboardTeam(); - String s2 = scoreboardteambase == null ? "" : scoreboardteambase.getName(); - - if (flag2 == s1.equalsIgnoreCase(s2)) { - continue; - } - } - - if (chunkcoordinates != null && (i > 0 || j > 0)) { - float f = chunkcoordinates.e(entityplayer.getChunkCoordinates()); - - if (i > 0 && f < (float) k1 || j > 0 && f > (float) l1) { - continue; - } - } - - if (this.a((EntityHuman) entityplayer, map) && (l == EnumGamemode.NONE.a() || l == entityplayer.playerInteractManager.getGameMode().a()) && (i1 <= 0 || entityplayer.expLevel >= i1) && entityplayer.expLevel <= j1) { - ((List) object).add(entityplayer); - } - } - } - - if (chunkcoordinates != null) { - Collections.sort((List) object, new PlayerDistanceComparator(chunkcoordinates)); - } - - if (flag) { - Collections.reverse((List) object); - } - - if (k > 0) { - object = ((List) object).subList(0, Math.min(k, ((List) object).size())); - } - - return (List) object; - } - } - - private boolean a(EntityHuman entityhuman, Map map) { - if (map != null && map.size() != 0) { - Iterator iterator = map.entrySet().iterator(); - - Entry entry; - boolean flag; - int i; - - do { - if (!iterator.hasNext()) { - return true; - } - - entry = (Entry) iterator.next(); - String s = (String) entry.getKey(); - - flag = false; - if (s.endsWith("_min") && s.length() > 4) { - flag = true; - s = s.substring(0, s.length() - 4); - } - - Scoreboard scoreboard = entityhuman.getScoreboard(); - ScoreboardObjective scoreboardobjective = scoreboard.getObjective(s); - - if (scoreboardobjective == null) { - return false; - } - - ScoreboardScore scoreboardscore = entityhuman.getScoreboard().getPlayerScoreForObjective(entityhuman.getName(), scoreboardobjective); - - i = scoreboardscore.getScore(); - if (i < ((Integer) entry.getValue()).intValue() && flag) { - return false; - } - } while (i <= ((Integer) entry.getValue()).intValue() || flag); - - return false; - } else { - return true; - } - } - - public void sendPacketNearby(double d0, double d1, double d2, double d3, int i, Packet packet) { - this.sendPacketNearby((EntityHuman) null, d0, d1, d2, d3, i, packet); - } - - public void sendPacketNearby(EntityHuman entityhuman, double d0, double d1, double d2, double d3, int i, Packet packet) { - for (int j = 0; j < this.players.size(); ++j) { - EntityPlayer entityplayer = (EntityPlayer) this.players.get(j); - - // CraftBukkit start - Test if player receiving packet can see the source of the packet - if (entityhuman != null && entityhuman instanceof EntityPlayer && !entityplayer.getBukkitEntity().canSee(((EntityPlayer) entityhuman).getBukkitEntity())) { - continue; - } - // CraftBukkit end - - if (entityplayer != entityhuman && entityplayer.dimension == i) { - double d4 = d0 - entityplayer.locX; - double d5 = d1 - entityplayer.locY; - double d6 = d2 - entityplayer.locZ; - - if (d4 * d4 + d5 * d5 + d6 * d6 < d3 * d3) { - entityplayer.playerConnection.sendPacket(packet); - } - } - } - } - - public void savePlayers() { - for (int i = 0; i < this.players.size(); ++i) { - this.b((EntityPlayer) this.players.get(i)); - } - } - - public void addWhitelist(GameProfile gameprofile) { - this.whitelist.add(new WhiteListEntry(gameprofile)); - } - - public void removeWhitelist(GameProfile gameprofile) { - this.whitelist.remove(gameprofile); - } - - public WhiteList getWhitelist() { - return this.whitelist; - } - - public String[] getWhitelisted() { - return this.whitelist.getEntries(); - } - - public OpList getOPs() { - return this.operators; - } - - public String[] n() { - return this.operators.getEntries(); - } - - public void reloadWhitelist() {} - - public void b(EntityPlayer entityplayer, WorldServer worldserver) { - entityplayer.playerConnection.sendPacket(new PacketPlayOutUpdateTime(worldserver.getTime(), worldserver.getDayTime(), worldserver.getGameRules().getBoolean("doDaylightCycle"))); - if (worldserver.Q()) { - // CraftBukkit start - handle player weather - // entityplayer.playerConnection.sendPacket(new PacketPlayOutGameStateChange(1, 0.0F)); - // entityplayer.playerConnection.sendPacket(new PacketPlayOutGameStateChange(7, worldserver.j(1.0F))); - // entityplayer.playerConnection.sendPacket(new PacketPlayOutGameStateChange(8, worldserver.h(1.0F))); - entityplayer.setPlayerWeather(org.bukkit.WeatherType.DOWNFALL, false); - // CraftBukkit end - } - } - - public void updateClient(EntityPlayer entityplayer) { - entityplayer.updateInventory(entityplayer.defaultContainer); - entityplayer.getBukkitEntity().updateScaledHealth(); // CraftBukkit - Update scaled health on respawn and worldchange - entityplayer.playerConnection.sendPacket(new PacketPlayOutHeldItemSlot(entityplayer.inventory.itemInHandIndex)); - } - - public int getPlayerCount() { - return this.players.size(); - } - - public int getMaxPlayers() { - return this.maxPlayers; - } - - public String[] getSeenPlayers() { - // CraftBukkit - fix reference to worldserver array - return this.server.worlds.get(0).getDataManager().getPlayerFileData().getSeenPlayers(); - } - - public boolean getHasWhitelist() { - return this.hasWhitelist; - } - - public void setHasWhitelist(boolean flag) { - this.hasWhitelist = flag; - } - - public List b(String s) { - ArrayList arraylist = new ArrayList(); - Iterator iterator = this.players.iterator(); - - while (iterator.hasNext()) { - EntityPlayer entityplayer = (EntityPlayer) iterator.next(); - - if (entityplayer.s().equals(s)) { - arraylist.add(entityplayer); - } - } - - return arraylist; - } - - public int s() { - return this.q; - } - - public MinecraftServer getServer() { - return this.server; - } - - public NBTTagCompound t() { - return null; - } - - private void a(EntityPlayer entityplayer, EntityPlayer entityplayer1, World world) { - if (entityplayer1 != null) { - entityplayer.playerInteractManager.setGameMode(entityplayer1.playerInteractManager.getGameMode()); - } else if (this.r != null) { - entityplayer.playerInteractManager.setGameMode(this.r); - } - - entityplayer.playerInteractManager.b(world.getWorldData().getGameType()); - } - - public void u() { - while (!this.players.isEmpty()) { - // Spigot start - EntityPlayer p = (EntityPlayer) this.players.get( 0 ); - p.playerConnection.disconnect( this.server.server.getShutdownMessage() ); - if ( ( !this.players.isEmpty() ) && ( this.players.get( 0 ) == p ) ) - { - this.players.remove( 0 ); // Prevent shutdown hang if already disconnected - } - // Spigot end - } - } - - // CraftBukkit start - Support multi-line messages - public void sendMessage(IChatBaseComponent[] ichatbasecomponent) { - for (IChatBaseComponent component : ichatbasecomponent) { - sendMessage(component, true); - } - } - // CraftBukkit end - - public void sendMessage(IChatBaseComponent ichatbasecomponent, boolean flag) { - this.server.sendMessage(ichatbasecomponent); - this.sendAll(new PacketPlayOutChat(ichatbasecomponent, flag)); - } - - public void sendMessage(IChatBaseComponent ichatbasecomponent) { - this.sendMessage(ichatbasecomponent, true); - } - - public ServerStatisticManager a(EntityHuman entityhuman) { - UUID uuid = entityhuman.getUniqueID(); - ServerStatisticManager serverstatisticmanager = uuid == null ? null : (ServerStatisticManager) this.n.get(uuid); - - if (serverstatisticmanager == null) { - File file1 = new File(this.server.getWorldServer(0).getDataManager().getDirectory(), "stats"); - File file2 = new File(file1, uuid.toString() + ".json"); - - if (!file2.exists()) { - File file3 = new File(file1, entityhuman.getName() + ".json"); - - if (file3.exists() && file3.isFile()) { - file3.renameTo(file2); - } - } - - serverstatisticmanager = new ServerStatisticManager(this.server, file2); - serverstatisticmanager.a(); - this.n.put(uuid, serverstatisticmanager); - } - - return serverstatisticmanager; - } - - public void a(int i) { - this.q = i; - if (this.server.worldServer != null) { - WorldServer[] aworldserver = this.server.worldServer; - int j = aworldserver.length; - - for (int k = 0; k < j; ++k) { - WorldServer worldserver = aworldserver[k]; - - if (worldserver != null) { - worldserver.getPlayerChunkMap().a(i); - } - } - } - } -} \ No newline at end of file diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/Chunk.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/Chunk.java similarity index 91% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/Chunk.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/Chunk.java index f3598643b..f501ed858 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/Chunk.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/Chunk.java @@ -1,4 +1,4 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; import java.util.ArrayList; import java.util.Arrays; @@ -35,12 +35,40 @@ public class Chunk { public boolean m; public boolean n; public boolean o; - public long p; + public long lastSaved; public boolean q; public int r; public long s; private int x; - protected gnu.trove.map.hash.TObjectIntHashMap entityCount = new gnu.trove.map.hash.TObjectIntHashMap(); // Spigot + protected net.minecraft.util.gnu.trove.map.hash.TObjectIntHashMap entityCount = new net.minecraft.util.gnu.trove.map.hash.TObjectIntHashMap(); // Spigot + + // CraftBukkit start - Neighbor loaded cache for chunk lighting and entity ticking + private int neighbors = 0x1 << 12; + + public boolean areNeighborsLoaded(final int radius) { + switch(radius) { + case 2: + return this.neighbors == Integer.MAX_VALUE >> 6; + case 1: + final int mask = + // x z offset x z offset x z offset + ( 0x1 << (1 * 5 + 1 + 12) ) | ( 0x1 << (0 * 5 + 1 + 12) ) | ( 0x1 << (-1 * 5 + 1 + 12) ) | + ( 0x1 << (1 * 5 + 0 + 12) ) | ( 0x1 << (0 * 5 + 0 + 12) ) | ( 0x1 << (-1 * 5 + 0 + 12) ) | + ( 0x1 << (1 * 5 + -1 + 12) ) | ( 0x1 << (0 * 5 + -1 + 12) ) | ( 0x1 << (-1 * 5 + -1 + 12) ); + return (this.neighbors & mask) == mask; + default: + throw new UnsupportedOperationException(String.valueOf(radius)); + } + } + + public void setNeighborLoaded(final int x, final int z) { + this.neighbors |= 0x1 << (x * 5 + 12 + z); + } + + public void setNeighborUnloaded(final int x, final int z) { + this.neighbors &= ~(0x1 << (x * 5 + 12 + z)); + } + // CraftBukkit end public Chunk(World world, int i, int j) { this.sections = new ChunkSection[16]; @@ -56,7 +84,7 @@ public class Chunk { this.heightMap = new int[256]; for (int k = 0; k < this.entitySlices.length; ++k) { - this.entitySlices[k] = new org.bukkit.craftbukkit.v1_7_R3.util.UnsafeList(); // CraftBukkit - ArrayList -> UnsafeList + this.entitySlices[k] = new org.bukkit.craftbukkit.v1_7_R4.util.UnsafeList(); // CraftBukkit - ArrayList -> UnsafeList } Arrays.fill(this.b, -999); @@ -64,7 +92,7 @@ public class Chunk { // CraftBukkit start if (!(this instanceof EmptyChunk)) { - this.bukkitChunk = new org.bukkit.craftbukkit.v1_7_R3.CraftChunk(this); + this.bukkitChunk = new org.bukkit.craftbukkit.v1_7_R4.CraftChunk(this); } } @@ -140,7 +168,7 @@ public class Chunk { return 0; } - public ChunkSection[] i() { + public ChunkSection[] getSections() { return this.sections; } @@ -399,13 +427,13 @@ public class Chunk { } // Spigot start - prevent invalid data values - private static int checkData( Block block, int l ) + public static int checkData( Block block, int data ) { - if (block == Block.b( "minecraft:double_plant" ) ) + if (block == Blocks.DOUBLE_PLANT ) { - return l == 7 ? 0 : l; + return data < 6 || data >= 8 ? data : 0; } - return l; + return data; } // Spigot end @@ -725,10 +753,15 @@ public class Chunk { tileentity.t(); this.tileEntities.put(chunkposition, tileentity); + // Spigot start - The tile entity has a world, now hoppers can be born ticking. + if (this.world.spigotConfig.altHopperTicking) { + this.world.triggerHoppersList.add(tileentity); + } + // Spigot end // CraftBukkit start } else { System.out.println("Attempted to place a tile entity (" + tileentity + ") at " + tileentity.x + "," + tileentity.y + "," + tileentity.z - + " (" + org.bukkit.craftbukkit.v1_7_R3.util.CraftMagicNumbers.getMaterial(getType(i, j, k)) + ") where there was no entity tile!"); + + " (" + org.bukkit.craftbukkit.v1_7_R4.util.CraftMagicNumbers.getMaterial(getType(i, j, k)) + ") where there was no entity tile!"); System.out.println("Chunk coordinates: " + (this.locX * 16) + "," + (this.locZ * 16)); new Exception().printStackTrace(); // CraftBukkit end @@ -757,7 +790,7 @@ public class Chunk { while (iterator.hasNext()) { Entity entity = (Entity) iterator.next(); - entity.W(); + entity.X(); } this.world.a(this.entitySlices[i]); @@ -773,9 +806,12 @@ public class Chunk { // Spigot Start if ( tileentity instanceof IInventory ) { - for ( org.bukkit.craftbukkit.v1_7_R3.entity.CraftHumanEntity h : new ArrayList( (List) ( (IInventory) tileentity ).getViewers() ) ) + for ( org.bukkit.entity.HumanEntity h : new ArrayList( (List) ( (IInventory) tileentity ).getViewers() ) ) { - h.getHandle().closeInventory(); + if ( h instanceof org.bukkit.craftbukkit.v1_7_R4.entity.CraftHumanEntity ) + { + ( (org.bukkit.craftbukkit.v1_7_R4.entity.CraftHumanEntity) h).getHandle().closeInventory(); + } } } // Spigot End @@ -791,9 +827,12 @@ public class Chunk { // Spigot Start if ( entity instanceof IInventory ) { - for ( org.bukkit.craftbukkit.v1_7_R3.entity.CraftHumanEntity h : new ArrayList( (List) ( (IInventory) entity ).getViewers() ) ) + for ( org.bukkit.entity.HumanEntity h : new ArrayList( (List) ( (IInventory) entity ).getViewers() ) ) { - h.getHandle().closeInventory(); + if ( h instanceof org.bukkit.craftbukkit.v1_7_R4.entity.CraftHumanEntity ) + { + ( (org.bukkit.craftbukkit.v1_7_R4.entity.CraftHumanEntity) h).getHandle().closeInventory(); + } } } // Spigot End @@ -829,7 +868,7 @@ public class Chunk { if (entity1 != entity && entity1.boundingBox.b(axisalignedbb) && (ientityselector == null || ientityselector.a(entity1))) { list.add(entity1); - Entity[] aentity = entity1.as(); + Entity[] aentity = entity1.at(); if (aentity != null) { for (int i1 = 0; i1 < aentity.length; ++i1) { @@ -866,10 +905,10 @@ public class Chunk { public boolean a(boolean flag) { if (flag) { - if (this.o && this.world.getTime() != this.p || this.n) { + if (this.o && this.world.getTime() != this.lastSaved || this.n) { return true; } - } else if (this.o && this.world.getTime() >= this.p + 600L) { + } else if (this.o && this.world.getTime() >= this.lastSaved + 600L) { return true; } @@ -884,7 +923,8 @@ public class Chunk { return false; } - public void a(IChunkProvider ichunkprovider, IChunkProvider ichunkprovider1, int i, int j) { + public void loadNearby(IChunkProvider ichunkprovider, IChunkProvider ichunkprovider1, int i, int j) { + world.timings.syncChunkLoadPostTimer.startTiming(); // Spigot if (!this.done && ichunkprovider.isChunkLoaded(i + 1, j + 1) && ichunkprovider.isChunkLoaded(i, j + 1) && ichunkprovider.isChunkLoaded(i + 1, j)) { ichunkprovider.getChunkAt(ichunkprovider1, i, j); } @@ -900,6 +940,7 @@ public class Chunk { if (ichunkprovider.isChunkLoaded(i - 1, j - 1) && !ichunkprovider.getOrCreateChunk(i - 1, j - 1).done && ichunkprovider.isChunkLoaded(i, j - 1) && ichunkprovider.isChunkLoaded(i - 1, j)) { ichunkprovider.getChunkAt(ichunkprovider1, i - 1, j - 1); } + world.timings.syncChunkLoadPostTimer.stopTiming(); // Spigot } public int d(int i, int j) { @@ -939,7 +980,7 @@ public class Chunk { } } - public boolean k() { + public boolean isReady() { // Spigot Start /* * As of 1.7, Mojang added a check to make sure that only chunks which have been lit are sent to the client. @@ -979,7 +1020,7 @@ public class Chunk { this.sections = achunksection; } - public BiomeBase a(int i, int j, WorldChunkManager worldchunkmanager) { + public BiomeBase getBiome(int i, int j, WorldChunkManager worldchunkmanager) { int k = this.v[j << 4 | i] & 255; if (k == 255) { @@ -1136,4 +1177,4 @@ public class Chunk { return true; } -} \ No newline at end of file +} diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/ChunkAddEntityEvent.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/ChunkAddEntityEvent.java similarity index 94% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/ChunkAddEntityEvent.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/ChunkAddEntityEvent.java index 492f3c9b2..5fe940a56 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/ChunkAddEntityEvent.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/ChunkAddEntityEvent.java @@ -1,4 +1,4 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; import org.bukkit.event.Cancellable; import org.bukkit.event.Event; diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/ChunkPreLoadEvent.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/ChunkPreLoadEvent.java similarity index 96% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/ChunkPreLoadEvent.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/ChunkPreLoadEvent.java index 9a45af8fd..791d0774c 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/ChunkPreLoadEvent.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/ChunkPreLoadEvent.java @@ -1,4 +1,4 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; import org.bukkit.event.Cancellable; import org.bukkit.event.Event; diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/ChunkProviderServer.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/ChunkProviderServer.java similarity index 86% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/ChunkProviderServer.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/ChunkProviderServer.java index 81c7bc84e..07af13347 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/ChunkProviderServer.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/ChunkProviderServer.java @@ -1,4 +1,4 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; import java.io.IOException; import java.util.ArrayList; @@ -16,10 +16,10 @@ import org.apache.logging.log4j.Logger; import java.util.Random; import org.bukkit.Server; -import org.bukkit.craftbukkit.v1_7_R3.chunkio.ChunkIOExecutor; -import org.bukkit.craftbukkit.v1_7_R3.util.LongHash; -import org.bukkit.craftbukkit.v1_7_R3.util.LongHashSet; -import org.bukkit.craftbukkit.v1_7_R3.util.LongObjectHashMap; +import org.bukkit.craftbukkit.v1_7_R4.chunkio.ChunkIOExecutor; +import org.bukkit.craftbukkit.v1_7_R4.util.LongHash; +import org.bukkit.craftbukkit.v1_7_R4.util.LongHashSet; +import org.bukkit.craftbukkit.v1_7_R4.util.LongObjectHashMap; import org.bukkit.event.world.ChunkUnloadEvent; // CraftBukkit end @@ -94,6 +94,10 @@ public class ChunkProviderServer implements IChunkProvider { } // CraftBukkit start - Add async variant, provide compatibility + public Chunk getChunkIfLoaded(int x, int z) { + return this.chunks.get(LongHash.toLong(x, z)); + } + public Chunk getChunkAt(int i, int j) { return getChunkAt(i, j, null); } @@ -183,7 +187,7 @@ public class ChunkProviderServer implements IChunkProvider { } if (chunk == null) { - org.bukkit.craftbukkit.v1_7_R3.SpigotTimings.syncChunkLoadTimer.startTiming(); // Spigot + world.timings.syncChunkLoadTimer.startTiming(); // Spigot chunk = this.loadChunk(i, j); if (chunk == null) { if (this.chunkProvider == null) { @@ -216,9 +220,24 @@ public class ChunkProviderServer implements IChunkProvider { */ server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkLoadEvent(chunk.bukkitChunk, newChunk)); } + + // Update neighbor counts + for (int x = -2; x < 3; x++) { + for (int z = -2; z < 3; z++) { + if (x == 0 && z == 0) { + continue; + } + + Chunk neighbor = this.getChunkIfLoaded(chunk.locX + x, chunk.locZ + z); + if (neighbor != null) { + neighbor.setNeighborLoaded(-x, -z); + chunk.setNeighborLoaded(x, z); + } + } + } // CraftBukkit end - chunk.a(this, this, i, j); - org.bukkit.craftbukkit.v1_7_R3.SpigotTimings.syncChunkLoadTimer.stopTiming(); // Spigot + chunk.loadNearby(this, this, i, j); + world.timings.syncChunkLoadTimer.stopTiming(); // Spigot } return chunk; @@ -249,9 +268,11 @@ public class ChunkProviderServer implements IChunkProvider { Chunk chunk = this.f.a(this.world, i, j); if (chunk != null) { - chunk.p = this.world.getTime(); + chunk.lastSaved = this.world.getTime(); if (this.chunkProvider != null) { + world.timings.syncChunkLoadStructuresTimer.startTiming(); // Spigot this.chunkProvider.recreateStructures(i, j); + world.timings.syncChunkLoadStructuresTimer.stopTiming(); // Spigot } } @@ -276,7 +297,7 @@ public class ChunkProviderServer implements IChunkProvider { public void saveChunk(Chunk chunk) { // CraftBukkit - private -> public if (this.f != null) { try { - chunk.p = this.world.getTime(); + chunk.lastSaved = this.world.getTime(); this.f.a(this.world, chunk); // CraftBukkit start - IOException to Exception } catch (Exception ioexception) { @@ -378,6 +399,21 @@ public class ChunkProviderServer implements IChunkProvider { // this.unloadQueue.remove(olong); // this.chunks.remove(olong.longValue()); + + // Update neighbor counts + for (int x = -2; x < 3; x++) { + for (int z = -2; z < 3; z++) { + if (x == 0 && z == 0) { + continue; + } + + Chunk neighbor = this.getChunkIfLoaded(chunk.locX + x, chunk.locZ + z); + if (neighbor != null) { + neighbor.setNeighborUnloaded(-x, -z); + chunk.setNeighborUnloaded(x, z); + } + } + } } } // CraftBukkit end @@ -408,9 +444,9 @@ public class ChunkProviderServer implements IChunkProvider { } public int getLoadedChunks() { - // CraftBukkit - this.chunks.count() -> .values().size() - return this.chunks.values().size(); + // CraftBukkit - this.chunks.count() -> this.chunks.size() + return this.chunks.size(); } public void recreateStructures(int i, int j) {} -} \ No newline at end of file +} diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/ContainerAnvilInventory.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/ContainerAnvilInventory.java similarity index 93% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/ContainerAnvilInventory.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/ContainerAnvilInventory.java index 81d129f35..75501b79b 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/ContainerAnvilInventory.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/ContainerAnvilInventory.java @@ -1,8 +1,8 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; // CraftBukkit start import java.util.List; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftHumanEntity; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftHumanEntity; import org.bukkit.entity.HumanEntity; // CraftBukkit end diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/DedicatedServer.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/DedicatedServer.java new file mode 100644 index 000000000..2c1958a39 --- /dev/null +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/DedicatedServer.java @@ -0,0 +1,512 @@ +package net.minecraft.server.v1_7_R4; + +import java.io.File; +import java.io.PrintStream; +import java.net.InetAddress; +import java.net.Proxy; +import java.net.UnknownHostException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Random; +import java.util.logging.Handler; +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.core.Appender; +import org.apache.logging.log4j.core.appender.ConsoleAppender; +import org.bukkit.craftbukkit.libs.joptsimple.OptionSet; +import org.bukkit.craftbukkit.v1_7_R4.CraftServer; +import org.bukkit.craftbukkit.v1_7_R4.LoggerOutputStream; +import org.bukkit.craftbukkit.v1_7_R4.SpigotTimings; +import org.bukkit.craftbukkit.v1_7_R4.command.CraftRemoteConsoleCommandSender; +import org.bukkit.craftbukkit.v1_7_R4.util.ForwardLogHandler; +import org.bukkit.craftbukkit.v1_7_R4.util.TerminalConsoleWriterThread; +import org.bukkit.event.server.ServerCommandEvent; +import org.bukkit.plugin.PluginLoadOrder; +import org.bukkit.plugin.PluginManager; +import org.spigotmc.CustomTimingsHandler; +import org.spigotmc.SpigotConfig; + +public class DedicatedServer + extends MinecraftServer + implements IMinecraftServer +{ + private static final org.apache.logging.log4j.Logger logger = LogManager.getLogger(); + private final List j = Collections.synchronizedList(new ArrayList()); + private RemoteStatusListener k; + private RemoteControlListener l; + public PropertyManager propertyManager; + private boolean generateStructures; + private EnumGamemode p; + private boolean q; + + public DedicatedServer(OptionSet options) + { + super(options, Proxy.NO_PROXY); + + + new ThreadSleepForever(this, "Server Infinisleeper"); + } + + protected boolean init() + throws UnknownHostException + { + ThreadCommandReader threadcommandreader = new ThreadCommandReader(this, "Server console handler"); + + threadcommandreader.setDaemon(true); + threadcommandreader.start(); + + + java.util.logging.Logger global = java.util.logging.Logger.getLogger(""); + global.setUseParentHandlers(false); + for (Handler handler : global.getHandlers()) { + global.removeHandler(handler); + } + global.addHandler(new ForwardLogHandler()); + + org.apache.logging.log4j.core.Logger logger = (org.apache.logging.log4j.core.Logger)LogManager.getRootLogger(); + for (Appender appender : logger.getAppenders().values()) { + if ((appender instanceof ConsoleAppender)) { + logger.removeAppender(appender); + } + } + new Thread(new TerminalConsoleWriterThread(System.out, this.reader)).start(); + + System.setOut(new PrintStream(new LoggerOutputStream(logger, Level.INFO), true)); + System.setErr(new PrintStream(new LoggerOutputStream(logger, Level.WARN), true)); + + + logger.info("Starting minecraft server version 1.7.10"); + if (Runtime.getRuntime().maxMemory() / 1024L / 1024L < 512L) { + logger.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\""); + } + logger.info("Loading properties"); + this.propertyManager = new PropertyManager(this.options); + + if (N()) + { + c("127.0.0.1"); + } + else + { + setOnlineMode(this.propertyManager.getBoolean("online-mode", true)); + c(this.propertyManager.getString("server-ip", "")); + } + setSpawnAnimals(this.propertyManager.getBoolean("spawn-animals", true)); + setSpawnNPCs(this.propertyManager.getBoolean("spawn-npcs", true)); + setPvP(this.propertyManager.getBoolean("pvp", true)); + setAllowFlight(this.propertyManager.getBoolean("allow-flight", false)); + setTexturePack(this.propertyManager.getString("resource-pack", "")); + setMotd(this.propertyManager.getString("motd", "A Minecraft Server")); + setForceGamemode(this.propertyManager.getBoolean("force-gamemode", false)); + setIdleTimeout(this.propertyManager.getInt("player-idle-timeout", 0)); + if (this.propertyManager.getInt("difficulty", 1) < 0) { + this.propertyManager.setProperty("difficulty", Integer.valueOf(0)); + } else if (this.propertyManager.getInt("difficulty", 1) > 3) { + this.propertyManager.setProperty("difficulty", Integer.valueOf(3)); + } + this.generateStructures = this.propertyManager.getBoolean("generate-structures", true); + int gamemode = this.propertyManager.getInt("gamemode", EnumGamemode.SURVIVAL.getId()); + + this.p = WorldSettings.a(gamemode); + logger.info("Default game type: " + this.p); + InetAddress inetaddress = null; + if (getServerIp().length() > 0) { + inetaddress = InetAddress.getByName(getServerIp()); + } + if (L() < 0) { + setPort(this.propertyManager.getInt("server-port", 25565)); + } + a(new DedicatedPlayerList(this)); + SpigotConfig.init(); + SpigotConfig.registerCommands(); + + + logger.info("Generating keypair"); + a(MinecraftEncryption.b()); + logger.info("Starting Minecraft server on " + (getServerIp().length() == 0 ? "*" : getServerIp()) + ":" + L()); + if (!SpigotConfig.lateBind) { + try + { + ai().a(inetaddress, L()); + } + catch (Throwable ioexception) + { + logger.warn("**** FAILED TO BIND TO PORT!"); + logger.warn("The exception was: {}", new Object[] { ioexception.toString() }); + logger.warn("Perhaps a server is already running on that port?"); + return false; + } + } + this.server.loadPlugins(); + this.server.enablePlugins(PluginLoadOrder.STARTUP); + if (!getOnlineMode()) + { + logger.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!"); + logger.warn("The server will make no attempt to authenticate usernames. Beware."); + logger.warn("While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose."); + logger.warn("To change this, set \"online-mode\" to \"true\" in the server.properties file."); + } + if (aE()) { + getUserCache().c(); + } + if (!NameReferencingFileConverter.a(this.propertyManager)) { + return false; + } + this.convertable = new WorldLoaderServer(this.server.getWorldContainer()); + long j = System.nanoTime(); + if (O() == null) { + k(this.propertyManager.getString("level-name", "world")); + } + String s = this.propertyManager.getString("level-seed", ""); + String s1 = this.propertyManager.getString("level-type", "DEFAULT"); + String s2 = this.propertyManager.getString("generator-settings", ""); + long k = new Random().nextLong(); + if (s.length() > 0) { + try + { + long l = Long.parseLong(s); + if (l != 0L) { + k = l; + } + } + catch (NumberFormatException numberformatexception) + { + k = s.hashCode(); + } + } + WorldType worldtype = WorldType.getType(s1); + if (worldtype == null) { + worldtype = WorldType.NORMAL; + } + at(); + getEnableCommandBlock(); + l(); + getSnooperEnabled(); + c(this.propertyManager.getInt("max-build-height", 256)); + c((getMaxBuildHeight() + 8) / 16 * 16); + c(MathHelper.a(getMaxBuildHeight(), 64, 256)); + this.propertyManager.setProperty("max-build-height", Integer.valueOf(getMaxBuildHeight())); + logger.info("Preparing level \"" + O() + "\""); + a(O(), O(), k, worldtype, s2); + long i1 = System.nanoTime() - j; + String s3 = String.format("%.3fs", new Object[] { Double.valueOf(i1 / 1000000000.0D) }); + + logger.info("Done (" + s3 + ")! For help, type \"help\" or \"?\""); + if (this.propertyManager.getBoolean("enable-query", false)) + { + logger.info("Starting GS4 status listener"); + this.k = new RemoteStatusListener(this); + this.k.a(); + } + if (this.propertyManager.getBoolean("enable-rcon", false)) + { + logger.info("Starting remote control listener"); + this.l = new RemoteControlListener(this); + this.l.a(); + this.remoteConsole = new CraftRemoteConsoleCommandSender(); + } + if (this.server.getBukkitSpawnRadius() > -1) + { + logger.info("'settings.spawn-radius' in bukkit.yml has been moved to 'spawn-protection' in server.properties. I will move your config for you."); + this.propertyManager.properties.remove("spawn-protection"); + this.propertyManager.getInt("spawn-protection", this.server.getBukkitSpawnRadius()); + this.server.removeBukkitSpawnRadius(); + this.propertyManager.savePropertiesFile(); + } + if (SpigotConfig.lateBind) { + try + { + ai().a(inetaddress, L()); + } + catch (Throwable ioexception) + { + logger.warn("**** FAILED TO BIND TO PORT!"); + logger.warn("The exception was: {}", new Object[] { ioexception.toString() }); + logger.warn("Perhaps a server is already running on that port?"); + return false; + } + } + return true; + } + + public PropertyManager getPropertyManager() + { + return this.propertyManager; + } + + public boolean getGenerateStructures() + { + return this.generateStructures; + } + + public EnumGamemode getGamemode() + { + return this.p; + } + + public EnumDifficulty getDifficulty() + { + return EnumDifficulty.getById(this.propertyManager.getInt("difficulty", 1)); + } + + public boolean isHardcore() + { + return this.propertyManager.getBoolean("hardcore", false); + } + + protected void a(CrashReport crashreport) {} + + public CrashReport b(CrashReport crashreport) + { + crashreport = super.b(crashreport); + crashreport.g().a("Is Modded", new CrashReportModded(this)); + crashreport.g().a("Type", new CrashReportType(this)); + return crashreport; + } + + protected void t() + { + System.exit(0); + } + + public void v() + { + super.v(); + aB(); + } + + public boolean getAllowNether() + { + return this.propertyManager.getBoolean("allow-nether", true); + } + + public boolean getSpawnMonsters() + { + return this.propertyManager.getBoolean("spawn-monsters", true); + } + + public void a(MojangStatisticsGenerator mojangstatisticsgenerator) + { + mojangstatisticsgenerator.a("whitelist_enabled", Boolean.valueOf(aC().getHasWhitelist())); + mojangstatisticsgenerator.a("whitelist_count", Integer.valueOf(aC().getWhitelisted().length)); + super.a(mojangstatisticsgenerator); + } + + public boolean getSnooperEnabled() + { + return this.propertyManager.getBoolean("snooper-enabled", true); + } + + public void issueCommand(String s, ICommandListener icommandlistener) + { + this.j.add(new ServerCommand(s, icommandlistener)); + } + + public void aB() + { + SpigotTimings.serverCommandTimer.startTiming(); + while (!this.j.isEmpty()) + { + ServerCommand servercommand = (ServerCommand)this.j.remove(0); + + + ServerCommandEvent event = new ServerCommandEvent(this.console, servercommand.command); + this.server.getPluginManager().callEvent(event); + servercommand = new ServerCommand(event.getCommand(), servercommand.source); + + + this.server.dispatchServerCommand(this.console, servercommand); + } + SpigotTimings.serverCommandTimer.stopTiming(); + } + + public boolean X() + { + return true; + } + + public DedicatedPlayerList aC() + { + return (DedicatedPlayerList)super.getPlayerList(); + } + + public int a(String s, int i) + { + return this.propertyManager.getInt(s, i); + } + + public String a(String s, String s1) + { + return this.propertyManager.getString(s, s1); + } + + public boolean a(String s, boolean flag) + { + return this.propertyManager.getBoolean(s, flag); + } + + public void a(String s, Object object) + { + this.propertyManager.setProperty(s, object); + } + + public void a() + { + this.propertyManager.savePropertiesFile(); + } + + public String b() + { + File file1 = this.propertyManager.c(); + + return file1 != null ? file1.getAbsolutePath() : "No settings file"; + } + + public void aD() + { + ServerGUI.a(this); + this.q = true; + } + + public boolean ak() + { + return this.q; + } + + public String a(EnumGamemode enumgamemode, boolean flag) + { + return ""; + } + + public boolean getEnableCommandBlock() + { + return this.propertyManager.getBoolean("enable-command-block", false); + } + + public int getSpawnProtection() + { + return this.propertyManager.getInt("spawn-protection", super.getSpawnProtection()); + } + + public boolean a(World world, int i, int j, int k, EntityHuman entityhuman) + { + if (world.worldProvider.dimension != 0) { + return false; + } + if (aC().getOPs().isEmpty()) { + return false; + } + if (aC().isOp(entityhuman.getProfile())) { + return false; + } + if (getSpawnProtection() <= 0) { + return false; + } + ChunkCoordinates chunkcoordinates = world.getSpawn(); + int l = MathHelper.a(i - chunkcoordinates.x); + int i1 = MathHelper.a(k - chunkcoordinates.z); + int j1 = Math.max(l, i1); + + return j1 <= getSpawnProtection(); + } + + public int l() + { + return this.propertyManager.getInt("op-permission-level", 4); + } + + public void setIdleTimeout(int i) + { + super.setIdleTimeout(i); + this.propertyManager.setProperty("player-idle-timeout", Integer.valueOf(i)); + a(); + } + + public boolean m() + { + return this.propertyManager.getBoolean("broadcast-rcon-to-ops", true); + } + + public boolean at() + { + return this.propertyManager.getBoolean("announce-player-achievements", true); + } + + protected boolean aE() + { + this.server.getLogger().info("**** Beginning UUID conversion, this may take A LONG time ****"); + boolean flag = false; + for (int i = 0; (!flag) && (i <= 2); i++) + { + if (i > 0) + { + logger.warn("Encountered a problem while converting the user banlist, retrying in a few seconds"); + aG(); + } + flag = NameReferencingFileConverter.a(this); + } + boolean flag1 = false; + for (int i = 0; (!flag1) && (i <= 2); i++) + { + if (i > 0) + { + logger.warn("Encountered a problem while converting the ip banlist, retrying in a few seconds"); + aG(); + } + flag1 = NameReferencingFileConverter.b(this); + } + boolean flag2 = false; + for (int i = 0; (!flag2) && (i <= 2); i++) + { + if (i > 0) + { + logger.warn("Encountered a problem while converting the op list, retrying in a few seconds"); + aG(); + } + flag2 = NameReferencingFileConverter.c(this); + } + boolean flag3 = false; + for (int i = 0; (!flag3) && (i <= 2); i++) + { + if (i > 0) + { + logger.warn("Encountered a problem while converting the whitelist, retrying in a few seconds"); + aG(); + } + flag3 = NameReferencingFileConverter.d(this); + } + boolean flag4 = false; + for (int i = 0; (!flag4) && (i <= 2); i++) + { + if (i > 0) + { + logger.warn("Encountered a problem while converting the player save files, retrying in a few seconds"); + aG(); + } + flag4 = NameReferencingFileConverter.a(this, this.propertyManager); + } + return (flag) || (flag1) || (flag2) || (flag3) || (flag4); + } + + private void aG() + { + try + { + Thread.sleep(5000L); + } + catch (InterruptedException interruptedexception) {} + } + + public PlayerList getPlayerList() + { + return aC(); + } + + static org.apache.logging.log4j.Logger aF() + { + return logger; + } +} diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/Entity.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/Entity.java similarity index 94% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/Entity.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/Entity.java index 743e91e83..bfcef9b0f 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/Entity.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/Entity.java @@ -1,4 +1,4 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; import java.util.List; import java.util.Random; @@ -22,12 +22,11 @@ import org.bukkit.event.painting.PaintingBreakByEntityEvent; import org.bukkit.event.vehicle.VehicleBlockCollisionEvent; import org.bukkit.event.vehicle.VehicleEnterEvent; import org.bukkit.event.vehicle.VehicleExitEvent; -import org.bukkit.craftbukkit.v1_7_R3.CraftWorld; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.CraftWorld; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.event.CraftEventFactory; import org.bukkit.event.entity.EntityCombustEvent; -import org.bukkit.event.entity.EntityDamageByBlockEvent; -import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityPortalEvent; import org.bukkit.plugin.PluginManager; // CraftBukkit end @@ -47,7 +46,7 @@ public abstract class Entity { public boolean k; public Entity passenger; public Entity vehicle; - public boolean n; + public boolean attachedToPlayer; public World world; public double lastX; public double lastY; @@ -116,18 +115,17 @@ public abstract class Entity { public org.bukkit.projectiles.ProjectileSource projectileSource; // CraftBukkit - For projectiles only // Spigot start - public CustomTimingsHandler tickTimer = org.bukkit.craftbukkit.v1_7_R3.SpigotTimings.getEntityTimings(this); // Spigot + public CustomTimingsHandler tickTimer = org.bukkit.craftbukkit.v1_7_R4.SpigotTimings.getEntityTimings(this); // Spigot public final byte activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this); public final boolean defaultActivationState; public long activatedTick = 0; public boolean fromMobSpawner; - - public boolean Silent; - public boolean Invisible; - public void inactiveTick() { } // Spigot end + public boolean Silent; + public boolean Invisible; + public int getId() { return this.id; } @@ -258,10 +256,10 @@ public abstract class Entity { } public void h() { - this.B(); + this.C(); } - public void B() { + public void C() { this.world.methodProfiler.a("entityBaseTick"); if (this.vehicle != null && this.vehicle.dead) { this.vehicle = null; @@ -279,12 +277,12 @@ public abstract class Entity { this.world.methodProfiler.a("portal"); MinecraftServer minecraftserver = ((WorldServer) this.world).getMinecraftServer(); - i = this.C(); + i = this.D(); if (this.an) { if (true || minecraftserver.getAllowNether()) { // CraftBukkit if (this.vehicle == null && this.ao++ >= i) { this.ao = i; - this.portalCooldown = this.ah(); + this.portalCooldown = this.ai(); byte b0; if (this.world.worldProvider.dimension == -1) { @@ -315,7 +313,7 @@ public abstract class Entity { this.world.methodProfiler.b(); } - if (this.isSprinting() && !this.L()) { + if (this.isSprinting() && !this.M()) { int j = MathHelper.floor(this.locX); i = MathHelper.floor(this.locY - 0.20000000298023224D - (double) this.height); @@ -323,11 +321,11 @@ public abstract class Entity { Block block = this.world.getType(j, i, k); if (block.getMaterial() != Material.AIR) { - this.world.addParticle("blockcrack_" + Block.b(block) + "_" + this.world.getData(j, i, k), this.locX + ((double) this.random.nextFloat() - 0.5D) * (double) this.width, this.boundingBox.b + 0.1D, this.locZ + ((double) this.random.nextFloat() - 0.5D) * (double) this.width, -this.motX * 4.0D, 1.5D, -this.motZ * 4.0D); + this.world.addParticle("blockcrack_" + Block.getId(block) + "_" + this.world.getData(j, i, k), this.locX + ((double) this.random.nextFloat() - 0.5D) * (double) this.width, this.boundingBox.b + 0.1D, this.locZ + ((double) this.random.nextFloat() - 0.5D) * (double) this.width, -this.motX * 4.0D, 1.5D, -this.motZ * 4.0D); } } - this.M(); + this.N(); if (this.world.isStatic) { this.fireTicks = 0; } else if (this.fireTicks > 0) { @@ -345,13 +343,13 @@ public abstract class Entity { } } - if (this.O()) { - this.D(); + if (this.P()) { + this.E(); this.fallDistance *= 0.5F; } if (this.locY < -64.0D) { - this.F(); + this.G(); } if (!this.world.isStatic) { @@ -362,32 +360,23 @@ public abstract class Entity { this.world.methodProfiler.b(); } - public int C() { + public int D() { return 0; } - protected void D() { + protected void E() { if (!this.fireProof) { + this.damageEntity(DamageSource.LAVA, 4); + // CraftBukkit start - Fallen in lava TODO: this event spams! if (this instanceof EntityLiving) { - Server server = this.world.getServer(); - - // TODO: shouldn't be sending null for the block. - org.bukkit.block.Block damager = null; // ((WorldServer) this.l).getWorld().getBlockAt(i, j, k); - org.bukkit.entity.Entity damagee = this.getBukkitEntity(); - - EntityDamageByBlockEvent event = new EntityDamageByBlockEvent(damager, damagee, EntityDamageEvent.DamageCause.LAVA, 4D); - server.getPluginManager().callEvent(event); - - if (!event.isCancelled()) { - damagee.setLastDamageCause(event); - this.damageEntity(DamageSource.LAVA, (float) event.getDamage()); - } - if (this.fireTicks <= 0) { // not on fire yet + // TODO: shouldn't be sending null for the block. + org.bukkit.block.Block damager = null; // ((WorldServer) this.l).getWorld().getBlockAt(i, j, k); + org.bukkit.entity.Entity damagee = this.getBukkitEntity(); EntityCombustEvent combustEvent = new org.bukkit.event.entity.EntityCombustByBlockEvent(damager, damagee, 15); - server.getPluginManager().callEvent(combustEvent); + this.world.getServer().getPluginManager().callEvent(combustEvent); if (!combustEvent.isCancelled()) { this.setOnFire(combustEvent.getDuration()); @@ -400,7 +389,6 @@ public abstract class Entity { } // CraftBukkit end - we also don't throw an event unless the object in lava is living, to save on some event calls - this.damageEntity(DamageSource.LAVA, 4); this.setOnFire(15); } } @@ -418,7 +406,7 @@ public abstract class Entity { this.fireTicks = 0; } - protected void F() { + protected void G() { this.die(); } @@ -433,7 +421,7 @@ public abstract class Entity { // CraftBukkit start - Don't do anything if we aren't moving // We need to do this regardless of whether or not we are moving thanks to portals try { - this.H(); + this.I(); } catch (Throwable throwable) { CrashReport crashreport = CrashReport.a(throwable, "Checking entity block collision"); CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being checked for collision"); @@ -445,8 +433,8 @@ public abstract class Entity { if (d0 == 0 && d1 == 0 && d2 == 0 && this.vehicle == null && this.passenger == null) { return; } - // CraftBukkit end - org.bukkit.craftbukkit.v1_7_R3.SpigotTimings.entityMoveTimer.startTiming(); // Spigot + // CraftBukkit end + org.bukkit.craftbukkit.v1_7_R4.SpigotTimings.entityMoveTimer.startTiming(); // Spigot if (this.X) { this.boundingBox.d(d0, d1, d2); this.locX = (this.boundingBox.a + this.boundingBox.d) / 2.0D; @@ -697,19 +685,18 @@ public abstract class Entity { this.Q = (float) ((double) this.Q + (double) MathHelper.sqrt(d10 * d10 + d11 * d11 + d12 * d12) * 0.6D); if (this.Q > (float) this.d && block.getMaterial() != Material.AIR) { this.d = (int) this.Q + 1; - if (this.L()) { + if (this.M()) { float f = MathHelper.sqrt(this.motX * this.motX * 0.20000000298023224D + this.motY * this.motY + this.motZ * this.motZ * 0.20000000298023224D) * 0.35F; if (f > 1.0F) { f = 1.0F; } - this.makeSound(this.G(), f, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F); + this.makeSound(this.H(), f, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F); } - if (!Silent) - this.a(l, k, i1, block); - + if (!Silent) + this.a(l, k, i1, block); block.b(this.world, l, k, i1, this); } } @@ -717,7 +704,7 @@ public abstract class Entity { // CraftBukkit start - Move to the top of the method /* try { - this.H(); + this.I(); } catch (Throwable throwable) { CrashReport crashreport = CrashReport.a(throwable, "Checking entity block collision"); CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being checked for collision"); @@ -727,7 +714,7 @@ public abstract class Entity { } */ // CraftBukkit end - boolean flag2 = this.K(); + boolean flag2 = this.L(); if (this.world.e(this.boundingBox.shrink(0.001D, 0.001D, 0.001D))) { this.burn(1); @@ -757,14 +744,14 @@ public abstract class Entity { this.world.methodProfiler.b(); } - org.bukkit.craftbukkit.v1_7_R3.SpigotTimings.entityMoveTimer.stopTiming(); // Spigot + org.bukkit.craftbukkit.v1_7_R4.SpigotTimings.entityMoveTimer.stopTiming(); // Spigot } - protected String G() { + protected String H() { return "game.neutral.swim"; } - protected void H() { + protected void I() { int i = MathHelper.floor(this.boundingBox.a + 0.001D); int j = MathHelper.floor(this.boundingBox.b + 0.001D); int k = MathHelper.floor(this.boundingBox.c + 0.001D); @@ -805,8 +792,8 @@ public abstract class Entity { } public void makeSound(String s, float f, float f1) { - if (!Silent) - this.world.makeSound(this, s, f, f1); + if (!Silent) + this.world.makeSound(this, s, f, f1); } protected boolean g_() { @@ -824,7 +811,7 @@ public abstract class Entity { } } - public AxisAlignedBB I() { + public AxisAlignedBB J() { return null; } @@ -844,15 +831,15 @@ public abstract class Entity { } } - public boolean K() { + public boolean L() { return this.inWater || this.world.isRainingAt(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)) || this.world.isRainingAt(MathHelper.floor(this.locX), MathHelper.floor(this.locY + (double) this.length), MathHelper.floor(this.locZ)); } - public boolean L() { + public boolean M() { return this.inWater; } - public boolean M() { + public boolean N() { if (this.world.a(this.boundingBox.grow(0.0D, -0.4000000059604645D, 0.0D).shrink(0.001D, 0.001D, 0.001D), Material.WATER, this)) { if (!this.inWater && !this.justCreated) { float f = MathHelper.sqrt(this.motX * this.motX * 0.20000000298023224D + this.motY * this.motY + this.motZ * this.motZ * 0.20000000298023224D) * 0.2F; @@ -861,7 +848,7 @@ public abstract class Entity { f = 1.0F; } - this.makeSound(this.N(), f, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F); + this.makeSound(this.O(), f, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F); float f1 = (float) MathHelper.floor(this.boundingBox.b); int i; @@ -891,7 +878,7 @@ public abstract class Entity { return this.inWater; } - protected String N() { + protected String O() { return "game.neutral.swim.splash"; } @@ -916,7 +903,7 @@ public abstract class Entity { return 0.0F; } - public boolean O() { + public boolean P() { return this.world.a(this.boundingBox.grow(-0.10000000149011612D, -0.4000000059604645D, -0.10000000149011612D), Material.LAVA); } @@ -1066,7 +1053,7 @@ public abstract class Entity { this.al = true; } - protected void P() { + protected void Q() { this.velocityChanged = true; } @@ -1074,23 +1061,23 @@ public abstract class Entity { if (this.isInvulnerable()) { return false; } else { - this.P(); + this.Q(); return false; } } - public boolean Q() { - return false; - } - public boolean R() { return false; } + public boolean S() { + return false; + } + public void b(Entity entity, int i) {} public boolean c(NBTTagCompound nbttagcompound) { - String s = this.V(); + String s = this.W(); if (!this.dead && s != null) { nbttagcompound.setString("id", s); @@ -1102,7 +1089,7 @@ public abstract class Entity { } public boolean d(NBTTagCompound nbttagcompound) { - String s = this.V(); + String s = this.W(); if (!this.dead && s != null && this.passenger == null) { nbttagcompound.setString("id", s); @@ -1204,7 +1191,7 @@ public abstract class Entity { this.setPosition(this.locX, this.locY, this.locZ); this.b(this.yaw, this.pitch); this.a(nbttagcompound); - if (this.U()) { + if (this.V()) { this.setPosition(this.locX, this.locY, this.locZ); } @@ -1255,7 +1242,7 @@ public abstract class Entity { if (bworld == null) { EntityPlayer entityPlayer = (EntityPlayer) this; - bworld = ((org.bukkit.craftbukkit.v1_7_R3.CraftServer) server).getServer().getWorldServer(entityPlayer.dimension).getWorld(); + bworld = ((org.bukkit.craftbukkit.v1_7_R4.CraftServer) server).getServer().getWorldServer(entityPlayer.dimension).getWorld(); } this.spawnIn(bworld == null ? null : ((CraftWorld) bworld).getHandle()); @@ -1270,11 +1257,11 @@ public abstract class Entity { } } - protected boolean U() { + protected boolean V() { return true; } - protected final String V() { + protected final String W() { return EntityTypes.b(this); } @@ -1282,7 +1269,7 @@ public abstract class Entity { protected abstract void b(NBTTagCompound nbttagcompound); - public void W() {} + public void X() {} protected NBTTagList a(double... adouble) { NBTTagList nbttaglist = new NBTTagList(); @@ -1322,6 +1309,13 @@ public abstract class Entity { public EntityItem a(ItemStack itemstack, float f) { if (itemstack.count != 0 && itemstack.getItem() != null) { + // CraftBukkit start - Capture drops for death event + if (this instanceof EntityLiving && ((EntityLiving) this).drops != null) { + ((EntityLiving) this).drops.add(org.bukkit.craftbukkit.v1_7_R4.inventory.CraftItemStack.asBukkitCopy(itemstack)); + return null; + } + // CraftBukkit end + EntityItem entityitem = new EntityItem(this.world, this.locX, this.locY + (double) f, this.locZ, itemstack); entityitem.pickupDelay = 10; @@ -1361,7 +1355,7 @@ public abstract class Entity { return null; } - public void aa() { + public void ab() { if (this.vehicle.dead) { this.vehicle = null; } else { @@ -1370,7 +1364,7 @@ public abstract class Entity { this.motZ = 0.0D; this.h(); if (this.vehicle != null) { - this.vehicle.ab(); + this.vehicle.ac(); this.h += (double) (this.vehicle.yaw - this.vehicle.lastYaw); for (this.g += (double) (this.vehicle.pitch - this.vehicle.lastPitch); this.h >= 180.0D; this.h -= 360.0D) { @@ -1415,17 +1409,17 @@ public abstract class Entity { } } - public void ab() { + public void ac() { if (this.passenger != null) { - this.passenger.setPosition(this.locX, this.locY + this.ad() + this.passenger.ac(), this.locZ); + this.passenger.setPosition(this.locX, this.locY + this.ae() + this.passenger.ad(), this.locZ); // Spigot } } - public double ac() { + public double ad() { return (double) this.height; } - public double ad() { + public double ae() { return (double) this.length * 0.75D; } @@ -1475,7 +1469,7 @@ public abstract class Entity { this.vehicle = null; } else { // CraftBukkit start - if ((this.bukkitEntity instanceof LivingEntity) && entity.getBukkitEntity() instanceof Vehicle && entity.world.isChunkLoaded((int) entity.locX >> 4, (int) entity.locZ >> 4)) { + if ((this.bukkitEntity instanceof LivingEntity) && (entity instanceof Vehicle) && entity.world.isChunkLoaded((int) entity.locX >> 4, (int) entity.locZ >> 4)) { // It's possible to move from one vehicle to another. We need to check if they're already in a vehicle, and fire an exit event if they are. VehicleExitEvent exitEvent = null; if (this.vehicle != null && this.vehicle.getBukkitEntity() instanceof Vehicle) { @@ -1531,17 +1525,17 @@ public abstract class Entity { } } - public float ae() { + public float af() { return 0.1F; } - public Vec3D af() { + public Vec3D ag() { return null; } - public void ag() { + public void ah() { if (this.portalCooldown > 0) { - this.portalCooldown = this.ah(); + this.portalCooldown = this.ai(); } else { double d0 = this.lastX - this.locX; double d1 = this.lastZ - this.locZ; @@ -1554,7 +1548,7 @@ public abstract class Entity { } } - public int ah() { + public int ai() { return 300; } @@ -1570,7 +1564,7 @@ public abstract class Entity { return !this.fireProof && (this.fireTicks > 0 || flag && this.g(0)); } - public boolean al() { + public boolean am() { return this.vehicle != null; } @@ -1597,7 +1591,7 @@ public abstract class Entity { public void setInvisible(boolean flag) { if (Invisible && !flag) return; - + this.a(5, flag); } @@ -1653,12 +1647,14 @@ public abstract class Entity { } } - EntityDamageEvent event = org.bukkit.craftbukkit.v1_7_R3.event.CraftEventFactory.callEntityDamageEvent(entitylightning, this, EntityDamageEvent.DamageCause.LIGHTNING, 5D); - if (event.isCancelled()) { + if (this.fireProof) { + return; + } + CraftEventFactory.entityDamage = entitylightning; + if (!this.damageEntity(DamageSource.FIRE, 5.0F)) { + CraftEventFactory.entityDamage = null; return; } - - this.burn((float) event.getDamage()); // CraftBukkit end ++this.fireTicks; @@ -1751,7 +1747,7 @@ public abstract class Entity { } } - public void ar() { + public void as() { this.I = true; this.fallDistance = 0.0F; } @@ -1766,7 +1762,7 @@ public abstract class Entity { return LocaleI18n.get("entity." + s + ".name"); } - public Entity[] as() { + public Entity[] at() { return null; } @@ -1778,7 +1774,7 @@ public abstract class Entity { return 0.0F; } - public boolean au() { + public boolean av() { return true; } @@ -1827,7 +1823,7 @@ public abstract class Entity { Location exit = exitWorld != null ? minecraftserver.getPlayerList().calculateTarget(enter, minecraftserver.getWorldServer(i)) : null; boolean useTravelAgent = exitWorld != null && !(this.dimension == 1 && exitWorld.dimension == 1); // don't use agent for custom worlds or return from THE_END - TravelAgent agent = exit != null ? (TravelAgent) ((CraftWorld) exit.getWorld()).getHandle().getTravelAgent() : org.bukkit.craftbukkit.v1_7_R3.CraftTravelAgent.DEFAULT; // return arbitrary TA to compensate for implementation dependent plugins + TravelAgent agent = exit != null ? (TravelAgent) ((CraftWorld) exit.getWorld()).getHandle().getTravelAgent() : org.bukkit.craftbukkit.v1_7_R4.CraftTravelAgent.DEFAULT; // return arbitrary TA to compensate for implementation dependent plugins EntityPortalEvent event = new EntityPortalEvent(this.getBukkitEntity(), enter, exit, agent); event.useTravelAgent(useTravelAgent); event.getEntity().getServer().getPluginManager().callEvent(event); @@ -1900,15 +1896,15 @@ public abstract class Entity { return true; } - public int aw() { + public int ax() { return 3; } - public int ax() { + public int ay() { return this.aq; } - public boolean ay() { + public boolean az() { return false; } @@ -1925,7 +1921,7 @@ public abstract class Entity { return this.uniqueID; } - public boolean aB() { + public boolean aC() { return true; } @@ -1934,4 +1930,4 @@ public abstract class Entity { } public void i(int i) {} -} \ No newline at end of file +} diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityBat.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityBat.java similarity index 86% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityBat.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityBat.java index 0dbde464b..f5e80d7dd 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityBat.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityBat.java @@ -1,4 +1,4 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; import java.util.Calendar; import java.util.Random; @@ -6,7 +6,7 @@ import java.util.Random; public class EntityBat extends EntityAmbient { private ChunkCoordinates h; - + public boolean Vegetated = false; public EntityBat(World paramWorld) @@ -14,7 +14,7 @@ public class EntityBat extends EntityAmbient super(paramWorld); a(0.5F, 0.9F); - setStartled(true); + setAsleep(true); } protected void c() @@ -24,36 +24,36 @@ public class EntityBat extends EntityAmbient this.datawatcher.a(16, new Byte((byte) 0)); } - protected float be() + protected float bf() { return 0.1F; } - protected float bf() + protected float bg() { - return super.bf() * 0.95F; + return super.bg() * 0.95F; } protected String t() { - if ((isStartled()) && (this.random.nextInt(4) != 0)) + if ((isAsleep()) && (this.random.nextInt(4) != 0)) { return null; } return "mob.bat.idle"; } - protected String aS() + protected String aT() { return "mob.bat.hurt"; } - protected String aT() + protected String aU() { return "mob.bat.death"; } - public boolean R() + public boolean S() { return false; } @@ -62,23 +62,23 @@ public class EntityBat extends EntityAmbient { } - protected void bn() + protected void bo() { } - protected void aC() + protected void aD() { - super.aC(); + super.aD(); - getAttributeInstance(GenericAttributes.a).setValue(6.0D); + getAttributeInstance(GenericAttributes.maxHealth).setValue(6.0D); } - public boolean isStartled() + public boolean isAsleep() { return (this.datawatcher.getByte(16) & 0x1) != 0; } - public void setStartled(boolean paramBoolean) + public void setAsleep(boolean paramBoolean) { int i = this.datawatcher.getByte(16); if (paramBoolean) @@ -91,7 +91,7 @@ public class EntityBat extends EntityAmbient } } - protected boolean bj() + protected boolean bk() { return true; } @@ -99,11 +99,11 @@ public class EntityBat extends EntityAmbient public void h() { super.h(); - + if (Vegetated) return; - - if (isStartled()) + + if (isAsleep()) { this.motX = (this.motY = this.motZ = 0.0D); this.locY = (MathHelper.floor(this.locY) + 1.0D - this.length); @@ -114,18 +114,18 @@ public class EntityBat extends EntityAmbient } } - protected void bm() + protected void bn() { - super.bm(); - + super.bn(); + if (Vegetated) return; - - if (isStartled()) + + if (isAsleep()) { if (!this.world.getType(MathHelper.floor(this.locX), (int) this.locY + 1, MathHelper.floor(this.locZ)).r()) { - setStartled(false); + setAsleep(false); this.world.a(null, 1015, (int) this.locX, (int) this.locY, (int) this.locZ, 0); } else @@ -136,7 +136,7 @@ public class EntityBat extends EntityAmbient } if (this.world.findNearbyPlayer(this, 4.0D) != null) { - setStartled(false); + setAsleep(false); this.world.a(null, 1015, (int) this.locX, (int) this.locY, (int) this.locZ, 0); } } @@ -170,7 +170,7 @@ public class EntityBat extends EntityAmbient && (this.world.getType(MathHelper.floor(this.locX), (int) this.locY + 1, MathHelper.floor(this.locZ)).r())) { - setStartled(true); + setAsleep(true); } } } @@ -188,7 +188,7 @@ public class EntityBat extends EntityAmbient { } - public boolean ay() + public boolean az() { return true; } @@ -199,9 +199,9 @@ public class EntityBat extends EntityAmbient { return false; } - if ((!this.world.isStatic) && (isStartled() && !Vegetated)) + if ((!this.world.isStatic) && (isAsleep()) && !Vegetated) { - setStartled(false); + setAsleep(false); } return super.damageEntity(paramDamageSource, paramFloat); } diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityBlaze.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityBlaze.java new file mode 100644 index 000000000..e27f4fe1b --- /dev/null +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityBlaze.java @@ -0,0 +1,192 @@ +package net.minecraft.server.v1_7_R4; + +import java.util.Random; + +public class EntityBlaze extends EntityMonster +{ + private float bp = 0.5F; + private int bq; + private int br; + + public EntityBlaze(World paramWorld) + { + super(paramWorld); + + this.fireProof = true; + this.b = 10; + } + + protected void aD() + { + super.aD(); + getAttributeInstance(GenericAttributes.e).setValue(6.0D); + } + + protected void c() + { + super.c(); + + this.datawatcher.a(16, new Byte((byte) 0)); + } + + protected String t() + { + return "mob.blaze.breathe"; + } + + protected String aT() + { + return "mob.blaze.hit"; + } + + protected String aU() + { + return "mob.blaze.death"; + } + + public float d(float paramFloat) + { + return 1.0F; + } + + public void e() + { + if (!this.world.isStatic) + { + if (L()) + { + damageEntity(DamageSource.DROWN, 1.0F); + } + this.bq -= 1; + if (this.bq <= 0) + { + this.bq = 100; + this.bp = (0.5F + (float) this.random.nextGaussian() * 3.0F); + } + if ((bT() != null) && (bT().locY + bT().getHeadHeight() > this.locY + getHeadHeight() + this.bp)) + { + this.motY += (0.300000011920929D - this.motY) * 0.300000011920929D; + } + } + if (this.random.nextInt(24) == 0) + { + this.world.makeSound(this.locX + 0.5D, this.locY + 0.5D, this.locZ + 0.5D, "fire.fire", + 1.0F + this.random.nextFloat(), this.random.nextFloat() * 0.7F + 0.3F); + } + if (!Vegetated && (!this.onGround) && (this.motY < 0.0D)) + { + this.motY *= 0.6D; + } + for (int i = 0; i < 2; i++) + { + this.world.addParticle("largesmoke", this.locX + (this.random.nextDouble() - 0.5D) * this.width, this.locY + + this.random.nextDouble() * this.length, this.locZ + (this.random.nextDouble() - 0.5D) + * this.width, 0.0D, 0.0D, 0.0D); + } + super.e(); + } + + protected void a(Entity paramEntity, float paramFloat) + { + if (Vegetated) + return; + + if ((this.attackTicks <= 0) && (paramFloat < 2.0F) && (paramEntity.boundingBox.e > this.boundingBox.b) + && (paramEntity.boundingBox.b < this.boundingBox.e)) + { + this.attackTicks = 20; + n(paramEntity); + } + else if (paramFloat < 30.0F) + { + double d1 = paramEntity.locX - this.locX; + double d2 = paramEntity.boundingBox.b + paramEntity.length / 2.0F - (this.locY + this.length / 2.0F); + double d3 = paramEntity.locZ - this.locZ; + if (this.attackTicks == 0) + { + this.br += 1; + if (this.br == 1) + { + this.attackTicks = 60; + a(true); + } + else if (this.br <= 4) + { + this.attackTicks = 6; + } + else + { + this.attackTicks = 100; + this.br = 0; + a(false); + } + if (this.br > 1) + { + float f = MathHelper.c(paramFloat) * 0.5F; + + this.world.a(null, 1009, (int) this.locX, (int) this.locY, (int) this.locZ, 0); + for (int i = 0; i < 1; i++) + { + EntitySmallFireball localEntitySmallFireball = new EntitySmallFireball(this.world, this, d1 + + this.random.nextGaussian() * f, d2, d3 + this.random.nextGaussian() * f); + localEntitySmallFireball.locY = (this.locY + this.length / 2.0F + 0.5D); + this.world.addEntity(localEntitySmallFireball); + } + } + } + this.yaw = ((float) (Math.atan2(d3, d1) * 180.0D / 3.141592741012573D) - 90.0F); + + this.bn = true; + } + } + + protected void b(float paramFloat) + { + } + + protected Item getLoot() + { + return Items.BLAZE_ROD; + } + + public boolean isBurning() + { + return bZ(); + } + + protected void dropDeathLoot(boolean paramBoolean, int paramInt) + { + if (paramBoolean) + { + int i = this.random.nextInt(2 + paramInt); + for (int j = 0; j < i; j++) + { + a(Items.BLAZE_ROD, 1); + } + } + } + + public boolean bZ() + { + return (this.datawatcher.getByte(16) & 0x1) != 0; + } + + public void a(boolean paramBoolean) + { + byte b = this.datawatcher.getByte(16); + if (paramBoolean) + { + b = (byte) (b | 0x1); + } + else + { + b = (byte) (b & 0xFFFFFFFE); + } + this.datawatcher.watch(16, Byte.valueOf(b)); + } + + protected boolean j_() + { + return true; + } +} diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityEnderDragon.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityEnderDragon.java similarity index 91% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityEnderDragon.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityEnderDragon.java index 6acb1e7a8..8b3a13e69 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityEnderDragon.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityEnderDragon.java @@ -1,13 +1,13 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; import java.util.Iterator; import java.util.List; // CraftBukkit start import org.bukkit.block.BlockState; -import org.bukkit.craftbukkit.v1_7_R3.util.BlockStateListPopulator; +import org.bukkit.craftbukkit.v1_7_R4.event.CraftEventFactory; +import org.bukkit.craftbukkit.v1_7_R4.util.BlockStateListPopulator; import org.bukkit.event.entity.EntityCreatePortalEvent; -import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.entity.EntityRegainHealthEvent; import org.bukkit.event.entity.EntityTargetEvent; @@ -38,8 +38,8 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo public EntityEnderCrystal bC; private Explosion explosionSource = new Explosion(null, this, Double.NaN, Double.NaN, Double.NaN, Float.NaN); // CraftBukkit - reusable source for CraftTNTPrimed.getSource() - public boolean Vegetated = false; - + public boolean Vegetated = false; + public EntityEnderDragon(World world) { super(world); this.children = new EntityComplexPart[] { this.bq = new EntityComplexPart(this, "head", 6.0F, 6.0F), this.br = new EntityComplexPart(this, "body", 8.0F, 8.0F), this.bs = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.bt = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.bu = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.bv = new EntityComplexPart(this, "wing", 4.0F, 4.0F), this.bw = new EntityComplexPart(this, "wing", 4.0F, 4.0F)}; @@ -51,9 +51,9 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo this.ak = true; } - protected void aC() { - super.aC(); - this.getAttributeInstance(GenericAttributes.a).setValue(200.0D); + protected void aD() { + super.aD(); + this.getAttributeInstance(GenericAttributes.maxHealth).setValue(200.0D); } protected void c() { @@ -165,7 +165,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo this.bm += this.random.nextGaussian() * 2.0D; } - if (!Vegetated && (this.bz || d3 < 100.0D || d3 > 22500.0D || this.positionChanged || this.F)) { + if (!Vegetated && this.bz || d3 < 100.0D || d3 > 22500.0D || this.positionChanged || this.F) { this.bQ(); } @@ -304,15 +304,9 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo if (this.bC != null) { if (this.bC.dead) { if (!this.world.isStatic) { - // CraftBukkit start - EntityDamageEvent event = new EntityDamageEvent(this.getBukkitEntity(), org.bukkit.event.entity.EntityDamageEvent.DamageCause.ENTITY_EXPLOSION, 10.0F); - Bukkit.getPluginManager().callEvent(event); - - if (!event.isCancelled()) { - getBukkitEntity().setLastDamageCause(event); - this.a(this.bq, DamageSource.explosion((Explosion) null), (float) event.getDamage()); - } - // CraftBukkit end + CraftEventFactory.entityDamage = this.bC; // CraftBukkit + this.a(this.bq, DamageSource.explosion((Explosion) null), 10.0F); + CraftEventFactory.entityDamage = null; // CraftBukkit } this.bC = null; @@ -376,7 +370,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo } } } - + public void setTargetBlock(int x, int y, int z) { this.h = x; @@ -384,7 +378,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo this.bm = z; this.bD = null; } - + public void setTargetEntity(Entity entity) { this.bD = entity; @@ -402,7 +396,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo if (event.getTarget() == null) { this.bD = null; } else { - this.bD = ((org.bukkit.craftbukkit.v1_7_R3.entity.CraftEntity) event.getTarget()).getHandle(); + this.bD = ((org.bukkit.craftbukkit.v1_7_R4.entity.CraftEntity) event.getTarget()).getHandle(); } } // CraftBukkit end @@ -442,7 +436,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo // CraftBukkit start - Create a list to hold all the destroyed blocks List destroyedBlocks = new java.util.ArrayList(); - org.bukkit.craftbukkit.v1_7_R3.CraftWorld craftWorld = this.world.getWorld(); + org.bukkit.craftbukkit.v1_7_R4.CraftWorld craftWorld = this.world.getWorld(); // CraftBukkit end for (int k1 = i; k1 <= l; ++k1) { @@ -490,7 +484,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo int blockY = block.getY(); int blockZ = block.getZ(); - Block nmsBlock = org.bukkit.craftbukkit.v1_7_R3.util.CraftMagicNumbers.getBlock(blockId); + Block nmsBlock = org.bukkit.craftbukkit.v1_7_R4.util.CraftMagicNumbers.getBlock(blockId); if (nmsBlock.a(explosionSource)) { nmsBlock.dropNaturally(this.world, blockX, blockY, blockZ, block.getData(), event.getYield(), 0); } @@ -539,7 +533,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo return super.damageEntity(damagesource, f); } - protected void aE() { + protected void aF() { if (this.dead) return; // CraftBukkit - can't kill what's already dead ++this.bB; if (this.bB >= 180 && this.bB <= 200) { @@ -565,14 +559,24 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo } if (this.bB == 1) { - // Spigot start - if(this.world.spigotConfig.dragonDeathSoundRadius > 0){ - this.world.getServer().getHandle().sendPacketNearby((int) this.locX, (int) this.locY, (int) this.locZ, this.world.spigotConfig.dragonDeathSoundRadius, this.dimension, new PacketPlayOutWorldEvent(1018, (int) this.locX, (int) this.locY, (int) this.locZ, 0, true)); + // CraftBukkit start - Use relative location for far away sounds + //this.world.b(1018, (int) this.locX, (int) this.locY, (int) this.locZ, 0); + int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; + for (EntityPlayer player : (List) this.world.players) { + double deltaX = this.locX - player.locX; + double deltaZ = this.locZ - player.locZ; + double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; + if ( world.spigotConfig.dragonDeathSoundRadius > 0 && distanceSquared > world.spigotConfig.dragonDeathSoundRadius * world.spigotConfig.dragonDeathSoundRadius ) continue; // Spigot + if (distanceSquared > viewDistance * viewDistance) { + double deltaLength = Math.sqrt(distanceSquared); + double relativeX = player.locX + (deltaX / deltaLength) * viewDistance; + double relativeZ = player.locZ + (deltaZ / deltaLength) * viewDistance; + player.playerConnection.sendPacket(new PacketPlayOutWorldEvent(1018, (int) relativeX, (int) this.locY, (int) relativeZ, 0, true)); + } else { + player.playerConnection.sendPacket(new PacketPlayOutWorldEvent(1018, (int) this.locX, (int) this.locY, (int) this.locZ, 0, true)); + } } - else { - this.world.b(1018, (int) this.locX, (int) this.locY, (int) this.locZ, 0); - } - // Spigot end + // CraftBukkit end } } @@ -660,11 +664,11 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo protected void w() {} - public Entity[] as() { + public Entity[] at() { return this.children; } - public boolean Q() { + public boolean R() { return false; } @@ -676,11 +680,11 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo return "mob.enderdragon.growl"; } - protected String aS() { + protected String aT() { return "mob.enderdragon.hit"; } - protected float be() { + protected float bf() { return 5.0F; } @@ -691,4 +695,4 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo return 12000; } // CraftBukkit end -} \ No newline at end of file +} diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityEnderman.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityEnderman.java similarity index 86% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityEnderman.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityEnderman.java index a71a00107..675752706 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityEnderman.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityEnderman.java @@ -1,10 +1,10 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; import java.util.UUID; // CraftBukkit start import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_7_R3.event.CraftEventFactory; +import org.bukkit.craftbukkit.v1_7_R4.event.CraftEventFactory; import org.bukkit.event.entity.EntityTeleportEvent; // CraftBukkit end @@ -24,9 +24,9 @@ public class EntityEnderman extends EntityMonster { this.W = 1.0F; } - protected void aC() { - super.aC(); - this.getAttributeInstance(GenericAttributes.a).setValue(40.0D); + protected void aD() { + super.aD(); + this.getAttributeInstance(GenericAttributes.maxHealth).setValue(40.0D); this.getAttributeInstance(GenericAttributes.d).setValue(0.30000001192092896D); this.getAttributeInstance(GenericAttributes.e).setValue(7.0D); } @@ -40,20 +40,20 @@ public class EntityEnderman extends EntityMonster { public void b(NBTTagCompound nbttagcompound) { super.b(nbttagcompound); - nbttagcompound.setShort("carried", (short) Block.b(this.getCarried())); + nbttagcompound.setShort("carried", (short) Block.getId(this.getCarried())); nbttagcompound.setShort("carriedData", (short) this.getCarriedData()); } public void a(NBTTagCompound nbttagcompound) { super.a(nbttagcompound); - this.setCarried(Block.e(nbttagcompound.getShort("carried"))); + this.setCarried(Block.getById(nbttagcompound.getShort("carried"))); this.setCarriedData(nbttagcompound.getShort("carriedData")); } protected Entity findTarget() { if (Vegetated) return null; - + EntityHuman entityhuman = this.world.findNearbyVulnerablePlayer(this, 64.0D); if (entityhuman != null) { @@ -89,12 +89,12 @@ public class EntityEnderman extends EntityMonster { vec3d1 = vec3d1.a(); double d1 = vec3d.b(vec3d1); - return d1 > 1.0D - 0.025D / d0 && entityhuman.p(this); + return d1 > 1.0D - 0.025D / d0 && entityhuman.hasLineOfSight(this); } } public void e() { - if (this.K()) { + if (this.L()) { this.damageEntity(DamageSource.DROWN, 1.0F); } @@ -121,7 +121,7 @@ public class EntityEnderman extends EntityMonster { j = MathHelper.floor(this.locY + this.random.nextDouble() * 3.0D); k = MathHelper.floor(this.locZ - 2.0D + this.random.nextDouble() * 4.0D); block = this.world.getType(i, j, k); - if (br[Block.b(block)]) { + if (br[Block.getId(block)]) { // CraftBukkit start - Pickup event if (!CraftEventFactory.callEntityChangeBlockEvent(this, this.world.getWorld().getBlockAt(i, j, k), org.bukkit.Material.AIR).isCancelled()) { this.setCarried(block); @@ -164,7 +164,7 @@ public class EntityEnderman extends EntityMonster { } } - if (this.K() || this.isBurning()) { + if (this.L() || this.isBurning()) { this.target = null; this.a(false); this.bv = false; @@ -293,11 +293,11 @@ public class EntityEnderman extends EntityMonster { return this.cd() ? "mob.endermen.scream" : "mob.endermen.idle"; } - protected String aS() { + protected String aT() { return "mob.endermen.hit"; } - protected String aT() { + protected String aU() { return "mob.endermen.death"; } @@ -309,25 +309,20 @@ public class EntityEnderman extends EntityMonster { Item item = this.getLoot(); if (item != null) { - // CraftBukkit start - Whole method - java.util.List loot = new java.util.ArrayList(); - int count = this.random.nextInt(2 + i); + int j = this.random.nextInt(2 + i); - if (count > 0) { - loot.add(new org.bukkit.inventory.ItemStack(org.bukkit.craftbukkit.v1_7_R3.util.CraftMagicNumbers.getMaterial(item), count)); + for (int k = 0; k < j; ++k) { + this.a(item, 1); } - - CraftEventFactory.callEntityDeathEvent(this, loot); - // CraftBukkit end } } public void setCarried(Block block) { - this.datawatcher.watch(16, Byte.valueOf((byte) (Block.b(block) & 255))); + this.datawatcher.watch(16, Byte.valueOf((byte) (Block.getId(block) & 255))); } public Block getCarried() { - return Block.e(this.datawatcher.getByte(16)); + return Block.getById(this.datawatcher.getByte(16)); } public void setCarriedData(int i) { @@ -372,19 +367,19 @@ public class EntityEnderman extends EntityMonster { } static { - br[Block.b((Block) Blocks.GRASS)] = true; - br[Block.b(Blocks.DIRT)] = true; - br[Block.b((Block) Blocks.SAND)] = true; - br[Block.b(Blocks.GRAVEL)] = true; - br[Block.b((Block) Blocks.YELLOW_FLOWER)] = true; - br[Block.b((Block) Blocks.RED_ROSE)] = true; - br[Block.b((Block) Blocks.BROWN_MUSHROOM)] = true; - br[Block.b((Block) Blocks.RED_MUSHROOM)] = true; - br[Block.b(Blocks.TNT)] = true; - br[Block.b(Blocks.CACTUS)] = true; - br[Block.b(Blocks.CLAY)] = true; - br[Block.b(Blocks.PUMPKIN)] = true; - br[Block.b(Blocks.MELON)] = true; - br[Block.b((Block) Blocks.MYCEL)] = true; + br[Block.getId(Blocks.GRASS)] = true; + br[Block.getId(Blocks.DIRT)] = true; + br[Block.getId(Blocks.SAND)] = true; + br[Block.getId(Blocks.GRAVEL)] = true; + br[Block.getId(Blocks.YELLOW_FLOWER)] = true; + br[Block.getId(Blocks.RED_ROSE)] = true; + br[Block.getId(Blocks.BROWN_MUSHROOM)] = true; + br[Block.getId(Blocks.RED_MUSHROOM)] = true; + br[Block.getId(Blocks.TNT)] = true; + br[Block.getId(Blocks.CACTUS)] = true; + br[Block.getId(Blocks.CLAY)] = true; + br[Block.getId(Blocks.PUMPKIN)] = true; + br[Block.getId(Blocks.MELON)] = true; + br[Block.getId(Blocks.MYCEL)] = true; } -} \ No newline at end of file +} diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityFallingBlock.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityFallingBlock.java similarity index 84% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityFallingBlock.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityFallingBlock.java index e65102c82..93bf96bc9 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityFallingBlock.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityFallingBlock.java @@ -1,19 +1,16 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; import java.util.ArrayList; import java.util.Iterator; - -// CraftBukkit start -import org.bukkit.craftbukkit.v1_7_R3.event.CraftEventFactory; +import org.bukkit.craftbukkit.v1_7_R4.event.CraftEventFactory; // CraftBukkit import org.bukkit.event.entity.EntityDamageEvent; -// CraftBukkit end public class EntityFallingBlock extends Entity { public Block id; // CraftBukkit - private -> public public int data; - public int b; + public int ticksLived; public boolean dropItem; private boolean f; private boolean hurtEntities; @@ -59,18 +56,18 @@ public class EntityFallingBlock extends Entity { protected void c() {} - public boolean Q() { + public boolean R() { return !this.dead && !spectating; } @Override public boolean damageEntity(DamageSource damagesource, float f) { - CraftEventFactory.handleEntityDamageEvent(this, damagesource, f); + CraftEventFactory.handleNonLivingEntityDamageEvent(this, damagesource, f); return true; } - + public void h() { if (this.id.getMaterial() == Material.AIR) { this.die(); @@ -78,7 +75,7 @@ public class EntityFallingBlock extends Entity { this.lastX = this.locX; this.lastY = this.locY; this.lastZ = this.locZ; - ++this.b; + ++this.ticksLived; this.motY -= 0.03999999910593033D; this.move(this.motX, this.motY, this.motZ); this.motX *= 0.9800000190734863D; @@ -89,9 +86,9 @@ public class EntityFallingBlock extends Entity { int j = MathHelper.floor(this.locY); int k = MathHelper.floor(this.locZ); - if (this.b == 1) { + if (this.ticksLived == 1) { // CraftBukkit - compare data and call event - if (this.b != 1 || this.world.getType(i, j, k) != this.id || this.world.getData(i, j, k) != this.data || CraftEventFactory.callEntityChangeBlockEvent(this, i, j, k, Blocks.AIR, 0).isCancelled()) { + if (this.ticksLived != 1 || this.world.getType(i, j, k) != this.id || this.world.getData(i, j, k) != this.data || CraftEventFactory.callEntityChangeBlockEvent(this, i, j, k, Blocks.AIR, 0).isCancelled()) { this.die(); return; } @@ -145,7 +142,7 @@ public class EntityFallingBlock extends Entity { this.a(new ItemStack(this.id, 1, this.id.getDropData(this.data)), 0.0F); } } - } else if (this.b > 100 && !this.world.isStatic && (j < 1 || j > 256) || this.b > 600) { + } else if (this.ticksLived > 100 && !this.world.isStatic && (j < 1 || j > 256) || this.ticksLived > 600) { if (this.dropItem) { this.a(new ItemStack(this.id, 1, this.id.getDropData(this.data)), 0.0F); } @@ -168,17 +165,10 @@ public class EntityFallingBlock extends Entity { while (iterator.hasNext()) { Entity entity = (Entity) iterator.next(); - - // CraftBukkit start - float damage = (float) Math.min(MathHelper.d((float) i * this.fallHurtAmount), this.fallHurtMax); - - EntityDamageEvent event = CraftEventFactory.callEntityDamageEvent(this, entity, EntityDamageEvent.DamageCause.FALLING_BLOCK, damage); - if (event.isCancelled()) { - continue; - } - - entity.damageEntity(damagesource, (float) event.getDamage()); - // CraftBukkit end + + CraftEventFactory.entityDamage = this; // CraftBukkit + entity.damageEntity(damagesource, (float) Math.min(MathHelper.d((float) i * this.fallHurtAmount), this.fallHurtMax)); + CraftEventFactory.entityDamage = null; // CraftBukkit } if (flag && (double) this.random.nextFloat() < 0.05000000074505806D + (double) i * 0.05D) { @@ -197,10 +187,10 @@ public class EntityFallingBlock extends Entity { } protected void b(NBTTagCompound nbttagcompound) { - nbttagcompound.setByte("Tile", (byte) Block.b(this.id)); - nbttagcompound.setInt("TileID", Block.b(this.id)); + nbttagcompound.setByte("Tile", (byte) Block.getId(this.id)); + nbttagcompound.setInt("TileID", Block.getId(this.id)); nbttagcompound.setByte("Data", (byte) this.data); - nbttagcompound.setByte("Time", (byte) this.b); + nbttagcompound.setByte("Time", (byte) this.ticksLived); nbttagcompound.setBoolean("DropItem", this.dropItem); nbttagcompound.setBoolean("HurtEntities", this.hurtEntities); nbttagcompound.setFloat("FallHurtAmount", this.fallHurtAmount); @@ -212,13 +202,13 @@ public class EntityFallingBlock extends Entity { protected void a(NBTTagCompound nbttagcompound) { if (nbttagcompound.hasKeyOfType("TileID", 99)) { - this.id = Block.e(nbttagcompound.getInt("TileID")); + this.id = Block.getById(nbttagcompound.getInt("TileID")); } else { - this.id = Block.e(nbttagcompound.getByte("Tile") & 255); + this.id = Block.getById(nbttagcompound.getByte("Tile") & 255); } this.data = nbttagcompound.getByte("Data") & 255; - this.b = nbttagcompound.getByte("Time") & 255; + this.ticksLived = nbttagcompound.getByte("Time") & 255; if (nbttagcompound.hasKeyOfType("HurtEntities", 99)) { this.hurtEntities = nbttagcompound.getBoolean("HurtEntities"); this.fallHurtAmount = nbttagcompound.getFloat("FallHurtAmount"); @@ -246,11 +236,11 @@ public class EntityFallingBlock extends Entity { public void a(CrashReportSystemDetails crashreportsystemdetails) { super.a(crashreportsystemdetails); - crashreportsystemdetails.a("Immitating block ID", Integer.valueOf(Block.b(this.id))); + crashreportsystemdetails.a("Immitating block ID", Integer.valueOf(Block.getId(this.id))); crashreportsystemdetails.a("Immitating block data", Integer.valueOf(this.data)); } public Block f() { return this.id; } -} \ No newline at end of file +} diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityGhast.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityGhast.java similarity index 90% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityGhast.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityGhast.java index e2e00de56..b1712444b 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityGhast.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityGhast.java @@ -1,8 +1,7 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; // CraftBukkit start -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_7_R3.inventory.CraftItemStack; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftEntity; import org.bukkit.event.entity.EntityTargetEvent; // CraftBukkit end @@ -42,12 +41,12 @@ public class EntityGhast extends EntityFlying implements IMonster { this.datawatcher.a(16, Byte.valueOf((byte) 0)); } - protected void aC() { - super.aC(); - this.getAttributeInstance(GenericAttributes.a).setValue(10.0D); + protected void aD() { + super.aD(); + this.getAttributeInstance(GenericAttributes.maxHealth).setValue(10.0D); } - protected void bp() { + protected void bq() { if (!this.world.isStatic && this.world.difficulty == EnumDifficulty.PEACEFUL) { this.die(); } @@ -67,9 +66,10 @@ public class EntityGhast extends EntityFlying implements IMonster { double d6 = this.bn - this.locZ; this.aN = this.yaw = -((float) Math.atan2(d5, d6)) * 180.0F / 3.1415927F; - + return; } + this.w(); this.bo = this.bp; double d0 = this.i - this.locX; @@ -142,7 +142,7 @@ public class EntityGhast extends EntityFlying implements IMonster { double d7 = this.target.locZ - this.locZ; this.aM = this.yaw = -((float) Math.atan2(d5, d7)) * 180.0F / 3.1415927F; - if (this.p(this.target)) { + if (this.hasLineOfSight(this.target)) { if (this.bp == 10) { this.world.a((EntityHuman) null, 1007, (int) this.locX, (int) this.locY, (int) this.locZ, 0); } @@ -203,11 +203,11 @@ public class EntityGhast extends EntityFlying implements IMonster { return "mob.ghast.moan"; } - protected String aS() { + protected String aT() { return "mob.ghast.scream"; } - protected String aT() { + protected String aU() { return "mob.ghast.death"; } @@ -216,27 +216,22 @@ public class EntityGhast extends EntityFlying implements IMonster { } protected void dropDeathLoot(boolean flag, int i) { - // CraftBukkit start - java.util.List loot = new java.util.ArrayList(); int j = this.random.nextInt(2) + this.random.nextInt(1 + i); int k; - if (j > 0) { - loot.add(CraftItemStack.asNewCraftStack(Items.GHAST_TEAR, j)); + for (k = 0; k < j; ++k) { + this.a(Items.GHAST_TEAR, 1); } j = this.random.nextInt(3) + this.random.nextInt(1 + i); - if (j > 0) { - loot.add(CraftItemStack.asNewCraftStack(Items.SULPHUR, j)); + for (k = 0; k < j; ++k) { + this.a(Items.SULPHUR, 1); } - - org.bukkit.craftbukkit.v1_7_R3.event.CraftEventFactory.callEntityDeathEvent(this, loot); - // CraftBukkit end } - protected float be() { + protected float bf() { return 10.0F; } @@ -259,4 +254,4 @@ public class EntityGhast extends EntityFlying implements IMonster { this.explosionPower = nbttagcompound.getInt("ExplosionPower"); } } -} \ No newline at end of file +} diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityHorse.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityHorse.java similarity index 93% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityHorse.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityHorse.java index cd55931b2..7452234fb 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityHorse.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityHorse.java @@ -1,14 +1,9 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; import java.util.Iterator; import java.util.List; - -// CraftBukkit start -import org.bukkit.craftbukkit.v1_7_R3.event.CraftEventFactory; -import org.bukkit.event.entity.EntityDamageEvent; -// CraftBukkit end -import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; +import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; // CraftBukkit public class EntityHorse extends EntityAnimal implements IInventoryListener { @@ -122,7 +117,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { if (Vegetated) return; - + if (flag) { this.datawatcher.watch(16, Integer.valueOf(j | i)); } else { @@ -262,11 +257,11 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { return this.passenger != null && this.passenger.equals(entity) ? false : super.damageEntity(damagesource, f); } - public int aU() { + public int aV() { return by[this.cl()]; } - public boolean R() { + public boolean S() { return this.passenger == null; } @@ -298,26 +293,9 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { int i = MathHelper.f(f * 0.5F - 3.0F); if (i > 0) { - // CraftBukkit start - fire EntityDamageEvent - EntityDamageEvent event = CraftEventFactory.callEntityDamageEvent(null, this, EntityDamageEvent.DamageCause.FALL, i); - if (!event.isCancelled()) { - float damage = (float) event.getDamage(); - if (damage > 0) { - this.getBukkitEntity().setLastDamageCause(event); - this.damageEntity(DamageSource.FALL, damage); - } - } - + this.damageEntity(DamageSource.FALL, (float) i); if (this.passenger != null) { - EntityDamageEvent passengerEvent = CraftEventFactory.callEntityDamageEvent(null, this.passenger, EntityDamageEvent.DamageCause.FALL, i); - if (!passengerEvent.isCancelled() && this.passenger != null) { // Check again in case of plugin - float damage = (float) passengerEvent.getDamage(); - if (damage > 0) { - this.passenger.getBukkitEntity().setLastDamageCause(passengerEvent); - this.passenger.damageEntity(DamageSource.FALL, damage); - } - } - // CraftBukkit end + this.passenger.damageEntity(DamageSource.FALL, (float) i); } Block block = this.world.getType(MathHelper.floor(this.locX), MathHelper.floor(this.locY - 0.2D - (double) this.lastYaw), MathHelper.floor(this.locZ)); @@ -415,7 +393,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { return this.getAttributeInstance(attributeJumpStrength).getValue(); } - protected String aT() { + protected String aU() { this.cS(); int i = this.getType(); @@ -426,10 +404,10 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { boolean flag = this.random.nextInt(4) == 0; int i = this.getType(); - return i == 4 ? Items.BONE : (i == 3 ? (flag ? Item.d(0) : Items.ROTTEN_FLESH) : Items.LEATHER); + return i == 4 ? Items.BONE : (i == 3 ? (flag ? Item.getById(0) : Items.ROTTEN_FLESH) : Items.LEATHER); } - protected String aS() { + protected String aT() { this.cS(); if (this.random.nextInt(3) == 0) { this.cU(); @@ -446,7 +424,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { protected String t() { this.cS(); - if (this.random.nextInt(10) == 0 && !this.bg()) { + if (this.random.nextInt(10) == 0 && !this.bh()) { this.cU(); } @@ -491,10 +469,10 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { } } - protected void aC() { - super.aC(); - this.bb().b(attributeJumpStrength); - this.getAttributeInstance(GenericAttributes.a).setValue(53.0D); + protected void aD() { + super.aD(); + this.getAttributeMap().b(attributeJumpStrength); + this.getAttributeInstance(GenericAttributes.maxHealth).setValue(53.0D); this.getAttributeInstance(GenericAttributes.d).setValue(0.22499999403953552D); } @@ -506,7 +484,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { return this.maxDomestication; // CraftBukkit - return stored max domestication instead of 100 } - protected float be() { + protected float bf() { return 0.8F; } @@ -688,7 +666,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { return i == 2 || i == 1; } - protected boolean bg() { + protected boolean bh() { return this.passenger != null && this.cu() ? true : this.cm() || this.cn(); } @@ -712,10 +690,23 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { public void die(DamageSource damagesource) { super.die(damagesource); + /* CraftBukkit start - Handle chest dropping in dropDeathLoot below if (!this.world.isStatic) { - this.cK(); + this.dropChest(); + } + // CraftBukkit end */ + } + + // CraftBukkit start - Add method + protected void dropDeathLoot(boolean flag, int i) { + super.dropDeathLoot(flag, i); + + // Moved from die method above + if (!this.world.isStatic) { + this.dropChest(); } } + // CraftBukkit end public void e() { if (this.random.nextInt(200) == 0) { @@ -858,11 +849,11 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { String s = this.cv(); if (s != null) { - this.makeSound(s, this.be(), this.bf()); + this.makeSound(s, this.bf(), this.bg()); } } - public void cK() { + public void dropChest() { this.a(this, this.inventoryChest); this.cs(); } @@ -880,7 +871,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { } public boolean h(EntityHuman entityhuman) { - this.setOwnerUUID(entityhuman.getUniqueID().toString()); + this.setOwnerUUID(entityhuman.getUniqueID().toString()); this.setTame(true); return true; } @@ -924,7 +915,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { } this.W = 1.0F; - this.aQ = this.bk() * 0.1F; + this.aQ = this.bl() * 0.1F; if (!this.world.isStatic) { this.i((float) this.getAttributeInstance(GenericAttributes.d).getValue()); super.e(f, f1); @@ -1018,7 +1009,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { this.maxDomestication = nbttagcompound.getInt("Bukkit.MaxDomestication"); } // CraftBukkit end - AttributeInstance attributeinstance = this.bb().a("Speed"); + AttributeInstance attributeinstance = this.getAttributeMap().a("Speed"); if (attributeinstance != null) { this.getAttributeInstance(GenericAttributes.d).setValue(attributeinstance.b() * 0.25D); @@ -1118,9 +1109,9 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { } entityhorse1.setType(k); - double d0 = this.getAttributeInstance(GenericAttributes.a).b() + entityageable.getAttributeInstance(GenericAttributes.a).b() + (double) this.cV(); + double d0 = this.getAttributeInstance(GenericAttributes.maxHealth).b() + entityageable.getAttributeInstance(GenericAttributes.maxHealth).b() + (double) this.cV(); - entityhorse1.getAttributeInstance(GenericAttributes.a).setValue(d0 / 3.0D); + entityhorse1.getAttributeInstance(GenericAttributes.maxHealth).setValue(d0 / 3.0D); double d1 = this.getAttributeInstance(attributeJumpStrength).b() + entityageable.getAttributeInstance(attributeJumpStrength).b() + this.cW(); entityhorse1.getAttributeInstance(attributeJumpStrength).setValue(d1 / 3.0D); @@ -1130,8 +1121,8 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { return entityhorse1; } - public GroupDataEntity a(GroupDataEntity groupdataentity) { - Object object = super.a(groupdataentity); + public GroupDataEntity prepare(GroupDataEntity groupdataentity) { + Object object = super.prepare(groupdataentity); boolean flag = false; int i = 0; int j; @@ -1160,14 +1151,14 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { } if (j != 4 && j != 3) { - this.getAttributeInstance(GenericAttributes.a).setValue((double) this.cV()); + this.getAttributeInstance(GenericAttributes.maxHealth).setValue((double) this.cV()); if (j == 0) { this.getAttributeInstance(GenericAttributes.d).setValue(this.cX()); } else { this.getAttributeInstance(GenericAttributes.d).setValue(0.17499999701976776D); } } else { - this.getAttributeInstance(GenericAttributes.a).setValue(15.0D); + this.getAttributeInstance(GenericAttributes.maxHealth).setValue(15.0D); this.getAttributeInstance(GenericAttributes.d).setValue(0.20000000298023224D); } @@ -1181,7 +1172,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { return (GroupDataEntity) object; } - protected boolean bj() { + protected boolean bk() { return true; } @@ -1199,7 +1190,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { power = 0.4F + 0.4F * (float) i / 90.0F; } - org.bukkit.event.entity.HorseJumpEvent event = org.bukkit.craftbukkit.v1_7_R3.event.CraftEventFactory.callHorseJumpEvent(this, power); + org.bukkit.event.entity.HorseJumpEvent event = org.bukkit.craftbukkit.v1_7_R4.event.CraftEventFactory.callHorseJumpEvent(this, power); if (!event.isCancelled()) { this.bI = true; this.cU(); @@ -1209,15 +1200,15 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { } } - public void ab() { - super.ab(); + public void ac() { + super.ac(); if (this.bM > 0.0F) { float f = MathHelper.sin(this.aM * 3.1415927F / 180.0F); float f1 = MathHelper.cos(this.aM * 3.1415927F / 180.0F); float f2 = 0.7F * this.bM; float f3 = 0.15F * this.bM; - this.passenger.setPosition(this.locX + (double) (f2 * f), this.locY + this.ad() + this.passenger.ac() + (double) f3, this.locZ - (double) (f2 * f1)); + this.passenger.setPosition(this.locX + (double) (f2 * f), this.locY + this.ad() + this.passenger.ad() + (double) f3, this.locZ - (double) (f2 * f1)); if (this.passenger instanceof EntityLiving) { ((EntityLiving) this.passenger).aM = this.aM; } @@ -1243,4 +1234,4 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { public boolean h_() { return false; } -} \ No newline at end of file +} diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityHuman.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityHuman.java similarity index 92% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityHuman.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityHuman.java index 3b47565b9..dcf0a0e47 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityHuman.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityHuman.java @@ -1,4 +1,4 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; import java.util.Collection; import java.util.Iterator; @@ -9,9 +9,9 @@ import net.minecraft.util.com.google.common.base.Charsets; import net.minecraft.util.com.mojang.authlib.GameProfile; // CraftBukkit start -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftHumanEntity; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftItem; -import org.bukkit.craftbukkit.v1_7_R3.inventory.CraftItemStack; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftHumanEntity; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftItem; +import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftItemStack; import org.bukkit.entity.Player; import org.bukkit.event.entity.EntityCombustByEntityEvent; import org.bukkit.event.player.PlayerBedEnterEvent; @@ -82,9 +82,9 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen this.maxFireTicks = 20; } - protected void aC() { - super.aC(); - this.bb().b(GenericAttributes.e).setValue(1.0D); + protected void aD() { + super.aD(); + this.getAttributeMap().b(GenericAttributes.e).setValue(1.0D); } protected void c() { @@ -94,19 +94,19 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen this.datawatcher.a(18, Integer.valueOf(0)); } - public boolean bx() { + public boolean by() { return this.f != null; } - public void bz() { + public void bA() { if (this.f != null) { this.f.b(this.world, this, this.g); } - this.bA(); + this.bB(); } - public void bA() { + public void bB() { this.f = null; this.g = 0; if (!this.world.isStatic) { @@ -115,7 +115,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen } public boolean isBlocking() { - return this.bx() && this.f.getItem().d(this.f) == EnumAnimation.BLOCK; + return this.by() && this.f.getItem().d(this.f) == EnumAnimation.BLOCK; } public void h() { @@ -131,7 +131,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen this.p(); } } else { - this.bA(); + this.bB(); } } @@ -214,19 +214,19 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen } } - public int C() { + public int D() { return this.abilities.isInvulnerable ? 0 : 80; } - protected String G() { + protected String H() { return "game.player.swim"; } - protected String N() { + protected String O() { return "game.player.swim.splash"; } - public int ah() { + public int ai() { return 10; } @@ -250,7 +250,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen vec3d1.a(-this.pitch * 3.1415927F / 180.0F); vec3d1.b(-this.yaw * 3.1415927F / 180.0F); vec3d1 = vec3d1.add(this.locX, this.locY + (double) this.getHeadHeight(), this.locZ); - String s = "iconcrack_" + Item.b(itemstack.getItem()); + String s = "iconcrack_" + Item.getId(itemstack.getItem()); if (itemstack.usesData()) { s = s + "_" + itemstack.getData(); @@ -276,7 +276,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen if (event.isCancelled()) { // Update client if (this instanceof EntityPlayer) { - ((EntityPlayer) this).playerConnection.sendPacket(new PacketPlayOutSetSlot((byte) 0, activeContainer.a((IInventory) this.inventory, this.inventory.itemInHandIndex).index, this.f)); + ((EntityPlayer) this).playerConnection.sendPacket(new PacketPlayOutSetSlot((byte) 0, activeContainer.getSlot((IInventory) this.inventory, this.inventory.itemInHandIndex).index, this.f)); // Spigot Start ((EntityPlayer) this).getBukkitEntity().updateInventory(); ((EntityPlayer) this).getBukkitEntity().updateScaledHealth(); @@ -291,7 +291,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen // Update client if (this instanceof EntityPlayer) { - ((EntityPlayer) this).playerConnection.sendPacket(new PacketPlayOutSetSlot((byte) 0, activeContainer.a((IInventory) this.inventory, this.inventory.itemInHandIndex).index, this.f)); + ((EntityPlayer) this).playerConnection.sendPacket(new PacketPlayOutSetSlot((byte) 0, activeContainer.getSlot((IInventory) this.inventory, this.inventory.itemInHandIndex).index, this.f)); } return; } @@ -306,11 +306,11 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen } } - this.bA(); + this.bB(); } } - protected boolean bg() { + protected boolean bh() { return this.getHealth() <= 0.0F || this.isSleeping(); } @@ -352,7 +352,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen } } - public void aa() { + public void ab() { if (!this.world.isStatic && this.isSneaking()) { this.mount((Entity) null); this.setSneaking(false); @@ -363,7 +363,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen float f = this.yaw; float f1 = this.pitch; - super.aa(); + super.ab(); this.br = this.bs; this.bs = 0.0F; this.l(this.locX - d0, this.locY - d1, this.locZ - d2); @@ -375,9 +375,9 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen } } - protected void bp() { - super.bp(); - this.ba(); + protected void bq() { + super.bq(); + this.bb(); } public void e() { @@ -407,7 +407,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen this.i((float) attributeinstance.getValue()); float f = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ); // CraftBukkit - Math -> TrigMath - float f1 = (float) org.bukkit.craftbukkit.v1_7_R3.TrigMath.atan(-this.motY * 0.20000000298023224D) * 15.0F; + float f1 = (float) org.bukkit.craftbukkit.v1_7_R4.TrigMath.atan(-this.motY * 0.20000000298023224D) * 15.0F; if (f > 0.1F) { f = 0.1F; @@ -434,7 +434,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen List list = this.world.getEntities(this, axisalignedbb); - if (list != null && this.R()) { // Spigot: Add this.R() condition + if (list != null && this.S()) { // Spigot: Add this.S() condition (second !this.isDead near bottom of EntityLiving) for (int i = 0; i < list.size(); ++i) { Entity entity = (Entity) list.get(i); @@ -488,11 +488,11 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen this.a(StatisticList.v, 1); } - protected String aS() { + protected String aT() { return "game.player.hurt"; } - protected String aT() { + protected String aU() { return "game.player.die"; } @@ -519,6 +519,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen } public EntityItem a(boolean flag) { + // Called only when dropped by Q or CTRL-Q return this.a(this.inventory.splitStack(this.inventory.itemInHandIndex, flag && this.inventory.getItemInHand() != null ? this.inventory.getItemInHand().count : 1), false, true); } @@ -570,7 +571,18 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen this.world.getServer().getPluginManager().callEvent(event); if (event.isCancelled()) { - player.getInventory().addItem(drop.getItemStack()); + org.bukkit.inventory.ItemStack cur = player.getInventory().getItemInHand(); + if (flag1 && (cur == null || cur.getAmount() == 0)) { + // The complete stack was dropped + player.getInventory().setItemInHand(drop.getItemStack()); + } else if (flag1 && cur.isSimilar(drop.getItemStack()) && drop.getItemStack().getAmount() == 1) { + // Only one item is dropped + cur.setAmount(cur.getAmount() + 1); + player.getInventory().setItemInHand(cur); + } else { + // Fallback + player.getInventory().addItem(drop.getItemStack()); + } return null; } // CraftBukkit end @@ -780,15 +792,15 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen // CraftBukkit end } - protected void h(float f) { + protected void damageArmor(float f) { this.inventory.a(f); } - public int aU() { + public int aV() { return this.inventory.l(); } - public float bD() { + public float bE() { int i = 0; ItemStack[] aitemstack = this.inventory.armor; int j = aitemstack.length; @@ -804,26 +816,32 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen return (float) i / (float) this.inventory.armor.length; } - protected void d(DamageSource damagesource, float f) { + // CraftBukkit start + protected boolean d(DamageSource damagesource, float f) { // void -> boolean + if (true) { + return super.d(damagesource, f); + } + // CraftBukkit end if (!this.isInvulnerable()) { if (!damagesource.ignoresArmor() && this.isBlocking() && f > 0.0F) { f = (1.0F + f) * 0.5F; } - f = this.b(damagesource, f); - f = this.c(damagesource, f); + f = this.applyArmorModifier(damagesource, f); + f = this.applyMagicModifier(damagesource, f); float f1 = f; - f = Math.max(f - this.br(), 0.0F); - this.m(this.br() - (f1 - f)); + f = Math.max(f - this.getAbsorptionHearts(), 0.0F); + this.setAbsorptionHearts(this.getAbsorptionHearts() - (f1 - f)); if (f != 0.0F) { - this.a(damagesource.f()); + this.applyExhaustion(damagesource.getExhaustionCost()); float f2 = this.getHealth(); this.setHealth(this.getHealth() - f); - this.aV().a(damagesource, f2, f); + this.aW().a(damagesource, f2, f); } } + return false; // CraftBukkit } public void openFurnace(TileEntityFurnace tileentityfurnace) {} @@ -843,7 +861,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen public void b(ItemStack itemstack) {} public boolean q(Entity entity) { - ItemStack itemstack = this.bE(); + ItemStack itemstack = this.bF(); ItemStack itemstack1 = itemstack != null ? itemstack.cloneItemStack() : null; if (!entity.c(this)) { @@ -855,7 +873,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen if (itemstack.a(this, (EntityLiving) entity)) { // CraftBukkit - bypass infinite items; <= 0 -> == 0 if (itemstack.count == 0 && !this.abilities.canInstantlyBuild) { - this.bF(); + this.bG(); } return true; @@ -864,9 +882,9 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen return false; } else { - if (itemstack != null && itemstack == this.bE()) { + if (itemstack != null && itemstack == this.bF()) { if (itemstack.count <= 0 && !this.abilities.canInstantlyBuild) { - this.bF(); + this.bG(); } else if (itemstack.count < itemstack1.count && this.abilities.canInstantlyBuild) { itemstack.count = itemstack1.count; } @@ -876,20 +894,20 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen } } - public ItemStack bE() { + public ItemStack bF() { return this.inventory.getItemInHand(); } - public void bF() { + public void bG() { this.inventory.setItem(this.inventory.itemInHandIndex, (ItemStack) null); } - public double ac() { + public double ad() { return (double) (this.height - 0.5F); } public void attack(Entity entity) { - if (entity.au()) { + if (entity.av()) { if (!entity.j(this)) { float f = (float) this.getAttributeInstance(GenericAttributes.e).getValue(); int i = 0; @@ -905,8 +923,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen } if (f > 0.0F || f1 > 0.0F) { - - boolean flag = this.fallDistance > 0.0F && !this.onGround && !this.h_() && !this.L() && !this.hasEffect(MobEffectList.BLINDNESS) && this.vehicle == null && entity instanceof EntityLiving; + boolean flag = this.fallDistance > 0.0F && !this.onGround && !this.h_() && !this.M() && !this.hasEffect(MobEffectList.BLINDNESS) && this.vehicle == null && entity instanceof EntityLiving; if (flag && f > 0.0F) { f *= 1.5F; @@ -956,7 +973,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen } EnchantmentManager.b(this, entity); - ItemStack itemstack = this.bE(); + ItemStack itemstack = this.bF(); Object object = entity; if (entity instanceof EntityComplexPart) { @@ -971,7 +988,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen itemstack.a((EntityLiving) object, this); // CraftBukkit - bypass infinite items; <= 0 -> == 0 if (itemstack.count == 0) { - this.bF(); + this.bG(); } } @@ -989,7 +1006,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen } } - this.a(0.3F); + this.applyExhaustion(0.3F); } else if (flag1) { entity.extinguish(); } @@ -1045,7 +1062,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen } } - if (this.al()) { + if (this.am()) { this.mount((Entity) null); } @@ -1245,13 +1262,13 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen public void a(Statistic statistic, int i) {} - public void bi() { - super.bi(); + public void bj() { + super.bj(); this.a(StatisticList.r, 1); if (this.isSprinting()) { - this.a(0.8F); + this.applyExhaustion(0.8F); } else { - this.a(0.2F); + this.applyExhaustion(0.2F); } } @@ -1275,7 +1292,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen this.checkMovement(this.locX - d0, this.locY - d1, this.locZ - d2); } - public float bk() { + public float bl() { return (float) this.getAttributeInstance(GenericAttributes.d).getValue(); } @@ -1287,13 +1304,13 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen i = Math.round(MathHelper.sqrt(d0 * d0 + d1 * d1 + d2 * d2) * 100.0F); if (i > 0) { this.a(StatisticList.m, i); - this.a(0.015F * (float) i * 0.01F); + this.applyExhaustion(0.015F * (float) i * 0.01F); } - } else if (this.L()) { + } else if (this.M()) { i = Math.round(MathHelper.sqrt(d0 * d0 + d2 * d2) * 100.0F); if (i > 0) { this.a(StatisticList.i, i); - this.a(0.015F * (float) i * 0.01F); + this.applyExhaustion(0.015F * (float) i * 0.01F); } } else if (this.h_()) { if (d1 > 0.0D) { @@ -1304,9 +1321,9 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen if (i > 0) { this.a(StatisticList.h, i); if (this.isSprinting()) { - this.a(0.099999994F * (float) i * 0.01F); + this.applyExhaustion(0.099999994F * (float) i * 0.01F); } else { - this.a(0.01F * (float) i * 0.01F); + this.applyExhaustion(0.01F * (float) i * 0.01F); } } } else { @@ -1368,9 +1385,9 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen } } - public void ar() { + public void as() { if (!this.abilities.isFlying) { - super.ar(); + super.as(); } } @@ -1414,7 +1431,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen return this.expLevel >= 30 ? 62 + (this.expLevel - 30) * 7 : (this.expLevel >= 15 ? 17 + (this.expLevel - 15) * 3 : 17); } - public void a(float f) { + public void applyExhaustion(float f) { if (!this.abilities.isInvulnerable) { if (!this.world.isStatic) { this.foodData.a(f); @@ -1430,7 +1447,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen return (flag || this.foodData.c()) && !this.abilities.isInvulnerable; } - public boolean bQ() { + public boolean bR() { return this.getHealth() > 0.0F && this.getHealth() < this.getMaxHealth(); } @@ -1455,8 +1472,8 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen return true; } - if (this.bE() != null) { - ItemStack itemstack = this.bE(); + if (this.bF() != null) { + ItemStack itemstack = this.bF(); if (itemstack.b(block) || itemstack.a(block) > 1.0F) { return true; @@ -1531,7 +1548,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen return i == 0 ? this.inventory.getItemInHand() : this.inventory.armor[i - 1]; } - public ItemStack bd() { + public ItemStack be() { return this.inventory.getItemInHand(); } @@ -1543,7 +1560,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen return this.inventory.armor; } - public boolean aB() { + public boolean aC() { return !this.abilities.isFlying; } @@ -1563,7 +1580,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen return chatcomponenttext; } - public void m(float f) { + public void setAbsorptionHearts(float f) { if (f < 0.0F) { f = 0.0F; } @@ -1571,7 +1588,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen this.getDataWatcher().watch(17, Float.valueOf(f)); } - public float br() { + public float getAbsorptionHearts() { return this.getDataWatcher().getFloat(17); } @@ -1584,4 +1601,4 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen return uuid; } -} \ No newline at end of file +} diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityInsentient.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityInsentient.java similarity index 93% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityInsentient.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityInsentient.java index 9e9e6a616..9d4c7d3a4 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityInsentient.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityInsentient.java @@ -1,11 +1,11 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; import java.util.Iterator; import java.util.List; import java.util.UUID; // CraftBukkit start -import org.bukkit.craftbukkit.v1_7_R3.event.CraftEventFactory; +import org.bukkit.craftbukkit.v1_7_R4.event.CraftEventFactory; import org.bukkit.event.entity.EntityUnleashEvent; import org.bukkit.event.entity.EntityUnleashEvent.UnleashReason; // CraftBukkit end @@ -33,7 +33,7 @@ public abstract class EntityInsentient extends EntityLiving { private boolean bv; private Entity bw; private NBTTagCompound bx; - + public boolean Vegetated; public boolean BreakLeash = true; public boolean PullWhileLeashed = true; @@ -54,9 +54,9 @@ public abstract class EntityInsentient extends EntityLiving { } } - protected void aC() { - super.aC(); - this.bb().b(GenericAttributes.b).setValue(16.0D); + protected void aD() { + super.aD(); + this.getAttributeMap().b(GenericAttributes.b).setValue(16.0D); } public ControllerLook getControllerLook() { @@ -107,12 +107,12 @@ public abstract class EntityInsentient extends EntityLiving { String s = this.t(); if (s != null) { - this.makeSound(s, this.be(), this.bf()); + this.makeSound(s, this.bf(), this.bg()); } } - public void B() { - super.B(); + public void C() { + super.C(); this.world.methodProfiler.a("mobBaseTick"); if (this.isAlive() && !Silent && this.random.nextInt(1000) < this.a_++) { this.a_ = -this.q(); @@ -158,7 +158,7 @@ public abstract class EntityInsentient extends EntityLiving { } protected float f(float f, float f1) { - if (this.bj()) { + if (this.bk()) { this.bn.a(); return f1; } else { @@ -171,12 +171,10 @@ public abstract class EntityInsentient extends EntityLiving { } protected Item getLoot() { - return Item.d(0); + return Item.getById(0); } protected void dropDeathLoot(boolean flag, int i) { - // CraftBukkit start - Whole method - List loot = new java.util.ArrayList(); Item item = this.getLoot(); if (item != null) { @@ -186,25 +184,10 @@ public abstract class EntityInsentient extends EntityLiving { j += this.random.nextInt(i + 1); } - if (j > 0) { - loot.add(new org.bukkit.inventory.ItemStack(org.bukkit.craftbukkit.v1_7_R3.util.CraftMagicNumbers.getMaterial(item), j)); + for (int k = 0; k < j; ++k) { + this.a(item, 1); } } - - // Determine rare item drops and add them to the loot - if (this.lastDamageByPlayerTime > 0) { - int k = this.random.nextInt(200) - i; - - if (k < 5) { - ItemStack itemstack = this.getRareDrop(k <= 0 ? 1 : 0); - if (itemstack != null) { - loot.add(org.bukkit.craftbukkit.v1_7_R3.inventory.CraftItemStack.asCraftMirror(itemstack)); - } - } - } - - CraftEventFactory.callEntityDeathEvent(this, loot); // raise event even for those times when the entity does not drop loot - // CraftBukkit end } public void b(NBTTagCompound nbttagcompound) { @@ -383,7 +366,7 @@ public abstract class EntityInsentient extends EntityLiving { this.world.methodProfiler.b(); } - protected boolean bj() { + protected boolean bk() { return false; } @@ -416,7 +399,7 @@ public abstract class EntityInsentient extends EntityLiving { } } - protected void bm() { + protected void bn() { ++this.aU; this.world.methodProfiler.a("checkDespawn"); this.w(); @@ -440,7 +423,7 @@ public abstract class EntityInsentient extends EntityLiving { this.navigation.f(); this.world.methodProfiler.b(); this.world.methodProfiler.a("mob tick"); - this.bo(); + this.bp(); this.world.methodProfiler.b(); this.world.methodProfiler.a("controls"); this.world.methodProfiler.a("move"); @@ -453,8 +436,8 @@ public abstract class EntityInsentient extends EntityLiving { this.world.methodProfiler.b(); } - protected void bp() { - super.bp(); + protected void bq() { + super.bq(); this.bd = 0.0F; this.be = 0.0F; this.w(); @@ -472,7 +455,7 @@ public abstract class EntityInsentient extends EntityLiving { } if (this.bu != null) { - this.a(this.bu, 10.0F, (float) this.bv()); + this.a(this.bu, 10.0F, (float) this.x()); if (this.g-- <= 0 || this.bu.dead || this.bu.f((Entity) this) > (double) (f * f)) { this.bu = null; } @@ -485,15 +468,15 @@ public abstract class EntityInsentient extends EntityLiving { this.pitch = this.f; } - boolean flag = this.L(); - boolean flag1 = this.O(); + boolean flag = this.M(); + boolean flag1 = this.P(); if (flag || flag1) { this.bc = this.random.nextFloat() < 0.8F; } } - public int bv() { + public int x() { return 40; } @@ -540,7 +523,7 @@ public abstract class EntityInsentient extends EntityLiving { return 4; } - public int aw() { + public int ax() { if (this.getGoalTarget() == null) { return 3; } else { @@ -555,7 +538,7 @@ public abstract class EntityInsentient extends EntityLiving { } } - public ItemStack bd() { + public ItemStack be() { return this.equipment[0]; } @@ -722,8 +705,8 @@ public abstract class EntityInsentient extends EntityLiving { protected void bD() { float f = this.world.b(this.locX, this.locY, this.locZ); - if (this.bd() != null && this.random.nextFloat() < 0.25F * f) { - EnchantmentManager.a(this.random, this.bd(), (int) (5.0F + f * (float) this.random.nextInt(18))); + if (this.be() != null && this.random.nextFloat() < 0.25F * f) { + EnchantmentManager.a(this.random, this.be(), (int) (5.0F + f * (float) this.random.nextInt(18))); } for (int i = 0; i < 4; ++i) { @@ -735,7 +718,7 @@ public abstract class EntityInsentient extends EntityLiving { } } - public GroupDataEntity a(GroupDataEntity groupdataentity) { + public GroupDataEntity prepare(GroupDataEntity groupdataentity) { this.getAttributeInstance(GenericAttributes.b).a(new AttributeModifier("Random spawn bonus", this.random.nextGaussian() * 0.05D, 1)); return groupdataentity; } @@ -814,7 +797,7 @@ public abstract class EntityInsentient extends EntityLiving { return true; } - if (entityhuman.getName().equalsIgnoreCase(((EntityTameableAnimal) this).getName())) { + if (((EntityTameableAnimal) this).e(entityhuman)) { // CraftBukkit start - fire PlayerLeashEntityEvent if (CraftEventFactory.callPlayerLeashEntityEvent(this, entityhuman, entityhuman).isCancelled()) { ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutAttachEntity(1, this, this.getLeashHolder())); @@ -916,4 +899,4 @@ public abstract class EntityInsentient extends EntityLiving { this.bx = null; } -} \ No newline at end of file +} diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityLiving.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityLiving.java similarity index 80% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityLiving.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityLiving.java index 75b64d12a..025f067c6 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityLiving.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityLiving.java @@ -1,4 +1,4 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; import java.util.Collection; import java.util.HashMap; @@ -8,11 +8,16 @@ import java.util.Random; import java.util.UUID; // CraftBukkit start -import org.bukkit.craftbukkit.v1_7_R3.event.CraftEventFactory; +import java.util.ArrayList; +import com.google.common.base.Function; +import org.bukkit.craftbukkit.v1_7_R4.event.CraftEventFactory; import org.bukkit.event.entity.EntityDamageEvent; +import org.bukkit.event.entity.EntityDamageEvent.DamageModifier; import org.bukkit.event.entity.EntityRegainHealthEvent; // CraftBukkit end +import org.bukkit.craftbukkit.v1_7_R4.SpigotTimings; // Spigot + public abstract class EntityLiving extends Entity { private static final UUID b = UUID.fromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D"); @@ -77,6 +82,7 @@ public abstract class EntityLiving extends Entity { // CraftBukkit start public int expToDrop; public int maxAirTicks = 300; + ArrayList drops = null; // CraftBukkit end // Spigot start public void inactiveTick() @@ -84,14 +90,14 @@ public abstract class EntityLiving extends Entity { super.inactiveTick(); ++this.aU; // Above all the floats } - // Spigot en + // Spigot end public boolean ghost; - + public EntityLiving(World world) { super(world); - this.aC(); + this.aD(); // CraftBukkit - setHealth(getMaxHealth()) inlined and simplified to skip the instanceof check for EntityPlayer, as getBukkitEntity() is not initialized in constructor - this.datawatcher.watch(6, (float) this.getAttributeInstance(GenericAttributes.a).getValue()); + this.datawatcher.watch(6, (float) this.getAttributeInstance(GenericAttributes.maxHealth).getValue()); this.k = true; this.aL = (float) (Math.random() + 1.0D) * 0.01F; this.setPosition(this.locX, this.locY, this.locZ); @@ -108,18 +114,18 @@ public abstract class EntityLiving extends Entity { this.datawatcher.a(6, Float.valueOf(1.0F)); } - protected void aC() { - this.bb().b(GenericAttributes.a); - this.bb().b(GenericAttributes.c); - this.bb().b(GenericAttributes.d); - if (!this.bj()) { + protected void aD() { + this.getAttributeMap().b(GenericAttributes.maxHealth); + this.getAttributeMap().b(GenericAttributes.c); + this.getAttributeMap().b(GenericAttributes.d); + if (!this.bk()) { this.getAttributeInstance(GenericAttributes.d).setValue(0.10000000149011612D); } } protected void a(double d0, boolean flag) { - if (!this.L()) { - this.M(); + if (!this.M()) { + this.N(); } if (flag && this.fallDistance > 0.0F) { @@ -151,13 +157,13 @@ public abstract class EntityLiving extends Entity { super.a(d0, flag); } - public boolean aD() { + public boolean aE() { return false; } - public void B() { + public void C() { this.aC = this.aD; - super.B(); + super.C(); this.world.methodProfiler.a("livingEntityBaseTick"); if (this.isAlive() && this.inBlock()) { this.damageEntity(DamageSource.STUCK, 1.0F); @@ -170,7 +176,7 @@ public abstract class EntityLiving extends Entity { boolean flag = this instanceof EntityHuman && ((EntityHuman) this).abilities.isInvulnerable; if (this.isAlive() && this.a(Material.WATER)) { - if (!this.aD() && !this.hasEffect(MobEffectList.WATER_BREATHING.id) && !flag) { + if (!this.aE() && !this.hasEffect(MobEffectList.WATER_BREATHING.id) && !flag) { this.setAirTicks(this.j(this.getAirTicks())); if (this.getAirTicks() == -20) { this.setAirTicks(0); @@ -187,7 +193,7 @@ public abstract class EntityLiving extends Entity { } } - if (!this.world.isStatic && this.al() && this.vehicle instanceof EntityLiving) { + if (!this.world.isStatic && this.am() && this.vehicle instanceof EntityLiving) { this.mount((Entity) null); } } else { @@ -198,7 +204,7 @@ public abstract class EntityLiving extends Entity { // CraftBukkit end } - if (this.isAlive() && this.K()) { + if (this.isAlive() && this.L()) { this.extinguish(); } @@ -216,7 +222,7 @@ public abstract class EntityLiving extends Entity { } if (this.getHealth() <= 0.0F) { - this.aE(); + this.aF(); } if (this.lastDamageByPlayerTime > 0) { @@ -237,7 +243,7 @@ public abstract class EntityLiving extends Entity { } } - this.aN(); + this.aO(); this.aY = this.aX; this.aN = this.aM; this.aP = this.aO; @@ -250,7 +256,7 @@ public abstract class EntityLiving extends Entity { public int getExpReward() { int exp = this.getExpValue(this.killer); - if (!this.world.isStatic && (this.lastDamageByPlayerTime > 0 || this.alwaysGivesExp()) && this.aF() && this.world.getGameRules().getBoolean("doMobLoot")) { + if (!this.world.isStatic && (this.lastDamageByPlayerTime > 0 || this.alwaysGivesExp()) && this.aG() && this.world.getGameRules().getBoolean("doMobLoot")) { return exp; } else { return 0; @@ -262,7 +268,7 @@ public abstract class EntityLiving extends Entity { return false; } - protected void aE() { + protected void aF() { ++this.deathTicks; if (this.deathTicks >= 20 && !this.dead) { // CraftBukkit - (this.deathTicks == 20) -> (this.deathTicks >= 20 && !this.dead) int i; @@ -290,7 +296,7 @@ public abstract class EntityLiving extends Entity { } } - protected boolean aF() { + protected boolean aG() { return !this.isBaby(); } @@ -308,7 +314,7 @@ public abstract class EntityLiving extends Entity { return false; } - public Random aH() { + public Random aI() { return this.random; } @@ -316,7 +322,7 @@ public abstract class EntityLiving extends Entity { return this.lastDamager; } - public int aJ() { + public int aK() { return this.bm; } @@ -325,11 +331,11 @@ public abstract class EntityLiving extends Entity { this.bm = this.ticksLived; } - public EntityLiving aK() { + public EntityLiving aL() { return this.bn; } - public int aL() { + public int aM() { return this.bo; } @@ -343,7 +349,7 @@ public abstract class EntityLiving extends Entity { this.bo = this.ticksLived; } - public int aM() { + public int aN() { return this.aU; } @@ -353,7 +359,7 @@ public abstract class EntityLiving extends Entity { nbttagcompound.setShort("HurtTime", (short) this.hurtTicks); nbttagcompound.setShort("DeathTime", (short) this.deathTicks); nbttagcompound.setShort("AttackTime", (short) this.attackTicks); - nbttagcompound.setFloat("AbsorptionAmount", this.br()); + nbttagcompound.setFloat("AbsorptionAmount", this.getAbsorptionHearts()); ItemStack[] aitemstack = this.getEquipment(); int i = aitemstack.length; @@ -367,7 +373,7 @@ public abstract class EntityLiving extends Entity { } } - nbttagcompound.set("Attributes", GenericAttributes.a(this.bb())); + nbttagcompound.set("Attributes", GenericAttributes.a(this.getAttributeMap())); aitemstack = this.getEquipment(); i = aitemstack.length; @@ -393,9 +399,9 @@ public abstract class EntityLiving extends Entity { } public void a(NBTTagCompound nbttagcompound) { - this.m(nbttagcompound.getFloat("AbsorptionAmount")); + this.setAbsorptionHearts(nbttagcompound.getFloat("AbsorptionAmount")); if (nbttagcompound.hasKeyOfType("Attributes", 9) && this.world != null && !this.world.isStatic) { - GenericAttributes.a(this.bb(), nbttagcompound.getList("Attributes", 10)); + GenericAttributes.a(this.getAttributeMap(), nbttagcompound.getList("Attributes", 10)); } if (nbttagcompound.hasKeyOfType("ActiveEffects", 9)) { @@ -415,9 +421,9 @@ public abstract class EntityLiving extends Entity { if (nbttagcompound.hasKey("Bukkit.MaxHealth")) { NBTBase nbtbase = nbttagcompound.get("Bukkit.MaxHealth"); if (nbtbase.getTypeId() == 5) { - this.getAttributeInstance(GenericAttributes.a).setValue((double) ((NBTTagFloat) nbtbase).c()); + this.getAttributeInstance(GenericAttributes.maxHealth).setValue((double) ((NBTTagFloat) nbtbase).c()); } else if (nbtbase.getTypeId() == 3) { - this.getAttributeInstance(GenericAttributes.a).setValue((double) ((NBTTagInt) nbtbase).d()); + this.getAttributeInstance(GenericAttributes.maxHealth).setValue((double) ((NBTTagInt) nbtbase).d()); } } // CraftBukkit end @@ -441,7 +447,7 @@ public abstract class EntityLiving extends Entity { this.attackTicks = nbttagcompound.getShort("AttackTime"); } - protected void aN() { + protected void aO() { Iterator iterator = this.effects.keySet().iterator(); while (iterator.hasNext()) { @@ -559,7 +565,7 @@ public abstract class EntityLiving extends Entity { return true; } - public boolean aQ() { + public boolean aR() { return this.getMonsterType() == EnumMonsterType.UNDEAD; } @@ -574,22 +580,22 @@ public abstract class EntityLiving extends Entity { protected void a(MobEffect mobeffect) { this.updateEffects = true; if (!this.world.isStatic) { - MobEffectList.byId[mobeffect.getEffectId()].b(this, this.bb(), mobeffect.getAmplifier()); + MobEffectList.byId[mobeffect.getEffectId()].b(this, this.getAttributeMap(), mobeffect.getAmplifier()); } } protected void a(MobEffect mobeffect, boolean flag) { this.updateEffects = true; if (flag && !this.world.isStatic) { - MobEffectList.byId[mobeffect.getEffectId()].a(this, this.bb(), mobeffect.getAmplifier()); - MobEffectList.byId[mobeffect.getEffectId()].b(this, this.bb(), mobeffect.getAmplifier()); + MobEffectList.byId[mobeffect.getEffectId()].a(this, this.getAttributeMap(), mobeffect.getAmplifier()); + MobEffectList.byId[mobeffect.getEffectId()].b(this, this.getAttributeMap(), mobeffect.getAmplifier()); } } protected void b(MobEffect mobeffect) { this.updateEffects = true; if (!this.world.isStatic) { - MobEffectList.byId[mobeffect.getEffectId()].a(this, this.bb(), mobeffect.getAmplifier()); + MobEffectList.byId[mobeffect.getEffectId()].a(this, this.getAttributeMap(), mobeffect.getAmplifier()); } } @@ -623,7 +629,7 @@ public abstract class EntityLiving extends Entity { public void setHealth(float f) { // CraftBukkit start - Handle scaled health if (this instanceof EntityPlayer) { - org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer player = ((EntityPlayer) this).getBukkitEntity(); + org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer player = ((EntityPlayer) this).getBukkitEntity(); // Squeeze if (f < 0.0F) { player.setRealHealth(0.0D); @@ -652,7 +658,8 @@ public abstract class EntityLiving extends Entity { } else if (damagesource.o() && this.hasEffect(MobEffectList.FIRE_RESISTANCE)) { return false; } else { - if ((damagesource == DamageSource.ANVIL || damagesource == DamageSource.FALLING_BLOCK) && this.getEquipment(4) != null) { + // CraftBukkit - Moved into d(DamageSource, float) + if (false && (damagesource == DamageSource.ANVIL || damagesource == DamageSource.FALLING_BLOCK) && this.getEquipment(4) != null) { this.getEquipment(4).damage((int) (f * 4.0F + this.random.nextFloat() * f * 2.0F), this); f *= 0.75F; } @@ -660,29 +667,28 @@ public abstract class EntityLiving extends Entity { this.aF = 1.5F; boolean flag = true; - // CraftBukkit start - EntityDamageEvent event = CraftEventFactory.handleEntityDamageEvent(this, damagesource, f); - if (event != null) { - if (event.isCancelled()) { - return false; - } - f = (float) event.getDamage(); - } - // CraftBukkit end - if ((float) this.noDamageTicks > (float) this.maxNoDamageTicks / 2.0F) { if (f <= this.lastDamage) { return false; } - this.d(damagesource, f - this.lastDamage); + // CraftBukkit start + if (!this.d(damagesource, f - this.lastDamage)) { + return false; + } + // CraftBukkit end this.lastDamage = f; flag = false; } else { + // CraftBukkit start + float previousHealth = this.getHealth(); + if (!this.d(damagesource, f)) { + return false; + } this.lastDamage = f; - this.aw = this.getHealth(); + this.aw = previousHealth; this.noDamageTicks = this.maxNoDamageTicks; - this.d(damagesource, f); + // CraftBukkit end this.hurtTicks = this.ay = 10; } @@ -710,7 +716,7 @@ public abstract class EntityLiving extends Entity { if (flag) { this.world.broadcastEntityEffect(this, (byte) 2); if (damagesource != DamageSource.DROWN) { - this.P(); + this.Q(); } if (entity != null) { @@ -732,16 +738,16 @@ public abstract class EntityLiving extends Entity { String s; if (this.getHealth() <= 0.0F) { - s = this.aT(); + s = this.aU(); if (flag && s != null) { - this.makeSound(s, this.be(), this.bf()); + this.makeSound(s, this.bf(), this.bg()); } this.die(damagesource); } else { - s = this.aS(); + s = this.aT(); if (flag && s != null) { - this.makeSound(s, this.be(), this.bf()); + this.makeSound(s, this.bf(), this.bg()); } } @@ -763,13 +769,13 @@ public abstract class EntityLiving extends Entity { vec3d1.a(-this.pitch * 3.1415927F / 180.0F); vec3d1.b(-this.yaw * 3.1415927F / 180.0F); vec3d1 = vec3d1.add(this.locX, this.locY + (double) this.getHeadHeight(), this.locZ); - this.world.addParticle("iconcrack_" + Item.b(itemstack.getItem()), vec3d1.a, vec3d1.b, vec3d1.c, vec3d.a, vec3d.b + 0.05D, vec3d.c); + this.world.addParticle("iconcrack_" + Item.getId(itemstack.getItem()), vec3d1.a, vec3d1.b, vec3d1.c, vec3d.a, vec3d.b + 0.05D, vec3d.c); } } public void die(DamageSource damagesource) { Entity entity = damagesource.getEntity(); - EntityLiving entityliving = this.aW(); + EntityLiving entityliving = this.aX(); if (this.ba >= 0 && entityliving != null) { entityliving.b(this, this.ba); @@ -780,7 +786,7 @@ public abstract class EntityLiving extends Entity { } this.aT = true; - this.aV().g(); + this.aW().g(); if (!this.world.isStatic) { int i = 0; @@ -788,18 +794,25 @@ public abstract class EntityLiving extends Entity { i = EnchantmentManager.getBonusMonsterLootEnchantmentLevel((EntityLiving) entity); } - if (this.aF() && this.world.getGameRules().getBoolean("doMobLoot")) { + if (this.aG() && this.world.getGameRules().getBoolean("doMobLoot")) { + this.drops = new ArrayList(); // CraftBukkit - Setup drop capture + this.dropDeathLoot(this.lastDamageByPlayerTime > 0, i); this.dropEquipment(this.lastDamageByPlayerTime > 0, i); - if (false && this.lastDamageByPlayerTime > 0) { // CraftBukkit - move rare item drop call to dropDeathLoot + if (this.lastDamageByPlayerTime > 0) { int j = this.random.nextInt(200) - i; if (j < 5) { this.getRareDrop(j <= 0 ? 1 : 0); } } - } else { // CraftBukkit - CraftEventFactory.callEntityDeathEvent(this); // CraftBukkit + + // CraftBukkit start - Call death event + CraftEventFactory.callEntityDeathEvent(this, this.drops); + this.drops = null; + } else { + CraftEventFactory.callEntityDeathEvent(this); + // CraftBukkit end } } @@ -826,19 +839,15 @@ public abstract class EntityLiving extends Entity { } } - protected String aS() { + protected String aT() { return "game.neutral.hurt"; } - protected String aT() { + protected String aU() { return "game.neutral.die"; } - // CraftBukkit start - Change return type to ItemStack - protected ItemStack getRareDrop(int i) { - return null; - } - // CraftBukkit end + protected void getRareDrop(int i) {} protected void dropDeathLoot(boolean flag, int i) {} @@ -859,25 +868,16 @@ public abstract class EntityLiving extends Entity { super.b(f); MobEffect mobeffect = this.getEffect(MobEffectList.JUMP); float f1 = mobeffect != null ? (float) (mobeffect.getAmplifier() + 1) : 0.0F; - // CraftBukkit start - float i = MathHelper.f(f - 3.0F - f1); + int i = MathHelper.f(f - 3.0F - f1); if (i > 0) { - EntityDamageEvent event = CraftEventFactory.callEntityDamageEvent(null, this, EntityDamageEvent.DamageCause.FALL, i); - if (event.isCancelled()) { + // CraftBukkit start + if (!this.damageEntity(DamageSource.FALL, (float) i)) { return; } - - i = (float) event.getDamage(); - if (i > 0) { - this.getBukkitEntity().setLastDamageCause(event); - } - } - // CraftBukkit end - - if (i > 0) { - this.makeSound(this.o(org.bukkit.util.NumberConversions.ceil(i)), 1.0F, 1.0F); // CraftBukkit - ceil - this.damageEntity(DamageSource.FALL, (float) i); + // CraftBukkit end + this.makeSound(this.o(i), 1.0F, 1.0F); + // this.damageEntity(DamageSource.FALL, (float) i); // CraftBukkit - moved up int j = MathHelper.floor(this.locX); int k = MathHelper.floor(this.locY - 0.20000000298023224D - (double) this.height); int l = MathHelper.floor(this.locZ); @@ -895,7 +895,7 @@ public abstract class EntityLiving extends Entity { return i > 4 ? "game.neutral.hurt.fall.big" : "game.neutral.hurt.fall.small"; } - public int aU() { + public int aV() { int i = 0; ItemStack[] aitemstack = this.getEquipment(); int j = aitemstack.length; @@ -913,22 +913,22 @@ public abstract class EntityLiving extends Entity { return i; } - protected void h(float f) {} + protected void damageArmor(float f) {} - protected float b(DamageSource damagesource, float f) { + protected float applyArmorModifier(DamageSource damagesource, float f) { if (!damagesource.ignoresArmor()) { - int i = 25 - this.aU(); + int i = 25 - this.aV(); float f1 = f * (float) i; - this.h(f); + // this.damageArmor(f); // CraftBukkit - Moved into d(DamageSource, float) f = f1 / 25.0F; } return f; } - protected float c(DamageSource damagesource, float f) { - if (damagesource.h()) { + protected float applyMagicModifier(DamageSource damagesource, float f) { + if (damagesource.isStarvation()) { return f; } else { if (this instanceof EntityZombie) { @@ -939,7 +939,8 @@ public abstract class EntityLiving extends Entity { int j; float f1; - if (this.hasEffect(MobEffectList.RESISTANCE) && damagesource != DamageSource.OUT_OF_WORLD) { + // CraftBukkit - Moved to d(DamageSource, float) + if (false && this.hasEffect(MobEffectList.RESISTANCE) && damagesource != DamageSource.OUT_OF_WORLD) { i = (this.getEffect(MobEffectList.RESISTANCE).getAmplifier() + 1) * 5; j = 25 - i; f1 = f * (float) j; @@ -965,37 +966,132 @@ public abstract class EntityLiving extends Entity { } } - protected void d(DamageSource damagesource, float f) { + // CraftBukkit start + protected boolean d(final DamageSource damagesource, float f) { // void -> boolean, add final if (!this.isInvulnerable()) { - f = this.b(damagesource, f); - f = this.c(damagesource, f); - float f1 = f; + final boolean human = this instanceof EntityHuman; + float originalDamage = f; + Function hardHat = new Function() { + @Override + public Double apply(Double f) { + if ((damagesource == DamageSource.ANVIL || damagesource == DamageSource.FALLING_BLOCK) && EntityLiving.this.getEquipment(4) != null) { + return -(f - (f * 0.75F)); + } + return -0.0; + } + }; + float hardHatModifier = hardHat.apply((double) f).floatValue(); + f += hardHatModifier; - f = Math.max(f - this.br(), 0.0F); - this.m(this.br() - (f1 - f)); + Function blocking = new Function() { + @Override + public Double apply(Double f) { + if (human) { + if (!damagesource.ignoresArmor() && ((EntityHuman) EntityLiving.this).isBlocking() && f > 0.0F) { + return -(f - ((1.0F + f) * 0.5F)); + } + } + return -0.0; + } + }; + float blockingModifier = blocking.apply((double) f).floatValue(); + f += blockingModifier; + + Function armor = new Function() { + @Override + public Double apply(Double f) { + return -(f - EntityLiving.this.applyArmorModifier(damagesource, f.floatValue())); + } + }; + float armorModifier = armor.apply((double) f).floatValue(); + f += armorModifier; + + Function resistance = new Function() { + @Override + public Double apply(Double f) { + if (!damagesource.isStarvation() && EntityLiving.this.hasEffect(MobEffectList.RESISTANCE) && damagesource != DamageSource.OUT_OF_WORLD) { + int i = (EntityLiving.this.getEffect(MobEffectList.RESISTANCE).getAmplifier() + 1) * 5; + int j = 25 - i; + float f1 = f.floatValue() * (float) j; + return -(f - (f1 / 25.0F)); + } + return -0.0; + } + }; + float resistanceModifier = resistance.apply((double) f).floatValue(); + f += resistanceModifier; + + Function magic = new Function() { + @Override + public Double apply(Double f) { + return -(f - EntityLiving.this.applyMagicModifier(damagesource, f.floatValue())); + } + }; + float magicModifier = magic.apply((double) f).floatValue(); + f += magicModifier; + + Function absorption = new Function() { + @Override + public Double apply(Double f) { + return -(Math.max(f - Math.max(f - EntityLiving.this.getAbsorptionHearts(), 0.0F), 0.0F)); + } + }; + float absorptionModifier = absorption.apply((double) f).floatValue(); + + EntityDamageEvent event = CraftEventFactory.handleLivingEntityDamageEvent(this, damagesource, originalDamage, hardHatModifier, blockingModifier, armorModifier, resistanceModifier, magicModifier, absorptionModifier, hardHat, blocking, armor, resistance, magic, absorption); + if (event.isCancelled()) { + return false; + } + + f = (float) event.getFinalDamage(); + + // Apply damage to helmet + if ((damagesource == DamageSource.ANVIL || damagesource == DamageSource.FALLING_BLOCK) && this.getEquipment(4) != null) { + this.getEquipment(4).damage((int) (event.getDamage() * 4.0F + this.random.nextFloat() * event.getDamage() * 2.0F), this); + } + + // Apply damage to armor + if (!damagesource.ignoresArmor()) { + float armorDamage = (float) (event.getDamage() + event.getDamage(DamageModifier.BLOCKING) + event.getDamage(DamageModifier.HARD_HAT)); + this.damageArmor(armorDamage); + } + + absorptionModifier = (float) -event.getDamage(DamageModifier.ABSORPTION); + this.setAbsorptionHearts(Math.max(this.getAbsorptionHearts() - absorptionModifier, 0.0F)); if (f != 0.0F) { + if (human) { + ((EntityHuman) this).applyExhaustion(damagesource.getExhaustionCost()); + } + // CraftBukkit end float f2 = this.getHealth(); this.setHealth(f2 - f); - this.aV().a(damagesource, f2, f); - this.m(this.br() - f); + this.aW().a(damagesource, f2, f); + // CraftBukkit start + if (human) { + return true; + } + // CraftBukkit end + this.setAbsorptionHearts(this.getAbsorptionHearts() - f); } + return true; // CraftBukkit } + return false; // CraftBukkit } - public CombatTracker aV() { + public CombatTracker aW() { return this.combatTracker; } - public EntityLiving aW() { + public EntityLiving aX() { return (EntityLiving) (this.combatTracker.c() != null ? this.combatTracker.c() : (this.killer != null ? this.killer : (this.lastDamager != null ? this.lastDamager : null))); } public final float getMaxHealth() { - return (float) this.getAttributeInstance(GenericAttributes.a).getValue(); + return (float) this.getAttributeInstance(GenericAttributes.maxHealth).getValue(); } - public final int aY() { + public final int aZ() { return this.datawatcher.getByte(9); } @@ -1007,7 +1103,7 @@ public abstract class EntityLiving extends Entity { return this.hasEffect(MobEffectList.FASTER_DIG) ? 6 - (1 + this.getEffect(MobEffectList.FASTER_DIG).getAmplifier()) * 1 : (this.hasEffect(MobEffectList.SLOWER_DIG) ? 6 + (1 + this.getEffect(MobEffectList.SLOWER_DIG).getAmplifier()) * 2 : 6); } - public void aZ() { + public void ba() { if (!this.at || this.au >= this.j() / 2 || this.au < 0) { this.au = -1; this.at = true; @@ -1017,11 +1113,11 @@ public abstract class EntityLiving extends Entity { } } - protected void F() { + protected void G() { this.damageEntity(DamageSource.OUT_OF_WORLD, 4.0F); } - protected void ba() { + protected void bb() { int i = this.j(); if (this.at) { @@ -1038,10 +1134,10 @@ public abstract class EntityLiving extends Entity { } public AttributeInstance getAttributeInstance(IAttribute iattribute) { - return this.bb().a(iattribute); + return this.getAttributeMap().a(iattribute); } - public AttributeMapBase bb() { + public AttributeMapBase getAttributeMap() { if (this.d == null) { this.d = new AttributeMapServer(); } @@ -1053,7 +1149,7 @@ public abstract class EntityLiving extends Entity { return EnumMonsterType.UNDEFINED; } - public abstract ItemStack bd(); + public abstract ItemStack be(); public abstract ItemStack getEquipment(int i); @@ -1074,15 +1170,15 @@ public abstract class EntityLiving extends Entity { public abstract ItemStack[] getEquipment(); - protected float be() { + protected float bf() { return 1.0F; } - protected float bf() { + protected float bg() { return this.isBaby() ? (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.5F : (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F; } - protected boolean bg() { + protected boolean bh() { return this.getHealth() <= 0.0F; } @@ -1122,7 +1218,7 @@ public abstract class EntityLiving extends Entity { this.enderTeleportTo(d0, d1, d2); } - protected void bi() { + protected void bj() { this.motY = 0.41999998688697815D; if (this.hasEffect(MobEffectList.JUMP)) { this.motY += (double) ((float) (this.getEffect(MobEffectList.JUMP).getAmplifier() + 1) * 0.1F); @@ -1141,9 +1237,9 @@ public abstract class EntityLiving extends Entity { public void e(float f, float f1) { double d0; - if (this.L() && (!(this instanceof EntityHuman) || !((EntityHuman) this).abilities.isFlying)) { + if (this.M() && (!(this instanceof EntityHuman) || !((EntityHuman) this).abilities.isFlying)) { d0 = this.locY; - this.a(f, f1, this.bj() ? 0.04F : 0.02F); + this.a(f, f1, this.bk() ? 0.04F : 0.02F); this.move(this.motX, this.motY, this.motZ); this.motX *= 0.800000011920929D; this.motY *= 0.800000011920929D; @@ -1152,7 +1248,7 @@ public abstract class EntityLiving extends Entity { if (this.positionChanged && this.c(this.motX, this.motY + 0.6000000238418579D - this.locY + d0, this.motZ)) { this.motY = 0.30000001192092896D; } - } else if (this.O() && (!(this instanceof EntityHuman) || !((EntityHuman) this).abilities.isFlying)) { + } else if (this.P() && (!(this instanceof EntityHuman) || !((EntityHuman) this).abilities.isFlying)) { d0 = this.locY; this.a(f, f1, 0.02F); this.move(this.motX, this.motY, this.motZ); @@ -1174,7 +1270,7 @@ public abstract class EntityLiving extends Entity { float f4; if (this.onGround) { - f4 = this.bk() * f3; + f4 = this.bl() * f3; } else { f4 = this.aQ; } @@ -1249,12 +1345,12 @@ public abstract class EntityLiving extends Entity { this.aG += this.aF; } - protected boolean bj() { + protected boolean bk() { return false; } - public float bk() { - return this.bj() ? this.bp : 0.1F; + public float bl() { + return this.bk() ? this.bp : 0.1F; } public void i(float f) { @@ -1271,9 +1367,10 @@ public abstract class EntityLiving extends Entity { } public void h() { + SpigotTimings.timerEntityBaseTick.startTiming(); // Spigot super.h(); if (!this.world.isStatic) { - int i = this.aY(); + int i = this.aZ(); if (i > 0) { if (this.av <= 0) { @@ -1305,11 +1402,13 @@ public abstract class EntityLiving extends Entity { } if (this.ticksLived % 20 == 0) { - this.aV().g(); + this.aW().g(); } } + SpigotTimings.timerEntityBaseTick.stopTiming(); // Spigot this.e(); + SpigotTimings.timerEntityTickRest.startTiming(); // Spigot double d0 = this.locX - this.lastX; double d1 = this.locZ - this.lastZ; float f = (float) (d0 * d0 + d1 * d1); @@ -1323,7 +1422,7 @@ public abstract class EntityLiving extends Entity { f3 = 1.0F; f2 = (float) Math.sqrt((double) f) * 3.0F; // CraftBukkit - Math -> TrigMath - f1 = (float) org.bukkit.craftbukkit.v1_7_R3.TrigMath.atan2(d1, d0) * 180.0F / 3.1415927F - 90.0F; + f1 = (float) org.bukkit.craftbukkit.v1_7_R4.TrigMath.atan2(d1, d0) * 180.0F / 3.1415927F - 90.0F; } if (this.aD > 0.0F) { @@ -1374,6 +1473,7 @@ public abstract class EntityLiving extends Entity { this.world.methodProfiler.b(); this.aX += f2; + SpigotTimings.timerEntityTickRest.stopTiming(); // Spigot } protected float f(float f, float f1) { @@ -1419,7 +1519,7 @@ public abstract class EntityLiving extends Entity { --this.bg; this.setPosition(d0, d1, d2); this.b(this.yaw, this.pitch); - } else if (!this.bq()) { + } else if (!this.br()) { this.motX *= 0.98D; this.motY *= 0.98D; this.motZ *= 0.98D; @@ -1438,30 +1538,32 @@ public abstract class EntityLiving extends Entity { } this.world.methodProfiler.a("ai"); - if (this.bg()) { + SpigotTimings.timerEntityAI.startTiming(); // Spigot + if (this.bh()) { this.bc = false; this.bd = 0.0F; this.be = 0.0F; this.bf = 0.0F; - } else if (this.bq()) { - if (this.bj()) { + } else if (this.br()) { + if (this.bk()) { this.world.methodProfiler.a("newAi"); - this.bm(); + this.bn(); this.world.methodProfiler.b(); } else { this.world.methodProfiler.a("oldAi"); - this.bp(); + this.bq(); this.world.methodProfiler.b(); this.aO = this.yaw; } } + SpigotTimings.timerEntityAI.stopTiming(); // Spigot this.world.methodProfiler.b(); this.world.methodProfiler.a("jump"); if (this.bc) { - if (!this.L() && !this.O()) { + if (!this.M() && !this.P()) { if (this.onGround && this.bq == 0) { - this.bi(); + this.bj(); this.bq = 10; } } else { @@ -1476,19 +1578,23 @@ public abstract class EntityLiving extends Entity { this.bd *= 0.98F; this.be *= 0.98F; this.bf *= 0.9F; + SpigotTimings.timerEntityAIMove.startTiming(); // Spigot this.e(this.bd, this.be); + SpigotTimings.timerEntityAIMove.stopTiming(); // Spigot this.world.methodProfiler.b(); this.world.methodProfiler.a("push"); if (!this.world.isStatic) { - this.bn(); + SpigotTimings.timerEntityAICollision.startTiming(); // Spigot + this.bo(); + SpigotTimings.timerEntityAICollision.stopTiming(); // Spigot } this.world.methodProfiler.b(); } - protected void bm() {} + protected void bn() {} - protected void bn() { + protected void bo() { List list = this.world.getEntities(this, this.boundingBox.grow(0.20000000298023224D, 0.0D, 0.20000000298023224D)); if (this.R() && list != null && !list.isEmpty()) { // Spigot: Add this.R() condition @@ -1504,7 +1610,7 @@ public abstract class EntityLiving extends Entity { } // CraftBukkit end - if (entity.R()) { + if (entity.S()) { entity.numCollisions++; // Spigot numCollisions++; // Spigot this.o(entity); @@ -1518,16 +1624,16 @@ public abstract class EntityLiving extends Entity { entity.collide(this); } - public void aa() { - super.aa(); + public void ab() { + super.ab(); this.aV = this.aW; this.aW = 0.0F; this.fallDistance = 0.0F; } - protected void bo() {} + protected void bp() {} - protected void bp() { + protected void bq() { ++this.aU; } @@ -1553,11 +1659,11 @@ public abstract class EntityLiving extends Entity { } } - public boolean p(Entity entity) { + public boolean hasLineOfSight(Entity entity) { return this.world.a(Vec3D.a(this.locX, this.locY + (double) this.getHeadHeight(), this.locZ), Vec3D.a(entity.locX, entity.locY + (double) entity.getHeadHeight(), entity.locZ)) == null; } - public Vec3D af() { + public Vec3D ag() { return this.j(1.0F); } @@ -1585,15 +1691,15 @@ public abstract class EntityLiving extends Entity { } } - public boolean bq() { + public boolean br() { return !this.world.isStatic; } - public boolean Q() { + public boolean R() { return !this.dead; } - public boolean R() { + public boolean S() { return !ghost && !this.dead; } @@ -1601,7 +1707,7 @@ public abstract class EntityLiving extends Entity { return this.length * 0.85F; } - protected void P() { + protected void Q() { this.velocityChanged = this.random.nextDouble() >= this.getAttributeInstance(GenericAttributes.c).getValue(); } @@ -1609,11 +1715,11 @@ public abstract class EntityLiving extends Entity { return this.aO; } - public float br() { + public float getAbsorptionHearts() { return this.br; } - public void m(float f) { + public void setAbsorptionHearts(float f) { if (f < 0.0F) { f = 0.0F; } @@ -1633,7 +1739,7 @@ public abstract class EntityLiving extends Entity { return this.getScoreboardTeam() != null ? this.getScoreboardTeam().isAlly(scoreboardteambase) : false; } - public void bt() {} - public void bu() {} -} \ No newline at end of file + + public void bv() {} +} diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityPlayer.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityPlayer.java similarity index 94% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityPlayer.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityPlayer.java index 104c2cb22..229244235 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityPlayer.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityPlayer.java @@ -1,4 +1,4 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; import java.io.IOException; import java.util.ArrayList; @@ -19,10 +19,10 @@ import org.apache.logging.log4j.Logger; // CraftBukkit start import org.bukkit.Bukkit; import org.bukkit.WeatherType; -import org.bukkit.craftbukkit.v1_7_R3.CraftWorld; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; -import org.bukkit.craftbukkit.v1_7_R3.event.CraftEventFactory; -import org.bukkit.craftbukkit.v1_7_R3.inventory.CraftItemStack; +import org.bukkit.craftbukkit.v1_7_R4.CraftWorld; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.event.CraftEventFactory; +import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftItemStack; import org.bukkit.event.inventory.InventoryType; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; // CraftBukkit end @@ -30,7 +30,7 @@ import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; public class EntityPlayer extends EntityHuman implements ICrafting { private static final Logger bL = LogManager.getLogger(); - public String locale = "en_US"; + public String locale = "en_US"; // Spigot public PlayerConnection playerConnection; public final MinecraftServer server; public final PlayerInteractManager playerInteractManager; @@ -47,7 +47,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public int invulnerableTicks = 60; // CraftBukkit - private -> public private EnumChatVisibility bV; private boolean bW = true; - private long bX = 0L; + private long bX = System.currentTimeMillis(); private int containerCounter; public boolean g; public int ping; @@ -67,23 +67,21 @@ public class EntityPlayer extends EntityHuman implements ICrafting { // Spigot start public boolean collidesWithEntities = true; - /* - @Override - public boolean Q() - { - return this.collidesWithEntities && super.Q(); - } - */ - @Override public boolean R() { - return this.collidesWithEntities && super.R(); + return !spectating && this.collidesWithEntities && super.R(); // (first !this.isDead near bottom of EntityLiving) + } + + @Override + public boolean S() + { + return this.collidesWithEntities && super.S(); // (second !this.isDead near bottom of EntityLiving) } // Spigot end public boolean spectating; // Mineplex - + public EntityPlayer(MinecraftServer minecraftserver, WorldServer worldserver, GameProfile gameprofile, PlayerInteractManager playerinteractmanager) { super(worldserver, gameprofile); playerinteractmanager.player = this; @@ -125,7 +123,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { if (MinecraftServer.getServer().getForceGamemode()) { this.playerInteractManager.setGameMode(MinecraftServer.getServer().getGamemode()); } else { - this.playerInteractManager.setGameMode(EnumGamemode.a(nbttagcompound.getInt("playerGameType"))); + this.playerInteractManager.setGameMode(EnumGamemode.getById(nbttagcompound.getInt("playerGameType"))); } } this.getBukkitEntity().readExtraData(nbttagcompound); // CraftBukkit @@ -133,7 +131,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public void b(NBTTagCompound nbttagcompound) { super.b(nbttagcompound); - nbttagcompound.setInt("playerGameType", this.playerInteractManager.getGameMode().a()); + nbttagcompound.setInt("playerGameType", this.playerInteractManager.getGameMode().getId()); this.getBukkitEntity().setExtraData(nbttagcompound); // CraftBukkit } @@ -225,7 +223,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { if (chunkcoordintpair != null) { if (this.world.isLoaded(chunkcoordintpair.x << 4, 0, chunkcoordintpair.z << 4)) { chunk = this.world.getChunkAt(chunkcoordintpair.x, chunkcoordintpair.z); - if (chunk.k()) { + if (chunk.isReady()) { arraylist.add(chunk); arraylist1.addAll(chunk.tileEntities.values()); // CraftBukkit - Get tile entities directly from the chunk instead of the world iterator1.remove(); @@ -254,10 +252,6 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } } } - - if (this.bX > 0L && this.server.getIdleTimeout() > 0 && MinecraftServer.ar() - this.bX > (long) (this.server.getIdleTimeout() * 1000 * 60)) { - this.playerConnection.disconnect("You have been idle for too long!"); - } } public void i() { @@ -277,15 +271,15 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } // CraftBukkit - Optionally scale health - if (this.getHealth() != this.bQ || this.bR != this.foodData.a() || this.foodData.e() == 0.0F != this.bS) { - this.playerConnection.sendPacket(new PacketPlayOutUpdateHealth(this.getBukkitEntity().getScaledHealth(), this.foodData.a(), this.foodData.e())); + if (this.getHealth() != this.bQ || this.bR != this.foodData.getFoodLevel() || this.foodData.getSaturationLevel() == 0.0F != this.bS) { + this.playerConnection.sendPacket(new PacketPlayOutUpdateHealth(this.getBukkitEntity().getScaledHealth(), this.foodData.getFoodLevel(), this.foodData.getSaturationLevel())); this.bQ = this.getHealth(); - this.bR = this.foodData.a(); - this.bS = this.foodData.e() == 0.0F; + this.bR = this.foodData.getFoodLevel(); + this.bS = this.foodData.getSaturationLevel() == 0.0F; } - if (this.getHealth() + this.br() != this.bP) { - this.bP = this.getHealth() + this.br(); + if (this.getHealth() + this.getAbsorptionHearts() != this.bP) { + this.bP = this.getHealth() + this.getAbsorptionHearts(); // CraftBukkit - Update ALL the scores! this.world.getServer().getScoreboardManager().updateAllScoresForList(IScoreboardCriteria.f, this.getName(), com.google.common.collect.ImmutableList.of(this)); } @@ -301,7 +295,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.playerConnection.sendPacket(new PacketPlayOutExperience(this.exp, this.expTotal, this.expLevel)); } - if (this.ticksLived % 20 * 5 == 0 && !this.getStatisticManager().a(AchievementList.L)) { + if (this.ticksLived % 20 * 5 == 0 && !this.getStatisticManager().hasAchievement(AchievementList.L)) { this.j(); } @@ -387,7 +381,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } } - IChatBaseComponent chatmessage = this.aV().b(); + IChatBaseComponent chatmessage = this.aW().b(); String deathmessage = chatmessage.c(); org.bukkit.event.entity.PlayerDeathEvent event = CraftEventFactory.callPlayerDeathEvent(this, loot, deathmessage); @@ -398,7 +392,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { if (deathMessage.equals(deathmessage)) { this.server.getPlayerList().sendMessage(chatmessage); } else { - this.server.getPlayerList().sendMessage(org.bukkit.craftbukkit.v1_7_R3.util.CraftChatMessage.fromString(deathMessage)); + this.server.getPlayerList().sendMessage(org.bukkit.craftbukkit.v1_7_R4.util.CraftChatMessage.fromString(deathMessage)); } } @@ -426,7 +420,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { scoreboardscore.incrementScore(); } - EntityLiving entityliving = this.aW(); + EntityLiving entityliving = this.aX(); if (entityliving != null) { int i = EntityTypes.a(entityliving); @@ -440,7 +434,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } this.a(StatisticList.v, 1); - this.aV().g(); + this.aW().g(); } public boolean damageEntity(DamageSource damagesource, float f) { @@ -505,10 +499,6 @@ public class EntityPlayer extends EntityHuman implements ICrafting { // CraftBukkit start TeleportCause cause = (this.dimension == 1 || i == 1) ? TeleportCause.END_PORTAL : TeleportCause.NETHER_PORTAL; - - if (dimension == -1 && i == 0) - i = 4; - this.server.getPlayerList().changeDimension(this, i, cause); // CraftBukkit end this.lastSentExp = -1; @@ -526,12 +516,6 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } } } - - @Override - public boolean Q() - { - return !spectating; - } public void receive(Entity entity, int i) { super.receive(entity, i); @@ -606,7 +590,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public void startCrafting(int i, int j, int k) { // CraftBukkit start - Inventory open hook Container container = CraftEventFactory.callInventoryOpenEvent(this, new ContainerWorkbench(this.inventory, this.world, i, j, k)); - if(container == null) return; + if (container == null) { + return; + } // CraftBukkit end this.nextContainerCounter(); @@ -619,7 +605,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public void startEnchanting(int i, int j, int k, String s) { // CraftBukkit start - Inventory open hook Container container = CraftEventFactory.callInventoryOpenEvent(this, new ContainerEnchantTable(this.inventory, this.world, i, j, k)); - if(container == null) return; + if (container == null) { + return; + } // CraftBukkit end this.nextContainerCounter(); @@ -632,7 +620,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public void openAnvil(int i, int j, int k) { // CraftBukkit start - Inventory open hook Container container = CraftEventFactory.callInventoryOpenEvent(this, new ContainerAnvil(this.inventory, this.world, i, j, k, this)); - if(container == null) return; + if (container == null) { + return; + } // CraftBukkit end this.nextContainerCounter(); @@ -650,7 +640,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { // CraftBukkit start - Inventory open hook Container container = CraftEventFactory.callInventoryOpenEvent(this, new ContainerChest(this.inventory, iinventory)); if (container == null) { - iinventory.l_(); // Should be closeContainer + iinventory.closeContainer(); return; } // CraftBukkit end @@ -666,7 +656,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { // CraftBukkit start - Inventory open hook Container container = CraftEventFactory.callInventoryOpenEvent(this, new ContainerHopper(this.inventory, tileentityhopper)); if (container == null) { - tileentityhopper.l_(); // Should be closeContainer + tileentityhopper.closeContainer(); return; } // CraftBukkit end @@ -682,7 +672,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { // CraftBukkit start - Inventory open hook Container container = CraftEventFactory.callInventoryOpenEvent(this, new ContainerHopper(this.inventory, entityminecarthopper)); if (container == null) { - entityminecarthopper.l_(); // Should be closeContainer + entityminecarthopper.closeContainer(); return; } // CraftBukkit end @@ -698,7 +688,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { // CraftBukkit start - Inventory open hook Container container = CraftEventFactory.callInventoryOpenEvent(this, new ContainerFurnace(this.inventory, tileentityfurnace)); if (container == null) { - tileentityfurnace.l_(); // Should be closeContainer + tileentityfurnace.closeContainer(); return; } // CraftBukkit end @@ -714,7 +704,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { // CraftBukkit start - Inventory open hook Container container = CraftEventFactory.callInventoryOpenEvent(this, new ContainerDispenser(this.inventory, tileentitydispenser)); if (container == null) { - tileentitydispenser.l_(); // Should be closeContainer + tileentitydispenser.closeContainer(); return; } // CraftBukkit end @@ -730,7 +720,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { // CraftBukkit start - Inventory open hook Container container = CraftEventFactory.callInventoryOpenEvent(this, new ContainerBrewingStand(this.inventory, tileentitybrewingstand)); if (container == null) { - tileentitybrewingstand.l_(); // Should be closeContainer + tileentitybrewingstand.closeContainer(); return; } // CraftBukkit end @@ -746,7 +736,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { // CraftBukkit start - Inventory open hook Container container = CraftEventFactory.callInventoryOpenEvent(this, new ContainerBeacon(this.inventory, tileentitybeacon)); if (container == null) { - tileentitybeacon.l_(); // Should be closeContainer + tileentitybeacon.closeContainer(); return; } // CraftBukkit end @@ -761,7 +751,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public void openTrade(IMerchant imerchant, String s) { // CraftBukkit start - Inventory open hook Container container = CraftEventFactory.callInventoryOpenEvent(this, new ContainerMerchant(this.inventory, imerchant, this.world)); - if(container == null) return; + if (container == null) { + return; + } // CraftBukkit end this.nextContainerCounter(); @@ -792,7 +784,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { // CraftBukkit start - Inventory open hook Container container = CraftEventFactory.callInventoryOpenEvent(this, new ContainerHorse(this.inventory, iinventory, entityhorse)); if (container == null) { - iinventory.l_(); // Should be closeContainer + iinventory.closeContainer(); return; } // CraftBukkit end @@ -831,7 +823,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } public void setContainerData(Container container, int i, int j) { - this.playerConnection.sendPacket(new PacketPlayOutCraftProgressBar(container.windowId, i, j)); + this.playerConnection.sendPacket(new PacketPlayOutWindowData(container.windowId, i, j)); } public void closeInventory() { @@ -961,7 +953,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public void a(EnumGamemode enumgamemode) { this.playerInteractManager.setGameMode(enumgamemode); - this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(3, (float) enumgamemode.a())); + this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(3, (float) enumgamemode.getId())); } // CraftBukkit start - Support multi-line messages @@ -1044,6 +1036,11 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.removeQueue.add(Integer.valueOf(entity.getId())); } } + + public long x() { + return this.bX; + } + // CraftBukkit start - Add per-player time and weather. public long timeOffset = 0; public boolean relativeTime = true; @@ -1130,4 +1127,4 @@ public class EntityPlayer extends EntityHuman implements ICrafting { return (CraftPlayer) super.getBukkitEntity(); } // CraftBukkit end -} \ No newline at end of file +} diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntitySlime.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntitySlime.java similarity index 91% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntitySlime.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntitySlime.java index 27fa87e0d..a14749ab9 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntitySlime.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntitySlime.java @@ -1,8 +1,8 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; // CraftBukkit start -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_7_R3.event.CraftEventFactory; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_7_R4.event.CraftEventFactory; import org.bukkit.event.entity.EntityTargetEvent; import org.bukkit.event.entity.SlimeSplitEvent; // CraftBukkit end @@ -34,7 +34,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { this.datawatcher.watch(16, new Byte((byte) i)); this.a(0.6F * (float) i, 0.6F * (float) i); this.setPosition(this.locX, this.locY, this.locZ); - this.getAttributeInstance(GenericAttributes.a).setValue((double) (i * i)); + this.getAttributeInstance(GenericAttributes.maxHealth).setValue((double) (i * i)); this.setHealth(this.getMaxHealth()); this.b = i; } @@ -92,7 +92,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { } if (this.bW()) { - this.makeSound(this.bV(), this.be(), ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) / 0.8F); + this.makeSound(this.bV(), this.bf(), ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) / 0.8F); } this.h = -0.5F; @@ -107,7 +107,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { } } - protected void bp() { + protected void bq() { this.w(); if (Vegetated) @@ -142,7 +142,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { this.bc = true; if (this.bY()) { - this.makeSound(this.bV(), this.be(), ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) * 0.8F); + this.makeSound(this.bV(), this.bf(), ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) * 0.8F); } this.bd = 1.0F - this.random.nextFloat() * 2.0F; @@ -203,7 +203,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { if (this.bT()) { int i = this.getSize(); - if (this.p(entityhuman) && this.f(entityhuman) < 0.6D * (double) i * 0.6D * (double) i && entityhuman.damageEntity(DamageSource.mobAttack(this), (float) this.bU())) { + if (this.hasLineOfSight(entityhuman) && this.f(entityhuman) < 0.6D * (double) i * 0.6D * (double) i && entityhuman.damageEntity(DamageSource.mobAttack(this), (float) this.bU())) { this.makeSound("mob.attack", 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F); } } @@ -217,16 +217,16 @@ public class EntitySlime extends EntityInsentient implements IMonster { return this.getSize(); } - protected String aS() { - return "mob.slime." + (this.getSize() > 1 ? "big" : "small"); - } - protected String aT() { return "mob.slime." + (this.getSize() > 1 ? "big" : "small"); } + protected String aU() { + return "mob.slime." + (this.getSize() > 1 ? "big" : "small"); + } + protected Item getLoot() { - return this.getSize() == 1 ? Items.SLIME_BALL : Item.d(0); + return this.getSize() == 1 ? Items.SLIME_BALL : Item.getById(0); } public boolean canSpawn() { @@ -251,11 +251,11 @@ public class EntitySlime extends EntityInsentient implements IMonster { } } - protected float be() { + protected float bf() { return 0.4F * (float) this.getSize(); } - public int bv() { + public int x() { return 0; } @@ -266,4 +266,4 @@ public class EntitySlime extends EntityInsentient implements IMonster { protected boolean bW() { return this.getSize() > 2; } -} \ No newline at end of file +} diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityTNTPrimed.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityTNTPrimed.java similarity index 92% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityTNTPrimed.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityTNTPrimed.java index d291695fb..61c340c1b 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/EntityTNTPrimed.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/EntityTNTPrimed.java @@ -1,4 +1,4 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit @@ -9,8 +9,8 @@ public class EntityTNTPrimed extends Entity { public float yield = 4; // CraftBukkit - add field public boolean isIncendiary = false; // CraftBukkit - add field - public boolean spectating = false; - + public boolean spectating = false; + public EntityTNTPrimed(World world) { super(world); this.k = true; @@ -39,7 +39,7 @@ public class EntityTNTPrimed extends Entity { return false; } - public boolean Q() { + public boolean R() { return !this.dead && !spectating; } @@ -74,9 +74,9 @@ public class EntityTNTPrimed extends Entity { // CraftBukkit start // float f = 4.0F; - org.bukkit.craftbukkit.v1_7_R3.CraftServer server = this.world.getServer(); + org.bukkit.craftbukkit.v1_7_R4.CraftServer server = this.world.getServer(); - ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) org.bukkit.craftbukkit.v1_7_R3.entity.CraftEntity.getEntity(server, this)); + ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) org.bukkit.craftbukkit.v1_7_R4.entity.CraftEntity.getEntity(server, this)); server.getPluginManager().callEvent(event); if (!event.isCancelled()) { @@ -97,4 +97,4 @@ public class EntityTNTPrimed extends Entity { public EntityLiving getSource() { return this.source; } -} \ No newline at end of file +} diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/IPacketVerifier.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/IPacketVerifier.java similarity index 64% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/IPacketVerifier.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/IPacketVerifier.java index 97d957caf..f0fc68d64 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/IPacketVerifier.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/IPacketVerifier.java @@ -1,4 +1,4 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; public interface IPacketVerifier { diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayInCloseWindow.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayInCloseWindow.java similarity index 94% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayInCloseWindow.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayInCloseWindow.java index 0c6e47b0f..3aec9c7fc 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayInCloseWindow.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayInCloseWindow.java @@ -1,4 +1,4 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; public class PacketPlayInCloseWindow extends Packet diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutAnimation.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutAnimation.java similarity index 96% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutAnimation.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutAnimation.java index 1ba91a083..79fd80c40 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutAnimation.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutAnimation.java @@ -1,4 +1,4 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; public class PacketPlayOutAnimation extends Packet { diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutAttachEntity.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutAttachEntity.java similarity index 96% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutAttachEntity.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutAttachEntity.java index 76a623580..ef789c0a8 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutAttachEntity.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutAttachEntity.java @@ -1,4 +1,4 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; public class PacketPlayOutAttachEntity extends Packet { diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutEntity.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutEntity.java similarity index 95% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutEntity.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutEntity.java index 556bd639f..9e4f0b81d 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutEntity.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutEntity.java @@ -1,4 +1,4 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; public class PacketPlayOutEntity extends Packet diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutEntityEquipment.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutEntityEquipment.java similarity index 96% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutEntityEquipment.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutEntityEquipment.java index efd011f00..0b299271f 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutEntityEquipment.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutEntityEquipment.java @@ -1,4 +1,4 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; public class PacketPlayOutEntityEquipment extends Packet { diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutEntityMetadata.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutEntityMetadata.java similarity index 96% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutEntityMetadata.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutEntityMetadata.java index 779cc2bd7..a217bf577 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutEntityMetadata.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutEntityMetadata.java @@ -1,4 +1,4 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; import java.util.List; diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutEntityTeleport.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutEntityTeleport.java similarity index 97% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutEntityTeleport.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutEntityTeleport.java index 69d5380ea..8c29b1b95 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutEntityTeleport.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutEntityTeleport.java @@ -1,4 +1,4 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; public class PacketPlayOutEntityTeleport extends Packet { diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutEntityVelocity.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutEntityVelocity.java similarity index 98% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutEntityVelocity.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutEntityVelocity.java index 4bf5a16e3..83503e652 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutEntityVelocity.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutEntityVelocity.java @@ -1,4 +1,4 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; public class PacketPlayOutEntityVelocity extends Packet diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutNamedEntitySpawn.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutNamedEntitySpawn.java similarity index 97% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutNamedEntitySpawn.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutNamedEntitySpawn.java index f1451d266..a7df8e757 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutNamedEntitySpawn.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutNamedEntitySpawn.java @@ -1,4 +1,4 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; import java.util.Iterator; import java.util.List; @@ -34,7 +34,7 @@ public class PacketPlayOutNamedEntitySpawn extends Packet { this.g = (byte) ((int) (entityhuman.pitch * 256.0F / 360.0F)); ItemStack itemstack = entityhuman.inventory.getItemInHand(); - this.h = itemstack == null ? 0 : Item.b(itemstack.getItem()); + this.h = itemstack == null ? 0 : Item.getId(itemstack.getItem()); this.i = entityhuman.getDataWatcher(); } diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutRelEntityMove.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutRelEntityMove.java similarity index 96% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutRelEntityMove.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutRelEntityMove.java index 5d0b0a865..567407233 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutRelEntityMove.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutRelEntityMove.java @@ -1,4 +1,4 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; public class PacketPlayOutRelEntityMove extends PacketPlayOutEntity diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutRelEntityMoveLook.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutRelEntityMoveLook.java similarity index 97% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutRelEntityMoveLook.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutRelEntityMoveLook.java index 4ae7d996c..f86f47c13 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutRelEntityMoveLook.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutRelEntityMoveLook.java @@ -1,4 +1,4 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; public class PacketPlayOutRelEntityMoveLook extends PacketPlayOutEntity diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutSpawnEntity.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutSpawnEntity.java similarity index 98% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutSpawnEntity.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutSpawnEntity.java index e74ceb726..a13a7594b 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutSpawnEntity.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutSpawnEntity.java @@ -1,4 +1,4 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; public class PacketPlayOutSpawnEntity extends Packet { diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutSpawnEntityLiving.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutSpawnEntityLiving.java similarity index 98% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutSpawnEntityLiving.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutSpawnEntityLiving.java index 91d8be160..b234e35fb 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketPlayOutSpawnEntityLiving.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketPlayOutSpawnEntityLiving.java @@ -1,4 +1,4 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; import java.util.List; diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketProcessor.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketProcessor.java similarity index 95% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketProcessor.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketProcessor.java index 16b72c393..1cd96228f 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PacketProcessor.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PacketProcessor.java @@ -1,4 +1,4 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; import java.util.ArrayList; import java.util.List; diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PlayerChunk.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PlayerChunk.java similarity index 98% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PlayerChunk.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PlayerChunk.java index 4ec99204c..3a12be9b5 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PlayerChunk.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PlayerChunk.java @@ -1,10 +1,10 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; import java.util.ArrayList; import java.util.List; // CraftBukkit start -import org.bukkit.craftbukkit.v1_7_R3.chunkio.ChunkIOExecutor; +import org.bukkit.craftbukkit.v1_7_R4.chunkio.ChunkIOExecutor; import java.util.HashMap; // CraftBukkit end @@ -84,7 +84,7 @@ class PlayerChunk { Chunk chunk = PlayerChunkMap.a(this.playerChunkMap).getChunkAt(this.location.x, this.location.z); - if (chunk.k()) { + if (chunk.isReady()) { entityplayer.playerConnection.sendPacket(new PacketPlayOutMapChunk(chunk, true, 0)); } diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PlayerConnection.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PlayerConnection.java similarity index 93% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PlayerConnection.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PlayerConnection.java index 6aac1238a..b263da632 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/PlayerConnection.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/PlayerConnection.java @@ -1,9 +1,10 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; import java.io.ByteArrayInputStream; import java.io.DataInputStream; import java.io.IOException; import java.util.ArrayList; +import java.util.Date; import java.util.Iterator; import java.util.Random; import java.util.concurrent.Callable; @@ -22,13 +23,13 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; import java.util.HashSet; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; -import org.bukkit.craftbukkit.v1_7_R3.event.CraftEventFactory; -import org.bukkit.craftbukkit.v1_7_R3.inventory.CraftInventoryView; -import org.bukkit.craftbukkit.v1_7_R3.inventory.CraftItemStack; -import org.bukkit.craftbukkit.v1_7_R3.util.CraftChatMessage; -import org.bukkit.craftbukkit.v1_7_R3.util.LazyPlayerSet; -import org.bukkit.craftbukkit.v1_7_R3.util.Waitable; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.event.CraftEventFactory; +import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftInventoryView; +import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftItemStack; +import org.bukkit.craftbukkit.v1_7_R4.util.CraftChatMessage; +import org.bukkit.craftbukkit.v1_7_R4.util.LazyPlayerSet; +import org.bukkit.craftbukkit.v1_7_R4.util.Waitable; import org.bukkit.Location; import org.bukkit.entity.Player; @@ -101,7 +102,7 @@ public class PlayerConnection implements PacketPlayInListener this.server = minecraftserver.server; } - private final org.bukkit.craftbukkit.v1_7_R3.CraftServer server; + private final org.bukkit.craftbukkit.v1_7_R4.CraftServer server; private int lastTick = MinecraftServer.currentTick; private int lastDropTick = MinecraftServer.currentTick; private int dropCount = 0; @@ -116,7 +117,7 @@ public class PlayerConnection implements PacketPlayInListener private float lastYaw = Float.MAX_VALUE; private boolean justTeleported = false; private boolean hasMoved; // Spigot - + // For the PacketPlayOutBlockPlace hack :( Long lastPacket; @@ -162,8 +163,11 @@ public class PlayerConnection implements PacketPlayInListener --this.x; } - this.minecraftServer.methodProfiler.c("playerTick"); - this.minecraftServer.methodProfiler.b(); + if (this.player.x() > 0L && this.minecraftServer.getIdleTimeout() > 0 + && MinecraftServer.ar() - this.player.x() > (long) (this.minecraftServer.getIdleTimeout() * 1000 * 60)) + { + this.disconnect("You have been idle for too long!"); + } } public NetworkManager b() @@ -213,6 +217,9 @@ public class PlayerConnection implements PacketPlayInListener { c.warn(player.getName() + " was caught trying to crash the server with an invalid position."); getPlayer().kickPlayer("NaN in position (Hacking?)"); // Spigot + // "Nope" -> + // Descriptive + // reason return; } // CraftBukkit end @@ -342,7 +349,7 @@ public class PlayerConnection implements PacketPlayInListener float f = this.player.yaw; float f1 = this.player.pitch; - this.player.vehicle.ab(); + this.player.vehicle.ac(); d1 = this.player.locX; d2 = this.player.locY; d3 = this.player.locZ; @@ -358,7 +365,7 @@ public class PlayerConnection implements PacketPlayInListener this.player.setLocation(d1, d2, d3, f, f1); if (this.player.vehicle != null) { - this.player.vehicle.ab(); + this.player.vehicle.ac(); } this.minecraftServer.getPlayerList().d(this.player); @@ -442,7 +449,8 @@ public class PlayerConnection implements PacketPlayInListener // CraftBukkit end double d10 = d7 * d7 + d8 * d8 + d9 * d9; - if (d10 > 100.0D && this.checkMovement + // Spigot: make "moved too quickly" limit configurable + if (d10 > org.spigotmc.SpigotConfig.movedTooQuicklyThreshold && this.checkMovement && (!this.minecraftServer.N() || !this.minecraftServer.M().equals(this.player.getName()))) { // CraftBukkit - Added this.checkMovement condition to solve // this check being triggered by teleports @@ -458,7 +466,7 @@ public class PlayerConnection implements PacketPlayInListener if (this.player.onGround && !packetplayinflying.i() && d5 > 0.0D) { - this.player.bi(); + this.player.bj(); } this.player.move(d4, d5, d6); @@ -477,7 +485,9 @@ public class PlayerConnection implements PacketPlayInListener d10 = d4 * d4 + d5 * d5 + d6 * d6; boolean flag1 = false; - if (d10 > 0.0625D && !this.player.isSleeping() && !this.player.playerInteractManager.isCreative()) + // Spigot: make "moved wrongly" limit configurable + if (d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() + && !this.player.playerInteractManager.isCreative()) { flag1 = true; c.warn(this.player.getName() + " moved wrongly!"); @@ -584,6 +594,12 @@ public class PlayerConnection implements PacketPlayInListener { if (this.player.dead) return; // CraftBukkit + // Spigot start + if (player.activeContainer != player.defaultContainer) + { + getPlayer().closeInventory(); + } + // Spigot end WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); this.player.v(); @@ -617,7 +633,7 @@ public class PlayerConnection implements PacketPlayInListener } else if (packetplayinblockdig.g() == 5) { - this.player.bz(); + this.player.bA(); } else { @@ -700,8 +716,23 @@ public class PlayerConnection implements PacketPlayInListener } } + // Spigot start - limit place/interactions + private long lastPlace = -1; + private int packets = 0; + public void a(PacketPlayInBlockPlace packetplayinblockplace) { + boolean throttled = false; + if (lastPlace != -1 && packetplayinblockplace.timestamp - lastPlace < 30 && packets++ >= 4) + { + throttled = true; + } + else if (packetplayinblockplace.timestamp - lastPlace >= 30 || lastPlace == -1) + { + lastPlace = packetplayinblockplace.timestamp; + packets = 0; + } + // Spigot end WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); // CraftBukkit start @@ -742,6 +773,12 @@ public class PlayerConnection implements PacketPlayInListener // a notch bug where the item doesn't update correctly. boolean always = false; // CraftBukkit end + // Spigot start + if (player.activeContainer != player.defaultContainer) + { + getPlayer().closeInventory(); + } + // Spigot end ItemStack itemstack = this.player.inventory.getItemInHand(); boolean flag = false; @@ -760,19 +797,24 @@ public class PlayerConnection implements PacketPlayInListener // CraftBukkit start int itemstackAmount = itemstack.count; - org.bukkit.event.player.PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, - Action.RIGHT_CLICK_AIR, itemstack); - if (event.useItemInHand() != Event.Result.DENY) + // Spigot start - skip the event if throttled + if (!throttled) { - this.player.playerInteractManager.useItem(this.player, this.player.world, itemstack); + org.bukkit.event.player.PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent( + this.player, Action.RIGHT_CLICK_AIR, itemstack); + if (event.useItemInHand() != Event.Result.DENY) + { + this.player.playerInteractManager.useItem(this.player, this.player.world, itemstack); + } } + // Spigot end // CraftBukkit - notch decrements the counter by 1 in the above // method with food, // snowballs and so forth, but he does it in a place that doesn't // cause the // inventory update packet to get sent - always = (itemstack.count != itemstackAmount); + always = (itemstack.count != itemstackAmount) || itemstack.getItem() == Item.getItemOf(Blocks.WATER_LILY); // CraftBukkit end } else if (packetplayinblockplace.d() >= this.minecraftServer.getMaxBuildHeight() - 1 @@ -799,9 +841,10 @@ public class PlayerConnection implements PacketPlayInListener return; } - if (!this.player.playerInteractManager.interact(this.player, worldserver, itemstack, i, j, k, l, - packetplayinblockplace.h(), packetplayinblockplace.i(), packetplayinblockplace.j())) - { + if (throttled + || !this.player.playerInteractManager.interact(this.player, worldserver, itemstack, i, j, k, l, + packetplayinblockplace.h(), packetplayinblockplace.i(), packetplayinblockplace.j())) + { // Spigot - skip the event if throttled always = true; // force PacketPlayOutSetSlot to be sent to // client to update ItemStack count } @@ -858,7 +901,7 @@ public class PlayerConnection implements PacketPlayInListener this.player.g = true; this.player.inventory.items[this.player.inventory.itemInHandIndex] = ItemStack .b(this.player.inventory.items[this.player.inventory.itemInHandIndex]); - Slot slot = this.player.activeContainer.a((IInventory) this.player.inventory, + Slot slot = this.player.activeContainer.getSlot((IInventory) this.player.inventory, this.player.inventory.itemInHandIndex); this.player.activeContainer.b(); @@ -988,6 +1031,10 @@ public class PlayerConnection implements PacketPlayInListener { c.warn(this.player.getName() + " tried to set an invalid carried item"); this.disconnect("Invalid hotbar selection (Hacking?)"); // CraftBukkit + // //Spigot + // "Nope" -> + // Descriptive + // reason } } @@ -1005,8 +1052,7 @@ public class PlayerConnection implements PacketPlayInListener this.player.v(); String s = packetplayinchat.c(); - // s = StringUtils.normalizeSpace(s); Spigot - Moved to - // PacketPlayInChat + s = StringUtils.normalizeSpace(s); for (int i = 0; i < s.length(); ++i) { @@ -1049,9 +1095,9 @@ public class PlayerConnection implements PacketPlayInListener } } - if (s.startsWith("/")) + // CraftBukkit start + if (!packetplayinchat.a()) { - // CraftBukkit start try { this.minecraftServer.server.playerCommandState = true; @@ -1068,7 +1114,18 @@ public class PlayerConnection implements PacketPlayInListener } else if (getPlayer().isConversing()) { - getPlayer().acceptConversationInput(s); + // Spigot start + final String message = s; + this.minecraftServer.processQueue.add(new Waitable() + { + @Override + protected Object evaluate() + { + getPlayer().acceptConversationInput(message); + return null; + } + }); + // Spigot end } else if (this.player.getChatFlags() == EnumChatVisibility.SYSTEM) { // Re-add "Command Only" flag check @@ -1079,7 +1136,7 @@ public class PlayerConnection implements PacketPlayInListener } else if (true) { - this.chat(s, packetplayinchat.a()); + this.chat(s, true); // CraftBukkit end - the below is for reference. :) } else @@ -1149,7 +1206,7 @@ public class PlayerConnection implements PacketPlayInListener return; } - if (s.startsWith("/")) + if (!async && s.startsWith("/")) { this.handleCommand(s); } @@ -1256,8 +1313,12 @@ public class PlayerConnection implements PacketPlayInListener private void handleCommand(String s) { - org.bukkit.craftbukkit.v1_7_R3.SpigotTimings.playerCommandTimer.startTiming(); // Spigot + org.bukkit.craftbukkit.v1_7_R4.SpigotTimings.playerCommandTimer.startTiming(); // Spigot + // CraftBukkit start - whole method + if (org.spigotmc.SpigotConfig.logCommands) + this.c.info(this.player.getName() + " issued server command: " + s); + CraftPlayer player = this.getPlayer(); PlayerCommandPreprocessEvent event = new PlayerCommandPreprocessEvent(player, s, new LazyPlayerSet()); @@ -1265,21 +1326,15 @@ public class PlayerConnection implements PacketPlayInListener if (event.isCancelled()) { - org.bukkit.craftbukkit.v1_7_R3.SpigotTimings.playerCommandTimer.stopTiming(); // Spigot + org.bukkit.craftbukkit.v1_7_R4.SpigotTimings.playerCommandTimer.stopTiming(); // Spigot return; } try { - // Spigot Start - if (org.spigotmc.SpigotConfig.logCommands) - { - this.c.info(event.getPlayer().getName() + " issued server command: " + event.getMessage()); - } - // Spigot end if (this.server.dispatchCommand(event.getPlayer(), event.getMessage().substring(1))) { - org.bukkit.craftbukkit.v1_7_R3.SpigotTimings.playerCommandTimer.stopTiming(); // Spigot + org.bukkit.craftbukkit.v1_7_R4.SpigotTimings.playerCommandTimer.stopTiming(); // Spigot return; } } @@ -1289,10 +1344,10 @@ public class PlayerConnection implements PacketPlayInListener + "An internal error occurred while attempting to perform this command"); java.util.logging.Logger.getLogger(PlayerConnection.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - org.bukkit.craftbukkit.v1_7_R3.SpigotTimings.playerCommandTimer.stopTiming(); // Spigot + org.bukkit.craftbukkit.v1_7_R4.SpigotTimings.playerCommandTimer.stopTiming(); // Spigot return; } - org.bukkit.craftbukkit.v1_7_R3.SpigotTimings.playerCommandTimer.stopTiming(); // Spigot + org.bukkit.craftbukkit.v1_7_R4.SpigotTimings.playerCommandTimer.stopTiming(); // Spigot // this.minecraftServer.getCommandHandler().a(this.player, s); // CraftBukkit end } @@ -1320,7 +1375,7 @@ public class PlayerConnection implements PacketPlayInListener float f6 = MathHelper.sin(-f1 * 0.017453292F); float f7 = f4 * f5; float f8 = f3 * f5; - double d3 = 5.0D; + double d3 = player.playerInteractManager.getGameMode() == EnumGamemode.CREATIVE ? 5.0D : 4.5D; // Spigot Vec3D vec3d1 = vec3d.add((double) f7 * d3, (double) f6 * d3, (double) f8 * d3); MovingObjectPosition movingobjectposition = this.player.world.rayTrace(vec3d, vec3d1, false); @@ -1338,7 +1393,7 @@ public class PlayerConnection implements PacketPlayInListener return; // CraftBukkit end - this.player.aZ(); + this.player.ba(); } } @@ -1423,11 +1478,17 @@ public class PlayerConnection implements PacketPlayInListener return; } // Spigot End + // Spigot start + if (player.activeContainer != player.defaultContainer) + { + getPlayer().closeInventory(); + } + // Spigot end this.player.v(); if (entity != null) { - boolean flag = this.player.p(entity); + boolean flag = this.player.hasLineOfSight(entity); double d0 = 36.0D; if (!flag) @@ -1542,7 +1603,8 @@ public class PlayerConnection implements PacketPlayInListener } else { - GameProfileBanEntry gameprofilebanentry = new GameProfileBanEntry(this.player.getProfile()); + GameProfileBanEntry gameprofilebanentry = new GameProfileBanEntry(this.player.getProfile(), + (Date) null, "(You just lost the game)", (Date) null, "Death in Hardcore"); this.minecraftServer.getPlayerList().getProfileBans().add(gameprofilebanentry); this.player.playerConnection.disconnect("You have died. Game over, man, it\'s game over!"); @@ -1576,7 +1638,7 @@ public class PlayerConnection implements PacketPlayInListener if (packetplayinclosewindow.a == player.activeContainer.windowId) { CraftEventFactory.handleInventoryCloseEvent(this.player); // CraftBukkit - + this.player.m(); } } @@ -1893,9 +1955,10 @@ public class PlayerConnection implements PacketPlayInListener ItemStack cursor = this.player.inventory.getCarried(); action = InventoryAction.NOTHING; // Quick check for if we have any of the item - if (inventory.getTopInventory().contains(org.bukkit.Material.getMaterial(Item.b(cursor.getItem()))) + if (inventory.getTopInventory().contains( + org.bukkit.Material.getMaterial(Item.getId(cursor.getItem()))) || inventory.getBottomInventory().contains( - org.bukkit.Material.getMaterial(Item.b(cursor.getItem())))) + org.bukkit.Material.getMaterial(Item.getId(cursor.getItem())))) { action = InventoryAction.COLLECT_TO_CURSOR; } @@ -1980,7 +2043,6 @@ public class PlayerConnection implements PacketPlayInListener case SWAP_WITH_CURSOR: this.player.playerConnection.sendPacket(new PacketPlayOutSetSlot(-1, -1, this.player.inventory .getCarried())); - if (this.player.activeContainer.c.size() > packetplayinwindowclick.d()) this.player.playerConnection.sendPacket(new PacketPlayOutSetSlot( this.player.activeContainer.windowId, packetplayinwindowclick.d(), @@ -1989,7 +2051,9 @@ public class PlayerConnection implements PacketPlayInListener // Modified clicked only case DROP_ALL_SLOT: case DROP_ONE_SLOT: - this.player.playerConnection.sendPacket(new PacketPlayOutSetSlot(this.player.activeContainer.windowId, packetplayinwindowclick.d(), this.player.activeContainer.getSlot(packetplayinwindowclick.d()).getItem())); + this.player.playerConnection.sendPacket(new PacketPlayOutSetSlot( + this.player.activeContainer.windowId, packetplayinwindowclick.d(), + this.player.activeContainer.getSlot(packetplayinwindowclick.d()).getItem())); break; // Modified cursor only case DROP_ALL_CURSOR: @@ -2049,7 +2113,7 @@ public class PlayerConnection implements PacketPlayInListener if (this.player.activeContainer.windowId == packetplayinenchantitem.c() && this.player.activeContainer.c(this.player)) { - this.player.activeContainer.a((EntityHuman) this.player, packetplayinenchantitem.d()); + this.player.activeContainer.a(this.player, packetplayinenchantitem.d()); this.player.activeContainer.b(); } } @@ -2063,9 +2127,9 @@ public class PlayerConnection implements PacketPlayInListener boolean flag1 = packetplayinsetcreativeslot.c() >= 1 && packetplayinsetcreativeslot.c() < 36 + PlayerInventory.getHotbarSize(); // CraftBukkit - Add invalidItems check - boolean flag2 = itemstack == null + boolean flag2 = itemstack == null || itemstack.getItem() != null - && (!invalidItems.contains(Item.b(itemstack.getItem())) || !org.spigotmc.SpigotConfig.filterCreativeItems); // Spigot + && (!invalidItems.contains(Item.getId(itemstack.getItem())) || !org.spigotmc.SpigotConfig.filterCreativeItems); // Spigot boolean flag3 = itemstack == null || itemstack.getData() >= 0 && itemstack.count <= 64 && itemstack.count > 0; @@ -2233,13 +2297,13 @@ public class PlayerConnection implements PacketPlayInListener // CraftBukkit start Player player = this.server.getPlayer(this.player); - SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.v1_7_R3.block.CraftBlock) player - .getWorld().getBlockAt(j, k, i), this.server.getPlayer(this.player), packetplayinupdatesign.f()); + SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.v1_7_R4.block.CraftBlock) player.getWorld() + .getBlockAt(j, k, i), this.server.getPlayer(this.player), packetplayinupdatesign.f()); this.server.getPluginManager().callEvent(event); if (!event.isCancelled()) { - tileentitysign1.lines = org.bukkit.craftbukkit.v1_7_R3.block.CraftSign.sanitizeLines(event.getLines()); + tileentitysign1.lines = org.bukkit.craftbukkit.v1_7_R4.block.CraftSign.sanitizeLines(event.getLines()); tileentitysign1.isEditable = false; } // System.arraycopy(packetplayinupdatesign.f(), 0, @@ -2334,22 +2398,22 @@ public class PlayerConnection implements PacketPlayInListener try { itemstack = packetdataserializer.c(); - if (itemstack == null) + if (itemstack != null) { - return; - } + if (!ItemBookAndQuill.a(itemstack.getTag())) + { + throw new IOException("Invalid book tag!"); + } - if (!ItemBookAndQuill.a(itemstack.getTag())) - { - throw new IOException("Invalid book tag!"); - } + itemstack1 = this.player.inventory.getItemInHand(); + if (itemstack1 == null) + { + return; + } - itemstack1 = this.player.inventory.getItemInHand(); - if (itemstack1 != null) - { if (itemstack.getItem() == Items.BOOK_AND_QUILL && itemstack.getItem() == itemstack1.getItem()) { - CraftEventFactory.handleEditBookEvent(player, itemstack); // CraftBukkit + CraftEventFactory.handleEditBookEvent(player, itemstack); // CraftBukkit } return; @@ -2389,7 +2453,7 @@ public class PlayerConnection implements PacketPlayInListener { return; } - + if (itemstack.getItem() == Items.WRITTEN_BOOK && itemstack1.getItem() == Items.BOOK_AND_QUILL) { CraftEventFactory.handleEditBookEvent(player, itemstack); // CraftBukkit @@ -2462,7 +2526,7 @@ public class PlayerConnection implements PacketPlayInListener if (tileentity instanceof TileEntityCommand) { - commandblocklistenerabstract = ((TileEntityCommand) tileentity).a(); + commandblocklistenerabstract = ((TileEntityCommand) tileentity).getCommandBlock(); } } else if (b0 == 1) @@ -2471,7 +2535,7 @@ public class PlayerConnection implements PacketPlayInListener if (entity instanceof EntityMinecartCommandBlock) { - commandblocklistenerabstract = ((EntityMinecartCommandBlock) entity).e(); + commandblocklistenerabstract = ((EntityMinecartCommandBlock) entity).getCommandBlock(); } } @@ -2479,7 +2543,7 @@ public class PlayerConnection implements PacketPlayInListener if (commandblocklistenerabstract != null) { - commandblocklistenerabstract.a(s); + commandblocklistenerabstract.setCommand(s); commandblocklistenerabstract.e(); this.player.sendMessage(new ChatMessage("advMode.setCommand.success", new Object[] { s })); } @@ -2605,4 +2669,4 @@ public class PlayerConnection implements PacketPlayInListener return !this.player.joining && !NetworkManager.a(this.networkManager).config().isAutoRead(); } // CraftBukkit end -} \ No newline at end of file +} diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/QueuedPacket.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/QueuedPacket.java similarity index 92% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/QueuedPacket.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/QueuedPacket.java index 25d0da40d..7b80b5b2a 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/QueuedPacket.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/QueuedPacket.java @@ -1,4 +1,4 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; import net.minecraft.util.io.netty.util.concurrent.GenericFutureListener; diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/World.java b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/World.java similarity index 93% rename from Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/World.java rename to Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/World.java index 6ad9dd5be..75bbe8ea5 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R3/World.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/net/minecraft/server/v1_7_R4/World.java @@ -1,4 +1,4 @@ -package net.minecraft.server.v1_7_R3; +package net.minecraft.server.v1_7_R4; import java.util.ArrayList; import java.util.Calendar; @@ -11,18 +11,16 @@ import java.util.Set; import java.util.UUID; import java.util.concurrent.Callable; - - // CraftBukkit start import org.bukkit.Bukkit; import org.bukkit.block.BlockState; -import org.bukkit.craftbukkit.v1_7_R3.util.CraftMagicNumbers; -import org.bukkit.craftbukkit.v1_7_R3.util.LongHashSet; -import org.bukkit.craftbukkit.v1_7_R3.SpigotTimings; // Spigot +import org.bukkit.craftbukkit.v1_7_R4.util.CraftMagicNumbers; +import org.bukkit.craftbukkit.v1_7_R4.util.LongHashSet; +import org.bukkit.craftbukkit.v1_7_R4.SpigotTimings; // Spigot import org.bukkit.generator.ChunkGenerator; -import org.bukkit.craftbukkit.v1_7_R3.CraftServer; -import org.bukkit.craftbukkit.v1_7_R3.CraftWorld; -import org.bukkit.craftbukkit.v1_7_R3.event.CraftEventFactory; +import org.bukkit.craftbukkit.v1_7_R4.CraftServer; +import org.bukkit.craftbukkit.v1_7_R4.CraftWorld; +import org.bukkit.craftbukkit.v1_7_R4.event.CraftEventFactory; import org.bukkit.event.block.BlockCanBuildEvent; import org.bukkit.event.block.BlockPhysicsEvent; import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; @@ -113,12 +111,22 @@ public abstract class World implements IBlockAccess // Spigot start private boolean guardEntityList; - protected final gnu.trove.map.hash.TLongShortHashMap chunkTickList; + protected final net.minecraft.util.gnu.trove.map.hash.TLongShortHashMap chunkTickList; protected float growthOdds = 100; protected float modifiedOdds = 100; private final byte chunkTickRadius; public static boolean haveWeSilencedAPhysicsCrash; public static String blockLocation; + public List triggerHoppersList = new ArrayList(); // Spigot, + // When + // altHopperTicking, + // tile + // entities + // being + // added + // go + // through + // here. public static long chunkToKey(int x, int z) { @@ -137,6 +145,54 @@ public abstract class World implements IBlockAccess return (int) (((k >> 32) & 0xFFFF0000L) | ((k >> 16) & 0x0000FFFF)); } + // Spigot Start - Hoppers need to be born ticking. + private void initializeHoppers() + { + if (this.spigotConfig.altHopperTicking) + { + for (TileEntity o : this.triggerHoppersList) + { + o.scheduleTicks(); + if (o instanceof TileEntityHopper) + { + ((TileEntityHopper) o).convertToScheduling(); + ((TileEntityHopper) o).scheduleHopperTick(); + } + } + } + triggerHoppersList.clear(); + } + + // Helper method for altHopperTicking. Updates chests at the specified + // location, + // accounting for double chests. Updating the chest will update adjacent + // hoppers. + public void updateChestAndHoppers(int a, int b, int c) + { + Block block = this.getType(a, b, c); + if (block instanceof BlockChest) + { + TileEntity tile = this.getTileEntity(a, b, c); + if (tile instanceof TileEntityChest) + { + tile.scheduleTicks(); + } + for (int i = 2; i < 6; i++) + { + // Facing class provides arrays for direction offset. + if (this.getType(a + Facing.b[i], b, c + Facing.d[i]) == block) + { + tile = this.getTileEntity(a + Facing.b[i], b, c + Facing.d[i]); + if (tile instanceof TileEntityChest) + { + tile.scheduleTicks(); + } + break; + } + } + } + } + // Spigot end public BiomeBase getBiome(int i, int j) @@ -147,7 +203,7 @@ public abstract class World implements IBlockAccess try { - return chunk.a(i & 15, j & 15, this.worldProvider.e); + return chunk.getBiome(i & 15, j & 15, this.worldProvider.e); } catch (Throwable throwable) { @@ -179,7 +235,7 @@ public abstract class World implements IBlockAccess public final SpigotTimings.WorldTimingsHandler timings; // Spigot private Entity _startEntity; - + public CraftWorld getWorld() { return this.world; @@ -190,6 +246,11 @@ public abstract class World implements IBlockAccess return (CraftServer) Bukkit.getServer(); } + public Chunk getChunkIfLoaded(int x, int z) + { + return ((ChunkProviderServer) this.chunkProvider).getChunkIfLoaded(x, z); + } + // Changed signature - added gen and env public World(IDataManager idatamanager, String s, WorldSettings worldsettings, WorldProvider worldprovider, MethodProfiler methodprofiler, ChunkGenerator gen, org.bukkit.World.Environment env) @@ -203,8 +264,8 @@ public abstract class World implements IBlockAccess // Spigot start this.chunkTickRadius = (byte) ((this.getServer().getViewDistance() < 7) ? this.getServer().getViewDistance() : 7); - this.chunkTickList = new gnu.trove.map.hash.TLongShortHashMap(spigotConfig.chunksPerTick * 5, 0.7f, - Long.MIN_VALUE, Short.MIN_VALUE); + this.chunkTickList = new net.minecraft.util.gnu.trove.map.hash.TLongShortHashMap( + spigotConfig.chunksPerTick * 5, 0.7f, Long.MIN_VALUE, Short.MIN_VALUE); this.chunkTickList.setAutoCompactionFactor(0); // Spigot end @@ -241,6 +302,12 @@ public abstract class World implements IBlockAccess this.worldProvider.a(this); this.chunkProvider = this.j(); + timings = new SpigotTimings.WorldTimingsHandler(this); // Spigot - code + // below can + // generate new + // world and + // access + // timings if (!this.worldData.isInitialized()) { try @@ -284,7 +351,6 @@ public abstract class World implements IBlockAccess this.a(); this.getServer().addWorld(this.world); // CraftBukkit - timings = new SpigotTimings.WorldTimingsHandler(this); // Spigot } protected abstract IChunkProvider j(); @@ -306,11 +372,18 @@ public abstract class World implements IBlockAccess return this.getType(i, k, j); } + // Spigot start public Block getType(int i, int j, int k) + { + return getType(i, j, k, true); + } + + public Block getType(int i, int j, int k, boolean useCaptured) { // CraftBukkit start - tree generation - if (captureTreeGeneration) + if (captureTreeGeneration && useCaptured) { + // Spigot end Iterator it = capturedBlockStates.iterator(); while (it.hasNext()) { @@ -322,7 +395,6 @@ public abstract class World implements IBlockAccess } } // CraftBukkit end - if (i >= -30000000 && k >= -30000000 && i < 30000000 && k < 30000000 && j >= 0 && j < 256) { Chunk chunk = null; @@ -376,10 +448,7 @@ public abstract class World implements IBlockAccess { for (int l1 = k; l1 <= j1; ++l1) { - // CraftBukkit - check unload queue too so we don't leak a - // chunk - if (!this.isChunkLoaded(k1, l1) - || ((WorldServer) this).chunkProviderServer.unloadQueue.contains(k1, l1)) + if (!this.isChunkLoaded(k1, l1)) { return false; } @@ -428,7 +497,7 @@ public abstract class World implements IBlockAccess } if (blockstate == null) { - blockstate = org.bukkit.craftbukkit.v1_7_R3.block.CraftBlockState.getBlockState(this, i, j, k, i1); + blockstate = org.bukkit.craftbukkit.v1_7_R4.block.CraftBlockState.getBlockState(this, i, j, k, i1); } blockstate.setTypeId(CraftMagicNumbers.getId(block)); blockstate.setRawData((byte) l); @@ -459,7 +528,7 @@ public abstract class World implements IBlockAccess BlockState blockstate = null; if (this.captureBlockStates) { - blockstate = org.bukkit.craftbukkit.v1_7_R3.block.CraftBlockState.getBlockState(this, i, j, k, i1); + blockstate = org.bukkit.craftbukkit.v1_7_R4.block.CraftBlockState.getBlockState(this, i, j, k, i1); this.capturedBlockStates.add(blockstate); } // CraftBukkit end @@ -484,6 +553,17 @@ public abstract class World implements IBlockAccess this.notifyAndUpdatePhysics(i, j, k, chunk, block1, block, i1); // CraftBukkit end } + // Spigot start - If this block is changing to that which a + // chest beneath it + // becomes able to be opened, then the chest must be updated. + // block1 is the old block. block is the new block. r returns + // true if the block type + // prevents access to a chest. + if (this.spigotConfig.altHopperTicking && block1 != null && block1.r() && !block.r()) + { + this.updateChestAndHoppers(i, j - 1, k); + } + // Spigot end return flag; } @@ -493,26 +573,25 @@ public abstract class World implements IBlockAccess return false; } } - + // CraftBukkit start - Split off from original setTypeAndData(int i, int j, // int k, Block block, int l, int i1) method in order to directly send // client and physic updates public void notifyAndUpdatePhysics(int i, int j, int k, Chunk chunk, Block oldBlock, Block newBlock, int flag) { // should be isReady() - if ((flag & 2) != 0 && (chunk == null || chunk.k())) - { // allow chunk to be null here as chunk.k() is false when we send our - // notification during block placement + if ((flag & 2) != 0 && (chunk == null || chunk.isReady())) + { // allow chunk to be null here as chunk.isReady() is false when we + // send our notification during block placement this.notify(i, j, k); } if ((flag & 1) != 0) { this.update(i, j, k, oldBlock); - if (newBlock.M()) - { // should be isComplexRedstone() - this.f(i, j, k, newBlock); // should be - // updateAdjacentComparators + if (newBlock.isComplexRedstone()) + { + this.updateAdjacentComparators(i, j, k, newBlock); } } } @@ -579,7 +658,7 @@ public abstract class World implements IBlockAccess } if (blockstate == null) { - blockstate = org.bukkit.craftbukkit.v1_7_R3.block.CraftBlockState.getBlockState(this, i, j, k, i1); + blockstate = org.bukkit.craftbukkit.v1_7_R4.block.CraftBlockState.getBlockState(this, i, j, k, i1); } blockstate.setRawData((byte) l); this.capturedBlockStates.add(blockstate); @@ -607,7 +686,7 @@ public abstract class World implements IBlockAccess { Block block = chunk.getType(j1, j, k1); - if ((i1 & 2) != 0 && (!this.isStatic || (i1 & 4) == 0) && chunk.k()) + if ((i1 & 2) != 0 && (!this.isStatic || (i1 & 4) == 0) && chunk.isReady()) { this.notify(i, j, k); } @@ -615,9 +694,9 @@ public abstract class World implements IBlockAccess if (!this.isStatic && (i1 & 1) != 0) { this.update(i, j, k, block); - if (block.M()) + if (block.isComplexRedstone()) { - this.f(i, j, k, block); + this.updateAdjacentComparators(i, j, k, block); } } } @@ -648,7 +727,7 @@ public abstract class World implements IBlockAccess { int l = this.getData(i, j, k); - this.triggerEffect(2001, i, j, k, Block.b(block) + (l << 12)); + this.triggerEffect(2001, i, j, k, Block.getId(block) + (l << 12)); if (flag) { block.b(this, i, j, k, l, 0); @@ -1310,7 +1389,7 @@ public abstract class World implements IBlockAccess int i = MathHelper.floor(entity.locX / 16.0D); int j = MathHelper.floor(entity.locZ / 16.0D); - boolean flag = entity.n; + boolean flag = entity.attachedToPlayer; if (entity instanceof EntityHuman) { @@ -1390,6 +1469,7 @@ public abstract class World implements IBlockAccess this.players.add(entityhuman); this.everyoneSleeping(); + this.b(entity); } this.getChunkAt(i, j).a(entity); @@ -1435,6 +1515,24 @@ public abstract class World implements IBlockAccess if (entity instanceof EntityHuman) { this.players.remove(entity); + // Spigot start + for (Object o : worldMaps.c) + { + if (o instanceof WorldMap) + { + WorldMap map = (WorldMap) o; + map.i.remove(entity); + for (Iterator iter = (Iterator) map.f.iterator(); iter + .hasNext();) + { + if (iter.next().trackee == entity) + { + iter.remove(); + } + } + } + } + // Spigot end this.everyoneSleeping(); } } @@ -1532,7 +1630,7 @@ public abstract class World implements IBlockAccess for (int j2 = 0; j2 < list.size(); ++j2) { - AxisAlignedBB axisalignedbb1 = ((Entity) list.get(j2)).I(); + AxisAlignedBB axisalignedbb1 = ((Entity) list.get(j2)).J(); if (axisalignedbb1 != null && axisalignedbb1.b(axisalignedbb)) { @@ -1673,32 +1771,15 @@ public abstract class World implements IBlockAccess CrashReport crashreport; CrashReportSystemDetails crashreportsystemdetails; - long lastChunk = Long.MIN_VALUE; // Spigot - cache chunk x, z cords for - // unload queue for (i = 0; i < this.i.size(); ++i) { entity = (Entity) this.i.get(i); - // CraftBukkit start - Fixed an NPE, don't process entities in - // chunks queued for unload + // CraftBukkit start - Fixed an NPE if (entity == null) { continue; } - - ChunkProviderServer chunkProviderServer = ((WorldServer) this).chunkProviderServer; - // Spigot start - check last chunk to see if this loaded (fast - // cache) - long chunk = org.bukkit.craftbukkit.v1_7_R3.util.LongHash.toLong(MathHelper.floor(entity.locX) >> 4, - MathHelper.floor(entity.locZ) >> 4); - if (lastChunk != chunk) - { - if (chunkProviderServer.unloadQueue.contains(chunk)) - { // Spigot end - continue; - } - } // CraftBukkit end - lastChunk = chunk; // Spigot try { @@ -1726,7 +1807,6 @@ public abstract class World implements IBlockAccess this.i.remove(i--); } } - lastChunk = Long.MIN_VALUE; // Spigot this.methodProfiler.c("remove"); this.entityList.removeAll(this.f); @@ -1760,23 +1840,6 @@ public abstract class World implements IBlockAccess for (this.tickPosition = 0; this.tickPosition < this.entityList.size(); ++this.tickPosition) { entity = (Entity) this.entityList.get(this.tickPosition); - - // Don't tick entities in chunks queued for unload - ChunkProviderServer chunkProviderServer = ((WorldServer) this).chunkProviderServer; - // Spigot start - check last chunk to see if this loaded (fast - // cache) - long chunk = org.bukkit.craftbukkit.v1_7_R3.util.LongHash.toLong(MathHelper.floor(entity.locX) >> 4, - MathHelper.floor(entity.locZ) >> 4); - if (lastChunk != chunk) - { - if (chunkProviderServer.unloadQueue.contains(chunk)) - { // Spigot end - continue; - } - } - // CraftBukkit end - lastChunk = Long.MIN_VALUE; // Spigot - if (entity.vehicle != null) { if (!entity.vehicle.dead && entity.vehicle.passenger == entity) @@ -1832,14 +1895,18 @@ public abstract class World implements IBlockAccess timings.entityTick.stopTiming(); // Spigot this.methodProfiler.c("blockEntities"); timings.tileEntityTick.startTiming(); // Spigot - // Spigot start - brought up from below + this.M = true; + // CraftBukkit start - From below, clean up tile entities before ticking + // them if (!this.b.isEmpty()) { this.tileEntityList.removeAll(this.b); this.b.clear(); } // Spigot End - this.M = true; + + this.initializeHoppers(); // Spigot - Initializes hoppers which have + // been added recently. Iterator iterator = this.tileEntityList.iterator(); while (iterator.hasNext()) @@ -1854,14 +1921,6 @@ public abstract class World implements IBlockAccess continue; } // Spigot end - // CraftBukkit start - Don't tick entities in chunks queued for - // unload - ChunkProviderServer chunkProviderServer = ((WorldServer) this).chunkProviderServer; - if (chunkProviderServer.unloadQueue.contains(tileentity.x >> 4, tileentity.z >> 4)) - { - continue; - } - // CraftBukkit end if (!tileentity.r() && tileentity.o() && this.isLoaded(tileentity.x, tileentity.y, tileentity.z)) { @@ -1899,6 +1958,10 @@ public abstract class World implements IBlockAccess timings.tileEntityTick.stopTiming(); // Spigot timings.tileEntityPending.startTiming(); // Spigot this.M = false; + /* + * CraftBukkit start - Moved up if (!this.b.isEmpty()) { + * this.tileEntityList.removeAll(this.b); this.b.clear(); } + */// CraftBukkit end this.methodProfiler.c("pendingBlockEntities"); if (!this.a.isEmpty()) @@ -1976,6 +2039,7 @@ public abstract class World implements IBlockAccess else { entity.tickTimer.startTiming(); // Spigot + // CraftBukkit end entity.S = entity.locX; entity.T = entity.locY; entity.U = entity.locZ; @@ -1986,7 +2050,7 @@ public abstract class World implements IBlockAccess ++entity.ticksLived; if (entity.vehicle != null) { - entity.aa(); + entity.ab(); } else { @@ -2076,6 +2140,7 @@ public abstract class World implements IBlockAccess _startEntity = null; } entity.tickTimer.stopTiming(); // Spigot + } } @@ -2258,7 +2323,7 @@ public abstract class World implements IBlockAccess } } - if (vec3d.b() > 0.0D && entity.aB()) + if (vec3d.b() > 0.0D && entity.aC()) { vec3d = vec3d.a(); double d1 = 0.014D; @@ -2512,6 +2577,7 @@ public abstract class World implements IBlockAccess } } + tileentity.a(this); // Spigot - No null worlds this.a.add(tileentity); } else @@ -3006,8 +3072,14 @@ public abstract class World implements IBlockAccess public boolean c(EnumSkyBlock enumskyblock, int i, int j, int k) { - if (!this.areChunksLoaded(i, j, k, 17)) + // CraftBukkit start - Use neighbor cache instead of looking up + Chunk chunk = this.getChunkIfLoaded(i >> 4, k >> 4); + if (chunk == null || !chunk.areNeighborsLoaded(1) /* + * !this.areChunksLoaded( + * i, j, k, 17) + */) { + // CraftBukkit end return false; } else @@ -3512,7 +3584,7 @@ public abstract class World implements IBlockAccess if (entityhuman1.isInvisible()) { - float f = entityhuman1.bD(); + float f = entityhuman1.bE(); if (f < 0.1F) { @@ -3612,7 +3684,7 @@ public abstract class World implements IBlockAccess return this.chunkProvider; } - public void playNote(int i, int j, int k, Block block, int l, int i1) + public void playBlockAction(int i, int j, int k, Block block, int l, int i1) { block.a(this, i, j, k, l, i1); } @@ -3816,7 +3888,7 @@ public abstract class World implements IBlockAccess return this.scoreboard; } - public void f(int i, int j, int k, Block block) + public void updateAdjacentComparators(int i, int j, int k, Block block) { for (int l = 0; l < 4; ++l) { @@ -3880,4 +3952,4 @@ public abstract class World implements IBlockAccess iworldaccess.b(); } } -} \ No newline at end of file +} diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/org/bukkit/craftbukkit/v1_7_R3/CraftWorld.java b/Plugins/Nautilus.Core.CraftBukkit/src/org/bukkit/craftbukkit/v1_7_R4/CraftWorld.java similarity index 93% rename from Plugins/Nautilus.Core.CraftBukkit/src/org/bukkit/craftbukkit/v1_7_R3/CraftWorld.java rename to Plugins/Nautilus.Core.CraftBukkit/src/org/bukkit/craftbukkit/v1_7_R4/CraftWorld.java index 0d1666985..f8c0bddd4 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/org/bukkit/craftbukkit/v1_7_R3/CraftWorld.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/org/bukkit/craftbukkit/v1_7_R4/CraftWorld.java @@ -1,4 +1,4 @@ -package org.bukkit.craftbukkit.v1_7_R3; +package org.bukkit.craftbukkit.v1_7_R4; import java.io.File; import java.util.ArrayList; @@ -9,7 +9,7 @@ import java.util.Random; import java.util.Set; import java.util.UUID; -import net.minecraft.server.v1_7_R3.*; +import net.minecraft.server.v1_7_R4.*; import org.apache.commons.lang.Validate; import org.bukkit.BlockChangeDelegate; @@ -19,20 +19,25 @@ import org.bukkit.ChunkSnapshot; import org.bukkit.Difficulty; import org.bukkit.Effect; import org.bukkit.Location; +import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.TreeType; import org.bukkit.World; +import org.bukkit.WorldType; +import org.bukkit.Effect.Type; +import org.bukkit.World.Environment; +import org.bukkit.World.Spigot; import org.bukkit.block.Biome; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.block.BlockState; -import org.bukkit.craftbukkit.v1_7_R3.block.CraftBlock; -import org.bukkit.craftbukkit.v1_7_R3.block.CraftBlockState; -import org.bukkit.craftbukkit.v1_7_R3.entity.*; -import org.bukkit.craftbukkit.v1_7_R3.inventory.CraftItemStack; -import org.bukkit.craftbukkit.v1_7_R3.metadata.BlockMetadataStore; -import org.bukkit.craftbukkit.v1_7_R3.util.CraftMagicNumbers; -import org.bukkit.craftbukkit.v1_7_R3.util.LongHash; +import org.bukkit.craftbukkit.v1_7_R4.block.CraftBlock; +import org.bukkit.craftbukkit.v1_7_R4.block.CraftBlockState; +import org.bukkit.craftbukkit.v1_7_R4.entity.*; +import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftItemStack; +import org.bukkit.craftbukkit.v1_7_R4.metadata.BlockMetadataStore; +import org.bukkit.craftbukkit.v1_7_R4.util.CraftMagicNumbers; +import org.bukkit.craftbukkit.v1_7_R4.util.LongHash; import org.bukkit.entity.*; import org.bukkit.entity.Entity; import org.bukkit.entity.minecart.ExplosiveMinecart; @@ -134,7 +139,7 @@ public class CraftWorld implements World { org.bukkit.Chunk[] craftChunks = new CraftChunk[chunks.length]; for (int i = 0; i < chunks.length; i++) { - net.minecraft.server.v1_7_R3.Chunk chunk = (net.minecraft.server.v1_7_R3.Chunk) chunks[i]; + net.minecraft.server.v1_7_R4.Chunk chunk = (net.minecraft.server.v1_7_R4.Chunk) chunks[i]; craftChunks[i] = chunk.bukkitChunk; } @@ -178,7 +183,7 @@ public class CraftWorld implements World { return false; } - net.minecraft.server.v1_7_R3.Chunk chunk = world.chunkProviderServer.getOrCreateChunk(x, z); + net.minecraft.server.v1_7_R4.Chunk chunk = world.chunkProviderServer.getOrCreateChunk(x, z); if (chunk.mustSave) { // If chunk had previously been queued to save, must do save to avoid loss of that data save = true; } @@ -201,7 +206,7 @@ public class CraftWorld implements World { world.chunkProviderServer.unloadQueue.remove(x, z); - net.minecraft.server.v1_7_R3.Chunk chunk = null; + net.minecraft.server.v1_7_R4.Chunk chunk = null; if (world.chunkProviderServer.chunkProvider == null) { chunk = world.chunkProviderServer.emptyChunk; @@ -249,17 +254,19 @@ public class CraftWorld implements World { } world.chunkProviderServer.unloadQueue.remove(x, z); - net.minecraft.server.v1_7_R3.Chunk chunk = world.chunkProviderServer.chunks.get(LongHash.toLong(x, z)); + net.minecraft.server.v1_7_R4.Chunk chunk = world.chunkProviderServer.chunks.get(LongHash.toLong(x, z)); if (chunk == null) { + world.timings.syncChunkLoadTimer.startTiming(); // Spigot chunk = world.chunkProviderServer.loadChunk(x, z); chunkLoadPostProcess(chunk, x, z); + world.timings.syncChunkLoadTimer.stopTiming(); // Spigot } return chunk != null; } - private void chunkLoadPostProcess(net.minecraft.server.v1_7_R3.Chunk chunk, int x, int z) { + private void chunkLoadPostProcess(net.minecraft.server.v1_7_R4.Chunk chunk, int x, int z) { if (chunk != null) { world.chunkProviderServer.chunks.put(LongHash.toLong(x, z), chunk); @@ -357,7 +364,7 @@ public class CraftWorld implements World { } public boolean generateTree(Location loc, TreeType type) { - net.minecraft.server.v1_7_R3.WorldGenerator gen; + net.minecraft.server.v1_7_R4.WorldGenerator gen; switch (type) { case BIG_TREE: gen = new WorldGenBigTree(true); @@ -377,6 +384,9 @@ public class CraftWorld implements World { case SMALL_JUNGLE: gen = new WorldGenTrees(true, 4 + rand.nextInt(7), 3, 3, false); break; + case COCOA_TREE: + gen = new WorldGenTrees(true, 4 + rand.nextInt(7), 3, 3, true); + break; case JUNGLE_BUSH: gen = new WorldGenGroundBush(3, 0); break; @@ -396,7 +406,7 @@ public class CraftWorld implements World { gen = new WorldGenForestTree(true); break; case MEGA_REDWOOD: - gen = new WorldGenMegaTree(true, rand.nextBoolean()); + gen = new WorldGenMegaTree(false, rand.nextBoolean()); break; case TALL_BIRCH: gen = new WorldGenForest(true, true); @@ -407,7 +417,7 @@ public class CraftWorld implements World { break; } - return gen.a(world, rand, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()); + return gen.generate(world, rand, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()); } public boolean generateTree(Location loc, TreeType type, BlockChangeDelegate delegate) { @@ -421,12 +431,12 @@ public class CraftWorld implements World { int x = blockstate.getX(); int y = blockstate.getY(); int z = blockstate.getZ(); - net.minecraft.server.v1_7_R3.Block oldBlock = world.getType(x, y, z); + net.minecraft.server.v1_7_R4.Block oldBlock = world.getType(x, y, z); int typeId = blockstate.getTypeId(); int data = blockstate.getRawData(); int flag = ((CraftBlockState)blockstate).getFlag(); delegate.setTypeIdAndData(x, y, z, typeId, data); - net.minecraft.server.v1_7_R3.Block newBlock = world.getType(x, y, z); + net.minecraft.server.v1_7_R4.Block newBlock = world.getType(x, y, z); world.notifyAndUpdatePhysics(x, y, z, null, oldBlock, newBlock, flag); } world.capturedBlockStates.clear(); @@ -557,7 +567,7 @@ public class CraftWorld implements World { public void setBiome(int x, int z, Biome bio) { BiomeBase bb = CraftBlock.biomeToBiomeBase(bio); if (this.world.isLoaded(x, 0, z)) { - net.minecraft.server.v1_7_R3.Chunk chunk = this.world.getChunkAtWorldCoords(x, z); + net.minecraft.server.v1_7_R4.Chunk chunk = this.world.getChunkAtWorldCoords(x, z); if (chunk != null) { byte[] biomevals = chunk.m(); @@ -578,8 +588,8 @@ public class CraftWorld implements World { List list = new ArrayList(); for (Object o : world.entityList) { - if (o instanceof net.minecraft.server.v1_7_R3.Entity) { - net.minecraft.server.v1_7_R3.Entity mcEnt = (net.minecraft.server.v1_7_R3.Entity) o; + if (o instanceof net.minecraft.server.v1_7_R4.Entity) { + net.minecraft.server.v1_7_R4.Entity mcEnt = (net.minecraft.server.v1_7_R4.Entity) o; Entity bukkitEntity = mcEnt.getBukkitEntity(); // Assuming that bukkitEntity isn't null @@ -596,8 +606,8 @@ public class CraftWorld implements World { List list = new ArrayList(); for (Object o : world.entityList) { - if (o instanceof net.minecraft.server.v1_7_R3.Entity) { - net.minecraft.server.v1_7_R3.Entity mcEnt = (net.minecraft.server.v1_7_R3.Entity) o; + if (o instanceof net.minecraft.server.v1_7_R4.Entity) { + net.minecraft.server.v1_7_R4.Entity mcEnt = (net.minecraft.server.v1_7_R4.Entity) o; Entity bukkitEntity = mcEnt.getBukkitEntity(); // Assuming that bukkitEntity isn't null @@ -621,8 +631,8 @@ public class CraftWorld implements World { Collection list = new ArrayList(); for (Object entity: world.entityList) { - if (entity instanceof net.minecraft.server.v1_7_R3.Entity) { - Entity bukkitEntity = ((net.minecraft.server.v1_7_R3.Entity) entity).getBukkitEntity(); + if (entity instanceof net.minecraft.server.v1_7_R4.Entity) { + Entity bukkitEntity = ((net.minecraft.server.v1_7_R4.Entity) entity).getBukkitEntity(); if (bukkitEntity == null) { continue; @@ -643,8 +653,8 @@ public class CraftWorld implements World { Collection list = new ArrayList(); for (Object entity: world.entityList) { - if (entity instanceof net.minecraft.server.v1_7_R3.Entity) { - Entity bukkitEntity = ((net.minecraft.server.v1_7_R3.Entity) entity).getBukkitEntity(); + if (entity instanceof net.minecraft.server.v1_7_R4.Entity) { + Entity bukkitEntity = ((net.minecraft.server.v1_7_R4.Entity) entity).getBukkitEntity(); if (bukkitEntity == null) { continue; @@ -668,8 +678,8 @@ public class CraftWorld implements World { List list = new ArrayList(); for (Object o : world.entityList) { - if (o instanceof net.minecraft.server.v1_7_R3.Entity) { - net.minecraft.server.v1_7_R3.Entity mcEnt = (net.minecraft.server.v1_7_R3.Entity) o; + if (o instanceof net.minecraft.server.v1_7_R4.Entity) { + net.minecraft.server.v1_7_R4.Entity mcEnt = (net.minecraft.server.v1_7_R4.Entity) o; Entity bukkitEntity = mcEnt.getBukkitEntity(); if ((bukkitEntity != null) && (bukkitEntity instanceof Player)) { @@ -704,7 +714,7 @@ public class CraftWorld implements World { } public void setDifficulty(Difficulty difficulty) { - this.getHandle().difficulty = EnumDifficulty.a(difficulty.getValue()); + this.getHandle().difficulty = EnumDifficulty.getById(difficulty.getValue()); } public Difficulty getDifficulty() { @@ -832,8 +842,8 @@ public class CraftWorld implements World { double y = location.getBlockY() + 0.5; double z = location.getBlockZ() + 0.5; - EntityFallingBlock entity = new EntityFallingBlock(world, x, y, z, net.minecraft.server.v1_7_R3.Block.e(material.getId()), data); - entity.b = 1; // ticksLived + EntityFallingBlock entity = new EntityFallingBlock(world, x, y, z, net.minecraft.server.v1_7_R4.Block.getById(material.getId()), data); + entity.ticksLived = 1; world.addEntity(entity, SpawnReason.CUSTOM); return (FallingBlock) entity.getBukkitEntity(); @@ -849,7 +859,7 @@ public class CraftWorld implements World { throw new IllegalArgumentException("Location or entity class cannot be null"); } - net.minecraft.server.v1_7_R3.Entity entity = null; + net.minecraft.server.v1_7_R4.Entity entity = null; double x = location.getX(); double y = location.getY(); @@ -867,7 +877,7 @@ public class CraftWorld implements World { int type = world.getTypeId((int) x, (int) y, (int) z); int data = world.getData((int) x, (int) y, (int) z); - entity = new EntityFallingBlock(world, x + 0.5, y + 0.5, z + 0.5, net.minecraft.server.v1_7_R3.Block.e(type), data); + entity = new EntityFallingBlock(world, x + 0.5, y + 0.5, z + 0.5, net.minecraft.server.v1_7_R4.Block.getById(type), data); } else if (Projectile.class.isAssignableFrom(clazz)) { if (Snowball.class.isAssignableFrom(clazz)) { entity = new EntitySnowball(world, x, y, z); @@ -1030,7 +1040,7 @@ public class CraftWorld implements World { entity = new EntityItemFrame(world, (int) x, (int) y, (int) z, dir); } else if (LeashHitch.class.isAssignableFrom(clazz)) { entity = new EntityLeash(world, (int) x, (int) y, (int) z); - entity.n = true; + entity.attachedToPlayer = true; } if (entity != null && !((EntityHanging) entity).survives()) { @@ -1051,9 +1061,16 @@ public class CraftWorld implements World { } if (entity != null) { - if (entity instanceof EntityInsentient) { - //((EntityInsentient) entity).a((GroupDataEntity) null); // Should be prepare? + // Spigot start + if (entity instanceof EntityOcelot) + { + ( (EntityOcelot) entity ).spawnBonus = false; } + // Spigot end + + //if (entity instanceof EntityInsentient) { + // ((EntityInsentient) entity).prepare((GroupDataEntity) null); + //} world.addEntity(entity, reason); return (T) entity.getBukkitEntity(); @@ -1269,11 +1286,11 @@ public class CraftWorld implements World { } public String[] getGameRules() { - return getHandle().getGameRules().b(); + return getHandle().getGameRules().getGameRules(); } public boolean isGameRule(String rule) { - return getHandle().getGameRules().e(rule); + return getHandle().getGameRules().contains(rule); } public void processChunkGC() { @@ -1288,7 +1305,7 @@ public class CraftWorld implements World { } ChunkProviderServer cps = world.chunkProviderServer; - for (net.minecraft.server.v1_7_R3.Chunk chunk : cps.chunks.values()) { + for (net.minecraft.server.v1_7_R4.Chunk chunk : cps.chunks.values()) { // If in use, skip it if (isChunkInUse(chunk.locX, chunk.locZ)) { continue; @@ -1321,7 +1338,7 @@ public class CraftWorld implements World { { StringBuilder particleFullName = new StringBuilder(); particleFullName.append( effect.getName() ); - if ( effect.getData() != null && ( effect.getData().equals( Material.class ) || effect.getData().equals( org.bukkit.material.MaterialData.class ) ) ) + if ( effect.getData() != null && ( effect.getData().equals( org.bukkit.Material.class ) || effect.getData().equals( org.bukkit.material.MaterialData.class ) ) ) { particleFullName.append( '_' ).append( id ); } @@ -1379,4 +1396,4 @@ public class CraftWorld implements World { return spigot; } // Spigot end -} \ No newline at end of file +} diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/org/bukkit/craftbukkit/v1_7_R3/entity/CraftPlayer.java b/Plugins/Nautilus.Core.CraftBukkit/src/org/bukkit/craftbukkit/v1_7_R4/entity/CraftPlayer.java similarity index 92% rename from Plugins/Nautilus.Core.CraftBukkit/src/org/bukkit/craftbukkit/v1_7_R3/entity/CraftPlayer.java rename to Plugins/Nautilus.Core.CraftBukkit/src/org/bukkit/craftbukkit/v1_7_R4/entity/CraftPlayer.java index b76836385..bcf6c0d1a 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/org/bukkit/craftbukkit/v1_7_R3/entity/CraftPlayer.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/org/bukkit/craftbukkit/v1_7_R4/entity/CraftPlayer.java @@ -1,4 +1,4 @@ -package org.bukkit.craftbukkit.v1_7_R3.entity; +package org.bukkit.craftbukkit.v1_7_R4.entity; import com.google.common.collect.ImmutableSet; import com.google.common.collect.MapMaker; @@ -17,13 +17,14 @@ import java.util.UUID; import java.util.logging.Level; import java.util.logging.Logger; -import net.minecraft.server.v1_7_R3.*; -import net.minecraft.util.com.mojang.authlib.GameProfile; +import net.minecraft.server.v1_7_R4.*; +import net.minecraft.util.com.mojang.authlib.GameProfile; import org.apache.commons.lang.Validate; import org.apache.commons.lang.NotImplementedException; import org.bukkit.*; import org.bukkit.Achievement; +import org.bukkit.BanList; import org.bukkit.Statistic; import org.bukkit.Material; import org.bukkit.Statistic.Type; @@ -32,19 +33,19 @@ import org.bukkit.configuration.serialization.DelegateDeserialization; import org.bukkit.conversations.Conversation; import org.bukkit.conversations.ConversationAbandonedEvent; import org.bukkit.conversations.ManuallyAbandonedConversationCanceller; -import org.bukkit.craftbukkit.v1_7_R3.block.CraftSign; -import org.bukkit.craftbukkit.v1_7_R3.conversations.ConversationTracker; -import org.bukkit.craftbukkit.v1_7_R3.CraftEffect; -import org.bukkit.craftbukkit.v1_7_R3.CraftOfflinePlayer; -import org.bukkit.craftbukkit.v1_7_R3.CraftServer; -import org.bukkit.craftbukkit.v1_7_R3.CraftSound; -import org.bukkit.craftbukkit.v1_7_R3.CraftStatistic; -import org.bukkit.craftbukkit.v1_7_R3.CraftWorld; -import org.bukkit.craftbukkit.v1_7_R3.map.CraftMapView; -import org.bukkit.craftbukkit.v1_7_R3.map.RenderData; -import org.bukkit.craftbukkit.v1_7_R3.scoreboard.CraftScoreboard; -import org.bukkit.craftbukkit.v1_7_R3.util.CraftChatMessage; -import org.bukkit.craftbukkit.v1_7_R3.util.CraftMagicNumbers; +import org.bukkit.craftbukkit.v1_7_R4.block.CraftSign; +import org.bukkit.craftbukkit.v1_7_R4.conversations.ConversationTracker; +import org.bukkit.craftbukkit.v1_7_R4.CraftEffect; +import org.bukkit.craftbukkit.v1_7_R4.CraftOfflinePlayer; +import org.bukkit.craftbukkit.v1_7_R4.CraftServer; +import org.bukkit.craftbukkit.v1_7_R4.CraftSound; +import org.bukkit.craftbukkit.v1_7_R4.CraftStatistic; +import org.bukkit.craftbukkit.v1_7_R4.CraftWorld; +import org.bukkit.craftbukkit.v1_7_R4.map.CraftMapView; +import org.bukkit.craftbukkit.v1_7_R4.map.RenderData; +import org.bukkit.craftbukkit.v1_7_R4.scoreboard.CraftScoreboard; +import org.bukkit.craftbukkit.v1_7_R4.util.CraftChatMessage; +import org.bukkit.craftbukkit.v1_7_R4.util.CraftMagicNumbers; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.event.player.PlayerGameModeChangeEvent; @@ -57,7 +58,6 @@ import org.bukkit.metadata.MetadataValue; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.messaging.StandardMessenger; import org.bukkit.scoreboard.Scoreboard; -import org.bukkit.util.NumberConversions; @DelegateDeserialization(CraftOfflinePlayer.class) public class CraftPlayer extends CraftHumanEntity implements Player @@ -68,7 +68,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player private final ConversationTracker conversationTracker = new ConversationTracker(); private final Set channels = new HashSet(); private final Set hiddenPlayers = new HashSet(); - private int hash = 0; private double health = 20; private boolean scaledHealth = false; @@ -121,7 +120,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player } } return false; - } public InetSocketAddress getAddress() @@ -270,12 +268,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player return false; } OfflinePlayer other = (OfflinePlayer) obj; - if ((this.getName() == null) || (other.getName() == null)) + if ((this.getUniqueId() == null) || (other.getUniqueId() == null)) { return false; } - boolean nameEquals = this.getName().equalsIgnoreCase(other.getName()); + boolean uuidEquals = this.getUniqueId().equals(other.getUniqueId()); boolean idEquals = true; if (other instanceof CraftPlayer) @@ -283,7 +281,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player idEquals = this.getEntityId() == ((CraftPlayer) other).getEntityId(); } - return nameEquals && idEquals; + return uuidEquals && idEquals; } @Override @@ -354,7 +352,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player break; } getHandle().playerConnection.sendPacket(new PacketPlayOutNamedSoundEffect("note." + instrumentName, loc - .getBlockX(), loc.getBlockY(), loc.getBlockZ(), 3.0f, note)); + .getBlockX(), loc.getBlockY(), loc.getBlockZ(), 3.0f, note)); } @Override @@ -481,7 +479,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player String[] astring = CraftSign.sanitizeLines(lines); getHandle().playerConnection.sendPacket(new PacketPlayOutUpdateSign(loc.getBlockX(), loc.getBlockY(), loc - .getBlockZ(), astring)); + .getBlockZ(), astring)); } @Override @@ -690,7 +688,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player public boolean hasAchievement(Achievement achievement) { Validate.notNull(achievement, "Achievement cannot be null"); - return getHandle().getStatisticManager().a(CraftStatistic.getNMSAchievement(achievement)); + return getHandle().getStatisticManager().hasAchievement(CraftStatistic.getNMSAchievement(achievement)); } @Override @@ -733,7 +731,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player Validate.notNull(statistic, "Statistic cannot be null"); Validate.isTrue(statistic.getType() == Type.UNTYPED, "Must supply additional paramater for this statistic"); Validate.isTrue(newValue >= 0, "Value must be greater than or equal to 0"); - net.minecraft.server.v1_7_R3.Statistic nmsStatistic = CraftStatistic.getNMSStatistic(statistic); + net.minecraft.server.v1_7_R4.Statistic nmsStatistic = CraftStatistic.getNMSStatistic(statistic); getHandle().getStatisticManager().setStatistic(getHandle(), nmsStatistic, newValue); } @@ -756,7 +754,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player Validate.notNull(material, "Material cannot be null"); Validate.isTrue(statistic.getType() == Type.BLOCK || statistic.getType() == Type.ITEM, "This statistic does not take a Material parameter"); - net.minecraft.server.v1_7_R3.Statistic nmsStatistic = CraftStatistic.getMaterialStatistic(statistic, material); + net.minecraft.server.v1_7_R4.Statistic nmsStatistic = CraftStatistic.getMaterialStatistic(statistic, material); Validate.notNull(nmsStatistic, "The supplied Material does not have a corresponding statistic"); return getHandle().getStatisticManager().getStatisticValue(nmsStatistic); } @@ -783,7 +781,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player Validate.isTrue(newValue >= 0, "Value must be greater than or equal to 0"); Validate.isTrue(statistic.getType() == Type.BLOCK || statistic.getType() == Type.ITEM, "This statistic does not take a Material parameter"); - net.minecraft.server.v1_7_R3.Statistic nmsStatistic = CraftStatistic.getMaterialStatistic(statistic, material); + net.minecraft.server.v1_7_R4.Statistic nmsStatistic = CraftStatistic.getMaterialStatistic(statistic, material); Validate.notNull(nmsStatistic, "The supplied Material does not have a corresponding statistic"); getHandle().getStatisticManager().setStatistic(getHandle(), nmsStatistic, newValue); } @@ -806,7 +804,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player Validate.notNull(statistic, "Statistic cannot be null"); Validate.notNull(entityType, "EntityType cannot be null"); Validate.isTrue(statistic.getType() == Type.ENTITY, "This statistic does not take an EntityType parameter"); - net.minecraft.server.v1_7_R3.Statistic nmsStatistic = CraftStatistic.getEntityStatistic(statistic, entityType); + net.minecraft.server.v1_7_R4.Statistic nmsStatistic = CraftStatistic.getEntityStatistic(statistic, entityType); Validate.notNull(nmsStatistic, "The supplied EntityType does not have a corresponding statistic"); return getHandle().getStatisticManager().getStatisticValue(nmsStatistic); } @@ -832,7 +830,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player Validate.notNull(entityType, "EntityType cannot be null"); Validate.isTrue(newValue >= 0, "Value must be greater than or equal to 0"); Validate.isTrue(statistic.getType() == Type.ENTITY, "This statistic does not take an EntityType parameter"); - net.minecraft.server.v1_7_R3.Statistic nmsStatistic = CraftStatistic.getEntityStatistic(statistic, entityType); + net.minecraft.server.v1_7_R4.Statistic nmsStatistic = CraftStatistic.getEntityStatistic(statistic, entityType); Validate.notNull(nmsStatistic, "The supplied EntityType does not have a corresponding statistic"); getHandle().getStatisticManager().setStatistic(getHandle(), nmsStatistic, newValue); } @@ -944,7 +942,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player return; } - getHandle().playerInteractManager.setGameMode(EnumGamemode.a(mode.getValue())); + getHandle().playerInteractManager.setGameMode(EnumGamemode.getById(mode.getValue())); getHandle().fallDistance = 0; getHandle().playerConnection.sendPacket(new PacketPlayOutGameStateChange(3, mode.getValue())); } @@ -953,7 +951,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player @Override public GameMode getGameMode() { - return GameMode.getByValue(getHandle().playerInteractManager.getGameMode().a()); + return GameMode.getByValue(getHandle().playerInteractManager.getGameMode().getId()); } public void giveExp(int exp) @@ -1094,6 +1092,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player .sendPacket(new PacketPlayOutPlayerInfo(player.getPlayerListName(), false, 9999)); } + public void showPlayer(Player player) { Validate.notNull(player, "shown player cannot be null"); @@ -1114,7 +1113,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player } getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(player.getPlayerListName(), true, - getHandle().ping)); + getHandle().ping)); } public void removeDisconnectingPlayer(Player player) @@ -1163,7 +1162,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { if (hash == 0 || hash == 485) { - hash = 97 * 5 + (this.getName() != null ? this.getName().toLowerCase().hashCode() : 0); + hash = 97 * 5 + (this.getUniqueId() != null ? this.getUniqueId().hashCode() : 0); } return hash; } @@ -1240,7 +1239,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player public void abandonConversation(Conversation conversation) { conversationTracker.abandonConversation(conversation, new ConversationAbandonedEvent(conversation, - new ManuallyAbandonedConversationCanceller())); + new ManuallyAbandonedConversationCanceller())); } public void abandonConversation(Conversation conversation, ConversationAbandonedEvent details) @@ -1555,14 +1554,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player public void updateScaledHealth() { - AttributeMapServer attributemapserver = (AttributeMapServer) getHandle().bb(); - Set set = attributemapserver.b(); + AttributeMapServer attributemapserver = (AttributeMapServer) getHandle().getAttributeMap(); + Set set = attributemapserver.getAttributes(); injectScaledMaxHealth(set, true); getHandle().getDataWatcher().watch(6, (float) getScaledHealth()); getHandle().playerConnection.sendPacket(new PacketPlayOutUpdateHealth(getScaledHealth(), getHandle() - .getFoodData().a(), getHandle().getFoodData().e())); + .getFoodData().getFoodLevel(), getHandle().getFoodData().getSaturationLevel())); getHandle().playerConnection.sendPacket(new PacketPlayOutUpdateAttributes(getHandle().getId(), set)); set.clear(); @@ -1577,16 +1576,23 @@ public class CraftPlayer extends CraftHumanEntity implements Player } for (Object genericInstance : collection) { - IAttribute attribute = ((AttributeInstance) genericInstance).a(); - if (attribute.a().equals("generic.maxHealth")) + IAttribute attribute = ((AttributeInstance) genericInstance).getAttribute(); + if (attribute.getName().equals("generic.maxHealth")) { collection.remove(genericInstance); break; } - continue; } - collection.add(new AttributeModifiable(getHandle().bb(), (new AttributeRanged("generic.maxHealth", - scaledHealth ? healthScale : getMaxHealth(), 0.0D, Float.MAX_VALUE)).a("Max Health").a(true))); + // Spigot start + double healthMod = scaledHealth ? healthScale : getMaxHealth(); + if (healthMod >= Float.MAX_VALUE || healthMod <= 0) + { + healthMod = 20; // Reset health + getServer().getLogger().warning(getName() + " tried to crash the server with a large health attribute"); + } + collection.add(new AttributeModifiable(getHandle().getAttributeMap(), (new AttributeRanged("generic.maxHealth", + healthMod, 0.0D, Float.MAX_VALUE)).a("Max Health").a(true))); + // Spigot end } // Spigot start @@ -1695,60 +1701,4 @@ public class CraftPlayer extends CraftHumanEntity implements Player return spigot; } // Spigot end - - @Deprecated - @Override - public int _INVALID_getLastDamage() - { - return NumberConversions.ceil(getLastDamage()); - } - - @Deprecated - @Override - public void _INVALID_setLastDamage(int damage) - { - setLastDamage(damage); - } - - @Deprecated - @Override - public void _INVALID_damage(int amount) - { - damage(amount); - } - - @Deprecated - @Override - public void _INVALID_damage(int amount, org.bukkit.entity.Entity source) - { - damage(amount, source); - } - - @Deprecated - @Override - public int _INVALID_getHealth() - { - return NumberConversions.ceil(getHealth()); - } - - @Deprecated - @Override - public void _INVALID_setHealth(int health) - { - setHealth(health); - } - - @Deprecated - @Override - public int _INVALID_getMaxHealth() - { - return NumberConversions.ceil(getMaxHealth()); - } - - @Deprecated - @Override - public void _INVALID_setMaxHealth(int health) - { - setMaxHealth(health); - } -} \ No newline at end of file +} diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/org/bukkit/craftbukkit/v1_7_R3/inventory/CraftInventoryCustom.java b/Plugins/Nautilus.Core.CraftBukkit/src/org/bukkit/craftbukkit/v1_7_R4/inventory/CraftInventoryCustom.java similarity index 76% rename from Plugins/Nautilus.Core.CraftBukkit/src/org/bukkit/craftbukkit/v1_7_R3/inventory/CraftInventoryCustom.java rename to Plugins/Nautilus.Core.CraftBukkit/src/org/bukkit/craftbukkit/v1_7_R4/inventory/CraftInventoryCustom.java index c268ca178..2213bdd90 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/org/bukkit/craftbukkit/v1_7_R3/inventory/CraftInventoryCustom.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/org/bukkit/craftbukkit/v1_7_R4/inventory/CraftInventoryCustom.java @@ -1,7 +1,7 @@ -package org.bukkit.craftbukkit.v1_7_R3.inventory; +package org.bukkit.craftbukkit.v1_7_R4.inventory; -import org.bukkit.craftbukkit.v1_7_R3.inventory.MinecraftInventory; -import org.bukkit.craftbukkit.v1_7_R3.inventory.CraftInventory; +import org.bukkit.craftbukkit.v1_7_R4.inventory.MinecraftInventory; +import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftInventory; import org.bukkit.event.inventory.InventoryType; import org.bukkit.inventory.InventoryHolder; diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/org/bukkit/craftbukkit/v1_7_R3/inventory/CraftItemStack.java b/Plugins/Nautilus.Core.CraftBukkit/src/org/bukkit/craftbukkit/v1_7_R4/inventory/CraftItemStack.java similarity index 88% rename from Plugins/Nautilus.Core.CraftBukkit/src/org/bukkit/craftbukkit/v1_7_R3/inventory/CraftItemStack.java rename to Plugins/Nautilus.Core.CraftBukkit/src/org/bukkit/craftbukkit/v1_7_R4/inventory/CraftItemStack.java index 55e301151..1e41bb6e5 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/org/bukkit/craftbukkit/v1_7_R3/inventory/CraftItemStack.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/org/bukkit/craftbukkit/v1_7_R4/inventory/CraftItemStack.java @@ -1,20 +1,20 @@ -package org.bukkit.craftbukkit.v1_7_R3.inventory; +package org.bukkit.craftbukkit.v1_7_R4.inventory; -import static org.bukkit.craftbukkit.v1_7_R3.inventory.CraftMetaItem.ENCHANTMENTS; -import static org.bukkit.craftbukkit.v1_7_R3.inventory.CraftMetaItem.ENCHANTMENTS_ID; -import static org.bukkit.craftbukkit.v1_7_R3.inventory.CraftMetaItem.ENCHANTMENTS_LVL; +import static org.bukkit.craftbukkit.v1_7_R4.inventory.CraftMetaItem.ENCHANTMENTS; +import static org.bukkit.craftbukkit.v1_7_R4.inventory.CraftMetaItem.ENCHANTMENTS_ID; +import static org.bukkit.craftbukkit.v1_7_R4.inventory.CraftMetaItem.ENCHANTMENTS_LVL; import java.util.Map; -import net.minecraft.server.v1_7_R3.EnchantmentManager; -import net.minecraft.server.v1_7_R3.Item; -import net.minecraft.server.v1_7_R3.NBTTagCompound; -import net.minecraft.server.v1_7_R3.NBTTagList; +import net.minecraft.server.v1_7_R4.EnchantmentManager; +import net.minecraft.server.v1_7_R4.Item; +import net.minecraft.server.v1_7_R4.NBTTagCompound; +import net.minecraft.server.v1_7_R4.NBTTagList; import org.apache.commons.lang.Validate; import org.bukkit.Material; import org.bukkit.configuration.serialization.DelegateDeserialization; -import org.bukkit.craftbukkit.v1_7_R3.util.CraftMagicNumbers; +import org.bukkit.craftbukkit.v1_7_R4.util.CraftMagicNumbers; import org.bukkit.enchantments.Enchantment; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; @@ -24,7 +24,7 @@ import com.google.common.collect.ImmutableMap; @DelegateDeserialization(ItemStack.class) public class CraftItemStack extends ItemStack { - public static net.minecraft.server.v1_7_R3.ItemStack asNMSCopy(ItemStack original) { + public static net.minecraft.server.v1_7_R4.ItemStack asNMSCopy(ItemStack original) { if (original instanceof CraftItemStack) { CraftItemStack stack = (CraftItemStack) original; return stack.handle == null ? null : stack.handle.cloneItemStack(); @@ -39,15 +39,15 @@ public class CraftItemStack extends ItemStack { return null; } - net.minecraft.server.v1_7_R3.ItemStack stack = new net.minecraft.server.v1_7_R3.ItemStack(item, original.getAmount(), original.getDurability()); + net.minecraft.server.v1_7_R4.ItemStack stack = new net.minecraft.server.v1_7_R4.ItemStack(item, original.getAmount(), original.getDurability()); if (original.hasItemMeta()) { setItemMeta(stack, original.getItemMeta()); } return stack; } - public static net.minecraft.server.v1_7_R3.ItemStack copyNMSStack(net.minecraft.server.v1_7_R3.ItemStack original, int amount) { - net.minecraft.server.v1_7_R3.ItemStack stack = original.cloneItemStack(); + public static net.minecraft.server.v1_7_R4.ItemStack copyNMSStack(net.minecraft.server.v1_7_R4.ItemStack original, int amount) { + net.minecraft.server.v1_7_R4.ItemStack stack = original.cloneItemStack(); stack.count = amount; return stack; } @@ -55,7 +55,7 @@ public class CraftItemStack extends ItemStack { /** * Copies the NMS stack to return as a strictly-Bukkit stack */ - public static ItemStack asBukkitCopy(net.minecraft.server.v1_7_R3.ItemStack original) { + public static ItemStack asBukkitCopy(net.minecraft.server.v1_7_R4.ItemStack original) { if (original == null) { return new ItemStack(Material.AIR); } @@ -66,7 +66,7 @@ public class CraftItemStack extends ItemStack { return stack; } - public static CraftItemStack asCraftMirror(net.minecraft.server.v1_7_R3.ItemStack original) { + public static CraftItemStack asCraftMirror(net.minecraft.server.v1_7_R4.ItemStack original) { return new CraftItemStack(original); } @@ -86,12 +86,12 @@ public class CraftItemStack extends ItemStack { return new CraftItemStack(CraftMagicNumbers.getMaterial(item), amount, (short) 0, null); } - net.minecraft.server.v1_7_R3.ItemStack handle; + net.minecraft.server.v1_7_R4.ItemStack handle; /** * Mirror */ - protected CraftItemStack(net.minecraft.server.v1_7_R3.ItemStack item) { + protected CraftItemStack(net.minecraft.server.v1_7_R4.ItemStack item) { this.handle = item; } @@ -125,7 +125,7 @@ public class CraftItemStack extends ItemStack { } else if (CraftMagicNumbers.getItem(type) == null) { // :( handle = null; } else if (handle == null) { - handle = new net.minecraft.server.v1_7_R3.ItemStack(CraftMagicNumbers.getItem(type), 1, 0); + handle = new net.minecraft.server.v1_7_R4.ItemStack(CraftMagicNumbers.getItem(type), 1, 0); } else { handle.setItem(CraftMagicNumbers.getItem(type)); if (hasItemMeta()) { @@ -203,7 +203,7 @@ public class CraftItemStack extends ItemStack { list.add(tag); } - static boolean makeTag(net.minecraft.server.v1_7_R3.ItemStack item) { + static boolean makeTag(net.minecraft.server.v1_7_R4.ItemStack item) { if (item == null) { return false; } @@ -279,7 +279,7 @@ public class CraftItemStack extends ItemStack { return getEnchantments(handle); } - static Map getEnchantments(net.minecraft.server.v1_7_R3.ItemStack item) { + static Map getEnchantments(net.minecraft.server.v1_7_R4.ItemStack item) { NBTTagList list = (item != null && item.hasEnchantments()) ? item.getEnchantments() : null; if (list == null || list.size() == 0) { @@ -298,7 +298,7 @@ public class CraftItemStack extends ItemStack { return result.build(); } - static NBTTagList getEnchantmentList(net.minecraft.server.v1_7_R3.ItemStack item) { + static NBTTagList getEnchantmentList(net.minecraft.server.v1_7_R4.ItemStack item) { return (item != null && item.hasEnchantments()) ? item.getEnchantments() : null; } @@ -316,11 +316,11 @@ public class CraftItemStack extends ItemStack { return getItemMeta(handle); } - public net.minecraft.server.v1_7_R3.ItemStack getHandle() { + public net.minecraft.server.v1_7_R4.ItemStack getHandle() { return handle; } - public static ItemMeta getItemMeta(net.minecraft.server.v1_7_R3.ItemStack item) { + public static ItemMeta getItemMeta(net.minecraft.server.v1_7_R4.ItemStack item) { if (!hasItemMeta(item)) { return CraftItemFactory.instance().getItemMeta(getType(item)); } @@ -350,7 +350,7 @@ public class CraftItemStack extends ItemStack { } } - static Material getType(net.minecraft.server.v1_7_R3.ItemStack item) { + static Material getType(net.minecraft.server.v1_7_R4.ItemStack item) { Material material = Material.getMaterial(item == null ? 0 : CraftMagicNumbers.getId(item.getItem())); return material == null ? Material.AIR : material; } @@ -360,11 +360,11 @@ public class CraftItemStack extends ItemStack { return setItemMeta(handle, itemMeta); } - public static boolean setItemMeta(net.minecraft.server.v1_7_R3.ItemStack item, ItemMeta itemMeta) { + public static boolean setItemMeta(net.minecraft.server.v1_7_R4.ItemStack item, ItemMeta itemMeta) { if (item == null) { return false; } - if (itemMeta == null) { + if (CraftItemFactory.instance().equals(itemMeta, null)) { item.tag = null; return true; } @@ -409,7 +409,7 @@ public class CraftItemStack extends ItemStack { return hasItemMeta(handle); } - static boolean hasItemMeta(net.minecraft.server.v1_7_R3.ItemStack item) { + static boolean hasItemMeta(net.minecraft.server.v1_7_R4.ItemStack item) { return !(item == null || item.tag == null || item.tag.isEmpty()); } } \ No newline at end of file diff --git a/Plugins/Nautilus.Core.CraftBukkit/src/org/bukkit/craftbukkit/v1_7_R3/inventory/MinecraftInventory.java b/Plugins/Nautilus.Core.CraftBukkit/src/org/bukkit/craftbukkit/v1_7_R4/inventory/MinecraftInventory.java similarity index 89% rename from Plugins/Nautilus.Core.CraftBukkit/src/org/bukkit/craftbukkit/v1_7_R3/inventory/MinecraftInventory.java rename to Plugins/Nautilus.Core.CraftBukkit/src/org/bukkit/craftbukkit/v1_7_R4/inventory/MinecraftInventory.java index 913941bee..e9204e828 100644 --- a/Plugins/Nautilus.Core.CraftBukkit/src/org/bukkit/craftbukkit/v1_7_R3/inventory/MinecraftInventory.java +++ b/Plugins/Nautilus.Core.CraftBukkit/src/org/bukkit/craftbukkit/v1_7_R4/inventory/MinecraftInventory.java @@ -1,17 +1,17 @@ -package org.bukkit.craftbukkit.v1_7_R3.inventory; +package org.bukkit.craftbukkit.v1_7_R4.inventory; import java.util.ArrayList; import java.util.List; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftHumanEntity; -import org.bukkit.craftbukkit.v1_7_R3.inventory.CraftItemStack; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftHumanEntity; +import org.bukkit.craftbukkit.v1_7_R4.inventory.CraftItemStack; import org.bukkit.entity.HumanEntity; import org.bukkit.event.inventory.InventoryType; import org.bukkit.inventory.InventoryHolder; -import net.minecraft.server.v1_7_R3.EntityHuman; -import net.minecraft.server.v1_7_R3.IInventory; -import net.minecraft.server.v1_7_R3.ItemStack; +import net.minecraft.server.v1_7_R4.EntityHuman; +import net.minecraft.server.v1_7_R4.IInventory; +import net.minecraft.server.v1_7_R4.ItemStack; import net.minecraft.util.org.apache.commons.lang3.Validate; public class MinecraftInventory implements IInventory @@ -188,7 +188,7 @@ public class MinecraftInventory implements IInventory } @Override - public void l_() + public void closeContainer() { } } \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java index 847f69b4a..e4e677b9a 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java @@ -20,8 +20,8 @@ import org.bukkit.ChatColor; import org.bukkit.GameMode; import org.bukkit.Material; import org.bukkit.OfflinePlayer; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java index d86b8edef..e3051d48b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java @@ -33,7 +33,7 @@ import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Sound; import org.bukkit.block.BlockFace; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.HandlerList; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiege/CastleSiege.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiege/CastleSiege.java index 52b3b6104..74e64806e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiege/CastleSiege.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiege/CastleSiege.java @@ -16,7 +16,7 @@ import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.FireworkEffect.Type; import org.bukkit.block.Block; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftCreature; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature; import org.bukkit.entity.Creature; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; @@ -61,8 +61,8 @@ import nautilus.game.arcade.game.Game.GameState; import nautilus.game.arcade.game.games.castlesiege.kits.*; import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.NullKit; -import net.minecraft.server.v1_7_R3.EntityCreature; -import net.minecraft.server.v1_7_R3.Navigation; +import net.minecraft.server.v1_7_R4.EntityCreature; +import net.minecraft.server.v1_7_R4.Navigation; public class CastleSiege extends TeamGame { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Sleigh.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Sleigh.java index 4b5e42d67..d74ac3928 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Sleigh.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Sleigh.java @@ -21,7 +21,7 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.FireworkEffect.Type; import org.bukkit.block.BlockFace; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftEntity; import org.bukkit.entity.Chicken; import org.bukkit.entity.Entity; import org.bukkit.entity.FallingBlock; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/SleighPart.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/SleighPart.java index cfcf24eb4..40d8c1cdc 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/SleighPart.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/SleighPart.java @@ -7,7 +7,7 @@ import mineplex.core.common.util.UtilMath; import org.bukkit.Color; import org.bukkit.Location; import org.bukkit.Material; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftFallingSand; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftFallingSand; import org.bukkit.entity.Chicken; import org.bukkit.entity.Entity; import org.bukkit.entity.FallingBlock; @@ -69,7 +69,7 @@ public class SleighPart ent = ent.getPassenger(); if (ent instanceof FallingBlock) - ((CraftFallingSand)ent).getHandle().b = 1; + ((CraftFallingSand)ent).getHandle().ticksLived = 1; } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/BossMobs.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/BossMobs.java index 3100dc6f8..39e2f25ff 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/BossMobs.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/BossMobs.java @@ -7,11 +7,11 @@ import java.util.Iterator; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilTime; import nautilus.game.arcade.game.games.christmas.parts.Part5; -import net.minecraft.server.v1_7_R3.EntityCreature; +import net.minecraft.server.v1_7_R4.EntityCreature; import org.bukkit.Location; import org.bukkit.Material; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftCreature; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature; import org.bukkit.entity.Creature; import org.bukkit.entity.Player; import org.bukkit.entity.Skeleton; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/BossSnowmanPattern.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/BossSnowmanPattern.java index f5f737f60..3902fcfac 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/BossSnowmanPattern.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/BossSnowmanPattern.java @@ -11,11 +11,11 @@ import mineplex.core.common.util.UtilTime; import mineplex.core.recharge.Recharge; import nautilus.game.arcade.game.games.christmas.Christmas; import nautilus.game.arcade.game.games.christmas.parts.Part5; -import net.minecraft.server.v1_7_R3.EntityCreature; +import net.minecraft.server.v1_7_R4.EntityCreature; import org.bukkit.Effect; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftCreature; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature; import org.bukkit.entity.Player; import org.bukkit.entity.Snowman; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanBoss.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanBoss.java index 8db439e0e..b54ea5cc3 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanBoss.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanBoss.java @@ -4,7 +4,7 @@ import java.util.ArrayList; import org.bukkit.Effect; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftCreature; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature; import org.bukkit.entity.Creature; import org.bukkit.entity.Entity; import org.bukkit.entity.IronGolem; @@ -23,7 +23,7 @@ import mineplex.core.common.util.UtilMath; import mineplex.core.recharge.Recharge; import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.game.games.christmas.Christmas; -import net.minecraft.server.v1_7_R3.EntityCreature; +import net.minecraft.server.v1_7_R4.EntityCreature; public class SnowmanBoss { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanWaveA.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanWaveA.java index 26546c440..7aa5ede50 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanWaveA.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanWaveA.java @@ -9,11 +9,11 @@ import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilTime; import mineplex.core.recharge.Recharge; import nautilus.game.arcade.game.games.christmas.Christmas; -import net.minecraft.server.v1_7_R3.EntityCreature; +import net.minecraft.server.v1_7_R4.EntityCreature; import org.bukkit.Effect; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftCreature; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature; import org.bukkit.entity.Player; import org.bukkit.entity.Snowman; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanWaveB.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanWaveB.java index 8ae283b2b..77bd8edbd 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanWaveB.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanWaveB.java @@ -9,11 +9,11 @@ import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilTime; import mineplex.core.recharge.Recharge; import nautilus.game.arcade.game.games.christmas.Christmas; -import net.minecraft.server.v1_7_R3.EntityCreature; +import net.minecraft.server.v1_7_R4.EntityCreature; import org.bukkit.Effect; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftCreature; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature; import org.bukkit.entity.Player; import org.bukkit.entity.Snowman; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part.java index 6be6c1206..d97f9864b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part.java @@ -12,7 +12,7 @@ import mineplex.core.common.util.UtilServer; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import nautilus.game.arcade.game.games.christmas.Christmas; -import net.minecraft.server.v1_7_R3.EntityCreature; +import net.minecraft.server.v1_7_R4.EntityCreature; import org.bukkit.Location; import org.bukkit.Material; @@ -20,7 +20,7 @@ import org.bukkit.SkullType; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.block.Skull; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftCreature; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature; import org.bukkit.entity.Ageable; import org.bukkit.entity.Creature; import org.bukkit.entity.Player; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part5.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part5.java index c0810a89d..8e26006e1 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part5.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part5.java @@ -13,7 +13,7 @@ import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.game.games.christmas.Christmas; import nautilus.game.arcade.game.games.christmas.content.*; -import net.minecraft.server.v1_7_R3.EntityCreature; +import net.minecraft.server.v1_7_R4.EntityCreature; import org.bukkit.Effect; import org.bukkit.EntityEffect; @@ -22,7 +22,7 @@ import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftCreature; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature; import org.bukkit.entity.Player; import org.bukkit.entity.Snowman; import org.bukkit.event.EventHandler; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonriders/DragonData.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonriders/DragonData.java index da626d6f5..5a22bcb61 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonriders/DragonData.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonriders/DragonData.java @@ -7,7 +7,7 @@ import nautilus.game.arcade.ArcadeManager; import org.bukkit.Location; import org.bukkit.Sound; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftEnderDragon; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftEnderDragon; import org.bukkit.entity.EnderDragon; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gravity/Gravity.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gravity/Gravity.java index 86931296e..5e089847d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gravity/Gravity.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gravity/Gravity.java @@ -12,7 +12,7 @@ import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.FireworkEffect.Type; import org.bukkit.block.Block; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftFallingSand; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftFallingSand; import org.bukkit.entity.Arrow; import org.bukkit.entity.FallingBlock; import org.bukkit.entity.Player; @@ -313,7 +313,7 @@ public class Gravity extends SoloGame //Dont Disappear if (obj.Ent instanceof FallingBlock) - ((CraftFallingSand)obj.Ent).getHandle().b = 1; + ((CraftFallingSand)obj.Ent).getHandle().ticksLived = 1; HashMap blocks = UtilBlock.getInRadius(obj.Ent.getLocation(), 1.2); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/CreatureBase.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/CreatureBase.java index 58b839251..7185583ba 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/CreatureBase.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/CreatureBase.java @@ -5,11 +5,11 @@ import mineplex.core.common.util.UtilMath; import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.game.Game; -import net.minecraft.server.v1_7_R3.EntityCreature; -import net.minecraft.server.v1_7_R3.Navigation; +import net.minecraft.server.v1_7_R4.EntityCreature; +import net.minecraft.server.v1_7_R4.Navigation; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftCreature; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.event.entity.EntityTargetEvent; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/PumpkinKing.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/PumpkinKing.java index e0504c959..72deeb40b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/PumpkinKing.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/halloween/creatures/PumpkinKing.java @@ -23,17 +23,17 @@ import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.game.Game; -import net.minecraft.server.v1_7_R3.EntityArrow; -import net.minecraft.server.v1_7_R3.EntityCreature; -import net.minecraft.server.v1_7_R3.Navigation; +import net.minecraft.server.v1_7_R4.EntityArrow; +import net.minecraft.server.v1_7_R4.EntityCreature; +import net.minecraft.server.v1_7_R4.Navigation; import org.bukkit.Effect; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.block.Block; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftArrow; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftCreature; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftArrow; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature; import org.bukkit.entity.Arrow; import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/HideSeek.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/HideSeek.java index 01acc66d9..64ddf7a19 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/HideSeek.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/HideSeek.java @@ -11,7 +11,7 @@ import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.FireworkEffect.Type; import org.bukkit.block.BlockFace; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftCreature; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Arrow; import org.bukkit.entity.Chicken; @@ -76,8 +76,8 @@ import nautilus.game.arcade.game.games.hideseek.forms.Form; import nautilus.game.arcade.game.games.hideseek.kits.*; import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.NullKit; -import net.minecraft.server.v1_7_R3.EntityCreature; -import net.minecraft.server.v1_7_R3.Navigation; +import net.minecraft.server.v1_7_R4.EntityCreature; +import net.minecraft.server.v1_7_R4.Navigation; @SuppressWarnings("deprecation") public class HideSeek extends TeamGame diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/forms/BlockForm.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/forms/BlockForm.java index 0774dce9e..139f25d63 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/forms/BlockForm.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/forms/BlockForm.java @@ -20,8 +20,8 @@ import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftFallingSand; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftFallingSand; import org.bukkit.entity.FallingBlock; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -240,7 +240,7 @@ public class BlockForm extends Form //Ensure Falling doesnt Despawn else { - ((CraftFallingSand)Player.getPassenger()).getHandle().b = 1; + ((CraftFallingSand)Player.getPassenger()).getHandle().ticksLived = 1; Player.getPassenger().setTicksLived(1); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/forms/CreatureForm.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/forms/CreatureForm.java index fe7ed00b1..c0524e588 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/forms/CreatureForm.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/forms/CreatureForm.java @@ -10,7 +10,7 @@ import nautilus.game.arcade.game.games.hideseek.HideSeek; import org.bukkit.Material; import org.bukkit.Sound; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftEntity; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/milkcow/MilkCow.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/milkcow/MilkCow.java index 13bcb29e7..579b47a02 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/milkcow/MilkCow.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/milkcow/MilkCow.java @@ -9,7 +9,7 @@ import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftCreature; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature; import org.bukkit.entity.Chicken; import org.bukkit.entity.Cow; import org.bukkit.entity.Creature; @@ -46,8 +46,8 @@ import nautilus.game.arcade.game.GameTeam.PlayerState; import nautilus.game.arcade.game.games.milkcow.kits.*; import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.NullKit; -import net.minecraft.server.v1_7_R3.EntityCreature; -import net.minecraft.server.v1_7_R3.Navigation; +import net.minecraft.server.v1_7_R4.EntityCreature; +import net.minecraft.server.v1_7_R4.Navigation; public class MilkCow extends SoloGame { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/paintball/Paintball.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/paintball/Paintball.java index a1c2a5e61..2bcf76369 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/paintball/Paintball.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/paintball/Paintball.java @@ -13,7 +13,7 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.block.Block; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.EnderPearl; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/runner/Runner.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/runner/Runner.java index 7869f7321..54f4fd9ad 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/runner/Runner.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/runner/Runner.java @@ -9,7 +9,7 @@ import org.bukkit.Effect; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftArrow; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftArrow; import org.bukkit.entity.Arrow; import org.bukkit.entity.Entity; import org.bukkit.entity.FallingBlock; @@ -32,7 +32,7 @@ import nautilus.game.arcade.GameType; import nautilus.game.arcade.game.SoloGame; import nautilus.game.arcade.game.games.runner.kits.*; import nautilus.game.arcade.kit.Kit; -import net.minecraft.server.v1_7_R3.EntityArrow; +import net.minecraft.server.v1_7_R4.EntityArrow; public class Runner extends SoloGame implements IThrown { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java index 3356df3df..9e1b24d05 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java @@ -154,8 +154,8 @@ public class SheepGame extends TeamGame this.CreatureAllowOverride = true; Sheep sheep = _sheepSpawns.get(0).getWorld().spawn(UtilAlg.Random(_sheepSpawns), Sheep.class); sheep.setAdult(); - sheep.setMaxHealth(9999); - sheep.setHealth(9999); + sheep.setMaxHealth(2048); + sheep.setHealth(2048); this.CreatureAllowOverride = false; _sheep.put(sheep, new SheepData(this, sheep)); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snake/Snake.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snake/Snake.java index b20dfd1b6..ed3a4bfbb 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snake/Snake.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/snake/Snake.java @@ -11,7 +11,7 @@ import org.bukkit.EntityEffect; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftCreature; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature; import org.bukkit.entity.Cow; import org.bukkit.entity.Creature; import org.bukkit.entity.Entity; @@ -50,8 +50,8 @@ import nautilus.game.arcade.events.PlayerPrepareTeleportEvent; import nautilus.game.arcade.game.SoloGame; import nautilus.game.arcade.game.games.snake.kits.*; import nautilus.game.arcade.kit.Kit; -import net.minecraft.server.v1_7_R3.EntityCreature; -import net.minecraft.server.v1_7_R3.Navigation; +import net.minecraft.server.v1_7_R4.EntityCreature; +import net.minecraft.server.v1_7_R4.Navigation; public class Snake extends SoloGame { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/spleef/Spleef.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/spleef/Spleef.java index 05a5e9f8a..fd5bbeb1f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/spleef/Spleef.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/spleef/Spleef.java @@ -5,7 +5,7 @@ import java.util.HashMap; import org.bukkit.Effect; import org.bukkit.block.Block; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftArrow; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftArrow; import org.bukkit.entity.Arrow; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -26,7 +26,7 @@ import nautilus.game.arcade.game.SoloGame; import nautilus.game.arcade.game.games.spleef.kits.*; import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.perks.event.PerkLeapEvent; -import net.minecraft.server.v1_7_R3.EntityArrow; +import net.minecraft.server.v1_7_R4.EntityArrow; public class Spleef extends SoloGame { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/spleef/SpleefTeams.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/spleef/SpleefTeams.java index ac773e40e..a88aa451d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/spleef/SpleefTeams.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/spleef/SpleefTeams.java @@ -4,7 +4,7 @@ import java.lang.reflect.Field; import org.bukkit.Effect; import org.bukkit.block.Block; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftArrow; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftArrow; import org.bukkit.entity.Arrow; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -25,7 +25,7 @@ import nautilus.game.arcade.game.TeamGame; import nautilus.game.arcade.game.games.spleef.kits.*; import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.perks.event.PerkLeapEvent; -import net.minecraft.server.v1_7_R3.EntityArrow; +import net.minecraft.server.v1_7_R4.EntityArrow; public class SpleefTeams extends TeamGame { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/ChunkChange.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/ChunkChange.java index 41c52523c..2d9e5c6c5 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/ChunkChange.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/ChunkChange.java @@ -2,7 +2,7 @@ package nautilus.game.arcade.game.games.survivalgames; import java.util.ArrayList; -import net.minecraft.server.v1_7_R3.PlayerChunkMap; +import net.minecraft.server.v1_7_R4.PlayerChunkMap; import org.bukkit.Chunk; import org.bukkit.Location; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java index f9b4b222a..0c783f9e8 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java @@ -18,7 +18,7 @@ import org.bukkit.Sound; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.block.Chest; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.Entity; import org.bukkit.entity.Firework; import org.bukkit.entity.ItemFrame; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/turfforts/TurfForts.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/turfforts/TurfForts.java index 438b76686..413cb8670 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/turfforts/TurfForts.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/turfforts/TurfForts.java @@ -11,7 +11,7 @@ import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftArrow; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftArrow; import org.bukkit.entity.Arrow; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; @@ -44,8 +44,8 @@ import nautilus.game.arcade.game.GameTeam; import nautilus.game.arcade.game.TeamGame; import nautilus.game.arcade.game.games.turfforts.kits.*; import nautilus.game.arcade.kit.Kit; -import net.minecraft.server.v1_7_R3.EntityArrow; -import net.minecraft.server.v1_7_R3.Item; +import net.minecraft.server.v1_7_R4.EntityArrow; +import net.minecraft.server.v1_7_R4.Item; public class TurfForts extends TeamGame { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/zombiesurvival/ZombieSurvival.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/zombiesurvival/ZombieSurvival.java index e6b157b10..e87a257f5 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/zombiesurvival/ZombieSurvival.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/zombiesurvival/ZombieSurvival.java @@ -7,7 +7,7 @@ import java.util.Iterator; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Location; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftCreature; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature; import org.bukkit.entity.Creature; import org.bukkit.entity.Player; import org.bukkit.entity.Zombie; @@ -34,8 +34,8 @@ import nautilus.game.arcade.game.GameTeam.PlayerState; import nautilus.game.arcade.game.games.zombiesurvival.kits.*; import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.NullKit; -import net.minecraft.server.v1_7_R3.EntityCreature; -import net.minecraft.server.v1_7_R3.Navigation; +import net.minecraft.server.v1_7_R4.EntityCreature; +import net.minecraft.server.v1_7_R4.Navigation; public class ZombieSurvival extends SoloGame { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkApple.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkApple.java index 6dfef33c1..0d2c14449 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkApple.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkApple.java @@ -22,7 +22,7 @@ import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.UpdateType; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.kit.Perk; -import net.minecraft.server.v1_7_R3.Item; +import net.minecraft.server.v1_7_R4.Item; public class PerkApple extends Perk implements IThrown { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSkeletons.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSkeletons.java index 12bbd7640..c1ff36af8 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSkeletons.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSkeletons.java @@ -7,8 +7,8 @@ import java.util.Iterator; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftCreature; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftSkeleton; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftSkeleton; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.entity.Skeleton; @@ -28,8 +28,8 @@ import mineplex.core.updater.UpdateType; import mineplex.minecraft.game.core.combat.event.CombatDeathEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.kit.Perk; -import net.minecraft.server.v1_7_R3.EntityCreature; -import net.minecraft.server.v1_7_R3.Navigation; +import net.minecraft.server.v1_7_R4.EntityCreature; +import net.minecraft.server.v1_7_R4.Navigation; public class PerkSkeletons extends Perk { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkTNTArrow.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkTNTArrow.java index 24106a234..12b9d2461 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkTNTArrow.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkTNTArrow.java @@ -5,7 +5,7 @@ import java.util.HashSet; import org.bukkit.Material; import org.bukkit.Sound; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftTNTPrimed; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftTNTPrimed; import org.bukkit.entity.Arrow; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWolf.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWolf.java index 5dadaef47..0b2faf37b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWolf.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWolf.java @@ -8,8 +8,8 @@ import org.bukkit.Effect; import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Sound; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftCreature; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftWolf; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftWolf; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.entity.Wolf; @@ -35,8 +35,8 @@ import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.UpdateType; import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.kit.Perk; -import net.minecraft.server.v1_7_R3.EntityCreature; -import net.minecraft.server.v1_7_R3.Navigation; +import net.minecraft.server.v1_7_R4.EntityCreature; +import net.minecraft.server.v1_7_R4.Navigation; public class PerkWolf extends Perk { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWolfPack.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWolfPack.java index 4d36b6a41..8817db4a5 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWolfPack.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWolfPack.java @@ -12,9 +12,9 @@ import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Sound; import org.bukkit.block.BlockFace; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftCreature; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftLivingEntity; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftWolf; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftLivingEntity; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftWolf; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.entity.Wolf; @@ -41,8 +41,8 @@ import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.UpdateType; import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.kit.Perk; -import net.minecraft.server.v1_7_R3.EntityCreature; -import net.minecraft.server.v1_7_R3.Navigation; +import net.minecraft.server.v1_7_R4.EntityCreature; +import net.minecraft.server.v1_7_R4.Navigation; public class PerkWolfPack extends Perk { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWolfPet.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWolfPet.java index cba4f4987..2f3751622 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWolfPet.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWolfPet.java @@ -10,9 +10,9 @@ import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftCreature; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftLivingEntity; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftWolf; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftLivingEntity; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftWolf; import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; @@ -38,8 +38,8 @@ import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.UpdateType; import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.kit.Perk; -import net.minecraft.server.v1_7_R3.EntityCreature; -import net.minecraft.server.v1_7_R3.Navigation; +import net.minecraft.server.v1_7_R4.EntityCreature; +import net.minecraft.server.v1_7_R4.Navigation; public class PerkWolfPet extends Perk { @@ -102,7 +102,7 @@ public class PerkWolfPet extends Perk wolf.setOwner(cur); wolf.setCollarColor(DyeColor.GREEN); wolf.playEffect(EntityEffect.WOLF_HEARTS); - + wolf.setAngry(true); wolf.setMaxHealth(18); wolf.setHealth(wolf.getMaxHealth()); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java index 59317a37b..5a116b736 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java @@ -27,7 +27,7 @@ import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java index 420c15f5a..d5830fca8 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java @@ -68,11 +68,11 @@ import nautilus.game.arcade.game.GameTeam; import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.KitAvailability; import nautilus.game.arcade.kit.KitSorter; -import net.minecraft.server.v1_7_R3.DataWatcher; -import net.minecraft.server.v1_7_R3.Packet; -import net.minecraft.server.v1_7_R3.PacketPlayOutEntityMetadata; -import net.minecraft.server.v1_7_R3.PacketPlayOutSpawnEntityLiving; -import net.minecraft.server.v1_7_R3.WatchableObject; +import net.minecraft.server.v1_7_R4.DataWatcher; +import net.minecraft.server.v1_7_R4.Packet; +import net.minecraft.server.v1_7_R4.PacketPlayOutEntityMetadata; +import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntityLiving; +import net.minecraft.server.v1_7_R4.WatchableObject; public class GameLobbyManager implements IPacketRunnable, Listener { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GamePlayerManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GamePlayerManager.java index 27180e6c3..155d3d9b6 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GamePlayerManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GamePlayerManager.java @@ -5,8 +5,8 @@ import java.util.ArrayList; import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Sound; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; @@ -37,7 +37,7 @@ import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.KitAvailability; import nautilus.game.arcade.shop.ArcadeShop; import nautilus.game.arcade.shop.KitPackage; -import net.minecraft.server.v1_7_R3.PacketPlayOutEntityMetadata; +import net.minecraft.server.v1_7_R4.PacketPlayOutEntityMetadata; public class GamePlayerManager implements Listener { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameWorldManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameWorldManager.java index 791588a8f..4c428cb61 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameWorldManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameWorldManager.java @@ -8,7 +8,7 @@ import mineplex.core.updater.event.UpdateEvent; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.game.Game.GameState; import nautilus.game.arcade.world.WorldData; -import net.minecraft.server.v1_7_R3.ChunkPreLoadEvent; +import net.minecraft.server.v1_7_R4.ChunkPreLoadEvent; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/MiscManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/MiscManager.java index 514982d5c..9237ef4a7 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/MiscManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/MiscManager.java @@ -13,7 +13,7 @@ import nautilus.game.arcade.game.Game.GameState; import org.bukkit.GameMode; import org.bukkit.Material; -import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/world/WorldData.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/world/WorldData.java index 0a228a8d9..04e47d2ec 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/world/WorldData.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/world/WorldData.java @@ -17,7 +17,7 @@ import mineplex.core.common.util.WorldUtil; import mineplex.core.common.util.ZipUtil; import mineplex.core.timing.TimingManager; import nautilus.game.arcade.game.Game; -import net.minecraft.server.v1_7_R3.ChunkPreLoadEvent; +import net.minecraft.server.v1_7_R4.ChunkPreLoadEvent; import org.bukkit.Difficulty; import org.bukkit.Location;