Merge branch 'master' of ssh://184.154.0.242:7999/min/Mineplex
Conflicts: Plugins/Mineplex.ServerData/src/mineplex/serverdata/RedisServerRepository.java
This commit is contained in:
commit
0d38ac4e96
@ -174,6 +174,10 @@
|
||||
<include name="**/*.class"/>
|
||||
</fileset>
|
||||
|
||||
<fileset dir="../Mineplex.ServerData/bin">
|
||||
<include name="**/*.class"/>
|
||||
</fileset>
|
||||
|
||||
<zipfileset src="../Libraries/mysql.zip" />
|
||||
|
||||
<manifest>
|
||||
@ -188,6 +192,8 @@
|
||||
<zipfileset src="../Libraries/gson-2.2.1.jar" />
|
||||
<zipfileset src="../Libraries/commons-logging-1.1.1.jar" />
|
||||
<zipfileset src="../Libraries/commons-codec-1.6.jar" />
|
||||
<zipfileset src="../Libraries/jedis-2.4.2.jar" />
|
||||
<zipfileset src="../Libraries/commons-pool2-2.2.jar" />
|
||||
</jar>
|
||||
<copy file="../bin/ServerMonitor.jar" todir="../../Testing/ServerMonitor/"/>
|
||||
</target>
|
||||
|
@ -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;
|
||||
|
@ -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());
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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
|
||||
|
Binary file not shown.
@ -39,7 +39,7 @@ public class LobbyBalancer implements Listener, Runnable
|
||||
loadLobbyServers();
|
||||
|
||||
_plugin.getProxy().getPluginManager().registerListener(_plugin, this);
|
||||
_plugin.getProxy().getScheduler().schedule(_plugin, this, 500L, 500L, TimeUnit.MILLISECONDS);
|
||||
_plugin.getProxy().getScheduler().schedule(_plugin, this, 200L, 200L, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -70,8 +70,7 @@ public class LobbyBalancer implements Listener, Runnable
|
||||
_bestServerIndex = 0;
|
||||
_maxPlayersToSendToBestServer = 1;
|
||||
|
||||
// Since we had to enter our dangerzone, update local data so if we have to enter it again we don't pick the same server over and over
|
||||
_sortedLobbies.get(_bestServerIndex).incrementPlayerCount(5);
|
||||
// Since we had to enter our dangerzone, decrease buffer so we try to hit another server
|
||||
bungeeBufferNumber -= 2;
|
||||
|
||||
if (bungeeBufferNumber <= 0)
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -37,6 +37,6 @@ public class UtilAction
|
||||
|
||||
//Velocity
|
||||
ent.setFallDistance(0);
|
||||
ent.setVelocity(vec);
|
||||
ent.setVelocity(vec);
|
||||
}
|
||||
}
|
||||
|
@ -3,18 +3,16 @@ 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.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;
|
||||
@ -29,7 +27,7 @@ public class UtilDisplay
|
||||
public static void sendPacket(Player player, Packet packet){
|
||||
EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
|
||||
|
||||
entityPlayer.playerConnection.sendPacket(packet);
|
||||
entityPlayer.playerConnection.sendPacket(packet);
|
||||
}
|
||||
|
||||
//Accessing packets
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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())
|
||||
|
@ -5,8 +5,35 @@ public enum Achievement
|
||||
GLOBAL_GEM_HUNTER("Gem Hunter",
|
||||
new String[] {"Global.GemsEarned"},
|
||||
new String[] {"+1 for every Gem earned in any game."},
|
||||
new int[] {10000, 15000, 20000, 25000, 30000, 35000, 40000, 45000, 50000, 55000, 60000, 65000});
|
||||
new int[] {10000, 15000, 20000, 25000, 30000, 35000, 40000, 45000, 50000, 55000, 60000, 65000}),
|
||||
|
||||
//Survival Games
|
||||
SURVIVAL_GAMES_WINS("Katniss Everdeen",
|
||||
new String[] {"Survival Games.Wins"},
|
||||
new String[] {"Win 50 games of Survival Games"},
|
||||
new int[] {50}),
|
||||
|
||||
SURVIVAL_GAMES_NUDIST("Nudist",
|
||||
new String[] {"Survival Games.NoArmor"},
|
||||
new String[] {"Win a game without wearing any armor"},
|
||||
new int[] {1}),
|
||||
|
||||
SURVIVAL_GAMES_BLOODLUST("Bloodlust",
|
||||
new String[] {"Survival Games.Bloodlust"},
|
||||
new String[] {"Kill 3 other players in the first minute"},
|
||||
new int[] {1}),
|
||||
|
||||
SURVIVAL_GAMES_LOOT("Loot Hoarder",
|
||||
new String[] {"Survival Games.SupplyDropsOpened"},
|
||||
new String[] {"Be the first to open 50 Supply Drops"},
|
||||
new int[] {50}),
|
||||
|
||||
SURVIVAL_GAMES_SKELETONS("Skeletal Army",
|
||||
new String[] {"Survival Games.Skeletons"},
|
||||
new String[] {"Have 5 Necromanced Skeletons alive"},
|
||||
new int[] {1});
|
||||
|
||||
|
||||
/*
|
||||
GAME_SPLEEF_SMASHER("Spleef Smasher",
|
||||
new String[] {"Super Spleef.BlocksBroken"},
|
||||
@ -52,6 +79,11 @@ public enum Achievement
|
||||
return _levels.length;
|
||||
}
|
||||
|
||||
public boolean isOngoing()
|
||||
{
|
||||
return _levels[0] > 1;
|
||||
}
|
||||
|
||||
public AchivementData getLevelData(int exp)
|
||||
{
|
||||
for (int i=0 ; i<_levels.length ; i++)
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -16,6 +16,7 @@ import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilGear;
|
||||
import mineplex.core.common.util.UtilInv;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.cosmetic.ui.CosmeticShop;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
@ -154,6 +155,10 @@ public class CosmeticManager extends MiniPlugin
|
||||
public void setActive(boolean b)
|
||||
{
|
||||
_showInterface = b;
|
||||
|
||||
if (!b)
|
||||
for (Player player : UtilServer.getPlayers())
|
||||
player.getOpenInventory().close();
|
||||
}
|
||||
|
||||
public void disableItemsForGame()
|
||||
|
@ -10,11 +10,13 @@ public class CloseButton implements IButton
|
||||
public void ClickedLeft(Player player)
|
||||
{
|
||||
player.closeInventory();
|
||||
System.out.println(this.getClass().getName() + " 13");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ClickedRight(Player player)
|
||||
{
|
||||
player.closeInventory();
|
||||
System.out.println(this.getClass().getName() + " 19");
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -69,6 +69,19 @@ public class MountManager extends MiniPlugin
|
||||
{
|
||||
if (!(event.getRightClicked() instanceof Horse))
|
||||
return;
|
||||
|
||||
boolean found = false;
|
||||
for (Mount mount : _playerActiveMountMap.values())
|
||||
{
|
||||
if (mount.GetActive().containsValue(event.getRightClicked()))
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
return;
|
||||
|
||||
Player player = event.getPlayer();
|
||||
Horse horse = (Horse)event.getRightClicked();
|
||||
|
@ -91,7 +91,8 @@ public class Dragon extends DragonMount
|
||||
@EventHandler
|
||||
public void DragonTargetCancel(EntityTargetEvent event)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
if (GetActive().containsValue(event.getEntity()))
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
public void SetName(String news)
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
@ -426,6 +426,7 @@ public class PunishPage extends CraftInventoryCustom implements Listener
|
||||
{
|
||||
_plugin.AddPunishment(_target, category, _reason, _player, severity, ban, punishTime);
|
||||
_player.closeInventory();
|
||||
System.out.println(this.getClass().getName() + " 429");
|
||||
ClosePunish();
|
||||
}
|
||||
|
||||
@ -451,6 +452,7 @@ public class PunishPage extends CraftInventoryCustom implements Listener
|
||||
{
|
||||
punishment.Remove(_player.getName(), _reason);
|
||||
_player.closeInventory();
|
||||
System.out.println(this.getClass().getName() + " 455");
|
||||
ClosePunish();
|
||||
}
|
||||
}
|
||||
|
@ -181,6 +181,7 @@ public abstract class ShopBase<PluginType extends MiniPlugin> implements Listene
|
||||
PlayerPageMap.get(event.getPlayer().getName()).Dispose();
|
||||
|
||||
event.getPlayer().closeInventory();
|
||||
System.out.println(this.getClass().getName() + " 184");
|
||||
CloseShopForPlayer(event.getPlayer());
|
||||
|
||||
PlayerPageMap.remove(event.getPlayer().getName());
|
||||
@ -199,6 +200,8 @@ public abstract class ShopBase<PluginType extends MiniPlugin> implements Listene
|
||||
SetCurrentPageForPlayer(player, page);
|
||||
|
||||
player.openInventory(page);
|
||||
|
||||
System.out.println(this.getClass().getName() + " - player.openInventory(page);");
|
||||
}
|
||||
|
||||
public void SetCurrentPageForPlayer(Player player, ShopPageBase<PluginType, ? extends ShopBase<PluginType>> page)
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -104,7 +104,11 @@ public class ConfirmationPage<PluginType extends MiniPlugin, ShopType extends Sh
|
||||
if (_returnPage != null)
|
||||
Shop.OpenPageForPlayer(player, _returnPage);
|
||||
else
|
||||
{
|
||||
player.closeInventory();
|
||||
System.out.println(this.getClass().getName() + " 109");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void BuildSquareAt(int slot, ShopItem item, IButton button)
|
||||
@ -288,6 +292,7 @@ public class ConfirmationPage<PluginType extends MiniPlugin, ShopType extends Sh
|
||||
else if (Player != null)
|
||||
{
|
||||
Player.closeInventory();
|
||||
System.out.println(this.getClass().getName() + " 291");
|
||||
}
|
||||
}
|
||||
catch (Exception exception)
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -2,7 +2,6 @@ package mineplex.core.status;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -21,8 +20,8 @@ import mineplex.serverdata.ServerRepository;
|
||||
|
||||
public class ServerStatusManager extends MiniPlugin
|
||||
{
|
||||
// The default timeout (in milliseconds) before the ServerStatus expires.
|
||||
public final int DEFAULT_SERVER_TIMEOUT = 15000;
|
||||
// The default timeout (in seconds) before the ServerStatus expires.
|
||||
public final int DEFAULT_SERVER_TIMEOUT = 15;
|
||||
|
||||
private ServerRepository _repository;
|
||||
private LagMeter _lagMeter;
|
||||
@ -30,7 +29,6 @@ public class ServerStatusManager extends MiniPlugin
|
||||
private String _name;
|
||||
private boolean _us;
|
||||
|
||||
private boolean _alternateSeconds;
|
||||
private boolean _enabled = true;
|
||||
|
||||
public ServerStatusManager(JavaPlugin plugin, LagMeter lagMeter)
|
||||
@ -41,20 +39,15 @@ public class ServerStatusManager extends MiniPlugin
|
||||
|
||||
if (new File("IgnoreUpdates.dat").exists())
|
||||
_enabled = false;
|
||||
|
||||
ServerListPingEvent event = new ServerListPingEvent(null, plugin.getServer().getMotd(), plugin.getServer().getOnlinePlayers().length, plugin.getServer().getMaxPlayers());
|
||||
|
||||
GetPluginManager().callEvent(event);
|
||||
|
||||
setupConfigValues();
|
||||
|
||||
String address = Bukkit.getServer().getIp().isEmpty() ? "localhost" : Bukkit.getServer().getIp();
|
||||
|
||||
_name = plugin.getConfig().getString("serverstatus.name");
|
||||
_us = plugin.getConfig().getBoolean("serverstatus.us");
|
||||
|
||||
Region region = _us ? Region.US : Region.EU;
|
||||
_repository = ServerManager.getServerRepository(region);
|
||||
saveServerStatus();
|
||||
}
|
||||
|
||||
private void setupConfigValues()
|
||||
@ -112,11 +105,6 @@ public class ServerStatusManager extends MiniPlugin
|
||||
|
||||
if (!_enabled)
|
||||
return;
|
||||
|
||||
_alternateSeconds = !_alternateSeconds;
|
||||
|
||||
if (!_alternateSeconds)
|
||||
return;
|
||||
|
||||
saveServerStatus();
|
||||
}
|
||||
@ -132,7 +120,7 @@ public class ServerStatusManager extends MiniPlugin
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
_repository.updataServerStatus(serverSnapshot, 15000);
|
||||
_repository.updataServerStatus(serverSnapshot, DEFAULT_SERVER_TIMEOUT);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -135,6 +135,7 @@ public class QueuePage extends ShopPageBase<QueueManager, QueueShop>
|
||||
if (_closeOnNextUpdate)
|
||||
{
|
||||
Player.closeInventory();
|
||||
System.out.println(this.getClass().getName() + " 138");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -187,6 +188,7 @@ public class QueuePage extends ShopPageBase<QueueManager, QueueShop>
|
||||
Plugin.respondToInvite(player, false);
|
||||
|
||||
player.closeInventory();
|
||||
System.out.println(this.getClass().getName() + " 191");
|
||||
}
|
||||
|
||||
private void buildSquareAt(int slot, ShopItem item, IButton button)
|
||||
|
@ -55,6 +55,7 @@ public class LobbyMenu extends ShopPageBase<ServerManager, LobbyShop> implements
|
||||
Material status = Material.IRON_BLOCK;
|
||||
List<String> lore = new ArrayList<String>();
|
||||
|
||||
slot = Integer.parseInt(serverInfo.Name.split("-")[1]) - 1;
|
||||
if (slot >= 54)
|
||||
break;
|
||||
|
||||
@ -79,19 +80,12 @@ public class LobbyMenu extends ShopPageBase<ServerManager, LobbyShop> implements
|
||||
AddButton(slot, new ShopItem(status, ChatColor.UNDERLINE + "" + ChatColor.BOLD + "" + ChatColor.WHITE + "Server " + serverInfo.Name.substring(serverInfo.Name.indexOf('-') + 1), lore.toArray(new String[lore.size()]), Integer.parseInt(serverInfo.Name.substring(serverInfo.Name.indexOf('-') + 1)), false), new JoinServerButton(this, serverInfo));
|
||||
else
|
||||
AddItem(slot, new ShopItem(status, ChatColor.UNDERLINE + "" + ChatColor.BOLD + "" + ChatColor.WHITE + "Server " + serverInfo.Name.substring(serverInfo.Name.indexOf('-') + 1), lore.toArray(new String[lore.size()]), Integer.parseInt(serverInfo.Name.substring(serverInfo.Name.indexOf('-') + 1)), false));
|
||||
|
||||
slot += 1;
|
||||
}
|
||||
|
||||
while (slot < 54)
|
||||
{
|
||||
setItem(slot, null);
|
||||
slot++;
|
||||
}
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
clear();
|
||||
BuildPage();
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,10 @@ import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.BlockBurnEvent;
|
||||
import org.bukkit.event.block.BlockFadeEvent;
|
||||
import org.bukkit.event.block.BlockSpreadEvent;
|
||||
import org.bukkit.event.block.LeavesDecayEvent;
|
||||
import org.bukkit.event.entity.EntitySpawnEvent;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
@ -635,6 +639,30 @@ public class MapParser extends JavaPlugin implements Listener
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void DisableBurn(BlockBurnEvent event)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void DisableFire(BlockSpreadEvent event)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void DisableFade(BlockFadeEvent event)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void DisableDecay(LeavesDecayEvent event)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void Updates(PlayerMoveEvent event)
|
||||
{
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
@ -56,6 +56,8 @@ public class ClassCombatShop extends ShopBase<ClassShopManager>
|
||||
{
|
||||
if (!CanOpenShop(player))
|
||||
return false;
|
||||
|
||||
System.out.println(this.getClass().getName() + " - I CAN OPEN SHOP");
|
||||
|
||||
OpenedShop.add(player.getName());
|
||||
|
||||
|
@ -149,6 +149,7 @@ public class CustomBuildPage extends ShopPageBase<ClassShopManager, ClassCombatS
|
||||
clientClass.EquipCustomBuild(customBuild);
|
||||
|
||||
Player.closeInventory();
|
||||
System.out.println(this.getClass().getName() + " 152");
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -14,11 +14,9 @@ import redis.clients.jedis.JedisPoolConfig;
|
||||
import redis.clients.jedis.Pipeline;
|
||||
import redis.clients.jedis.Response;
|
||||
import redis.clients.jedis.Transaction;
|
||||
import redis.clients.jedis.Tuple;
|
||||
import redis.clients.jedis.exceptions.JedisConnectionException;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
/**
|
||||
* RedisServerRepository offers a Redis-based implementation of {@link ServerRepository}
|
||||
* using a mixture of hash and JSON encoded storage.
|
||||
@ -132,8 +130,8 @@ public class RedisServerRepository implements ServerRepository
|
||||
String serverName = serverData.getName();
|
||||
String setKey = concatenate("serverstatus", "minecraft", _region.toString());
|
||||
String dataKey = concatenate(setKey, serverName);
|
||||
long expiry = System.currentTimeMillis() + timeout;
|
||||
|
||||
long expiry = Long.parseLong(jedis.time().get(0)) + timeout;
|
||||
|
||||
Transaction transaction = jedis.multi();
|
||||
transaction.set(dataKey, serializedData);
|
||||
transaction.zadd(setKey, expiry, serverName);
|
||||
@ -166,7 +164,7 @@ public class RedisServerRepository implements ServerRepository
|
||||
String dataKey = concatenate(setKey, serverName);
|
||||
|
||||
Transaction transaction = jedis.multi();
|
||||
transaction.set(dataKey, null);
|
||||
transaction.del(dataKey);
|
||||
transaction.zrem(setKey, serverName);
|
||||
transaction.exec();
|
||||
}
|
||||
@ -250,7 +248,7 @@ public class RedisServerRepository implements ServerRepository
|
||||
{
|
||||
for (MinecraftServer minecraftServer : getServerStatuses())
|
||||
{
|
||||
if (serverGroups.containsKey(minecraftServer.getGroup()))
|
||||
if (serverGroups.containsKey(minecraftServer.getGroup()) && minecraftServer.getPublicAddress().equalsIgnoreCase(server.getPrivateAddress()))
|
||||
{
|
||||
ServerGroup serverGroup = serverGroups.get(minecraftServer.getGroup());
|
||||
server.incrementServerCount(serverGroup);
|
||||
@ -296,41 +294,6 @@ public class RedisServerRepository implements ServerRepository
|
||||
return servers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int clean()
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
catch (JedisConnectionException exception)
|
||||
{
|
||||
exception.printStackTrace();
|
||||
_jedisPool.returnBrokenResource(jedis);
|
||||
jedis = null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (jedis != null)
|
||||
{
|
||||
_jedisPool.returnResource(jedis);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param key - the key where the sorted set of server sessions is stored
|
||||
* @return the {@link Set} of active server names stored at {@code key} for non-expired
|
||||
@ -343,7 +306,7 @@ public class RedisServerRepository implements ServerRepository
|
||||
|
||||
try
|
||||
{
|
||||
String min = "(" + System.currentTimeMillis();
|
||||
String min = "(" + jedis.time().get(0);
|
||||
String max = "+inf";
|
||||
names = jedis.zrangeByScore(key, min, max);
|
||||
}
|
||||
@ -364,38 +327,6 @@ 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);
|
||||
}
|
||||
catch (JedisConnectionException exception)
|
||||
{
|
||||
exception.printStackTrace();
|
||||
_jedisPool.returnBrokenResource(jedis);
|
||||
jedis = null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (jedis != null)
|
||||
{
|
||||
_jedisPool.returnResource(jedis);
|
||||
}
|
||||
}
|
||||
|
||||
return names;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param elements - the elements to concatenate together
|
||||
* @return the concatenated form of all {@code elements}
|
||||
@ -406,6 +337,51 @@ public class RedisServerRepository implements ServerRepository
|
||||
return Utility.concatenate(KEY_DELIMITER, elements);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<MinecraftServer> getDeadServers()
|
||||
{
|
||||
Set<MinecraftServer> servers = new HashSet<MinecraftServer>();
|
||||
Jedis jedis = _jedisPool.getResource();
|
||||
|
||||
try
|
||||
{
|
||||
Pipeline pipeline = jedis.pipelined();
|
||||
String setKey = concatenate("serverstatus", "minecraft", _region.toString());
|
||||
String min = "-inf";
|
||||
String max = jedis.time().get(0);
|
||||
|
||||
List<Response<String>> responses = new ArrayList<Response<String>>();
|
||||
for (Tuple serverName : jedis.zrangeByScoreWithScores(setKey, min, max))
|
||||
{
|
||||
String dataKey = concatenate(setKey, serverName.getElement());
|
||||
responses.add(pipeline.get(dataKey));
|
||||
}
|
||||
|
||||
pipeline.sync();
|
||||
|
||||
for (Response<String> response : responses)
|
||||
{
|
||||
String serializedData = response.get();
|
||||
servers.add(Utility.deserialize(serializedData, MinecraftServer.class));
|
||||
}
|
||||
}
|
||||
catch (JedisConnectionException exception)
|
||||
{
|
||||
exception.printStackTrace();
|
||||
_jedisPool.returnBrokenResource(jedis);
|
||||
jedis = null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (jedis != null)
|
||||
{
|
||||
_jedisPool.returnResource(jedis);
|
||||
}
|
||||
}
|
||||
|
||||
return servers;
|
||||
}
|
||||
|
||||
/*
|
||||
* <region> = "US" or "EU"
|
||||
* serverstatus.minecraft.<region>.<name> stores the JSON encoded information of an active MinecraftServer instance.
|
||||
|
@ -9,5 +9,5 @@ package mineplex.serverdata;
|
||||
public enum Region
|
||||
{
|
||||
US,
|
||||
EU;
|
||||
EU,
|
||||
}
|
||||
|
@ -51,13 +51,13 @@ public class ServerGroup
|
||||
public boolean getArcadeGroup() { return _arcadeGroup; }
|
||||
|
||||
private String _worldZip;
|
||||
public String getWorldZip() { return _serverType; }
|
||||
public String getWorldZip() { return _worldZip; }
|
||||
|
||||
private String _plugin;
|
||||
public String getPlugin() { return _serverType; }
|
||||
public String getPlugin() { return _plugin; }
|
||||
|
||||
private String _configPath;
|
||||
public String getConfigPath() { return _serverType; }
|
||||
public String getConfigPath() { return _configPath; }
|
||||
|
||||
private int _minPlayers;
|
||||
public int getMinPlayers() { return _minPlayers; }
|
||||
@ -208,7 +208,7 @@ public class ServerGroup
|
||||
|
||||
for (MinecraftServer server : repository.getServerStatuses())
|
||||
{
|
||||
if (_name.equals(server.getGroup()))
|
||||
if (_name.equalsIgnoreCase(server.getGroup()))
|
||||
{
|
||||
servers.add(server);
|
||||
}
|
||||
@ -218,9 +218,9 @@ public class ServerGroup
|
||||
/**
|
||||
* @return a unique server name suffix id, unique to any servers in this ServerGroup.
|
||||
*/
|
||||
public int generateUniqueId()
|
||||
public int generateUniqueId(int startId)
|
||||
{
|
||||
int id = 0;
|
||||
int id = startId;
|
||||
|
||||
while (true)
|
||||
{
|
||||
|
@ -1,6 +1,7 @@
|
||||
package mineplex.serverdata;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* The ServerRepository is used for storing/retrieving active sessions
|
||||
@ -60,12 +61,6 @@ public interface ServerRepository
|
||||
* currently active {@link ServerGroup}s in the repository.
|
||||
*/
|
||||
public Collection<ServerGroup> getServerGroups();
|
||||
|
||||
/**
|
||||
* Clean the repository by removing all expired server statuses that have
|
||||
* passed their timeout period.
|
||||
* @return the number of expired server statuses removed/cleared.
|
||||
*/
|
||||
public int clean();
|
||||
|
||||
Collection<MinecraftServer> getDeadServers();
|
||||
}
|
||||
|
@ -73,8 +73,12 @@ public class ServerMonitor
|
||||
while (true)
|
||||
{
|
||||
Collection<ServerGroup> serverGroups = _repository.getServerGroups();
|
||||
_repository.clean(); // Clean out old expired server entries
|
||||
|
||||
|
||||
for (MinecraftServer deadServer : _repository.getDeadServers())
|
||||
{
|
||||
killServer(deadServer.getName(), deadServer.getPublicAddress(), true);
|
||||
}
|
||||
|
||||
List<DedicatedServer> dedicatedServers = new ArrayList<DedicatedServer>(_repository.getDedicatedServers());
|
||||
|
||||
if (_count % 15 == 0)
|
||||
@ -82,7 +86,7 @@ public class ServerMonitor
|
||||
_badServers.clear();
|
||||
|
||||
for (DedicatedServer serverData : dedicatedServers)
|
||||
{
|
||||
{
|
||||
if (isServerOffline(serverData))
|
||||
{
|
||||
System.out.println("------=[OFFLINE]=------=[" + serverData.getName() + ":" + serverData.getPublicAddress() + "]=------=[OFFLINE]=------");
|
||||
@ -117,11 +121,20 @@ public class ServerMonitor
|
||||
}
|
||||
}*/
|
||||
|
||||
HashSet<String> onlineServers = new HashSet<String>();
|
||||
|
||||
for (MinecraftServer minecraftServer : _repository.getServerStatuses())
|
||||
{
|
||||
onlineServers.add(minecraftServer.getName());
|
||||
}
|
||||
|
||||
for (Iterator<Entry<String, Entry<String, Long>>> iterator = serverTracker.entrySet().iterator(); iterator.hasNext();)
|
||||
{
|
||||
Entry<String, Entry<String, Long>> entry = iterator.next();
|
||||
|
||||
if (System.currentTimeMillis() - entry.getValue().getValue() > 15000)
|
||||
if (onlineServers.contains(entry.getKey()))
|
||||
iterator.remove();
|
||||
else if (System.currentTimeMillis() - entry.getValue().getValue() > 20000)
|
||||
{
|
||||
System.out.println("-=[SERVER STARTUP TOO SLOW]=- " + entry.getKey());
|
||||
|
||||
@ -185,7 +198,7 @@ public class ServerMonitor
|
||||
processWaits++;
|
||||
}
|
||||
|
||||
processWaits = 0;
|
||||
processWaits = 0;
|
||||
|
||||
try
|
||||
{
|
||||
@ -203,7 +216,7 @@ public class ServerMonitor
|
||||
|
||||
private static void handleGroupChanges(List<DedicatedServer> dedicatedServers, HashMap<String, Entry<String, Long>> serverTracker, ServerGroup serverGroup, boolean free)
|
||||
{
|
||||
int serverNum = serverGroup.generateUniqueId();
|
||||
int serverNum = 0;
|
||||
//GroupStatusData groupStatus = groupStatusList.get(serverGroup.Name);
|
||||
int requiredTotal = serverGroup.getRequiredTotalServers();
|
||||
int requiredJoinable = serverGroup.getRequiredJoinableServers();
|
||||
@ -221,6 +234,7 @@ public class ServerMonitor
|
||||
|
||||
while (serversToAdd > 0)
|
||||
{
|
||||
serverNum = serverGroup.generateUniqueId(serverNum + 1);
|
||||
Collections.sort(dedicatedServers, new DedicatedServerSorter());
|
||||
DedicatedServer bestServer = getBestDedicatedServer(dedicatedServers, serverGroup);
|
||||
|
||||
@ -244,7 +258,7 @@ public class ServerMonitor
|
||||
while (serversToKill > 0)
|
||||
{
|
||||
List<MinecraftServer> emptyServers = new ArrayList<MinecraftServer>(serverGroup.getEmptyServers());
|
||||
MinecraftServer emptyServer = emptyServers.get(0);
|
||||
MinecraftServer emptyServer = emptyServers.get(serversToKill - 1);
|
||||
System.out.println("[" + emptyServer.getName() + ":" + emptyServer.getPublicAddress() + "] Killing " + serverGroup.getName() + " Req Total: " + serverGroup.getRequiredTotalServers() + " Req Joinable: " + serverGroup.getRequiredJoinableServers() + " | Actual Total: " + serverGroup.getServerCount() + " Actual Joinable: " + serverGroup.getJoinableCount());
|
||||
killServer(emptyServer);
|
||||
serversToKill--;
|
||||
@ -357,12 +371,12 @@ public class ServerMonitor
|
||||
|
||||
private static void startServer(final DedicatedServer serverSpace, final ServerGroup serverGroup, final int serverNum, final boolean free)
|
||||
{
|
||||
String cmd = "/home/mineplex/easyRemoteStartServer.sh";
|
||||
String cmd = "/home/mineplex/easyRemoteStartServerCustom.sh";
|
||||
final String groupPrefix = serverGroup.getPrefix();
|
||||
final String serverName = serverSpace.getName();
|
||||
final String serverAddress = serverSpace.getPublicAddress();
|
||||
|
||||
ProcessRunner pr = new ProcessRunner(new String[] {"/bin/sh", cmd, serverAddress, serverSpace.getPrivateAddress(), serverGroup.getPortSection() + serverNum + "", serverGroup.getRequiredRam() + "", serverGroup.getWorldZip(), serverGroup.getPlugin(), serverGroup.getConfigPath(), serverGroup.getName(), serverGroup.getPrefix() + "-" + serverNum, serverGroup.getMinPlayers() + "", serverGroup.getMaxPlayers() + "", serverGroup.getPvp() + "", serverGroup.getTournament() + "", free + "", serverSpace.isUsRegion() ? "true" : "false", serverGroup.getArcadeGroup() + "", serverGroup.getGames(), serverGroup.getServerType(), serverGroup.getAddNoCheat() + ""});
|
||||
|
||||
ProcessRunner pr = new ProcessRunner(new String[] {"/bin/sh", cmd, serverAddress, serverSpace.getPrivateAddress(), (serverGroup.getPortSection() + serverNum) + "", serverGroup.getRequiredRam() + "", serverGroup.getWorldZip(), serverGroup.getPlugin(), serverGroup.getConfigPath(), serverGroup.getName(), serverGroup.getPrefix() + "-" + serverNum, serverGroup.getMinPlayers() + "", serverGroup.getMaxPlayers() + "", serverGroup.getPvp() + "", serverGroup.getTournament() + "", free + "", serverSpace.isUsRegion() ? "true" : "false", serverGroup.getArcadeGroup() + "", serverGroup.getGames(), serverGroup.getServerType(), serverGroup.getAddNoCheat() + ""});
|
||||
pr.start(new GenericRunnable<Boolean>()
|
||||
{
|
||||
public void run(Boolean error)
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user