Merge branch 'master' of ssh://184.154.0.242:7999/min/mineplex

This commit is contained in:
Chiss 2014-08-14 10:32:52 +10:00
commit b21ae8ef72
173 changed files with 2659 additions and 3517 deletions

View File

@ -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;

View File

@ -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());

View File

@ -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();
}
}

View File

@ -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;

View File

@ -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;

View File

@ -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
{

View File

@ -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

View File

@ -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
@ -48,6 +48,8 @@ public class LobbyBalancer implements Listener, Runnable
if (!event.getTarget().getName().equalsIgnoreCase("Lobby"))
return;
int bungeeBufferNumber = 20;
synchronized (_serverLock)
{
if (_playersSentToBestServer >= _maxPlayersToSendToBestServer)
@ -57,7 +59,7 @@ public class LobbyBalancer implements Listener, Runnable
while (_bestServerIndex < _sortedLobbies.size())
{
_bestServerIndex++;
_maxPlayersToSendToBestServer = (_sortedLobbies.get(_bestServerIndex).getMaxPlayerCount() - _sortedLobbies.get(_bestServerIndex).getPlayerCount());
_maxPlayersToSendToBestServer = (_sortedLobbies.get(_bestServerIndex).getMaxPlayerCount() - _sortedLobbies.get(_bestServerIndex).getPlayerCount()) / bungeeBufferNumber;
if (_maxPlayersToSendToBestServer > 0)
break;
@ -68,8 +70,11 @@ 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)
bungeeBufferNumber = 0;
}
}

View File

@ -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

View File

@ -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<net.minecraft.server.v1_7_R3.Chunk> chunkIterator = ((CraftWorld) world).getHandle().chunkProviderServer.chunks
Iterator<net.minecraft.server.v1_7_R4.Chunk> 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();
}

View File

@ -37,6 +37,6 @@ public class UtilAction
//Velocity
ent.setFallDistance(0);
ent.setVelocity(vec);
ent.setVelocity(vec);
}
}

View File

@ -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;

View File

@ -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
{

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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())

View File

@ -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

View File

@ -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;

View File

@ -90,7 +90,7 @@ public class Menu extends ShopPageBase<CosmeticManager, CosmeticShop>
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<CosmeticManager, CosmeticShop>
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<CosmeticManager, CosmeticShop>
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<CosmeticManager, CosmeticShop>
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<CosmeticManager, CosmeticShop>
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

View File

@ -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<CosmeticManager, CosmeticShop>
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);
}

View File

@ -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<CosmeticManager, CosmeticShop>
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);

View File

@ -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)
{

View File

@ -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;

View File

@ -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;

View File

@ -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
{

View File

@ -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
{

View File

@ -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

View File

@ -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

View File

@ -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<Packet> getArmorPackets()
{
List<PacketPlayOutEntityEquipment> p5 = new ArrayList<PacketPlayOutEntityEquipment>();
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)
{

View File

@ -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
{

View File

@ -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

View File

@ -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
{

View File

@ -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

View File

@ -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
{

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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)

View File

@ -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

View File

@ -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;

View File

@ -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
{

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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
{

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -46,8 +46,7 @@ public class Portal extends MiniPlugin
Bukkit.getMessenger().registerOutgoingPluginChannel(GetPlugin(), "BungeeCord");
String host = plugin.getConfig().getString("serverstatus.connectionurl");
_repository = new PortalRepository(host);
_repository = new PortalRepository();
}
public void SendAllPlayers(String serverName)
@ -150,23 +149,12 @@ public class Portal extends MiniPlugin
AddCommand(new ServerCommand(this));
AddCommand(new SendCommand(this));
}
boolean sent = false;
@EventHandler
public void checkForServerTransfers(UpdateEvent event)
{
if (event.getType() != UpdateType.SEC || Bukkit.getOnlinePlayers().length == 0)
return;
// DEBUG CODE - REMOVE THIS
if (Bukkit.getOnlinePlayers().length > 0 && !sent)
{
Player player = Bukkit.getOnlinePlayers()[0];
if (player.isSneaking())
{
System.out.println("Debug transferring player " + player.getName());
AddTransferRecord(player.getName(), "TEST-2");
sent = true;
}
}
_retrieve = !_retrieve;

View File

@ -0,0 +1,149 @@
package mineplex.core.portal;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import mineplex.serverdata.ServerManager;
import mineplex.serverdata.Utility;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;
import redis.clients.jedis.Pipeline;
import redis.clients.jedis.Response;
import redis.clients.jedis.Transaction;
public class PortalRepository
{
// The delimiter character used for redis key paths
public final char KEY_DELIMITER = '.';
// The access portal for jedis resources
private JedisPool _jedisPool;
/**
* Class constructor
*/
public PortalRepository()
{
this._jedisPool = new JedisPool(new JedisPoolConfig(), ServerManager.DEFAULT_REDIS_HOST,
ServerManager.DEFAULT_REDIS_PORT);
}
/**
* @return the {@link Set} of all ongoing {@link ServerTransfer}s available in this repository.
*/
public Collection<ServerTransfer> getServerTransfers()
{
Set<ServerTransfer> serverTransfers = new HashSet<ServerTransfer>();
Jedis jedis = _jedisPool.getResource();
try
{
String setKey = "servertransfers";
Set<String> playerNames = jedis.smembers(setKey);
Pipeline pipeline = jedis.pipelined();
List<Response<String>> responses = new ArrayList<Response<String>>();
for (String playerName : playerNames)
{
String dataKey = concatenate(setKey, playerName);
responses.add(pipeline.get(dataKey));
}
pipeline.sync();
for (Response<String> response : responses)
{
String serializedData = response.get();
ServerTransfer serverTransfer = Utility.deserialize(serializedData, ServerTransfer.class);
serverTransfers.add(serverTransfer);
}
}
finally
{
_jedisPool.returnResource(jedis);
}
return serverTransfers;
}
/**
* Add a new {@link ServerTransfer} to this repository.
* @param serverTransfer - the {@link ServerTransfer} to be added in.
*/
public void addServerTransfer(ServerTransfer serverTransfer)
{
Jedis jedis = _jedisPool.getResource();
try
{
String setKey = "servertransfers";
String dataKey = concatenate(setKey, serverTransfer.getPlayerName());
String serializedTransfer = Utility.serialize(serverTransfer);
Transaction transaction = jedis.multi();
transaction.sadd(setKey, serverTransfer.getPlayerName());
transaction.set(dataKey, serializedTransfer);
transaction.exec();
}
finally
{
_jedisPool.returnResource(jedis);
}
}
/**
* Remove an existing {@link ServerTransfer} from this repository whose
* stored {@code playerName} matches the passed in name.
* @param playerName - the name of the player whose active {@link ServerTransfer}
* is to be removed.
* @return true, if the {@link ServerTransfer} belonging to player with matching
* {@code playerName} was successfully removed, false otherwise.
*/
public boolean removeServerTransfer(String playerName)
{
boolean removedTransfer = false;
Jedis jedis = _jedisPool.getResource();
try
{
String setKey = "servertransfers";
String dataKey = concatenate(setKey, playerName);
if (jedis.sismember(setKey, playerName))
{
Transaction transaction = jedis.multi();
transaction.srem(setKey, playerName);
transaction.del(dataKey);
transaction.exec();
removedTransfer = true;
}
}
finally
{
_jedisPool.returnResource(jedis);
}
return removedTransfer;
}
/**
* @param elements - the elements to concatenate together
* @return the concatenated form of all {@code elements}
* separated by the delimiter {@value KEY_DELIMITER}.
*/
protected String concatenate(String... elements)
{
return Utility.concatenate(KEY_DELIMITER, elements);
}
/*
* 'servertransfers' contains a set of player names for players with an active server transfer
* 'servertransfers.<player name>' contains the JSON serialized 'ServerTransfer' object holding info.
*/
}

View File

@ -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)
{

View File

@ -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;

View File

@ -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
{

View File

@ -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;

View File

@ -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);
}

View File

@ -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
{

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -100,14 +100,6 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
AddItem(22, item);
}
private void clearPage()
{
for (int i = 0; i < getSize(); i++)
{
setItem(i, null);
}
}
private ShopItem buildShopItem(ServerInfo serverInfo, int slotsNeeded)
{
boolean ownsUltraPackage = DonationManager.Get(Player.getName()).OwnsUnknownPackage(serverInfo.ServerType + " ULTRA") || Client.GetRank().Has(Rank.ULTRA);
@ -287,14 +279,16 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
@Override
public void Clicked(Player player)
{
clearPage();
clear();
_onMainPage = true;
}
});
while (slot < getSize())
{
setItem(slot, null);
if (getItem(slot) != null)
setItem(slot, null);
slot++;
}
}

View File

@ -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)

View File

@ -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;

View File

@ -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)
{

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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
{

View File

@ -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);

View File

@ -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
{

View File

@ -244,7 +244,26 @@ public class RedisServerRepository implements ServerRepository
@Override
public int clean()
{
// TODO: Clean out expired/dead MinecraftServers.
Jedis jedis = _jedisPool.getResource();
try
{
String setKey = concatenate("serverstatus", "minecraft", _region.toString());
for (String deadName : getDeadNames(setKey))
{
String dataKey = concatenate(setKey, deadName);
Transaction transaction = jedis.multi();
transaction.del(dataKey);
transaction.zrem(setKey, deadName);
transaction.exec();
}
}
finally
{
_jedisPool.returnResource(jedis);
}
return 0;
}
@ -272,6 +291,29 @@ public class RedisServerRepository implements ServerRepository
return names;
}
/**
* @param key - the key where the sorted set of server sessions is stored
* @return the {@link Set} of dead (expired) server names stored at {@code key}.
*/
protected Set<String> getDeadNames(String key)
{
Set<String> names = new HashSet<String>();
Jedis jedis = _jedisPool.getResource();
try
{
String min = "-inf";
String max = System.currentTimeMillis() + "";
names = jedis.zrangeByScore(key, min, max);
}
finally
{
_jedisPool.returnResource(jedis);
}
return names;
}
/**
* @param elements - the elements to concatenate together
* @return the concatenated form of all {@code elements}

View File

@ -12,10 +12,10 @@ import java.util.Map;
public class ServerManager
{
// The host of the default redis database used for server repository
private static String DEFAULT_REDIS_HOST = "10.33.53.16";
public final static String DEFAULT_REDIS_HOST = "10.33.53.16";
// The default port used by redis databases
private static int DEFAULT_REDIS_PORT = 6379;
public final static int DEFAULT_REDIS_PORT = 6379;
// The cached repository instances
private static Map<Region, ServerRepository> repositories = new HashMap<Region, ServerRepository>();

View File

@ -135,12 +135,6 @@ public class ServerMonitor
for (ServerGroup serverGroup : serverGroups)
{
handleGroupChanges(dedicatedServers, serverTracker, serverGroup, false);
if (serverGroup.getGenerateFreeVersions() && _count % 6 == 0)
{
handleGroupChanges(dedicatedServers, serverTracker, serverGroup, true);
}
}
int processWaits = 0;

View File

@ -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<EnchantmentModifierProtection> 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<EnchantmentModifierDamage> 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<EnchantmentModifierThorns> 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<EnchantmentModifierArthropods> 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<EnchantmentInstance>)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<EnchantmentInstance>)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;
}
}

View File

@ -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<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>();
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;
}
}

View File

@ -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;
}
}

View File

@ -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<Class> entityCount = new gnu.trove.map.hash.TObjectIntHashMap<Class>(); // Spigot
protected net.minecraft.util.gnu.trove.map.hash.TObjectIntHashMap<Class> entityCount = new net.minecraft.util.gnu.trove.map.hash.TObjectIntHashMap<Class>(); // 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<org.bukkit.craftbukkit.v1_7_R3.entity.CraftHumanEntity>( (List) ( (IInventory) tileentity ).getViewers() ) )
for ( org.bukkit.entity.HumanEntity h : new ArrayList<org.bukkit.entity.HumanEntity>( (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<org.bukkit.craftbukkit.v1_7_R3.entity.CraftHumanEntity>( (List) ( (IInventory) entity ).getViewers() ) )
for ( org.bukkit.entity.HumanEntity h : new ArrayList<org.bukkit.entity.HumanEntity>( (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;
}
}
}

View File

@ -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;

View File

@ -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;

View File

@ -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) {}
}
}

View File

@ -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

View File

@ -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;
}
}

View File

@ -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) {}
}
}

View File

@ -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);
}

View File

@ -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;
}
}

View File

@ -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<org.bukkit.block.Block> destroyedBlocks = new java.util.ArrayList<org.bukkit.block.Block>();
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<EntityPlayer>) 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
}
}

View File

@ -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<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>();
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;
}
}
}

View File

@ -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;
}
}
}

View File

@ -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<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>();
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");
}
}
}
}

Some files were not shown because too many files have changed in this diff Show More