Converted to Spigot's latest 1.7.5
This commit is contained in:
parent
a26894fda6
commit
0375384fb5
@ -13,7 +13,7 @@ import mineplex.core.itemstack.ItemStackFactory;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.inventory.CraftItemStack;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.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_R1.CraftChunk;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.CraftChunk;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.CraftWorld;
|
||||
|
||||
public class BlockRegenerateData
|
||||
{
|
||||
@ -46,7 +46,7 @@ public class BlockRegenerateData
|
||||
//if (_loc.getBlock().getType() == Material.CHEST)
|
||||
// return;
|
||||
|
||||
net.minecraft.server.v1_7_R1.Chunk c = ((CraftChunk)_loc.getChunk()).getHandle();
|
||||
net.minecraft.server.v1_7_R2.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_R1.CraftChunk;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.CraftChunk;
|
||||
|
||||
public class BlockRegenerateSet
|
||||
{
|
||||
@ -61,7 +61,7 @@ public class BlockRegenerateSet
|
||||
{
|
||||
for (Chunk chunk : _chunks)
|
||||
{
|
||||
net.minecraft.server.v1_7_R1.Chunk c = ((CraftChunk)chunk).getHandle();
|
||||
net.minecraft.server.v1_7_R2.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_R1.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.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_R1.EntityInsentient;
|
||||
import net.minecraft.server.v1_7_R1.EntityLiving;
|
||||
import net.minecraft.server.v1_7_R1.EntityPlayer;
|
||||
import net.minecraft.server.v1_7_R1.MathHelper;
|
||||
import net.minecraft.server.v1_7_R1.Packet28EntityVelocity;
|
||||
import net.minecraft.server.v1_7_R1.Packet31RelEntityMove;
|
||||
import net.minecraft.server.v1_7_R1.Packet34EntityTeleport;
|
||||
import net.minecraft.server.v1_7_R1.PathfinderGoalSelector;
|
||||
import net.minecraft.server.v1_7_R2.EntityInsentient;
|
||||
import net.minecraft.server.v1_7_R2.EntityLiving;
|
||||
import net.minecraft.server.v1_7_R2.EntityPlayer;
|
||||
import net.minecraft.server.v1_7_R2.MathHelper;
|
||||
import net.minecraft.server.v1_7_R2.Packet28EntityVelocity;
|
||||
import net.minecraft.server.v1_7_R2.Packet31RelEntityMove;
|
||||
import net.minecraft.server.v1_7_R2.Packet34EntityTeleport;
|
||||
import net.minecraft.server.v1_7_R2.PathfinderGoalSelector;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftAgeable;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftLivingEntity;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftAgeable;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftLivingEntity;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.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_R1.EntityPlayer;
|
||||
import net.minecraft.server.v1_7_R1.Packet28EntityVelocity;
|
||||
import net.minecraft.server.v1_7_R2.EntityPlayer;
|
||||
import net.minecraft.server.v1_7_R2.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_R1.inventory.CraftInventory;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.inventory.CraftInventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class InventoryUtil
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -45,6 +45,6 @@ public class PlayerCount implements Listener, Runnable
|
||||
{
|
||||
net.md_5.bungee.api.ServerPing serverPing = event.getResponse();
|
||||
|
||||
event.setResponse(new net.md_5.bungee.api.ServerPing(serverPing.getVersion(), new Players(_totalMaxPlayers, _totalPlayers), serverPing.getMotd(), serverPing.getFavicon()));
|
||||
event.setResponse(new net.md_5.bungee.api.ServerPing(serverPing.getVersion(), new Players(_totalMaxPlayers, _totalPlayers, null), serverPing.getDescription(), serverPing.getFavicon()));
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package mineplex.core.common.util;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.bukkit.craftbukkit.v1_7_R1.inventory.CraftInventory;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.inventory.CraftInventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class InventoryUtil
|
||||
|
@ -10,24 +10,24 @@ import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.server.v1_7_R1.Block;
|
||||
import net.minecraft.server.v1_7_R1.ChunkCoordIntPair;
|
||||
import net.minecraft.server.v1_7_R1.ChunkSection;
|
||||
import net.minecraft.server.v1_7_R1.IContainer;
|
||||
import net.minecraft.server.v1_7_R1.MinecraftServer;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutMultiBlockChange;
|
||||
import net.minecraft.server.v1_7_R1.PlayerChunkMap;
|
||||
import net.minecraft.server.v1_7_R1.RegionFile;
|
||||
import net.minecraft.server.v1_7_R2.Block;
|
||||
import net.minecraft.server.v1_7_R2.ChunkCoordIntPair;
|
||||
import net.minecraft.server.v1_7_R2.ChunkSection;
|
||||
import net.minecraft.server.v1_7_R2.IContainer;
|
||||
import net.minecraft.server.v1_7_R2.MinecraftServer;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutMultiBlockChange;
|
||||
import net.minecraft.server.v1_7_R2.PlayerChunkMap;
|
||||
import net.minecraft.server.v1_7_R2.RegionFile;
|
||||
|
||||
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_R1.CraftChunk;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.CraftChunk;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.world.WorldUnloadEvent;
|
||||
@ -38,7 +38,7 @@ public class MapUtil
|
||||
{
|
||||
public static void ReplaceOreInChunk(Chunk chunk, Material replacee, Material replacer)
|
||||
{
|
||||
net.minecraft.server.v1_7_R1.Chunk c = ((CraftChunk)chunk).getHandle();
|
||||
net.minecraft.server.v1_7_R2.Chunk c = ((CraftChunk)chunk).getHandle();
|
||||
|
||||
for(int x = 0; x < 16; x++)
|
||||
{
|
||||
@ -84,7 +84,7 @@ 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_R1.Chunk c = ((CraftChunk)chunk).getHandle();
|
||||
net.minecraft.server.v1_7_R2.Chunk c = ((CraftChunk)chunk).getHandle();
|
||||
|
||||
c.a(x & 0xF, y, z & 0xF, Block.e(id), data);
|
||||
((CraftWorld)world).getHandle().notify(x, y, z);
|
||||
@ -129,9 +129,9 @@ public class MapUtil
|
||||
return totalHeight / count;
|
||||
}
|
||||
|
||||
public static void ResendChunksForNearbyPlayers(Collection<net.minecraft.server.v1_7_R1.Chunk> chunks)
|
||||
public static void ResendChunksForNearbyPlayers(Collection<net.minecraft.server.v1_7_R2.Chunk> chunks)
|
||||
{
|
||||
for (net.minecraft.server.v1_7_R1.Chunk c : chunks)
|
||||
for (net.minecraft.server.v1_7_R2.Chunk c : chunks)
|
||||
{
|
||||
|
||||
for (Player player : Bukkit.getOnlinePlayers())
|
||||
@ -148,14 +148,14 @@ public class MapUtil
|
||||
}
|
||||
}
|
||||
|
||||
public static net.minecraft.server.v1_7_R1.Chunk ChunkBlockChange(Location location, int id, byte data)
|
||||
public static net.minecraft.server.v1_7_R2.Chunk ChunkBlockChange(Location location, int id, byte data)
|
||||
{
|
||||
return ChunkBlockChange(location.getWorld(), location.getBlockX(), location.getBlockY(), location.getBlockZ(), id, data);
|
||||
}
|
||||
|
||||
public static net.minecraft.server.v1_7_R1.Chunk ChunkBlockChange(World world, int x, int y, int z, int id, byte data)
|
||||
public static net.minecraft.server.v1_7_R2.Chunk ChunkBlockChange(World world, int x, int y, int z, int id, byte data)
|
||||
{
|
||||
net.minecraft.server.v1_7_R1.Chunk c = ((CraftChunk)world.getChunkAt(x >> 4, z >> 4)).getHandle();
|
||||
net.minecraft.server.v1_7_R2.Chunk c = ((CraftChunk)world.getChunkAt(x >> 4, z >> 4)).getHandle();
|
||||
Block block = Block.e(id);
|
||||
|
||||
x = x & 0xF;
|
||||
@ -184,7 +184,7 @@ public class MapUtil
|
||||
return c;
|
||||
}
|
||||
|
||||
public static void SendChunkForPlayer(net.minecraft.server.v1_7_R1.Chunk chunk, Player player)
|
||||
public static void SendChunkForPlayer(net.minecraft.server.v1_7_R2.Chunk chunk, Player player)
|
||||
{
|
||||
SendChunkForPlayer(chunk.locX, chunk.locZ, player);
|
||||
}
|
||||
@ -217,11 +217,11 @@ public class MapUtil
|
||||
|
||||
Bukkit.getPluginManager().callEvent(new WorldUnloadEvent(((CraftWorld)world).getHandle().getWorld()));
|
||||
|
||||
Iterator<net.minecraft.server.v1_7_R1.Chunk> chunkIterator = ((CraftWorld)world).getHandle().chunkProviderServer.chunks.values().iterator();
|
||||
Iterator<net.minecraft.server.v1_7_R2.Chunk> chunkIterator = ((CraftWorld)world).getHandle().chunkProviderServer.chunks.values().iterator();
|
||||
|
||||
while (chunkIterator.hasNext())
|
||||
{
|
||||
net.minecraft.server.v1_7_R1.Chunk chunk = chunkIterator.next();
|
||||
net.minecraft.server.v1_7_R2.Chunk chunk = chunkIterator.next();
|
||||
chunk.removeEntities();
|
||||
}
|
||||
|
||||
@ -275,10 +275,10 @@ public class MapUtil
|
||||
|
||||
try
|
||||
{
|
||||
Field a = net.minecraft.server.v1_7_R1.RegionFileCache.class.getDeclaredField("a");
|
||||
Field a = net.minecraft.server.v1_7_R2.RegionFileCache.class.getDeclaredField("a");
|
||||
a.setAccessible(true);
|
||||
regionfiles = (HashMap) a.get(null);
|
||||
rafField = net.minecraft.server.v1_7_R1.RegionFile.class.getDeclaredField("c");
|
||||
rafField = net.minecraft.server.v1_7_R2.RegionFile.class.getDeclaredField("c");
|
||||
rafField.setAccessible(true);
|
||||
}
|
||||
catch (Throwable t)
|
||||
|
@ -3,18 +3,18 @@ package mineplex.core.common.util;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.server.v1_7_R1.DataWatcher;
|
||||
import net.minecraft.server.v1_7_R1.EntityPlayer;
|
||||
import net.minecraft.server.v1_7_R1.MathHelper;
|
||||
import net.minecraft.server.v1_7_R1.Packet;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayInClientCommand;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutEntityDestroy;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutEntityMetadata;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutSpawnEntityLiving;
|
||||
import net.minecraft.server.v1_7_R2.DataWatcher;
|
||||
import net.minecraft.server.v1_7_R2.EntityPlayer;
|
||||
import net.minecraft.server.v1_7_R2.MathHelper;
|
||||
import net.minecraft.server.v1_7_R2.Packet;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayInClientCommand;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutEntityDestroy;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutEntityMetadata;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutSpawnEntityLiving;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftPlayer;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
@ -4,33 +4,33 @@ import java.lang.reflect.Field;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
|
||||
import net.minecraft.server.v1_7_R1.EntityBat;
|
||||
import net.minecraft.server.v1_7_R1.EntityCreature;
|
||||
import net.minecraft.server.v1_7_R1.EntityEnderDragon;
|
||||
import net.minecraft.server.v1_7_R1.EntityHuman;
|
||||
import net.minecraft.server.v1_7_R1.EntityInsentient;
|
||||
import net.minecraft.server.v1_7_R1.EntityLiving;
|
||||
import net.minecraft.server.v1_7_R1.Navigation;
|
||||
import net.minecraft.server.v1_7_R1.PathfinderGoalLookAtPlayer;
|
||||
import net.minecraft.server.v1_7_R1.PathfinderGoalMoveTowardsRestriction;
|
||||
import net.minecraft.server.v1_7_R1.PathfinderGoalRandomLookaround;
|
||||
import net.minecraft.server.v1_7_R1.PathfinderGoalSelector;
|
||||
import net.minecraft.server.v1_7_R2.EntityBat;
|
||||
import net.minecraft.server.v1_7_R2.EntityCreature;
|
||||
import net.minecraft.server.v1_7_R2.EntityEnderDragon;
|
||||
import net.minecraft.server.v1_7_R2.EntityHuman;
|
||||
import net.minecraft.server.v1_7_R2.EntityInsentient;
|
||||
import net.minecraft.server.v1_7_R2.EntityLiving;
|
||||
import net.minecraft.server.v1_7_R2.Navigation;
|
||||
import net.minecraft.server.v1_7_R2.PathfinderGoalLookAtPlayer;
|
||||
import net.minecraft.server.v1_7_R2.PathfinderGoalMoveTowardsRestriction;
|
||||
import net.minecraft.server.v1_7_R2.PathfinderGoalRandomLookaround;
|
||||
import net.minecraft.server.v1_7_R2.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_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftLivingEntity;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.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_R1.entity.CraftCreature;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftCreature;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.CraftWorld;
|
||||
|
||||
public class UtilEnt
|
||||
{
|
||||
|
@ -3,10 +3,10 @@ package mineplex.core.common.util;
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutWorldParticles;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutWorldParticles;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class UtilParticle
|
||||
|
@ -5,7 +5,7 @@ import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
||||
import net.minecraft.server.v1_7_R1.Chunk;
|
||||
import net.minecraft.server.v1_7_R2.Chunk;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
|
@ -2,23 +2,23 @@ package mineplex.core.common.util;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import net.minecraft.server.v1_7_R1.ConvertProgressUpdater;
|
||||
import net.minecraft.server.v1_7_R1.Convertable;
|
||||
import net.minecraft.server.v1_7_R1.EntityTracker;
|
||||
import net.minecraft.server.v1_7_R1.EnumDifficulty;
|
||||
import net.minecraft.server.v1_7_R1.EnumGamemode;
|
||||
import net.minecraft.server.v1_7_R1.IWorldAccess;
|
||||
import net.minecraft.server.v1_7_R1.ServerNBTManager;
|
||||
import net.minecraft.server.v1_7_R1.WorldLoaderServer;
|
||||
import net.minecraft.server.v1_7_R1.WorldManager;
|
||||
import net.minecraft.server.v1_7_R1.WorldServer;
|
||||
import net.minecraft.server.v1_7_R1.WorldSettings;
|
||||
import net.minecraft.server.v1_7_R1.WorldType;
|
||||
import net.minecraft.server.v1_7_R2.ConvertProgressUpdater;
|
||||
import net.minecraft.server.v1_7_R2.Convertable;
|
||||
import net.minecraft.server.v1_7_R2.EntityTracker;
|
||||
import net.minecraft.server.v1_7_R2.EnumDifficulty;
|
||||
import net.minecraft.server.v1_7_R2.EnumGamemode;
|
||||
import net.minecraft.server.v1_7_R2.IWorldAccess;
|
||||
import net.minecraft.server.v1_7_R2.ServerNBTManager;
|
||||
import net.minecraft.server.v1_7_R2.WorldLoaderServer;
|
||||
import net.minecraft.server.v1_7_R2.WorldManager;
|
||||
import net.minecraft.server.v1_7_R2.WorldServer;
|
||||
import net.minecraft.server.v1_7_R2.WorldSettings;
|
||||
import net.minecraft.server.v1_7_R2.WorldType;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.WorldCreator;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
|
||||
import org.bukkit.event.world.WorldInitEvent;
|
||||
import org.bukkit.event.world.WorldLoadEvent;
|
||||
import org.bukkit.generator.ChunkGenerator;
|
||||
|
@ -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_R1.inventory.CraftItemStack;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.inventory.CraftItemStack;
|
||||
import org.bukkit.entity.Item;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
@ -4,7 +4,7 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftLivingEntity;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.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_R1.ChunkAddEntityEvent;
|
||||
import net.minecraft.server.v1_7_R1.EntityPlayer;
|
||||
import net.minecraft.server.v1_7_R1.Packet;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutAnimation;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutNamedEntitySpawn;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutSpawnEntity;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutEntityVelocity;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutEntityDestroy;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutRelEntityMove;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutRelEntityMoveLook;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutEntityTeleport;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutEntityMetadata;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutSpawnEntityLiving;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutUpdateAttributes;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutEntityEquipment;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutNamedSoundEffect;
|
||||
import net.minecraft.server.v1_7_R2.ChunkAddEntityEvent;
|
||||
import net.minecraft.server.v1_7_R2.EntityPlayer;
|
||||
import net.minecraft.server.v1_7_R2.Packet;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutAnimation;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutNamedEntitySpawn;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutSpawnEntity;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutEntityVelocity;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutEntityDestroy;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutRelEntityMove;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutRelEntityMoveLook;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutEntityTeleport;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutEntityMetadata;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutSpawnEntityLiving;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutUpdateAttributes;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutEntityEquipment;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutNamedSoundEffect;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftLivingEntity;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftLivingEntity;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.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_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
|
||||
|
||||
import net.minecraft.server.v1_7_R1.DataWatcher;
|
||||
import net.minecraft.server.v1_7_R1.Entity;
|
||||
import net.minecraft.server.v1_7_R1.Packet;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutEntityMetadata;
|
||||
import net.minecraft.server.v1_7_R2.DataWatcher;
|
||||
import net.minecraft.server.v1_7_R2.Entity;
|
||||
import net.minecraft.server.v1_7_R2.Packet;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutEntityMetadata;
|
||||
|
||||
public abstract class DisguiseBase
|
||||
{
|
||||
|
@ -2,9 +2,9 @@ package mineplex.core.disguise.disguises;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.server.v1_7_R1.MathHelper;
|
||||
import net.minecraft.server.v1_7_R1.Packet;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutSpawnEntity;
|
||||
import net.minecraft.server.v1_7_R2.MathHelper;
|
||||
import net.minecraft.server.v1_7_R2.Packet;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutSpawnEntity;
|
||||
|
||||
public class DisguiseBlock extends DisguiseBase
|
||||
{
|
||||
|
@ -1,9 +1,9 @@
|
||||
package mineplex.core.disguise.disguises;
|
||||
|
||||
import net.minecraft.server.v1_7_R1.EnumEntitySize;
|
||||
import net.minecraft.server.v1_7_R1.MathHelper;
|
||||
import net.minecraft.server.v1_7_R1.Packet;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutSpawnEntityLiving;
|
||||
import net.minecraft.server.v1_7_R2.EnumEntitySize;
|
||||
import net.minecraft.server.v1_7_R2.MathHelper;
|
||||
import net.minecraft.server.v1_7_R2.Packet;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutSpawnEntityLiving;
|
||||
|
||||
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_R1.MobEffect;
|
||||
import net.minecraft.server.v1_7_R1.MobEffectList;
|
||||
import net.minecraft.server.v1_7_R1.PotionBrewer;
|
||||
import net.minecraft.server.v1_7_R2.MobEffect;
|
||||
import net.minecraft.server.v1_7_R2.MobEffectList;
|
||||
import net.minecraft.server.v1_7_R2.PotionBrewer;
|
||||
|
||||
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_R1.Packet;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutEntityEquipment;
|
||||
import net.minecraft.server.v1_7_R2.Packet;
|
||||
import net.minecraft.server.v1_7_R2.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_R1.ItemStack[] armorContents = Entity.getEquipment();
|
||||
net.minecraft.server.v1_7_R2.ItemStack[] armorContents = Entity.getEquipment();
|
||||
|
||||
for (short i=0; i < armorContents.length; i++)
|
||||
{
|
||||
net.minecraft.server.v1_7_R1.ItemStack armorSlot = armorContents[i];
|
||||
net.minecraft.server.v1_7_R2.ItemStack armorSlot = armorContents[i];
|
||||
|
||||
if (armorSlot != null)
|
||||
{
|
||||
|
@ -1,9 +1,9 @@
|
||||
package mineplex.core.disguise.disguises;
|
||||
|
||||
import net.minecraft.server.v1_7_R1.EnumEntitySize;
|
||||
import net.minecraft.server.v1_7_R1.MathHelper;
|
||||
import net.minecraft.server.v1_7_R1.Packet;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutSpawnEntityLiving;
|
||||
import net.minecraft.server.v1_7_R2.EnumEntitySize;
|
||||
import net.minecraft.server.v1_7_R2.MathHelper;
|
||||
import net.minecraft.server.v1_7_R2.Packet;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutSpawnEntityLiving;
|
||||
|
||||
public class DisguiseMagmaCube extends DisguiseInsentient
|
||||
{
|
||||
|
@ -1,8 +1,8 @@
|
||||
package mineplex.core.disguise.disguises;
|
||||
|
||||
import net.minecraft.server.v1_7_R1.MathHelper;
|
||||
import net.minecraft.server.v1_7_R1.Packet;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutNamedEntitySpawn;
|
||||
import net.minecraft.server.v1_7_R2.MathHelper;
|
||||
import net.minecraft.server.v1_7_R2.Packet;
|
||||
import net.minecraft.server.v1_7_R2.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_R1.EnumEntitySize;
|
||||
import net.minecraft.server.v1_7_R1.MathHelper;
|
||||
import net.minecraft.server.v1_7_R1.Packet;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutSpawnEntityLiving;
|
||||
import net.minecraft.server.v1_7_R2.EnumEntitySize;
|
||||
import net.minecraft.server.v1_7_R2.MathHelper;
|
||||
import net.minecraft.server.v1_7_R2.Packet;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutSpawnEntityLiving;
|
||||
|
||||
public class DisguiseSlime extends DisguiseInsentient
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
package mineplex.core.disguise.disguises;
|
||||
|
||||
import net.minecraft.server.v1_7_R1.BlockCloth;
|
||||
import net.minecraft.server.v1_7_R2.BlockCloth;
|
||||
|
||||
public class DisguiseWolf extends DisguiseTameableAnimal
|
||||
{
|
||||
|
@ -1,8 +1,8 @@
|
||||
package mineplex.core.disguise.disguises;
|
||||
|
||||
import net.minecraft.server.v1_7_R1.Entity;
|
||||
import net.minecraft.server.v1_7_R1.NBTTagCompound;
|
||||
import net.minecraft.server.v1_7_R1.World;
|
||||
import net.minecraft.server.v1_7_R2.Entity;
|
||||
import net.minecraft.server.v1_7_R2.NBTTagCompound;
|
||||
import net.minecraft.server.v1_7_R2.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_R1.BlockCloth;
|
||||
import net.minecraft.server.v1_7_R1.DataWatcher;
|
||||
import net.minecraft.server.v1_7_R1.Entity;
|
||||
import net.minecraft.server.v1_7_R1.EntityLiving;
|
||||
import net.minecraft.server.v1_7_R1.EntitySlime;
|
||||
import net.minecraft.server.v1_7_R1.EnumEntitySize;
|
||||
import net.minecraft.server.v1_7_R1.MathHelper;
|
||||
import net.minecraft.server.v1_7_R1.Packet;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutSpawnEntityLiving;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutEntityDestroy;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutAttachEntity;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutEntityMetadata;
|
||||
import net.minecraft.server.v1_7_R2.BlockCloth;
|
||||
import net.minecraft.server.v1_7_R2.DataWatcher;
|
||||
import net.minecraft.server.v1_7_R2.Entity;
|
||||
import net.minecraft.server.v1_7_R2.EntityLiving;
|
||||
import net.minecraft.server.v1_7_R2.EntitySlime;
|
||||
import net.minecraft.server.v1_7_R2.EnumEntitySize;
|
||||
import net.minecraft.server.v1_7_R2.MathHelper;
|
||||
import net.minecraft.server.v1_7_R2.Packet;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutSpawnEntityLiving;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutEntityDestroy;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutAttachEntity;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutEntityMetadata;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.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_R1.Packet;
|
||||
import net.minecraft.server.v1_7_R2.Packet;
|
||||
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.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_R1.EnumEntitySize;
|
||||
import net.minecraft.server.v1_7_R1.MathHelper;
|
||||
import net.minecraft.server.v1_7_R1.Packet;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutSpawnEntity;
|
||||
import net.minecraft.server.v1_7_R2.EnumEntitySize;
|
||||
import net.minecraft.server.v1_7_R2.MathHelper;
|
||||
import net.minecraft.server.v1_7_R2.Packet;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutSpawnEntity;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.EntityType;
|
||||
|
@ -1,13 +1,13 @@
|
||||
package mineplex.core.fakeEntity;
|
||||
|
||||
import net.minecraft.server.v1_7_R1.DataWatcher;
|
||||
import net.minecraft.server.v1_7_R1.ItemStack;
|
||||
import net.minecraft.server.v1_7_R1.MathHelper;
|
||||
import net.minecraft.server.v1_7_R1.Packet;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutSpawnEntity;
|
||||
import net.minecraft.server.v1_7_R2.DataWatcher;
|
||||
import net.minecraft.server.v1_7_R2.ItemStack;
|
||||
import net.minecraft.server.v1_7_R2.MathHelper;
|
||||
import net.minecraft.server.v1_7_R2.Packet;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutSpawnEntity;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.inventory.CraftItemStack;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.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_R1.ItemStack(_itemStack.getItem(), _itemStack.count));
|
||||
dataWatcher.a(10, new net.minecraft.server.v1_7_R2.ItemStack(_itemStack.getItem(), _itemStack.count));
|
||||
}
|
||||
|
||||
public void SetItemStack(org.bukkit.inventory.ItemStack itemStack)
|
||||
|
@ -2,16 +2,16 @@ package mineplex.core.fakeEntity;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
import net.minecraft.server.v1_7_R1.DataWatcher;
|
||||
import net.minecraft.server.v1_7_R1.EntitySlime;
|
||||
import net.minecraft.server.v1_7_R1.MathHelper;
|
||||
import net.minecraft.server.v1_7_R1.Packet;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutNamedEntitySpawn;
|
||||
import net.minecraft.server.v1_7_R2.DataWatcher;
|
||||
import net.minecraft.server.v1_7_R2.EntitySlime;
|
||||
import net.minecraft.server.v1_7_R2.MathHelper;
|
||||
import net.minecraft.server.v1_7_R2.Packet;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutNamedEntitySpawn;
|
||||
import net.minecraft.util.com.mojang.authlib.GameProfile;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.CraftWorld;
|
||||
import org.bukkit.entity.EntityType;
|
||||
|
||||
public class FakePlayer extends FakeEntity
|
||||
|
@ -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_R1.inventory.CraftItemStack;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.inventory.CraftItemStack;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Monster;
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -2,12 +2,12 @@ package mineplex.core.memory;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import net.minecraft.server.v1_7_R1.IInventory;
|
||||
import net.minecraft.server.v1_7_R2.IInventory;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftPlayer;
|
||||
import org.bukkit.entity.HumanEntity;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
|
@ -5,7 +5,7 @@ import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.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_R1.EntityCreature;
|
||||
import net.minecraft.server.v1_7_R2.EntityCreature;
|
||||
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftCreature;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.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_R1.EntityAgeable;
|
||||
import net.minecraft.server.v1_7_R1.EntityInsentient;
|
||||
import net.minecraft.server.v1_7_R2.EntityAgeable;
|
||||
import net.minecraft.server.v1_7_R2.EntityInsentient;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World.Environment;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftAgeable;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftCreature;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftLivingEntity;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftAgeable;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftCreature;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.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_R1.Packet;
|
||||
import net.minecraft.server.v1_7_R2.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_R1.Packet;
|
||||
import net.minecraft.server.v1_7_R2.Packet;
|
||||
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.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_R1.IPacketVerifier;
|
||||
import net.minecraft.server.v1_7_R1.Packet;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutEntityVelocity;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutRelEntityMove;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutRelEntityMoveLook;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutEntityTeleport;
|
||||
import net.minecraft.server.v1_7_R2.IPacketVerifier;
|
||||
import net.minecraft.server.v1_7_R2.Packet;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutEntityVelocity;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutRelEntityMove;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutRelEntityMoveLook;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutEntityTeleport;
|
||||
import net.minecraft.util.io.netty.util.concurrent.GenericFutureListener;
|
||||
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class PacketVerifier implements IPacketVerifier
|
||||
|
@ -16,13 +16,13 @@ import mineplex.core.common.util.NautHashMap;
|
||||
import mineplex.core.common.util.UtilInv;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import net.minecraft.server.v1_7_R1.EntityCreature;
|
||||
import net.minecraft.server.v1_7_R1.EntityHuman;
|
||||
import net.minecraft.server.v1_7_R1.EntityInsentient;
|
||||
import net.minecraft.server.v1_7_R1.Navigation;
|
||||
import net.minecraft.server.v1_7_R1.PathfinderGoalLookAtPlayer;
|
||||
import net.minecraft.server.v1_7_R1.PathfinderGoalRandomLookaround;
|
||||
import net.minecraft.server.v1_7_R1.PathfinderGoalSelector;
|
||||
import net.minecraft.server.v1_7_R2.EntityCreature;
|
||||
import net.minecraft.server.v1_7_R2.EntityHuman;
|
||||
import net.minecraft.server.v1_7_R2.EntityInsentient;
|
||||
import net.minecraft.server.v1_7_R2.Navigation;
|
||||
import net.minecraft.server.v1_7_R2.PathfinderGoalLookAtPlayer;
|
||||
import net.minecraft.server.v1_7_R2.PathfinderGoalRandomLookaround;
|
||||
import net.minecraft.server.v1_7_R2.PathfinderGoalSelector;
|
||||
|
||||
|
||||
|
||||
@ -33,8 +33,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_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftCreature;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftCreature;
|
||||
import org.bukkit.entity.Ageable;
|
||||
import org.bukkit.entity.Creature;
|
||||
import org.bukkit.entity.EntityType;
|
||||
|
@ -4,15 +4,15 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.server.v1_7_R1.Block;
|
||||
import net.minecraft.server.v1_7_R1.EntityPlayer;
|
||||
import net.minecraft.server.v1_7_R1.Item;
|
||||
import net.minecraft.server.v1_7_R1.Items;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutOpenWindow;
|
||||
import net.minecraft.server.v1_7_R1.PacketPlayOutSetSlot;
|
||||
import net.minecraft.server.v1_7_R2.Block;
|
||||
import net.minecraft.server.v1_7_R2.EntityPlayer;
|
||||
import net.minecraft.server.v1_7_R2.Item;
|
||||
import net.minecraft.server.v1_7_R2.Items;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutOpenWindow;
|
||||
import net.minecraft.server.v1_7_R2.PacketPlayOutSetSlot;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Creature;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@ -116,7 +116,7 @@ public class PetPage extends ShopPageBase<PetManager, PetShop>
|
||||
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_R1.ItemStack(Items.NAME_TAG)));
|
||||
entityPlayer.playerConnection.sendPacket(new PacketPlayOutSetSlot(containerCounter, 0, new net.minecraft.server.v1_7_R2.ItemStack(Items.NAME_TAG)));
|
||||
|
||||
Shop.SetCurrentPageForPlayer(Player, petTagPage);
|
||||
}
|
||||
|
@ -14,9 +14,9 @@ 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_R1.Item;
|
||||
import net.minecraft.server.v1_7_R1.ItemStack;
|
||||
import net.minecraft.server.v1_7_R1.Items;
|
||||
import net.minecraft.server.v1_7_R2.Item;
|
||||
import net.minecraft.server.v1_7_R2.ItemStack;
|
||||
import net.minecraft.server.v1_7_R2.Items;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
|
@ -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_R1.AxisAlignedBB;
|
||||
import net.minecraft.server.v1_7_R1.MathHelper;
|
||||
import net.minecraft.server.v1_7_R1.MovingObjectPosition;
|
||||
import net.minecraft.server.v1_7_R1.Vec3D;
|
||||
import net.minecraft.server.v1_7_R2.AxisAlignedBB;
|
||||
import net.minecraft.server.v1_7_R2.MathHelper;
|
||||
import net.minecraft.server.v1_7_R2.MovingObjectPosition;
|
||||
import net.minecraft.server.v1_7_R2.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_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftLivingEntity;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftLivingEntity;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
@ -106,24 +106,24 @@ public class ProjectileUser
|
||||
double distanceToEntity = 0.0D;
|
||||
LivingEntity victim = null;
|
||||
|
||||
net.minecraft.server.v1_7_R1.Entity nmsEntity = ((CraftEntity)_thrown).getHandle();
|
||||
Vec3D vec3d = nmsEntity.world.getVec3DPool().create(nmsEntity.locX, nmsEntity.locY, nmsEntity.locZ);
|
||||
Vec3D vec3d1 = nmsEntity.world.getVec3DPool().create(nmsEntity.locX + nmsEntity.motX, nmsEntity.locY + nmsEntity.motY, nmsEntity.locZ + nmsEntity.motZ);
|
||||
net.minecraft.server.v1_7_R2.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);
|
||||
|
||||
MovingObjectPosition finalObjectPosition = nmsEntity.world.rayTrace(vec3d, vec3d1, false, true, false);
|
||||
vec3d = nmsEntity.world.getVec3DPool().create(nmsEntity.locX, nmsEntity.locY, nmsEntity.locZ);
|
||||
vec3d1 = nmsEntity.world.getVec3DPool().create(nmsEntity.locX + nmsEntity.motX, nmsEntity.locY + nmsEntity.motY, nmsEntity.locZ + nmsEntity.motZ);
|
||||
vec3d = Vec3D.a(nmsEntity.locX, nmsEntity.locY, nmsEntity.locZ);
|
||||
vec3d1 = Vec3D.a(nmsEntity.locX + nmsEntity.motX, nmsEntity.locY + nmsEntity.motY, nmsEntity.locZ + nmsEntity.motZ);
|
||||
|
||||
if (finalObjectPosition != null)
|
||||
{
|
||||
vec3d1 = nmsEntity.world.getVec3DPool().create(finalObjectPosition.pos.c, finalObjectPosition.pos.d, finalObjectPosition.pos.e);
|
||||
vec3d1 = Vec3D.a(finalObjectPosition.pos.a, finalObjectPosition.pos.b, finalObjectPosition.pos.c);
|
||||
}
|
||||
|
||||
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_R1.Entity)
|
||||
if (entity instanceof net.minecraft.server.v1_7_R2.Entity)
|
||||
{
|
||||
Entity bukkitEntity = ((net.minecraft.server.v1_7_R1.Entity) entity).getBukkitEntity();
|
||||
Entity bukkitEntity = ((net.minecraft.server.v1_7_R2.Entity) entity).getBukkitEntity();
|
||||
|
||||
if (bukkitEntity instanceof LivingEntity)
|
||||
{
|
||||
@ -144,7 +144,7 @@ public class ProjectileUser
|
||||
disguise = EntityType.SQUID;
|
||||
}
|
||||
|
||||
float f1 = (float)(nmsEntity.boundingBox.b() * .6);
|
||||
float f1 = (float)(nmsEntity.boundingBox.a() * .6);
|
||||
AxisAlignedBB axisalignedbb1 = ((CraftEntity)ent).getHandle().boundingBox.grow(f1, f1, f1);
|
||||
MovingObjectPosition entityCollisionPosition = axisalignedbb1.a(vec3d, vec3d1);
|
||||
|
||||
@ -170,27 +170,14 @@ public class ProjectileUser
|
||||
|
||||
if (finalObjectPosition != null)
|
||||
{
|
||||
if (finalObjectPosition.entity != null && _hitPlayer)
|
||||
{
|
||||
nmsEntity.motX = ((float) (finalObjectPosition.pos.c - nmsEntity.locX));
|
||||
nmsEntity.motY = ((float) (finalObjectPosition.pos.d - nmsEntity.locY));
|
||||
nmsEntity.motZ = ((float) (finalObjectPosition.pos.e - nmsEntity.locZ));
|
||||
float f2 = MathHelper.sqrt(nmsEntity.motX * nmsEntity.motX + nmsEntity.motY * nmsEntity.motY + nmsEntity.motZ * nmsEntity.motZ);
|
||||
nmsEntity.locX -= nmsEntity.motX / f2 * 0.0500000007450581D;
|
||||
nmsEntity.locY -= nmsEntity.motY / f2 * 0.0500000007450581D;
|
||||
nmsEntity.locZ -= nmsEntity.motZ / f2 * 0.0500000007450581D;
|
||||
|
||||
_callback.Collide(victim, null, this);
|
||||
return true;
|
||||
}
|
||||
else if (_hitBlock)
|
||||
if (_hitBlock)
|
||||
{
|
||||
Block block = _thrown.getWorld().getBlockAt(finalObjectPosition.b, finalObjectPosition.c, finalObjectPosition.d);
|
||||
if (!UtilBlock.airFoliage(block) && !block.isLiquid())
|
||||
{
|
||||
nmsEntity.motX = ((float) (finalObjectPosition.pos.c - nmsEntity.locX));
|
||||
nmsEntity.motY = ((float) (finalObjectPosition.pos.d - nmsEntity.locY));
|
||||
nmsEntity.motZ = ((float) (finalObjectPosition.pos.e - nmsEntity.locZ));
|
||||
nmsEntity.motX = ((float) (finalObjectPosition.pos.a - nmsEntity.locX));
|
||||
nmsEntity.motY = ((float) (finalObjectPosition.pos.b - nmsEntity.locY));
|
||||
nmsEntity.motZ = ((float) (finalObjectPosition.pos.c - nmsEntity.locZ));
|
||||
float f2 = MathHelper.sqrt(nmsEntity.motX * nmsEntity.motX + nmsEntity.motY * nmsEntity.motY + nmsEntity.motZ * nmsEntity.motZ);
|
||||
nmsEntity.locX -= nmsEntity.motX / f2 * 0.0500000007450581D;
|
||||
nmsEntity.locY -= nmsEntity.motY / f2 * 0.0500000007450581D;
|
||||
|
@ -22,7 +22,7 @@ import mineplex.core.shop.item.ShopItem;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.inventory.CraftInventoryCustom;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.inventory.CraftInventoryCustom;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
|
@ -5,7 +5,7 @@ import java.util.List;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import mineplex.core.account.CoreClient;
|
||||
import net.minecraft.server.v1_7_R1.IInventory;
|
||||
import net.minecraft.server.v1_7_R2.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_R1.IInventory;
|
||||
import net.minecraft.server.v1_7_R2.IInventory;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.inventory.CraftInventory;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.inventory.CraftInventory;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
package mineplex.core.shop.item;
|
||||
|
||||
import net.minecraft.server.v1_7_R1.NBTTagList;
|
||||
import net.minecraft.server.v1_7_R1.NBTTagString;
|
||||
import net.minecraft.server.v1_7_R2.NBTTagList;
|
||||
import net.minecraft.server.v1_7_R2.NBTTagString;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.inventory.CraftItemStack;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.inventory.CraftItemStack;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class ShopItem extends CraftItemStack
|
||||
@ -100,8 +100,8 @@ public class ShopItem extends CraftItemStack
|
||||
return false;
|
||||
}
|
||||
|
||||
net.minecraft.server.v1_7_R1.ItemStack original = ((CraftItemStack)this).getHandle();
|
||||
net.minecraft.server.v1_7_R1.ItemStack comparison = ((CraftItemStack)obj).getHandle();
|
||||
net.minecraft.server.v1_7_R2.ItemStack original = ((CraftItemStack)this).getHandle();
|
||||
net.minecraft.server.v1_7_R2.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_R1.inventory.CraftInventory;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.inventory.CraftInventoryDoubleChest;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.inventory.CraftInventoryPlayer;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.inventory.CraftInventoryView;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.inventory.CraftInventory;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.inventory.CraftInventoryDoubleChest;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.inventory.CraftInventoryPlayer;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.inventory.CraftInventoryView;
|
||||
|
||||
import net.minecraft.server.v1_7_R1.Container;
|
||||
import net.minecraft.server.v1_7_R1.EntityHuman;
|
||||
import net.minecraft.server.v1_7_R1.IInventory;
|
||||
import net.minecraft.server.v1_7_R1.InventoryLargeChest;
|
||||
import net.minecraft.server.v1_7_R1.PlayerInventory;
|
||||
import net.minecraft.server.v1_7_R1.Slot;
|
||||
import net.minecraft.server.v1_7_R2.Container;
|
||||
import net.minecraft.server.v1_7_R2.EntityHuman;
|
||||
import net.minecraft.server.v1_7_R2.IInventory;
|
||||
import net.minecraft.server.v1_7_R2.InventoryLargeChest;
|
||||
import net.minecraft.server.v1_7_R2.PlayerInventory;
|
||||
import net.minecraft.server.v1_7_R2.Slot;
|
||||
|
||||
public class AnvilContainer extends Container
|
||||
{
|
||||
|
@ -1,8 +1,8 @@
|
||||
package mineplex.core.shop.page;
|
||||
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.inventory.CraftInventoryCustom;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.inventory.CraftInventoryCustom;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
|
@ -8,7 +8,7 @@ import org.bukkit.ChatColor;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.CraftWorld;
|
||||
import org.bukkit.entity.Egg;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
@ -338,6 +338,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
||||
Objective obj = board.registerNewObjective(C.Bold + "Player Data", "dummy");
|
||||
obj.setDisplaySlot(DisplaySlot.SIDEBAR);
|
||||
|
||||
|
||||
for (Rank rank : Rank.values())
|
||||
{
|
||||
if (rank != Rank.ALL)
|
||||
@ -367,6 +368,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
||||
//Add Self to Other
|
||||
otherPlayer.getScoreboard().getTeam(rankName).addPlayer(player);
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -6,7 +6,7 @@ import java.util.HashSet;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftPlayer;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
|
@ -5,7 +5,7 @@ import mineplex.core.common.util.UtilEnt;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEnderDragon;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.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_R1.EntityCreature;
|
||||
import net.minecraft.server.v1_7_R1.Navigation;
|
||||
import net.minecraft.server.v1_7_R2.EntityCreature;
|
||||
import net.minecraft.server.v1_7_R2.Navigation;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftCreature;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftCreature;
|
||||
import org.bukkit.entity.Horse.Variant;
|
||||
import org.bukkit.entity.Horse;
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -12,7 +12,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_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
|
@ -55,7 +55,7 @@ public class ItemFactory extends MiniPlugin implements IItemFactory
|
||||
|
||||
try
|
||||
{
|
||||
_itemMaxDurability = net.minecraft.server.v1_7_R1.Item.class.getDeclaredField("durability");
|
||||
_itemMaxDurability = net.minecraft.server.v1_7_R2.Item.class.getDeclaredField("durability");
|
||||
_itemMaxDurability.setAccessible(true);
|
||||
}
|
||||
catch (SecurityException e)
|
||||
@ -195,7 +195,7 @@ public class ItemFactory extends MiniPlugin implements IItemFactory
|
||||
|
||||
try
|
||||
{
|
||||
_itemMaxDurability.setInt(net.minecraft.server.v1_7_R1.Item.d(newItem.GetType().getId()), 56);
|
||||
_itemMaxDurability.setInt(net.minecraft.server.v1_7_R2.Item.d(newItem.GetType().getId()), 56);
|
||||
}
|
||||
catch (IllegalArgumentException e)
|
||||
{
|
||||
|
@ -2,7 +2,7 @@ package mineplex.minecraft.game.classcombat.item;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.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_R1.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.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_R1.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.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_R1.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftPlayer;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
|
@ -3,9 +3,9 @@ package mineplex.minecraft.game.core.combat;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
||||
import net.minecraft.server.v1_7_R1.ItemStack;
|
||||
import net.minecraft.server.v1_7_R2.ItemStack;
|
||||
|
||||
import org.bukkit.craftbukkit.v1_7_R1.inventory.CraftItemStack;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.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_R1.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.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_R1.DamageSource;
|
||||
import net.minecraft.server.v1_7_R1.EntityHuman;
|
||||
import net.minecraft.server.v1_7_R1.EntityLiving;
|
||||
import net.minecraft.server.v1_7_R2.DamageSource;
|
||||
import net.minecraft.server.v1_7_R2.EntityHuman;
|
||||
import net.minecraft.server.v1_7_R2.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_R1.entity.CraftLivingEntity;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftLivingEntity;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.Fish;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
@ -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().aZ() + 1);
|
||||
((CraftLivingEntity)event.GetDamageeEntity()).getHandle().p(((CraftLivingEntity)event.GetDamageeEntity()).getHandle().aY() + 1);
|
||||
|
||||
//Knockback
|
||||
double knockback = event.GetDamage();
|
||||
@ -367,7 +367,7 @@ public class DamageManager extends MiniPlugin
|
||||
else
|
||||
{
|
||||
entityDamagee.lastDamage = damage;
|
||||
entityDamagee.ax = entityDamagee.getHealth();
|
||||
entityDamagee.aw = entityDamagee.getHealth();
|
||||
//entityDamagee.noDamageTicks = entityDamagee.maxNoDamageTicks;
|
||||
ApplyDamage(entityDamagee, damage, ignoreArmor);
|
||||
//entityDamagee.hurtTicks = entityDamagee.aW = 10;
|
||||
@ -478,7 +478,7 @@ public class DamageManager extends MiniPlugin
|
||||
{
|
||||
if (!ignoreArmor)
|
||||
{
|
||||
int j = 25 - entityLiving.aV();
|
||||
int j = 25 - entityLiving.aU();
|
||||
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_R1.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftPlayer;
|
||||
|
||||
public class Fire extends MiniPlugin
|
||||
{
|
||||
|
@ -1,225 +0,0 @@
|
||||
package net.minecraft.server.v1_7_R1;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Random;
|
||||
|
||||
public class EntityBat
|
||||
extends EntityAmbient
|
||||
{
|
||||
private ChunkCoordinates h;
|
||||
|
||||
public boolean Vegetated = false;
|
||||
|
||||
public EntityBat(World paramWorld)
|
||||
{
|
||||
super(paramWorld);
|
||||
|
||||
a(0.5F, 0.9F);
|
||||
a(true);
|
||||
}
|
||||
|
||||
protected void c()
|
||||
{
|
||||
super.c();
|
||||
|
||||
this.datawatcher.a(16, new Byte((byte)0));
|
||||
}
|
||||
|
||||
protected float bf()
|
||||
{
|
||||
return 0.1F;
|
||||
}
|
||||
|
||||
protected float bg()
|
||||
{
|
||||
return super.bg() * 0.95F;
|
||||
}
|
||||
|
||||
protected String t()
|
||||
{
|
||||
if ((bN()) && (this.random.nextInt(4) != 0)) {
|
||||
return null;
|
||||
}
|
||||
return "mob.bat.idle";
|
||||
}
|
||||
|
||||
protected String aT()
|
||||
{
|
||||
return "mob.bat.hurt";
|
||||
}
|
||||
|
||||
protected String aU()
|
||||
{
|
||||
return "mob.bat.death";
|
||||
}
|
||||
|
||||
public boolean S()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void n(Entity paramEntity) {}
|
||||
|
||||
protected void bo() {}
|
||||
|
||||
protected void aD()
|
||||
{
|
||||
super.aD();
|
||||
|
||||
getAttributeInstance(GenericAttributes.a).setValue(6.0D);
|
||||
}
|
||||
|
||||
public boolean bN()
|
||||
{
|
||||
return (this.datawatcher.getByte(16) & 0x1) != 0;
|
||||
}
|
||||
|
||||
public void a(boolean paramBoolean)
|
||||
{
|
||||
int i = this.datawatcher.getByte(16);
|
||||
if (paramBoolean) {
|
||||
this.datawatcher.watch(16, Byte.valueOf((byte)(i | 0x1)));
|
||||
} else {
|
||||
this.datawatcher.watch(16, Byte.valueOf((byte)(i & 0xFFFFFFFE)));
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean bk()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void h()
|
||||
{
|
||||
super.h();
|
||||
|
||||
if (Vegetated)
|
||||
return;
|
||||
|
||||
if (bN())
|
||||
{
|
||||
this.motX = (this.motY = this.motZ = 0.0D);
|
||||
this.locY = (MathHelper.floor(this.locY) + 1.0D - this.length);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.motY *= 0.6000000238418579D;
|
||||
}
|
||||
}
|
||||
|
||||
protected void bn()
|
||||
{
|
||||
super.bn();
|
||||
|
||||
if (Vegetated)
|
||||
return;
|
||||
|
||||
if (bN())
|
||||
{
|
||||
if (!this.world.getType(MathHelper.floor(this.locX), (int)this.locY + 1, MathHelper.floor(this.locZ)).r())
|
||||
{
|
||||
a(false);
|
||||
this.world.a(null, 1015, (int)this.locX, (int)this.locY, (int)this.locZ, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.random.nextInt(200) == 0) {
|
||||
this.aP = this.random.nextInt(360);
|
||||
}
|
||||
if (this.world.findNearbyPlayer(this, 4.0D) != null)
|
||||
{
|
||||
a(false);
|
||||
this.world.a(null, 1015, (int)this.locX, (int)this.locY, (int)this.locZ, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((this.h != null) && ((!this.world.isEmpty(this.h.x, this.h.y, this.h.z)) || (this.h.y < 1))) {
|
||||
this.h = null;
|
||||
}
|
||||
if ((this.h == null) || (this.random.nextInt(30) == 0) || (this.h.e((int)this.locX, (int)this.locY, (int)this.locZ) < 4.0F)) {
|
||||
this.h = new ChunkCoordinates((int)this.locX + this.random.nextInt(7) - this.random.nextInt(7), (int)this.locY + this.random.nextInt(6) - 2, (int)this.locZ + this.random.nextInt(7) - this.random.nextInt(7));
|
||||
}
|
||||
double d1 = this.h.x + 0.5D - this.locX;
|
||||
double d2 = this.h.y + 0.1D - this.locY;
|
||||
double d3 = this.h.z + 0.5D - this.locZ;
|
||||
|
||||
this.motX += (Math.signum(d1) * 0.5D - this.motX) * 0.1000000014901161D;
|
||||
this.motY += (Math.signum(d2) * 0.699999988079071D - this.motY) * 0.1000000014901161D;
|
||||
this.motZ += (Math.signum(d3) * 0.5D - this.motZ) * 0.1000000014901161D;
|
||||
|
||||
float f1 = (float)(Math.atan2(this.motZ, this.motX) * 180.0D / 3.141592741012573D) - 90.0F;
|
||||
float f2 = MathHelper.g(f1 - this.yaw);
|
||||
this.bf = 0.5F;
|
||||
this.yaw += f2;
|
||||
if ((this.random.nextInt(100) == 0) && (this.world.getType(MathHelper.floor(this.locX), (int)this.locY + 1, MathHelper.floor(this.locZ)).r())) {
|
||||
a(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean g_()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void b(float paramFloat) {}
|
||||
|
||||
protected void a(double paramDouble, boolean paramBoolean) {}
|
||||
|
||||
public boolean az()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource paramDamageSource, float paramFloat)
|
||||
{
|
||||
if (isInvulnerable()) {
|
||||
return false;
|
||||
}
|
||||
if ((!this.world.isStatic) &&
|
||||
(bN()) &&
|
||||
!Vegetated) {
|
||||
a(false);
|
||||
}
|
||||
return super.damageEntity(paramDamageSource, paramFloat);
|
||||
}
|
||||
|
||||
public void a(NBTTagCompound paramNBTTagCompound)
|
||||
{
|
||||
super.a(paramNBTTagCompound);
|
||||
|
||||
this.datawatcher.watch(16, Byte.valueOf(paramNBTTagCompound.getByte("BatFlags")));
|
||||
}
|
||||
|
||||
public void b(NBTTagCompound paramNBTTagCompound)
|
||||
{
|
||||
super.b(paramNBTTagCompound);
|
||||
|
||||
paramNBTTagCompound.setByte("BatFlags", this.datawatcher.getByte(16));
|
||||
}
|
||||
|
||||
public boolean canSpawn()
|
||||
{
|
||||
int i = MathHelper.floor(this.boundingBox.b);
|
||||
if (i >= 63) {
|
||||
return false;
|
||||
}
|
||||
int j = MathHelper.floor(this.locX);
|
||||
int k = MathHelper.floor(this.locZ);
|
||||
|
||||
int m = this.world.getLightLevel(j, i, k);
|
||||
int n = 4;
|
||||
Calendar localCalendar = this.world.V();
|
||||
if (((localCalendar.get(2) + 1 == 10) && (localCalendar.get(5) >= 20)) || ((localCalendar.get(2) + 1 == 11) && (localCalendar.get(5) <= 3))) {
|
||||
n = 7;
|
||||
} else if (this.random.nextBoolean()) {
|
||||
return false;
|
||||
}
|
||||
if (m > this.random.nextInt(n)) {
|
||||
return false;
|
||||
}
|
||||
return super.canSpawn();
|
||||
}
|
||||
}
|
@ -1,313 +0,0 @@
|
||||
package net.minecraft.server.v1_7_R1;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
// CraftBukkit start
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||
import org.bukkit.event.entity.EntityTargetEvent;
|
||||
import org.bukkit.event.entity.EntityUnleashEvent;
|
||||
// CraftBukkit end
|
||||
|
||||
public abstract class EntityCreature extends EntityInsentient {
|
||||
|
||||
public static final UUID h = UUID.fromString("E199AD21-BA8A-4C53-8D13-6182D5C69D3A");
|
||||
public static final AttributeModifier i = (new AttributeModifier(h, "Fleeing speed bonus", 2.0D, 2)).a(false);
|
||||
public PathEntity pathEntity; // CraftBukkit - private -> public
|
||||
public Entity target; // CraftBukkit - protected -> public
|
||||
protected boolean bn;
|
||||
protected int bo;
|
||||
private ChunkCoordinates bq = new ChunkCoordinates(0, 0, 0);
|
||||
private float br = -1.0F;
|
||||
private PathfinderGoal bs = new PathfinderGoalMoveTowardsRestriction(this, 1.0D);
|
||||
private boolean bt;
|
||||
|
||||
public EntityCreature(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
protected boolean bN() {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void bq() {
|
||||
this.world.methodProfiler.a("ai");
|
||||
if (this.bo > 0 && --this.bo == 0) {
|
||||
AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.d);
|
||||
|
||||
attributeinstance.b(i);
|
||||
}
|
||||
|
||||
this.bn = this.bN();
|
||||
float f11 = 16.0F;
|
||||
|
||||
if (this.target == null) {
|
||||
// CraftBukkit start
|
||||
Entity target = this.findTarget();
|
||||
if (target != null) {
|
||||
EntityTargetEvent event = new EntityTargetEvent(this.getBukkitEntity(), target.getBukkitEntity(), EntityTargetEvent.TargetReason.CLOSEST_PLAYER);
|
||||
this.world.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
if (event.getTarget() == null) {
|
||||
this.target = null;
|
||||
} else {
|
||||
this.target = ((CraftEntity) event.getTarget()).getHandle();
|
||||
}
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
if (this.target != null) {
|
||||
this.pathEntity = this.world.findPath(this, this.target, f11, true, false, false, true);
|
||||
}
|
||||
} else if (this.target.isAlive()) {
|
||||
float f1 = this.target.d((Entity) this);
|
||||
|
||||
if (this.o(this.target)) {
|
||||
this.a(this.target, f1);
|
||||
}
|
||||
} else {
|
||||
// CraftBukkit start
|
||||
EntityTargetEvent event = new EntityTargetEvent(this.getBukkitEntity(), null, EntityTargetEvent.TargetReason.TARGET_DIED);
|
||||
this.world.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
if (event.getTarget() == null) {
|
||||
this.target = null;
|
||||
} else {
|
||||
this.target = ((CraftEntity) event.getTarget()).getHandle();
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
if (this.target instanceof EntityPlayer && ((EntityPlayer) this.target).playerInteractManager.isCreative()) {
|
||||
this.target = null;
|
||||
}
|
||||
|
||||
this.world.methodProfiler.b();
|
||||
if (!this.bn && this.target != null && (this.pathEntity == null || this.random.nextInt(20) == 0)) {
|
||||
this.pathEntity = this.world.findPath(this, this.target, f11, true, false, false, true);
|
||||
} else if (!this.bn && (this.pathEntity == null && this.random.nextInt(180) == 0 || this.random.nextInt(120) == 0 || this.bo > 0) && this.aV < 100) {
|
||||
this.bO();
|
||||
}
|
||||
|
||||
int i = MathHelper.floor(this.boundingBox.b + 0.5D);
|
||||
boolean flag = this.M();
|
||||
boolean flag1 = this.P();
|
||||
|
||||
this.pitch = 0.0F;
|
||||
if (this.pathEntity != null && this.random.nextInt(100) != 0) {
|
||||
this.world.methodProfiler.a("followpath");
|
||||
Vec3D vec3d = this.pathEntity.a((Entity) this);
|
||||
double d0 = (double) (this.width * 2.0F);
|
||||
|
||||
while (vec3d != null && vec3d.d(this.locX, vec3d.d, this.locZ) < d0 * d0) {
|
||||
this.pathEntity.a();
|
||||
if (this.pathEntity.b()) {
|
||||
vec3d = null;
|
||||
this.pathEntity = null;
|
||||
} else {
|
||||
vec3d = this.pathEntity.a((Entity) this);
|
||||
}
|
||||
}
|
||||
|
||||
this.bd = false;
|
||||
if (vec3d != null) {
|
||||
double d1 = vec3d.c - this.locX;
|
||||
double d2 = vec3d.e - this.locZ;
|
||||
double d3 = vec3d.d - (double) i;
|
||||
// CraftBukkit - Math -> TrigMath
|
||||
float f2 = (float) (org.bukkit.craftbukkit.v1_7_R1.TrigMath.atan2(d2, d1) * 180.0D / 3.1415927410125732D) - 90.0F;
|
||||
float f3 = MathHelper.g(f2 - this.yaw);
|
||||
|
||||
this.bf = (float) this.getAttributeInstance(GenericAttributes.d).getValue();
|
||||
if (f3 > 30.0F) {
|
||||
f3 = 30.0F;
|
||||
}
|
||||
|
||||
if (f3 < -30.0F) {
|
||||
f3 = -30.0F;
|
||||
}
|
||||
|
||||
this.yaw += f3;
|
||||
if (this.bn && this.target != null) {
|
||||
double d4 = this.target.locX - this.locX;
|
||||
double d5 = this.target.locZ - this.locZ;
|
||||
float f4 = this.yaw;
|
||||
|
||||
this.yaw = (float) (Math.atan2(d5, d4) * 180.0D / 3.1415927410125732D) - 90.0F;
|
||||
f3 = (f4 - this.yaw + 90.0F) * 3.1415927F / 180.0F;
|
||||
this.be = -MathHelper.sin(f3) * this.bf * 1.0F;
|
||||
this.bf = MathHelper.cos(f3) * this.bf * 1.0F;
|
||||
}
|
||||
|
||||
if (d3 > 0.0D) {
|
||||
this.bd = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.target != null) {
|
||||
this.a(this.target, 30.0F, 30.0F);
|
||||
}
|
||||
|
||||
if (this.positionChanged && !this.bQ()) {
|
||||
this.bd = true;
|
||||
}
|
||||
|
||||
if (this.random.nextFloat() < 0.8F && (flag || flag1)) {
|
||||
this.bd = true;
|
||||
}
|
||||
|
||||
this.world.methodProfiler.b();
|
||||
} else {
|
||||
super.bq();
|
||||
this.pathEntity = null;
|
||||
}
|
||||
}
|
||||
|
||||
protected void bO() {
|
||||
this.world.methodProfiler.a("stroll");
|
||||
boolean flag = false;
|
||||
int i = -1;
|
||||
int j = -1;
|
||||
int k = -1;
|
||||
float f = -99999.0F;
|
||||
|
||||
for (int l = 0; l < 10; ++l) {
|
||||
int i1 = MathHelper.floor(this.locX + (double) this.random.nextInt(13) - 6.0D);
|
||||
int j1 = MathHelper.floor(this.locY + (double) this.random.nextInt(7) - 3.0D);
|
||||
int k1 = MathHelper.floor(this.locZ + (double) this.random.nextInt(13) - 6.0D);
|
||||
float f1 = this.a(i1, j1, k1);
|
||||
|
||||
if (f1 > f) {
|
||||
f = f1;
|
||||
i = i1;
|
||||
j = j1;
|
||||
k = k1;
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (flag) {
|
||||
this.pathEntity = this.world.a(this, i, j, k, 10.0F, true, false, false, true);
|
||||
}
|
||||
|
||||
this.world.methodProfiler.b();
|
||||
}
|
||||
|
||||
protected void a(Entity entity, float f) {}
|
||||
|
||||
public float a(int i, int j, int k) {
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
protected Entity findTarget() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean canSpawn() {
|
||||
int i = MathHelper.floor(this.locX);
|
||||
int j = MathHelper.floor(this.boundingBox.b);
|
||||
int k = MathHelper.floor(this.locZ);
|
||||
|
||||
return super.canSpawn() && this.a(i, j, k) >= 0.0F;
|
||||
}
|
||||
|
||||
public boolean bQ() {
|
||||
return this.pathEntity != null;
|
||||
}
|
||||
|
||||
public void setPathEntity(PathEntity pathentity) {
|
||||
this.pathEntity = pathentity;
|
||||
}
|
||||
|
||||
public Entity bR() {
|
||||
return this.target;
|
||||
}
|
||||
|
||||
public void setTarget(Entity entity) {
|
||||
this.target = entity;
|
||||
}
|
||||
|
||||
public boolean bS() {
|
||||
return this.b(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ));
|
||||
}
|
||||
|
||||
public boolean b(int i, int j, int k) {
|
||||
return this.br == -1.0F ? true : this.bq.e(i, j, k) < this.br * this.br;
|
||||
}
|
||||
|
||||
public void a(int i, int j, int k, int l) {
|
||||
this.bq.b(i, j, k);
|
||||
this.br = (float) l;
|
||||
}
|
||||
|
||||
public ChunkCoordinates bT() {
|
||||
return this.bq;
|
||||
}
|
||||
|
||||
public float bU() {
|
||||
return this.br;
|
||||
}
|
||||
|
||||
public void bV() {
|
||||
this.br = -1.0F;
|
||||
}
|
||||
|
||||
public boolean bW() {
|
||||
return this.br != -1.0F;
|
||||
}
|
||||
|
||||
protected void bJ() {
|
||||
super.bJ();
|
||||
if (this.bL() && this.getLeashHolder() != null && this.getLeashHolder().world == this.world && this.PullWhileLeashed) {
|
||||
Entity entity = this.getLeashHolder();
|
||||
|
||||
this.a((int) entity.locX, (int) entity.locY, (int) entity.locZ, 5);
|
||||
float f = this.d(entity);
|
||||
|
||||
if (this instanceof EntityTameableAnimal && ((EntityTameableAnimal) this).isSitting()) {
|
||||
if (f > 10.0F) {
|
||||
this.world.getServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit
|
||||
this.unleash(true, true);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.bt) {
|
||||
this.goalSelector.a(2, this.bs);
|
||||
this.getNavigation().a(false);
|
||||
this.bt = true;
|
||||
}
|
||||
|
||||
this.o(f);
|
||||
if (f > 4.0F) {
|
||||
this.getNavigation().a(entity, 1.0D);
|
||||
}
|
||||
|
||||
if (f > 6.0F) {
|
||||
double d0 = (entity.locX - this.locX) / (double) f;
|
||||
double d1 = (entity.locY - this.locY) / (double) f;
|
||||
double d2 = (entity.locZ - this.locZ) / (double) f;
|
||||
|
||||
this.motX += d0 * Math.abs(d0) * 0.4D;
|
||||
this.motY += d1 * Math.abs(d1) * 0.4D;
|
||||
this.motZ += d2 * Math.abs(d2) * 0.4D;
|
||||
}
|
||||
|
||||
if (f > 10.0F) {
|
||||
this.world.getServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit
|
||||
this.unleash(true, true);
|
||||
}
|
||||
} else if (!this.bL() && this.bt) {
|
||||
this.bt = false;
|
||||
this.goalSelector.a(this.bs);
|
||||
this.getNavigation().a(true);
|
||||
this.bV();
|
||||
}
|
||||
}
|
||||
|
||||
protected void o(float f) {}
|
||||
}
|
@ -1,80 +0,0 @@
|
||||
package net.minecraft.server.v1_7_R1;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import net.minecraft.util.com.mojang.authlib.GameProfile;
|
||||
|
||||
public class PacketPlayOutNamedEntitySpawn extends Packet
|
||||
{
|
||||
public int a;
|
||||
public GameProfile b;
|
||||
public int c;
|
||||
public int d;
|
||||
public int e;
|
||||
public byte f;
|
||||
public byte g;
|
||||
public int h;
|
||||
public DataWatcher i;
|
||||
public List j;
|
||||
|
||||
public PacketPlayOutNamedEntitySpawn() {}
|
||||
|
||||
public PacketPlayOutNamedEntitySpawn(EntityHuman entityhuman)
|
||||
{
|
||||
this.a = entityhuman.getId();
|
||||
this.b = entityhuman.getProfile();
|
||||
this.c = MathHelper.floor(entityhuman.locX * 32.0D);
|
||||
this.d = MathHelper.floor(entityhuman.locY * 32.0D);
|
||||
this.e = MathHelper.floor(entityhuman.locZ * 32.0D);
|
||||
this.f = ((byte)(int)(entityhuman.yaw * 256.0F / 360.0F));
|
||||
this.g = ((byte)(int)(entityhuman.pitch * 256.0F / 360.0F));
|
||||
ItemStack itemstack = entityhuman.inventory.getItemInHand();
|
||||
|
||||
this.h = (itemstack == null ? 0 : Item.b(itemstack.getItem()));
|
||||
this.i = entityhuman.getDataWatcher();
|
||||
}
|
||||
|
||||
public void a(PacketDataSerializer packetdataserializer)
|
||||
throws IOException
|
||||
{
|
||||
this.a = packetdataserializer.a();
|
||||
this.b = new GameProfile(packetdataserializer.c(36), packetdataserializer.c(16));
|
||||
this.c = packetdataserializer.readInt();
|
||||
this.d = packetdataserializer.readInt();
|
||||
this.e = packetdataserializer.readInt();
|
||||
this.f = packetdataserializer.readByte();
|
||||
this.g = packetdataserializer.readByte();
|
||||
this.h = packetdataserializer.readShort();
|
||||
this.j = DataWatcher.b(packetdataserializer);
|
||||
}
|
||||
|
||||
public void b(PacketDataSerializer packetdataserializer)
|
||||
throws IOException
|
||||
{
|
||||
packetdataserializer.b(this.a);
|
||||
packetdataserializer.a(this.b.getId());
|
||||
packetdataserializer.a(this.b.getName().length() > 16 ? this.b.getName().substring(0, 16) : this.b.getName());
|
||||
packetdataserializer.writeInt(this.c);
|
||||
packetdataserializer.writeInt(this.d);
|
||||
packetdataserializer.writeInt(this.e);
|
||||
packetdataserializer.writeByte(this.f);
|
||||
packetdataserializer.writeByte(this.g);
|
||||
packetdataserializer.writeShort(this.h);
|
||||
this.i.a(packetdataserializer);
|
||||
}
|
||||
|
||||
public void a(PacketPlayOutListener packetplayoutlistener)
|
||||
{
|
||||
packetplayoutlistener.a(this);
|
||||
}
|
||||
|
||||
public String b()
|
||||
{
|
||||
return String.format("id=%d, gameProfile='%s', x=%.2f, y=%.2f, z=%.2f, carried=%d", new Object[] { Integer.valueOf(this.a), this.b, Float.valueOf(this.c / 32.0F), Float.valueOf(this.d / 32.0F), Float.valueOf(this.e / 32.0F), Integer.valueOf(this.h) });
|
||||
}
|
||||
|
||||
public void handle(PacketListener packetlistener)
|
||||
{
|
||||
a((PacketPlayOutListener)packetlistener);
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
package net.minecraft.server.v1_7_R1;
|
||||
package net.minecraft.server.v1_7_R2;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@ -9,10 +9,9 @@ import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
import net.minecraft.server.v1_7_R1.ChunkAddEntityEvent;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import org.bukkit.Bukkit; // CraftBukkit
|
||||
|
||||
public class Chunk {
|
||||
@ -41,6 +40,7 @@ public class Chunk {
|
||||
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
|
||||
|
||||
public Chunk(World world, int i, int j) {
|
||||
this.sections = new ChunkSection[16];
|
||||
@ -56,7 +56,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_R1.util.UnsafeList(); // CraftBukkit - ArrayList -> UnsafeList
|
||||
this.entitySlices[k] = new org.bukkit.craftbukkit.v1_7_R2.util.UnsafeList(); // CraftBukkit - ArrayList -> UnsafeList
|
||||
}
|
||||
|
||||
Arrays.fill(this.b, -999);
|
||||
@ -64,7 +64,7 @@ public class Chunk {
|
||||
|
||||
// CraftBukkit start
|
||||
if (!(this instanceof EmptyChunk)) {
|
||||
this.bukkitChunk = new org.bukkit.craftbukkit.v1_7_R1.CraftChunk(this);
|
||||
this.bukkitChunk = new org.bukkit.craftbukkit.v1_7_R2.CraftChunk(this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -115,7 +115,7 @@ public class Chunk {
|
||||
}
|
||||
|
||||
this.sections[l1].setTypeId(l, j1 & 15, i1, block);
|
||||
this.sections[l1].setData(l, j1 & 15, i1, abyte[k1]);
|
||||
this.sections[l1].setData(l, j1 & 15, i1, checkData( block, abyte[k1] ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -398,6 +398,17 @@ public class Chunk {
|
||||
}
|
||||
}
|
||||
|
||||
// Spigot start - prevent invalid data values
|
||||
private static int checkData( Block block, int l )
|
||||
{
|
||||
if (block == Block.b( "minecraft:double_plant" ) )
|
||||
{
|
||||
return l == 7 ? 0 : l;
|
||||
}
|
||||
return l;
|
||||
}
|
||||
// Spigot end
|
||||
|
||||
public boolean a(int i, int j, int k, Block block, int l) {
|
||||
int i1 = k << 4 | i;
|
||||
|
||||
@ -452,7 +463,7 @@ public class Chunk {
|
||||
if (chunksection.getTypeId(i, j & 15, k) != block) {
|
||||
return false;
|
||||
} else {
|
||||
chunksection.setData(i, j & 15, k, l);
|
||||
chunksection.setData(i, j & 15, k, checkData( block, l ) );
|
||||
if (flag) {
|
||||
this.initLighting();
|
||||
} else {
|
||||
@ -502,6 +513,13 @@ public class Chunk {
|
||||
if (tileentity != null) {
|
||||
tileentity.u();
|
||||
}
|
||||
|
||||
// Spigot start
|
||||
if ( tileentity instanceof TileEntitySkull )
|
||||
{
|
||||
org.spigotmc.HeadConverter.convertHead( (TileEntitySkull) tileentity );
|
||||
}
|
||||
// Spigot end
|
||||
}
|
||||
|
||||
this.n = true;
|
||||
@ -522,8 +540,9 @@ public class Chunk {
|
||||
return false;
|
||||
} else {
|
||||
this.n = true;
|
||||
chunksection.setData(i, j & 15, k, l);
|
||||
if (chunksection.getTypeId(i, j & 15, k) instanceof IContainer) {
|
||||
Block block = chunksection.getTypeId( i, j & 15, k );
|
||||
chunksection.setData(i, j & 15, k, checkData( block, l ) );
|
||||
if (block instanceof IContainer) {
|
||||
TileEntity tileentity = this.e(i, j, k);
|
||||
|
||||
if (tileentity != null) {
|
||||
@ -592,15 +611,15 @@ public class Chunk {
|
||||
if (i != this.locX || j != this.locZ) {
|
||||
// CraftBukkit start
|
||||
Bukkit.getLogger().warning("Wrong location for " + entity + " in world '" + world.getWorld().getName() + "'!");
|
||||
// t.error("Wrong location! " + entity);
|
||||
// t.warn("Wrong location! " + entity + " (at " + i + ", " + j + " instead of " + this.locX + ", " + this.locZ + ")");
|
||||
// Thread.dumpStack();
|
||||
Bukkit.getLogger().warning("Entity is at " + entity.locX + "," + entity.locZ + " (chunk " + i + "," + j + ") but was stored in chunk " + this.locX + "," + this.locZ);
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
ChunkAddEntityEvent event = new ChunkAddEntityEvent(entity.bukkitEntity);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
|
||||
ChunkAddEntityEvent event = new ChunkAddEntityEvent(entity.bukkitEntity);
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
int k = MathHelper.floor(entity.locY / 16.0D);
|
||||
|
||||
if (k < 0) {
|
||||
@ -611,15 +630,31 @@ public class Chunk {
|
||||
k = this.entitySlices.length - 1;
|
||||
}
|
||||
|
||||
entity.ah = true;
|
||||
entity.ai = this.locX;
|
||||
entity.aj = k;
|
||||
entity.ak = this.locZ;
|
||||
entity.ag = true;
|
||||
entity.ah = this.locX;
|
||||
entity.ai = k;
|
||||
entity.aj = this.locZ;
|
||||
this.entitySlices[k].add(entity);
|
||||
// Spigot start - increment creature type count
|
||||
// Keep this synced up with World.a(Class)
|
||||
if (entity instanceof EntityInsentient) {
|
||||
EntityInsentient entityinsentient = (EntityInsentient) entity;
|
||||
if (entityinsentient.isTypeNotPersistent() && entityinsentient.isPersistent()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
for ( EnumCreatureType creatureType : EnumCreatureType.values() )
|
||||
{
|
||||
if ( creatureType.a().isAssignableFrom( entity.getClass() ) )
|
||||
{
|
||||
this.entityCount.adjustOrPutValue( creatureType.a(), 1, 1 );
|
||||
}
|
||||
}
|
||||
// Spigot end
|
||||
}
|
||||
|
||||
public void b(Entity entity) {
|
||||
this.a(entity, entity.aj);
|
||||
this.a(entity, entity.ai);
|
||||
}
|
||||
|
||||
public void a(Entity entity, int i) {
|
||||
@ -632,6 +667,22 @@ public class Chunk {
|
||||
}
|
||||
|
||||
this.entitySlices[i].remove(entity);
|
||||
// Spigot start - decrement creature type count
|
||||
// Keep this synced up with World.a(Class)
|
||||
if (entity instanceof EntityInsentient) {
|
||||
EntityInsentient entityinsentient = (EntityInsentient) entity;
|
||||
if (entityinsentient.isTypeNotPersistent() && entityinsentient.isPersistent()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
for ( EnumCreatureType creatureType : EnumCreatureType.values() )
|
||||
{
|
||||
if ( creatureType.a().isAssignableFrom( entity.getClass() ) )
|
||||
{
|
||||
this.entityCount.adjustValue( creatureType.a(), -1 );
|
||||
}
|
||||
}
|
||||
// Spigot end
|
||||
}
|
||||
|
||||
public boolean d(int i, int j, int k) {
|
||||
@ -689,7 +740,7 @@ public class Chunk {
|
||||
// CraftBukkit start
|
||||
} else {
|
||||
System.out.println("Attempted to place a tile entity (" + tileentity + ") at " + tileentity.x + "," + tileentity.y + "," + tileentity.z
|
||||
+ " (" + org.bukkit.Material.getMaterial(Block.b(getType(i, j, k))) + ") where there was no entity tile!");
|
||||
+ " (" + org.bukkit.craftbukkit.v1_7_R2.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
|
||||
@ -718,7 +769,7 @@ public class Chunk {
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity = (Entity) iterator.next();
|
||||
|
||||
entity.X();
|
||||
entity.W();
|
||||
}
|
||||
|
||||
this.world.a(this.entitySlices[i]);
|
||||
@ -731,6 +782,15 @@ public class Chunk {
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
TileEntity tileentity = (TileEntity) iterator.next();
|
||||
// Spigot Start
|
||||
if ( tileentity instanceof IInventory )
|
||||
{
|
||||
for ( org.bukkit.craftbukkit.v1_7_R2.entity.CraftHumanEntity h : new ArrayList<org.bukkit.craftbukkit.v1_7_R2.entity.CraftHumanEntity>( (List) ( (IInventory) tileentity ).getViewers() ) )
|
||||
{
|
||||
h.getHandle().closeInventory();
|
||||
}
|
||||
}
|
||||
// Spigot End
|
||||
|
||||
this.world.a(tileentity);
|
||||
}
|
||||
@ -740,6 +800,15 @@ public class Chunk {
|
||||
java.util.Iterator<Object> iter = this.entitySlices[i].iterator();
|
||||
while (iter.hasNext()) {
|
||||
Entity entity = (Entity) iter.next();
|
||||
// Spigot Start
|
||||
if ( entity instanceof IInventory )
|
||||
{
|
||||
for ( org.bukkit.craftbukkit.v1_7_R2.entity.CraftHumanEntity h : new ArrayList<org.bukkit.craftbukkit.v1_7_R2.entity.CraftHumanEntity>( (List) ( (IInventory) entity ).getViewers() ) )
|
||||
{
|
||||
h.getHandle().closeInventory();
|
||||
}
|
||||
}
|
||||
// Spigot End
|
||||
|
||||
// Do not pass along players, as doing so can get them stuck outside of time.
|
||||
// (which for example disables inventory icon updates and prevents block breaking)
|
||||
@ -772,7 +841,7 @@ public class Chunk {
|
||||
|
||||
if (entity1 != entity && entity1.boundingBox.b(axisalignedbb) && (ientityselector == null || ientityselector.a(entity1))) {
|
||||
list.add(entity1);
|
||||
Entity[] aentity = entity1.at();
|
||||
Entity[] aentity = entity1.as();
|
||||
|
||||
if (aentity != null) {
|
||||
for (int i1 = 0; i1 < aentity.length; ++i1) {
|
||||
@ -877,13 +946,21 @@ public class Chunk {
|
||||
}
|
||||
|
||||
this.m = true;
|
||||
if (!this.lit && this.done) {
|
||||
if (!this.lit && this.done && this.world.spigotConfig.randomLightUpdates) { // Spigot - also use random light updates setting to determine if we should relight
|
||||
this.p();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean k() {
|
||||
return this.m && this.done && this.lit;
|
||||
// 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.
|
||||
* Unfortunately this interferes with our modified chunk ticking algorithm, which will only tick chunks distant from the player on a very infrequent basis.
|
||||
* We cannot unfortunately do this lighting stage during chunk gen as it appears to put a lot more noticeable load on the server, than when it is done at play time.
|
||||
* For now at least we will simply send all chunks, in accordance with pre 1.7 behaviour.
|
||||
*/
|
||||
return true;
|
||||
// Spigot End
|
||||
}
|
||||
|
||||
public ChunkCoordIntPair l() {
|
||||
@ -1071,4 +1148,4 @@ public class Chunk {
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package net.minecraft.server.v1_7_R1;
|
||||
package net.minecraft.server.v1_7_R2;
|
||||
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.Event;
|
@ -1,4 +1,4 @@
|
||||
package net.minecraft.server.v1_7_R1;
|
||||
package net.minecraft.server.v1_7_R2;
|
||||
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.Event;
|
@ -1,27 +1,24 @@
|
||||
package net.minecraft.server.v1_7_R1;
|
||||
package net.minecraft.server.v1_7_R2;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.server.v1_7_R1.ChunkPreLoadEvent;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
|
||||
|
||||
// CraftBukkit start
|
||||
import java.util.Random;
|
||||
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.chunkio.ChunkIOExecutor;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.util.LongHash;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.util.LongHashSet;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.util.LongObjectHashMap;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.chunkio.ChunkIOExecutor;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.util.LongHash;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.util.LongHashSet;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.util.LongObjectHashMap;
|
||||
import org.bukkit.event.world.ChunkUnloadEvent;
|
||||
// CraftBukkit end
|
||||
|
||||
@ -49,6 +46,13 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
return this.chunks.containsKey(LongHash.toLong(i, j)); // CraftBukkit
|
||||
}
|
||||
|
||||
// CraftBukkit start - Change return type to Collection and return the values of our chunk map
|
||||
public java.util.Collection a() {
|
||||
// return this.chunkList;
|
||||
return this.chunks.values();
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
public void queueUnload(int i, int j) {
|
||||
if (this.world.worldProvider.e()) {
|
||||
ChunkCoordinates chunkcoordinates = this.world.getSpawn();
|
||||
@ -78,7 +82,7 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
}
|
||||
}
|
||||
|
||||
public void a() {
|
||||
public void b() {
|
||||
Iterator iterator = this.chunks.values().iterator(); // CraftBukkit
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@ -95,8 +99,7 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
|
||||
public Chunk getChunkAt(int i, int j, Runnable runnable) {
|
||||
this.unloadQueue.remove(i, j);
|
||||
Chunk chunk = (Chunk) this.chunks.get(LongHash.toLong(i, j));
|
||||
boolean newChunk = false;
|
||||
Chunk chunk = this.chunks.get(LongHash.toLong(i, j));
|
||||
ChunkRegionLoader loader = null;
|
||||
|
||||
if (this.f instanceof ChunkRegionLoader) {
|
||||
@ -122,12 +125,12 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
|
||||
return chunk;
|
||||
}
|
||||
|
||||
|
||||
public Chunk originalGetChunkAt(int i, int j) {
|
||||
this.unloadQueue.remove(i, j);
|
||||
Chunk chunk = (Chunk) this.chunks.get(LongHash.toLong(i, j));
|
||||
boolean newChunk = false;
|
||||
|
||||
|
||||
Server server = this.world.getServer();
|
||||
|
||||
if (chunk == null && server != null)
|
||||
@ -138,7 +141,7 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
if (event.isCancelled())
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
if (chunk == null) {
|
||||
chunk = this.loadChunk(i, j);
|
||||
if (chunk == null) {
|
||||
@ -306,7 +309,7 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void b() {
|
||||
public void c() {
|
||||
if (this.f != null) {
|
||||
this.f.b();
|
||||
}
|
||||
@ -365,4 +368,4 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
}
|
||||
|
||||
public void recreateStructures(int i, int j) {}
|
||||
}
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
package net.minecraft.server.v1_7_R1;
|
||||
package net.minecraft.server.v1_7_R2;
|
||||
|
||||
// CraftBukkit start
|
||||
import java.util.List;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftHumanEntity;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftHumanEntity;
|
||||
import org.bukkit.entity.HumanEntity;
|
||||
// CraftBukkit end
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
package net.minecraft.server.v1_7_R1;
|
||||
package net.minecraft.server.v1_7_R2;
|
||||
|
||||
public class EntityBlaze extends EntityMonster {
|
||||
|
||||
@ -12,8 +12,8 @@ public class EntityBlaze extends EntityMonster {
|
||||
this.b = 10;
|
||||
}
|
||||
|
||||
protected void aD() {
|
||||
super.aD();
|
||||
protected void aC() {
|
||||
super.aC();
|
||||
this.getAttributeInstance(GenericAttributes.e).setValue(6.0D);
|
||||
}
|
||||
|
||||
@ -26,11 +26,11 @@ public class EntityBlaze extends EntityMonster {
|
||||
return "mob.blaze.breathe";
|
||||
}
|
||||
|
||||
protected String aT() {
|
||||
protected String aS() {
|
||||
return "mob.blaze.hit";
|
||||
}
|
||||
|
||||
protected String aU() {
|
||||
protected String aT() {
|
||||
return "mob.blaze.death";
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@ public class EntityBlaze extends EntityMonster {
|
||||
|
||||
public void e() {
|
||||
if (!this.world.isStatic) {
|
||||
if (this.L()) {
|
||||
if (this.K()) {
|
||||
this.damageEntity(DamageSource.DROWN, 1.0F);
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ public class EntityBlaze extends EntityMonster {
|
||||
this.bp = 0.5F + (float) this.random.nextGaussian() * 3.0F;
|
||||
}
|
||||
|
||||
if (this.bR() != null && this.bR().locY + (double) this.bR().getHeadHeight() > this.locY + (double) this.getHeadHeight() + (double) this.bp) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -76,7 +76,7 @@ public class EntityBlaze extends EntityMonster {
|
||||
|
||||
if (this.attackTicks <= 0 && f < 2.0F && entity.boundingBox.e > this.boundingBox.b && entity.boundingBox.b < this.boundingBox.e) {
|
||||
this.attackTicks = 20;
|
||||
this.m(entity);
|
||||
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));
|
||||
@ -121,7 +121,7 @@ public class EntityBlaze extends EntityMonster {
|
||||
}
|
||||
|
||||
public boolean isBurning() {
|
||||
return this.bX();
|
||||
return this.bZ();
|
||||
}
|
||||
|
||||
protected void dropDeathLoot(boolean flag, int i) {
|
||||
@ -132,15 +132,15 @@ public class EntityBlaze extends EntityMonster {
|
||||
int j = this.random.nextInt(2 + i);
|
||||
|
||||
if (j > 0) {
|
||||
loot.add(new org.bukkit.inventory.ItemStack(org.bukkit.craftbukkit.v1_7_R1.util.CraftMagicNumbers.getMaterial(Items.BLAZE_ROD), j));
|
||||
loot.add(new org.bukkit.inventory.ItemStack(org.bukkit.craftbukkit.v1_7_R2.util.CraftMagicNumbers.getMaterial(Items.BLAZE_ROD), j));
|
||||
}
|
||||
}
|
||||
|
||||
org.bukkit.craftbukkit.v1_7_R1.event.CraftEventFactory.callEntityDeathEvent(this, loot);
|
||||
org.bukkit.craftbukkit.v1_7_R2.event.CraftEventFactory.callEntityDeathEvent(this, loot);
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
public boolean bX() {
|
||||
public boolean bZ() {
|
||||
return (this.datawatcher.getByte(16) & 1) != 0;
|
||||
}
|
||||
|
@ -1,11 +1,11 @@
|
||||
package net.minecraft.server.v1_7_R1;
|
||||
package net.minecraft.server.v1_7_R2;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
// CraftBukkit start
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.util.BlockStateListPopulator;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.util.BlockStateListPopulator;
|
||||
import org.bukkit.event.entity.EntityCreatePortalEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||
@ -18,7 +18,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
|
||||
public double h;
|
||||
public double i;
|
||||
public double j;
|
||||
public double bm;
|
||||
public double[][] bn = new double[64][3];
|
||||
public int bo = -1;
|
||||
public EntityComplexPart[] children;
|
||||
@ -45,14 +45,14 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
this.children = new EntityComplexPart[] { this.bq = new EntityComplexPart(this, "head", 6.0F, 6.0F), this.br = new EntityComplexPart(this, "body", 8.0F, 8.0F), this.bs = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.bt = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.bu = new EntityComplexPart(this, "tail", 4.0F, 4.0F), this.bv = new EntityComplexPart(this, "wing", 4.0F, 4.0F), this.bw = new EntityComplexPart(this, "wing", 4.0F, 4.0F)};
|
||||
this.setHealth(this.getMaxHealth());
|
||||
this.a(16.0F, 8.0F);
|
||||
this.Y = true;
|
||||
this.X = true;
|
||||
this.fireProof = true;
|
||||
this.i = 100.0D;
|
||||
this.al = true;
|
||||
this.ak = true;
|
||||
}
|
||||
|
||||
protected void aD() {
|
||||
super.aD();
|
||||
protected void aC() {
|
||||
super.aC();
|
||||
this.getAttributeInstance(GenericAttributes.a).setValue(200.0D);
|
||||
}
|
||||
|
||||
@ -101,7 +101,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
f2 = (this.random.nextFloat() - 0.5F) * 8.0F;
|
||||
this.world.addParticle("largeexplode", this.locX + (double) f, this.locY + 2.0D + (double) f1, this.locZ + (double) f2, 0.0D, 0.0D, 0.0D);
|
||||
} else {
|
||||
this.bN();
|
||||
this.bP();
|
||||
f = 0.2F / (MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ) * 10.0F + 1.0F);
|
||||
f *= (float) Math.pow(2.0D, this.motY);
|
||||
if (this.bA) {
|
||||
@ -131,27 +131,27 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
float f3;
|
||||
|
||||
if (this.world.isStatic) {
|
||||
if (this.bh > 0) {
|
||||
d0 = this.locX + (this.bi - this.locX) / (double) this.bh;
|
||||
d1 = this.locY + (this.bj - this.locY) / (double) this.bh;
|
||||
d2 = this.locZ + (this.bk - this.locZ) / (double) this.bh;
|
||||
d3 = MathHelper.g(this.bl - (double) this.yaw);
|
||||
this.yaw = (float) ((double) this.yaw + d3 / (double) this.bh);
|
||||
this.pitch = (float) ((double) this.pitch + (this.bm - (double) this.pitch) / (double) this.bh);
|
||||
--this.bh;
|
||||
if (this.bg > 0) {
|
||||
d0 = this.locX + (this.bh - this.locX) / (double) this.bg;
|
||||
d1 = this.locY + (this.bi - this.locY) / (double) this.bg;
|
||||
d2 = this.locZ + (this.bj - this.locZ) / (double) this.bg;
|
||||
d3 = MathHelper.g(this.bk - (double) this.yaw);
|
||||
this.yaw = (float) ((double) this.yaw + d3 / (double) this.bg);
|
||||
this.pitch = (float) ((double) this.pitch + (this.bm - (double) this.pitch) / (double) this.bg);
|
||||
--this.bg;
|
||||
this.setPosition(d0, d1, d2);
|
||||
this.b(this.yaw, this.pitch);
|
||||
}
|
||||
} else {
|
||||
d0 = this.h - this.locX;
|
||||
d1 = this.i - this.locY;
|
||||
d2 = this.j - this.locZ;
|
||||
d2 = this.bm - this.locZ;
|
||||
d3 = d0 * d0 + d1 * d1 + d2 * d2;
|
||||
if (this.bD != null) {
|
||||
this.h = this.bD.locX;
|
||||
this.j = this.bD.locZ;
|
||||
this.bm = this.bD.locZ;
|
||||
double d4 = this.h - this.locX;
|
||||
double d5 = this.j - this.locZ;
|
||||
double d5 = this.bm - this.locZ;
|
||||
double d6 = Math.sqrt(d4 * d4 + d5 * d5);
|
||||
double d7 = 0.4000000059604645D + d6 / 80.0D - 1.0D;
|
||||
|
||||
@ -162,11 +162,11 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
this.i = this.bD.boundingBox.b + d7;
|
||||
} else {
|
||||
this.h += this.random.nextGaussian() * 2.0D;
|
||||
this.j += this.random.nextGaussian() * 2.0D;
|
||||
this.bm += this.random.nextGaussian() * 2.0D;
|
||||
}
|
||||
|
||||
if (!Vegetated && (this.bz || d3 < 100.0D || d3 > 22500.0D || this.positionChanged || this.G)) {
|
||||
this.bO();
|
||||
if (!Vegetated && (this.bz || d3 < 100.0D || d3 > 22500.0D || this.positionChanged || this.F)) {
|
||||
this.bQ();
|
||||
}
|
||||
|
||||
d1 /= (double) MathHelper.sqrt(d0 * d0 + d2 * d2);
|
||||
@ -192,15 +192,15 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
d9 = -50.0D;
|
||||
}
|
||||
|
||||
Vec3D vec3d = this.world.getVec3DPool().create(this.h - this.locX, this.i - this.locY, this.j - this.locZ).a();
|
||||
Vec3D vec3d1 = this.world.getVec3DPool().create((double) MathHelper.sin(this.yaw * 3.1415927F / 180.0F), this.motY, (double) (-MathHelper.cos(this.yaw * 3.1415927F / 180.0F))).a();
|
||||
Vec3D vec3d = Vec3D.a(this.h - this.locX, this.i - this.locY, this.bm - this.locZ).a();
|
||||
Vec3D vec3d1 = Vec3D.a((double) MathHelper.sin(this.yaw * 3.1415927F / 180.0F), this.motY, (double) (-MathHelper.cos(this.yaw * 3.1415927F / 180.0F))).a();
|
||||
float f4 = (float) (vec3d1.b(vec3d) + 0.5D) / 1.5F;
|
||||
|
||||
if (f4 < 0.0F) {
|
||||
f4 = 0.0F;
|
||||
}
|
||||
|
||||
this.bg *= 0.8F;
|
||||
this.bf *= 0.8F;
|
||||
float f5 = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ) * 1.0F + 1.0F;
|
||||
double d10 = Math.sqrt(this.motX * this.motX + this.motZ * this.motZ) * 1.0D + 1.0D;
|
||||
|
||||
@ -208,8 +208,8 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
d10 = 40.0D;
|
||||
}
|
||||
|
||||
this.bg = (float) ((double) this.bg + d9 * (0.699999988079071D / d10 / (double) f5));
|
||||
this.yaw += this.bg * 0.1F;
|
||||
this.bf = (float) ((double) this.bf + d9 * (0.699999988079071D / d10 / (double) f5));
|
||||
this.yaw += this.bf * 0.1F;
|
||||
float f6 = (float) (2.0D / (d10 + 1.0D));
|
||||
float f7 = 0.06F;
|
||||
|
||||
@ -220,7 +220,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
this.move(this.motX, this.motY, this.motZ);
|
||||
}
|
||||
|
||||
Vec3D vec3d2 = this.world.getVec3DPool().create(this.motX, this.motY, this.motZ).a();
|
||||
Vec3D vec3d2 = Vec3D.a(this.motX, this.motY, this.motZ).a();
|
||||
float f8 = (float) (vec3d2.b(vec3d1) + 1.0D) / 2.0F;
|
||||
|
||||
f8 = 0.8F + 0.15F * f8;
|
||||
@ -229,7 +229,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
this.motY *= 0.9100000262260437D;
|
||||
}
|
||||
|
||||
this.aN = this.yaw;
|
||||
this.aM = this.yaw;
|
||||
this.bq.width = this.bq.length = 3.0F;
|
||||
this.bs.width = this.bs.length = 2.0F;
|
||||
this.bt.width = this.bt.length = 2.0F;
|
||||
@ -262,8 +262,8 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
double[] adouble = this.b(5, 1.0F);
|
||||
double[] adouble1 = this.b(0, 1.0F);
|
||||
|
||||
f3 = MathHelper.sin(this.yaw * 3.1415927F / 180.0F - this.bg * 0.01F);
|
||||
float f13 = MathHelper.cos(this.yaw * 3.1415927F / 180.0F - this.bg * 0.01F);
|
||||
f3 = MathHelper.sin(this.yaw * 3.1415927F / 180.0F - this.bf * 0.01F);
|
||||
float f13 = MathHelper.cos(this.yaw * 3.1415927F / 180.0F - this.bf * 0.01F);
|
||||
|
||||
this.bq.h();
|
||||
this.bq.setPositionRotation(this.locX + (double) (f3 * 5.5F * f2), this.locY + (adouble1[1] - adouble[1]) * 1.0D + (double) (f9 * 5.5F), this.locZ - (double) (f13 * 5.5F * f2), 0.0F, 0.0F);
|
||||
@ -300,7 +300,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
}
|
||||
}
|
||||
|
||||
private void bN() {
|
||||
private void bP() {
|
||||
if (this.bC != null) {
|
||||
if (this.bC.dead) {
|
||||
if (!this.world.isStatic) {
|
||||
@ -337,7 +337,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
EntityEnderCrystal entityendercrystal1 = (EntityEnderCrystal) iterator.next();
|
||||
double d1 = entityendercrystal1.e(this);
|
||||
double d1 = entityendercrystal1.f(this);
|
||||
|
||||
if (d1 < d0) {
|
||||
d0 = d1;
|
||||
@ -381,7 +381,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
{
|
||||
this.h = x;
|
||||
this.i = y;
|
||||
this.j = z;
|
||||
this.bm = z;
|
||||
this.bD = null;
|
||||
}
|
||||
|
||||
@ -390,7 +390,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
this.bD = entity;
|
||||
}
|
||||
|
||||
private void bO() {
|
||||
private void bQ() {
|
||||
this.bz = false;
|
||||
if (this.random.nextInt(2) == 0 && !this.world.players.isEmpty()) {
|
||||
// CraftBukkit start
|
||||
@ -402,7 +402,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
if (event.getTarget() == null) {
|
||||
this.bD = null;
|
||||
} else {
|
||||
this.bD = ((org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity) event.getTarget()).getHandle();
|
||||
this.bD = ((org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity) event.getTarget()).getHandle();
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
@ -412,12 +412,12 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
do {
|
||||
this.h = 0.0D;
|
||||
this.i = (double) (70.0F + this.random.nextFloat() * 50.0F);
|
||||
this.j = 0.0D;
|
||||
this.bm = 0.0D;
|
||||
this.h += (double) (this.random.nextFloat() * 120.0F - 60.0F);
|
||||
this.j += (double) (this.random.nextFloat() * 120.0F - 60.0F);
|
||||
this.bm += (double) (this.random.nextFloat() * 120.0F - 60.0F);
|
||||
double d0 = this.locX - this.h;
|
||||
double d1 = this.locY - this.i;
|
||||
double d2 = this.locZ - this.j;
|
||||
double d2 = this.locZ - this.bm;
|
||||
|
||||
flag = d0 * d0 + d1 * d1 + d2 * d2 > 100.0D;
|
||||
} while (!flag);
|
||||
@ -442,7 +442,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
|
||||
// CraftBukkit start - Create a list to hold all the destroyed blocks
|
||||
List<org.bukkit.block.Block> destroyedBlocks = new java.util.ArrayList<org.bukkit.block.Block>();
|
||||
org.bukkit.craftbukkit.v1_7_R1.CraftWorld craftWorld = this.world.getWorld();
|
||||
org.bukkit.craftbukkit.v1_7_R2.CraftWorld craftWorld = this.world.getWorld();
|
||||
// CraftBukkit end
|
||||
|
||||
for (int k1 = i; k1 <= l; ++k1) {
|
||||
@ -490,7 +490,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
int blockY = block.getY();
|
||||
int blockZ = block.getZ();
|
||||
|
||||
Block nmsBlock = org.bukkit.craftbukkit.v1_7_R1.util.CraftMagicNumbers.getBlock(blockId);
|
||||
Block nmsBlock = org.bukkit.craftbukkit.v1_7_R2.util.CraftMagicNumbers.getBlock(blockId);
|
||||
if (nmsBlock.a(explosionSource)) {
|
||||
nmsBlock.dropNaturally(this.world, blockX, blockY, blockZ, block.getData(), event.getYield(), 0);
|
||||
}
|
||||
@ -522,9 +522,9 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
|
||||
this.h = this.locX + (double) (f2 * 5.0F) + (double) ((this.random.nextFloat() - 0.5F) * 2.0F);
|
||||
this.i = this.locY + (double) (this.random.nextFloat() * 3.0F) + 1.0D;
|
||||
this.j = this.locZ - (double) (f3 * 5.0F) + (double) ((this.random.nextFloat() - 0.5F) * 2.0F);
|
||||
this.bm = this.locZ - (double) (f3 * 5.0F) + (double) ((this.random.nextFloat() - 0.5F) * 2.0F);
|
||||
this.bD = null;
|
||||
if (damagesource.getEntity() instanceof EntityHuman || damagesource.c()) {
|
||||
if (damagesource.getEntity() instanceof EntityHuman || damagesource.isExplosion()) {
|
||||
this.dealDamage(damagesource, f);
|
||||
}
|
||||
|
||||
@ -539,7 +539,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
return super.damageEntity(damagesource, f);
|
||||
}
|
||||
|
||||
protected void aF() {
|
||||
protected void aE() {
|
||||
if (this.dead) return; // CraftBukkit - can't kill what's already dead
|
||||
++this.bB;
|
||||
if (this.bB >= 180 && this.bB <= 200) {
|
||||
@ -570,7 +570,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
}
|
||||
|
||||
this.move(0.0D, 0.10000000149011612D, 0.0D);
|
||||
this.aN = this.yaw += 20.0F;
|
||||
this.aM = this.yaw += 20.0F;
|
||||
if (this.bB == 200 && !this.world.isStatic) {
|
||||
i = this.expToDrop - (10 * this.expToDrop / 12); // CraftBukkit - drop the remaining experience
|
||||
|
||||
@ -653,11 +653,11 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
|
||||
protected void w() {}
|
||||
|
||||
public Entity[] at() {
|
||||
public Entity[] as() {
|
||||
return this.children;
|
||||
}
|
||||
|
||||
public boolean R() {
|
||||
public boolean Q() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -669,11 +669,11 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
return "mob.enderdragon.growl";
|
||||
}
|
||||
|
||||
protected String aT() {
|
||||
protected String aS() {
|
||||
return "mob.enderdragon.hit";
|
||||
}
|
||||
|
||||
protected float bf() {
|
||||
protected float be() {
|
||||
return 5.0F;
|
||||
}
|
||||
|
||||
@ -684,4 +684,4 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
|
||||
return 12000;
|
||||
}
|
||||
// CraftBukkit end
|
||||
}
|
||||
}
|
@ -1,10 +1,10 @@
|
||||
package net.minecraft.server.v1_7_R1;
|
||||
package net.minecraft.server.v1_7_R2;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
// CraftBukkit start
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.event.CraftEventFactory;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.event.CraftEventFactory;
|
||||
import org.bukkit.event.entity.EntityTeleportEvent;
|
||||
// CraftBukkit end
|
||||
|
||||
@ -21,11 +21,11 @@ public class EntityEnderman extends EntityMonster {
|
||||
public EntityEnderman(World world) {
|
||||
super(world);
|
||||
this.a(0.6F, 2.9F);
|
||||
this.X = 1.0F;
|
||||
this.W = 1.0F;
|
||||
}
|
||||
|
||||
protected void aD() {
|
||||
super.aD();
|
||||
protected void aC() {
|
||||
super.aC();
|
||||
this.getAttributeInstance(GenericAttributes.a).setValue(40.0D);
|
||||
this.getAttributeInstance(GenericAttributes.d).setValue(0.30000001192092896D);
|
||||
this.getAttributeInstance(GenericAttributes.e).setValue(7.0D);
|
||||
@ -83,18 +83,18 @@ public class EntityEnderman extends EntityMonster {
|
||||
return false;
|
||||
} else {
|
||||
Vec3D vec3d = entityhuman.j(1.0F).a();
|
||||
Vec3D vec3d1 = this.world.getVec3DPool().create(this.locX - entityhuman.locX, this.boundingBox.b + (double) (this.length / 2.0F) - (entityhuman.locY + (double) entityhuman.getHeadHeight()), this.locZ - entityhuman.locZ);
|
||||
Vec3D vec3d1 = Vec3D.a(this.locX - entityhuman.locX, this.boundingBox.b + (double) (this.length / 2.0F) - (entityhuman.locY + (double) entityhuman.getHeadHeight()), this.locZ - entityhuman.locZ);
|
||||
double d0 = vec3d1.b();
|
||||
|
||||
vec3d1 = vec3d1.a();
|
||||
double d1 = vec3d.b(vec3d1);
|
||||
|
||||
return d1 > 1.0D - 0.025D / d0 ? entityhuman.o(this) : false;
|
||||
return d1 > 1.0D - 0.025D / d0 && entityhuman.p(this);
|
||||
}
|
||||
}
|
||||
|
||||
public void e() {
|
||||
if (this.L()) {
|
||||
if (this.K()) {
|
||||
this.damageEntity(DamageSource.DROWN, 1.0F);
|
||||
}
|
||||
|
||||
@ -153,29 +153,29 @@ public class EntityEnderman extends EntityMonster {
|
||||
this.world.addParticle("portal", this.locX + (this.random.nextDouble() - 0.5D) * (double) this.width, this.locY + this.random.nextDouble() * (double) this.length - 0.25D, this.locZ + (this.random.nextDouble() - 0.5D) * (double) this.width, (this.random.nextDouble() - 0.5D) * 2.0D, -this.random.nextDouble(), (this.random.nextDouble() - 0.5D) * 2.0D);
|
||||
}
|
||||
|
||||
if (this.world.v() && !this.world.isStatic) {
|
||||
if (this.world.w() && !this.world.isStatic) {
|
||||
float f = this.d(1.0F);
|
||||
|
||||
if (f > 0.5F && this.world.i(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) {
|
||||
this.target = null;
|
||||
this.a(false);
|
||||
this.bv = false;
|
||||
this.bX();
|
||||
this.bZ();
|
||||
}
|
||||
}
|
||||
|
||||
if (this.L() || this.isBurning()) {
|
||||
if (this.K() || this.isBurning()) {
|
||||
this.target = null;
|
||||
this.a(false);
|
||||
this.bv = false;
|
||||
this.bX();
|
||||
this.bZ();
|
||||
}
|
||||
|
||||
if (this.cb() && !this.bv && this.random.nextInt(100) == 0) {
|
||||
if (this.cd() && !this.bv && this.random.nextInt(100) == 0) {
|
||||
this.a(false);
|
||||
}
|
||||
|
||||
this.bd = false;
|
||||
this.bc = false;
|
||||
if (this.target != null) {
|
||||
this.a(this.target, 100.0F, 100.0F);
|
||||
}
|
||||
@ -183,12 +183,12 @@ public class EntityEnderman extends EntityMonster {
|
||||
if (!this.world.isStatic && this.isAlive()) {
|
||||
if (this.target != null) {
|
||||
if (this.target instanceof EntityHuman && this.f((EntityHuman) this.target)) {
|
||||
if (this.target.e((Entity) this) < 16.0D) {
|
||||
this.bX();
|
||||
if (this.target.f((Entity) this) < 16.0D) {
|
||||
this.bZ();
|
||||
}
|
||||
|
||||
this.bs = 0;
|
||||
} else if (this.target.e((Entity) this) > 256.0D && this.bs++ >= 30 && this.c(this.target)) {
|
||||
} else if (this.target.f((Entity) this) > 256.0D && this.bs++ >= 30 && this.c(this.target)) {
|
||||
this.bs = 0;
|
||||
}
|
||||
} else {
|
||||
@ -200,7 +200,7 @@ public class EntityEnderman extends EntityMonster {
|
||||
super.e();
|
||||
}
|
||||
|
||||
protected boolean bX() {
|
||||
protected boolean bZ() {
|
||||
double d0 = this.locX + (this.random.nextDouble() - 0.5D) * 64.0D;
|
||||
double d1 = this.locY + (double) (this.random.nextInt(64) - 32);
|
||||
double d2 = this.locZ + (this.random.nextDouble() - 0.5D) * 64.0D;
|
||||
@ -209,13 +209,13 @@ public class EntityEnderman extends EntityMonster {
|
||||
}
|
||||
|
||||
protected boolean c(Entity entity) {
|
||||
Vec3D vec3d = this.world.getVec3DPool().create(this.locX - entity.locX, this.boundingBox.b + (double) (this.length / 2.0F) - entity.locY + (double) entity.getHeadHeight(), this.locZ - entity.locZ);
|
||||
Vec3D vec3d = Vec3D.a(this.locX - entity.locX, this.boundingBox.b + (double) (this.length / 2.0F) - entity.locY + (double) entity.getHeadHeight(), this.locZ - entity.locZ);
|
||||
|
||||
vec3d = vec3d.a();
|
||||
double d0 = 16.0D;
|
||||
double d1 = this.locX + (this.random.nextDouble() - 0.5D) * 8.0D - vec3d.c * d0;
|
||||
double d2 = this.locY + (double) (this.random.nextInt(16) - 8) - vec3d.d * d0;
|
||||
double d3 = this.locZ + (this.random.nextDouble() - 0.5D) * 8.0D - vec3d.e * d0;
|
||||
double d1 = this.locX + (this.random.nextDouble() - 0.5D) * 8.0D - vec3d.a * d0;
|
||||
double d2 = this.locY + (double) (this.random.nextInt(16) - 8) - vec3d.b * d0;
|
||||
double d3 = this.locZ + (this.random.nextDouble() - 0.5D) * 8.0D - vec3d.c * d0;
|
||||
|
||||
return this.k(d1, d2, d3);
|
||||
}
|
||||
@ -290,14 +290,14 @@ public class EntityEnderman extends EntityMonster {
|
||||
}
|
||||
|
||||
protected String t() {
|
||||
return this.cb() ? "mob.endermen.scream" : "mob.endermen.idle";
|
||||
return this.cd() ? "mob.endermen.scream" : "mob.endermen.idle";
|
||||
}
|
||||
|
||||
protected String aT() {
|
||||
protected String aS() {
|
||||
return "mob.endermen.hit";
|
||||
}
|
||||
|
||||
protected String aU() {
|
||||
protected String aT() {
|
||||
return "mob.endermen.death";
|
||||
}
|
||||
|
||||
@ -314,7 +314,7 @@ public class EntityEnderman extends EntityMonster {
|
||||
int count = this.random.nextInt(2 + i);
|
||||
|
||||
if (count > 0) {
|
||||
loot.add(new org.bukkit.inventory.ItemStack(org.bukkit.craftbukkit.v1_7_R1.util.CraftMagicNumbers.getMaterial(item), count));
|
||||
loot.add(new org.bukkit.inventory.ItemStack(org.bukkit.craftbukkit.v1_7_R2.util.CraftMagicNumbers.getMaterial(item), count));
|
||||
}
|
||||
|
||||
CraftEventFactory.callEntityDeathEvent(this, loot);
|
||||
@ -351,7 +351,7 @@ public class EntityEnderman extends EntityMonster {
|
||||
this.bv = false;
|
||||
|
||||
for (int i = 0; i < 64; ++i) {
|
||||
if (this.bX()) {
|
||||
if (this.bZ()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -363,7 +363,7 @@ public class EntityEnderman extends EntityMonster {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean cb() {
|
||||
public boolean cd() {
|
||||
return this.datawatcher.getByte(18) > 0;
|
||||
}
|
||||
|
||||
@ -374,7 +374,7 @@ public class EntityEnderman extends EntityMonster {
|
||||
static {
|
||||
br[Block.b((Block) Blocks.GRASS)] = true;
|
||||
br[Block.b(Blocks.DIRT)] = true;
|
||||
br[Block.b(Blocks.SAND)] = true;
|
||||
br[Block.b((Block) Blocks.SAND)] = true;
|
||||
br[Block.b(Blocks.GRAVEL)] = true;
|
||||
br[Block.b((Block) Blocks.YELLOW_FLOWER)] = true;
|
||||
br[Block.b((Block) Blocks.RED_ROSE)] = true;
|
||||
@ -387,4 +387,4 @@ public class EntityEnderman extends EntityMonster {
|
||||
br[Block.b(Blocks.MELON)] = true;
|
||||
br[Block.b((Block) Blocks.MYCEL)] = true;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,10 +1,10 @@
|
||||
package net.minecraft.server.v1_7_R1;
|
||||
package net.minecraft.server.v1_7_R2;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
||||
// CraftBukkit start
|
||||
import org.bukkit.craftbukkit.v1_7_R1.event.CraftEventFactory;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.event.CraftEventFactory;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
// CraftBukkit end
|
||||
|
||||
@ -19,9 +19,9 @@ public class EntityFallingBlock extends Entity {
|
||||
private int fallHurtMax;
|
||||
private float fallHurtAmount;
|
||||
public NBTTagCompound tileEntityData;
|
||||
|
||||
public boolean spectating;
|
||||
|
||||
public boolean spectating;
|
||||
|
||||
public EntityFallingBlock(World world) {
|
||||
super(world);
|
||||
this.dropItem = true;
|
||||
@ -40,7 +40,7 @@ public class EntityFallingBlock extends Entity {
|
||||
this.fallHurtAmount = 2.0F;
|
||||
this.id = block;
|
||||
this.data = i;
|
||||
this.l = true;
|
||||
this.k = true;
|
||||
this.a(0.98F, 0.98F);
|
||||
this.height = this.length / 2.0F;
|
||||
this.setPosition(d0, d1, d2);
|
||||
@ -58,7 +58,7 @@ public class EntityFallingBlock extends Entity {
|
||||
|
||||
protected void c() {}
|
||||
|
||||
public boolean R() {
|
||||
public boolean Q() {
|
||||
return !this.dead && !spectating;
|
||||
}
|
||||
|
||||
@ -96,7 +96,7 @@ public class EntityFallingBlock extends Entity {
|
||||
this.motY *= -0.5D;
|
||||
if (this.world.getType(i, j, k) != Blocks.PISTON_MOVING) {
|
||||
this.die();
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - fire EntityChangeBlockEvent
|
||||
if (!this.f && this.world.mayPlace(this.id, i, j, k, true, 1, (Entity) null, (ItemStack) null) && !BlockFalling.canFall(this.world, i, j - 1, k) /* mimic the false conditions of setTypeIdAndData */ && i >= -30000000 && k >= -30000000 && i < 30000000 && k < 30000000 && j > 0 && j < 256 && !(this.world.getType(i, j, k) == this.id && this.world.getData(i, j, k) == this.data)) {
|
||||
if (CraftEventFactory.callEntityChangeBlockEvent(this, i, j, k, this.id, this.data).isCancelled()) {
|
||||
return;
|
||||
@ -242,4 +242,4 @@ public class EntityFallingBlock extends Entity {
|
||||
public Block f() {
|
||||
return this.id;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
package net.minecraft.server.v1_7_R1;
|
||||
package net.minecraft.server.v1_7_R2;
|
||||
|
||||
// CraftBukkit start
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.inventory.CraftItemStack;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.inventory.CraftItemStack;
|
||||
import org.bukkit.event.entity.EntityTargetEvent;
|
||||
// CraftBukkit end
|
||||
|
||||
@ -10,7 +10,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
|
||||
public int h;
|
||||
public double i;
|
||||
public double j;
|
||||
public double bm;
|
||||
public double bn;
|
||||
private Entity target;
|
||||
private int br;
|
||||
@ -42,20 +42,20 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
this.datawatcher.a(16, Byte.valueOf((byte) 0));
|
||||
}
|
||||
|
||||
protected void aD() {
|
||||
super.aD();
|
||||
protected void aC() {
|
||||
super.aC();
|
||||
this.getAttributeInstance(GenericAttributes.a).setValue(10.0D);
|
||||
}
|
||||
|
||||
protected void bq() {
|
||||
protected void bp() {
|
||||
if (!this.world.isStatic && this.world.difficulty == EnumDifficulty.PEACEFUL) {
|
||||
this.die();
|
||||
}
|
||||
|
||||
|
||||
if (Vegetated)
|
||||
{
|
||||
double d0 = this.i - this.locX;
|
||||
double d1 = this.j - this.locY;
|
||||
double d1 = this.bm - this.locY;
|
||||
double d2 = this.bn - this.locZ;
|
||||
double d3 = d0 * d0 + d1 * d1 + d2 * d2;
|
||||
|
||||
@ -70,36 +70,35 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
this.w();
|
||||
this.bo = this.bp;
|
||||
double d0 = this.i - this.locX;
|
||||
double d1 = this.j - this.locY;
|
||||
double d1 = this.bm - this.locY;
|
||||
double d2 = this.bn - this.locZ;
|
||||
double d3 = d0 * d0 + d1 * d1 + d2 * d2;
|
||||
|
||||
if (d3 < 1.0D || d3 > 3600.0D) {
|
||||
this.i = this.locX + (double) ((this.random.nextFloat() * 2.0F - 1.0F) * 16.0F);
|
||||
this.j = this.locY + (double) ((this.random.nextFloat() * 2.0F - 1.0F) * 16.0F);
|
||||
this.bm = this.locY + (double) ((this.random.nextFloat() * 2.0F - 1.0F) * 16.0F);
|
||||
this.bn = this.locZ + (double) ((this.random.nextFloat() * 2.0F - 1.0F) * 16.0F);
|
||||
}
|
||||
|
||||
if (this.h-- <= 0) {
|
||||
this.h += this.random.nextInt(5) + 2;
|
||||
d3 = (double) MathHelper.sqrt(d3);
|
||||
if (this.a(this.i, this.j, this.bn, d3)) {
|
||||
if (this.a(this.i, this.bm, this.bn, d3)) {
|
||||
this.motX += d0 / d3 * 0.1D;
|
||||
this.motY += d1 / d3 * 0.1D;
|
||||
this.motZ += d2 / d3 * 0.1D;
|
||||
} else {
|
||||
this.i = this.locX;
|
||||
this.j = this.locY;
|
||||
this.bm = this.locY;
|
||||
this.bn = this.locZ;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.target != null && this.target.dead) {
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - fire EntityTargetEvent
|
||||
EntityTargetEvent event = new EntityTargetEvent(this.getBukkitEntity(), null, EntityTargetEvent.TargetReason.TARGET_DIED);
|
||||
this.world.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
@ -114,7 +113,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
}
|
||||
|
||||
if (this.target == null || this.br-- <= 0) {
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - fire EntityTargetEvent
|
||||
Entity target = this.world.findNearbyVulnerablePlayer(this, 100.0D);
|
||||
if (target != null) {
|
||||
EntityTargetEvent event = new EntityTargetEvent(this.getBukkitEntity(), target.getBukkitEntity(), EntityTargetEvent.TargetReason.CLOSEST_PLAYER);
|
||||
@ -137,13 +136,13 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
|
||||
double d4 = 64.0D;
|
||||
|
||||
if (this.target != null && this.target.e((Entity) this) < d4 * d4) {
|
||||
if (this.target != null && this.target.f((Entity) this) < d4 * d4) {
|
||||
double d5 = this.target.locX - this.locX;
|
||||
double d6 = this.target.boundingBox.b + (double) (this.target.length / 2.0F) - (this.locY + (double) (this.length / 2.0F));
|
||||
double d7 = this.target.locZ - this.locZ;
|
||||
|
||||
this.aN = this.yaw = -((float) Math.atan2(d5, d7)) * 180.0F / 3.1415927F;
|
||||
if (this.o(this.target)) {
|
||||
this.aM = this.yaw = -((float) Math.atan2(d5, d7)) * 180.0F / 3.1415927F;
|
||||
if (this.p(this.target)) {
|
||||
if (this.bp == 10) {
|
||||
this.world.a((EntityHuman) null, 1007, (int) this.locX, (int) this.locY, (int) this.locZ, 0);
|
||||
}
|
||||
@ -158,9 +157,9 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
double d8 = 4.0D;
|
||||
Vec3D vec3d = this.j(1.0F);
|
||||
|
||||
entitylargefireball.locX = this.locX + vec3d.c * d8;
|
||||
entitylargefireball.locX = this.locX + vec3d.a * d8;
|
||||
entitylargefireball.locY = this.locY + (double) (this.length / 2.0F) + 0.5D;
|
||||
entitylargefireball.locZ = this.locZ + vec3d.e * d8;
|
||||
entitylargefireball.locZ = this.locZ + vec3d.c * d8;
|
||||
this.world.addEntity(entitylargefireball);
|
||||
this.bp = -40;
|
||||
}
|
||||
@ -168,7 +167,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
--this.bp;
|
||||
}
|
||||
} else {
|
||||
this.aN = this.yaw = -((float) Math.atan2(this.motX, this.motZ)) * 180.0F / 3.1415927F;
|
||||
this.aM = this.yaw = -((float) Math.atan2(this.motX, this.motZ)) * 180.0F / 3.1415927F;
|
||||
if (this.bp > 0) {
|
||||
--this.bp;
|
||||
}
|
||||
@ -186,7 +185,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
|
||||
private boolean a(double d0, double d1, double d2, double d3) {
|
||||
double d4 = (this.i - this.locX) / d3;
|
||||
double d5 = (this.j - this.locY) / d3;
|
||||
double d5 = (this.bm - this.locY) / d3;
|
||||
double d6 = (this.bn - this.locZ) / d3;
|
||||
AxisAlignedBB axisalignedbb = this.boundingBox.clone();
|
||||
|
||||
@ -204,11 +203,11 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
return "mob.ghast.moan";
|
||||
}
|
||||
|
||||
protected String aT() {
|
||||
protected String aS() {
|
||||
return "mob.ghast.scream";
|
||||
}
|
||||
|
||||
protected String aU() {
|
||||
protected String aT() {
|
||||
return "mob.ghast.death";
|
||||
}
|
||||
|
||||
@ -233,11 +232,11 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
loot.add(CraftItemStack.asNewCraftStack(Items.SULPHUR, j));
|
||||
}
|
||||
|
||||
org.bukkit.craftbukkit.v1_7_R1.event.CraftEventFactory.callEntityDeathEvent(this, loot);
|
||||
org.bukkit.craftbukkit.v1_7_R2.event.CraftEventFactory.callEntityDeathEvent(this, loot);
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
protected float bf() {
|
||||
protected float be() {
|
||||
return 10.0F;
|
||||
}
|
||||
|
||||
@ -245,7 +244,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
return this.random.nextInt(20) == 0 && super.canSpawn() && this.world.difficulty != EnumDifficulty.PEACEFUL;
|
||||
}
|
||||
|
||||
public int bz() {
|
||||
public int bB() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -260,4 +259,4 @@ public class EntityGhast extends EntityFlying implements IMonster {
|
||||
this.explosionPower = nbttagcompound.getInt("ExplosionPower");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,10 +1,10 @@
|
||||
package net.minecraft.server.v1_7_R1;
|
||||
package net.minecraft.server.v1_7_R2;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
// CraftBukkit start
|
||||
import org.bukkit.craftbukkit.v1_7_R1.event.CraftEventFactory;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.event.CraftEventFactory;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
// CraftBukkit end
|
||||
|
||||
@ -69,7 +69,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
|
||||
public void setType(int i) {
|
||||
this.datawatcher.watch(19, Byte.valueOf((byte) i));
|
||||
this.cN();
|
||||
this.cP();
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
@ -78,7 +78,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
|
||||
public void setVariant(int i) {
|
||||
this.datawatcher.watch(20, Integer.valueOf(i));
|
||||
this.cN();
|
||||
this.cP();
|
||||
}
|
||||
|
||||
public int getVariant() {
|
||||
@ -128,7 +128,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean bZ() {
|
||||
public boolean cb() {
|
||||
return !this.isBaby();
|
||||
}
|
||||
|
||||
@ -136,8 +136,8 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
return this.x(2);
|
||||
}
|
||||
|
||||
public boolean ce() {
|
||||
return this.bZ();
|
||||
public boolean cg() {
|
||||
return this.cb();
|
||||
}
|
||||
|
||||
public String getOwnerName() {
|
||||
@ -148,7 +148,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
this.datawatcher.watch(21, s);
|
||||
}
|
||||
|
||||
public float cg() {
|
||||
public float ci() {
|
||||
int i = this.getAge();
|
||||
|
||||
return i >= 0 ? 1.0F : 0.5F + (float) (-24000 - i) / -24000.0F * 0.5F;
|
||||
@ -156,13 +156,13 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
|
||||
public void a(boolean flag) {
|
||||
if (flag) {
|
||||
this.a(this.cg());
|
||||
this.a(this.ci());
|
||||
} else {
|
||||
this.a(1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean ch() {
|
||||
public boolean cj() {
|
||||
return this.br;
|
||||
}
|
||||
|
||||
@ -174,12 +174,12 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
this.br = flag;
|
||||
}
|
||||
|
||||
public boolean bK() {
|
||||
return !this.cC() && super.bK();
|
||||
public boolean bM() {
|
||||
return !this.cE() && super.bM();
|
||||
}
|
||||
|
||||
protected void o(float f) {
|
||||
if (f > 6.0F && this.ck()) {
|
||||
if (f > 6.0F && this.cm()) {
|
||||
this.o(false);
|
||||
}
|
||||
}
|
||||
@ -188,7 +188,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
return this.x(8);
|
||||
}
|
||||
|
||||
public int cj() {
|
||||
public int cl() {
|
||||
return this.datawatcher.getInt(22);
|
||||
}
|
||||
|
||||
@ -202,25 +202,25 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean ck() {
|
||||
public boolean cm() {
|
||||
return this.x(32);
|
||||
}
|
||||
|
||||
public boolean cl() {
|
||||
public boolean cn() {
|
||||
return this.x(64);
|
||||
}
|
||||
|
||||
public boolean cm() {
|
||||
public boolean co() {
|
||||
return this.x(16);
|
||||
}
|
||||
|
||||
public boolean cn() {
|
||||
public boolean cp() {
|
||||
return this.bH;
|
||||
}
|
||||
|
||||
public void d(ItemStack itemstack) {
|
||||
this.datawatcher.watch(22, Integer.valueOf(this.e(itemstack)));
|
||||
this.cN();
|
||||
this.cP();
|
||||
}
|
||||
|
||||
public void k(boolean flag) {
|
||||
@ -260,15 +260,15 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
return this.passenger != null && this.passenger.equals(entity) ? false : super.damageEntity(damagesource, f);
|
||||
}
|
||||
|
||||
public int aV() {
|
||||
return by[this.cj()];
|
||||
public int aU() {
|
||||
return by[this.cl()];
|
||||
}
|
||||
|
||||
public boolean S() {
|
||||
public boolean R() {
|
||||
return this.passenger == null;
|
||||
}
|
||||
|
||||
public boolean cp() {
|
||||
public boolean cr() {
|
||||
int i = MathHelper.floor(this.locX);
|
||||
int j = MathHelper.floor(this.locZ);
|
||||
|
||||
@ -276,15 +276,15 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void cq() {
|
||||
public void cs() {
|
||||
if (!this.world.isStatic && this.hasChest()) {
|
||||
this.a(Item.getItemOf(Blocks.CHEST), 1);
|
||||
this.setHasChest(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void cJ() {
|
||||
this.cQ();
|
||||
private void cL() {
|
||||
this.cS();
|
||||
this.world.makeSound(this, "eating", 1.0F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F);
|
||||
}
|
||||
|
||||
@ -296,7 +296,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
int i = MathHelper.f(f * 0.5F - 3.0F);
|
||||
|
||||
if (i > 0) {
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - fire EntityDamageEvent
|
||||
EntityDamageEvent event = CraftEventFactory.callEntityDamageEvent(null, this, EntityDamageEvent.DamageCause.FALL, i);
|
||||
if (!event.isCancelled()) {
|
||||
float damage = (float) event.getDamage();
|
||||
@ -328,7 +328,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
}
|
||||
|
||||
private int cK() {
|
||||
private int cM() {
|
||||
int i = this.getType();
|
||||
|
||||
return this.hasChest() /* && (i == 1 || i == 2) */ ? 17 : 2; // CraftBukkit - Remove type check
|
||||
@ -337,7 +337,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
public void loadChest() { // CraftBukkit - private -> public
|
||||
InventoryHorseChest inventoryhorsechest = this.inventoryChest;
|
||||
|
||||
this.inventoryChest = new InventoryHorseChest("HorseChest", this.cK(), this); // CraftBukkit - add this horse
|
||||
this.inventoryChest = new InventoryHorseChest("HorseChest", this.cM(), this); // CraftBukkit - add this horse
|
||||
this.inventoryChest.a(this.getName());
|
||||
if (inventoryhorsechest != null) {
|
||||
inventoryhorsechest.b(this);
|
||||
@ -355,38 +355,38 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
|
||||
this.inventoryChest.a(this);
|
||||
this.cM();
|
||||
this.cO();
|
||||
}
|
||||
|
||||
private void cM() {
|
||||
private void cO() {
|
||||
if (!this.world.isStatic) {
|
||||
this.n(this.inventoryChest.getItem(0) != null);
|
||||
if (this.cz()) {
|
||||
if (this.cB()) {
|
||||
this.d(this.inventoryChest.getItem(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void a(InventorySubcontainer inventorysubcontainer) {
|
||||
int i = this.cj();
|
||||
boolean flag = this.cs();
|
||||
int i = this.cl();
|
||||
boolean flag = this.cu();
|
||||
|
||||
this.cM();
|
||||
this.cO();
|
||||
if (this.ticksLived > 20) {
|
||||
if (i == 0 && i != this.cj()) {
|
||||
if (i == 0 && i != this.cl()) {
|
||||
this.makeSound("mob.horse.armor", 0.5F, 1.0F);
|
||||
} else if (i != this.cj()) {
|
||||
} else if (i != this.cl()) {
|
||||
this.makeSound("mob.horse.armor", 0.5F, 1.0F);
|
||||
}
|
||||
|
||||
if (!flag && this.cs()) {
|
||||
if (!flag && this.cu()) {
|
||||
this.makeSound("mob.horse.leather", 0.5F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canSpawn() {
|
||||
this.cp();
|
||||
this.cr();
|
||||
return super.canSpawn();
|
||||
}
|
||||
|
||||
@ -413,8 +413,8 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
return this.getAttributeInstance(attributeJumpStrength).getValue();
|
||||
}
|
||||
|
||||
protected String aU() {
|
||||
this.cQ();
|
||||
protected String aT() {
|
||||
this.cS();
|
||||
int i = this.getType();
|
||||
|
||||
return i == 3 ? "mob.horse.zombie.death" : (i == 4 ? "mob.horse.skeleton.death" : (i != 1 && i != 2 ? "mob.horse.death" : "mob.horse.donkey.death"));
|
||||
@ -427,10 +427,10 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
return i == 4 ? Items.BONE : (i == 3 ? (flag ? Item.d(0) : Items.ROTTEN_FLESH) : Items.LEATHER);
|
||||
}
|
||||
|
||||
protected String aT() {
|
||||
this.cQ();
|
||||
protected String aS() {
|
||||
this.cS();
|
||||
if (this.random.nextInt(3) == 0) {
|
||||
this.cS();
|
||||
this.cU();
|
||||
}
|
||||
|
||||
int i = this.getType();
|
||||
@ -438,14 +438,14 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
return i == 3 ? "mob.horse.zombie.hit" : (i == 4 ? "mob.horse.skeleton.hit" : (i != 1 && i != 2 ? "mob.horse.hit" : "mob.horse.donkey.hit"));
|
||||
}
|
||||
|
||||
public boolean cs() {
|
||||
public boolean cu() {
|
||||
return this.x(4);
|
||||
}
|
||||
|
||||
protected String t() {
|
||||
this.cQ();
|
||||
if (this.random.nextInt(10) == 0 && !this.bh()) {
|
||||
this.cS();
|
||||
this.cS();
|
||||
if (this.random.nextInt(10) == 0 && !this.bg()) {
|
||||
this.cU();
|
||||
}
|
||||
|
||||
int i = this.getType();
|
||||
@ -453,9 +453,9 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
return i == 3 ? "mob.horse.zombie.idle" : (i == 4 ? "mob.horse.skeleton.idle" : (i != 1 && i != 2 ? "mob.horse.idle" : "mob.horse.donkey.idle"));
|
||||
}
|
||||
|
||||
protected String ct() {
|
||||
this.cQ();
|
||||
protected String cv() {
|
||||
this.cS();
|
||||
this.cU();
|
||||
int i = this.getType();
|
||||
|
||||
return i != 3 && i != 4 ? (i != 1 && i != 2 ? "mob.horse.angry" : "mob.horse.donkey.angry") : null;
|
||||
@ -489,14 +489,14 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
}
|
||||
|
||||
protected void aD() {
|
||||
super.aD();
|
||||
this.bc().b(attributeJumpStrength);
|
||||
protected void aC() {
|
||||
super.aC();
|
||||
this.bb().b(attributeJumpStrength);
|
||||
this.getAttributeInstance(GenericAttributes.a).setValue(53.0D);
|
||||
this.getAttributeInstance(GenericAttributes.d).setValue(0.22499999403953552D);
|
||||
}
|
||||
|
||||
public int bz() {
|
||||
public int bB() {
|
||||
return 6;
|
||||
}
|
||||
|
||||
@ -504,7 +504,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
return this.maxDomestication; // CraftBukkit - return stored max domestication instead of 100
|
||||
}
|
||||
|
||||
protected float bf() {
|
||||
protected float be() {
|
||||
return 0.8F;
|
||||
}
|
||||
|
||||
@ -512,7 +512,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
return 400;
|
||||
}
|
||||
|
||||
private void cN() {
|
||||
private void cP() {
|
||||
this.bQ = null;
|
||||
}
|
||||
|
||||
@ -528,18 +528,18 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
|
||||
if (itemstack != null && itemstack.getItem() == Items.MONSTER_EGG) {
|
||||
return super.a(entityhuman);
|
||||
} else if (!this.isTame() && this.cC()) {
|
||||
} else if (!this.isTame() && this.cE()) {
|
||||
return false;
|
||||
} else if (this.isTame() && this.bZ() && entityhuman.isSneaking()) {
|
||||
} else if (this.isTame() && this.cb() && entityhuman.isSneaking()) {
|
||||
this.g(entityhuman);
|
||||
return true;
|
||||
} else if (this.ce() && this.passenger != null) {
|
||||
} else if (this.cg() && this.passenger != null) {
|
||||
return super.a(entityhuman);
|
||||
} else {
|
||||
if (itemstack != null) {
|
||||
boolean flag = false;
|
||||
|
||||
if (this.cz()) {
|
||||
if (this.cB()) {
|
||||
byte b0 = -1;
|
||||
|
||||
if (itemstack.getItem() == Items.HORSE_ARMOR_IRON) {
|
||||
@ -552,7 +552,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
|
||||
if (b0 >= 0) {
|
||||
if (!this.isTame()) {
|
||||
this.cH();
|
||||
this.cJ();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -561,7 +561,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
}
|
||||
|
||||
if (!flag && !this.cC()) {
|
||||
if (!flag && !this.cE()) {
|
||||
float f = 0.0F;
|
||||
short short1 = 0;
|
||||
byte b1 = 0;
|
||||
@ -608,7 +608,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
if (!this.bZ() && short1 > 0) {
|
||||
if (!this.cb() && short1 > 0) {
|
||||
this.a(short1);
|
||||
flag = true;
|
||||
}
|
||||
@ -619,7 +619,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
|
||||
if (flag) {
|
||||
this.cJ();
|
||||
this.cL();
|
||||
}
|
||||
}
|
||||
|
||||
@ -628,18 +628,18 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
return true;
|
||||
}
|
||||
|
||||
this.cH();
|
||||
this.cJ();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!flag && this.cA() && !this.hasChest() && itemstack.getItem() == Item.getItemOf(Blocks.CHEST)) {
|
||||
if (!flag && this.cC() && !this.hasChest() && itemstack.getItem() == Item.getItemOf(Blocks.CHEST)) {
|
||||
this.setHasChest(true);
|
||||
this.makeSound("mob.chickenplop", 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
|
||||
flag = true;
|
||||
this.loadChest();
|
||||
}
|
||||
|
||||
if (!flag && this.ce() && !this.cs() && itemstack.getItem() == Items.SADDLE) {
|
||||
if (!flag && this.cg() && !this.cu() && itemstack.getItem() == Items.SADDLE) {
|
||||
this.g(entityhuman);
|
||||
return true;
|
||||
}
|
||||
@ -653,7 +653,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.ce() && this.passenger == null) {
|
||||
if (this.cg() && this.passenger == null) {
|
||||
if (itemstack != null && itemstack.a(entityhuman, (EntityLiving) this)) {
|
||||
return true;
|
||||
} else {
|
||||
@ -676,48 +676,48 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean cz() {
|
||||
public boolean cB() {
|
||||
return this.getType() == 0;
|
||||
}
|
||||
|
||||
public boolean cA() {
|
||||
int i = this.getType();
|
||||
|
||||
return i == 2 || i == 1;
|
||||
}
|
||||
|
||||
protected boolean bh() {
|
||||
return this.passenger != null && this.cs() ? true : this.ck() || this.cl();
|
||||
}
|
||||
|
||||
public boolean cC() {
|
||||
int i = this.getType();
|
||||
|
||||
return i == 2 || i == 1;
|
||||
}
|
||||
|
||||
protected boolean bg() {
|
||||
return this.passenger != null && this.cu() ? true : this.cm() || this.cn();
|
||||
}
|
||||
|
||||
public boolean cE() {
|
||||
int i = this.getType();
|
||||
|
||||
return i == 3 || i == 4;
|
||||
}
|
||||
|
||||
public boolean cD() {
|
||||
return this.cC() || this.getType() == 2;
|
||||
public boolean cF() {
|
||||
return this.cE() || this.getType() == 2;
|
||||
}
|
||||
|
||||
public boolean c(ItemStack itemstack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
private void cP() {
|
||||
private void cR() {
|
||||
this.bp = 1;
|
||||
}
|
||||
|
||||
public void die(DamageSource damagesource) {
|
||||
super.die(damagesource);
|
||||
if (!this.world.isStatic) {
|
||||
this.cI();
|
||||
this.cK();
|
||||
}
|
||||
}
|
||||
|
||||
public void e() {
|
||||
if (this.random.nextInt(200) == 0) {
|
||||
this.cP();
|
||||
this.cR();
|
||||
}
|
||||
|
||||
super.e();
|
||||
@ -726,19 +726,19 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
this.heal(1.0F);
|
||||
}
|
||||
|
||||
if (!this.ck() && this.passenger == null && this.random.nextInt(300) == 0 && this.world.getType(MathHelper.floor(this.locX), MathHelper.floor(this.locY) - 1, MathHelper.floor(this.locZ)) == Blocks.GRASS) {
|
||||
if (!this.cm() && this.passenger == null && this.random.nextInt(300) == 0 && this.world.getType(MathHelper.floor(this.locX), MathHelper.floor(this.locY) - 1, MathHelper.floor(this.locZ)) == Blocks.GRASS) {
|
||||
this.o(true);
|
||||
}
|
||||
|
||||
if (this.ck() && ++this.bD > 50) {
|
||||
if (this.cm() && ++this.bD > 50) {
|
||||
this.bD = 0;
|
||||
this.o(false);
|
||||
}
|
||||
|
||||
if (this.cm() && !this.bZ() && !this.ck()) {
|
||||
if (this.co() && !this.cb() && !this.cm()) {
|
||||
EntityHorse entityhorse = this.a(this, 16.0D);
|
||||
|
||||
if (entityhorse != null && this.e(entityhorse) > 4.0D) {
|
||||
if (entityhorse != null && this.f(entityhorse) > 4.0D) {
|
||||
PathEntity pathentity = this.world.findPath(this, entityhorse, 16.0F, true, false, false, true);
|
||||
|
||||
this.setPathEntity(pathentity);
|
||||
@ -751,7 +751,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
super.h();
|
||||
if (this.world.isStatic && this.datawatcher.a()) {
|
||||
this.datawatcher.e();
|
||||
this.cN();
|
||||
this.cP();
|
||||
}
|
||||
|
||||
if (this.bE > 0 && ++this.bE > 30) {
|
||||
@ -776,7 +776,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
|
||||
this.bK = this.bJ;
|
||||
if (this.ck()) {
|
||||
if (this.cm()) {
|
||||
this.bJ += (1.0F - this.bJ) * 0.4F + 0.05F;
|
||||
if (this.bJ > 1.0F) {
|
||||
this.bJ = 1.0F;
|
||||
@ -789,7 +789,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
|
||||
this.bM = this.bL;
|
||||
if (this.cl()) {
|
||||
if (this.cn()) {
|
||||
this.bK = this.bJ = 0.0F;
|
||||
this.bL += (1.0F - this.bL) * 0.4F + 0.05F;
|
||||
if (this.bL > 1.0F) {
|
||||
@ -817,15 +817,15 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
}
|
||||
|
||||
private void cQ() {
|
||||
private void cS() {
|
||||
if (!this.world.isStatic) {
|
||||
this.bE = 1;
|
||||
this.b(128, true);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean cR() {
|
||||
return this.passenger == null && this.vehicle == null && this.isTame() && this.bZ() && !this.cD() && this.getHealth() >= this.getMaxHealth();
|
||||
private boolean cT() {
|
||||
return this.passenger == null && this.vehicle == null && this.isTame() && this.cb() && !this.cF() && this.getHealth() >= this.getMaxHealth();
|
||||
}
|
||||
|
||||
public void e(boolean flag) {
|
||||
@ -844,25 +844,25 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
this.b(64, flag);
|
||||
}
|
||||
|
||||
private void cS() {
|
||||
private void cU() {
|
||||
if (!this.world.isStatic) {
|
||||
this.bF = 1;
|
||||
this.p(true);
|
||||
}
|
||||
}
|
||||
|
||||
public void cH() {
|
||||
this.cS();
|
||||
String s = this.ct();
|
||||
public void cJ() {
|
||||
this.cU();
|
||||
String s = this.cv();
|
||||
|
||||
if (s != null) {
|
||||
this.makeSound(s, this.bf(), this.bg());
|
||||
this.makeSound(s, this.be(), this.bf());
|
||||
}
|
||||
}
|
||||
|
||||
public void cI() {
|
||||
public void cK() {
|
||||
this.a(this, this.inventoryChest);
|
||||
this.cq();
|
||||
this.cs();
|
||||
}
|
||||
|
||||
private void a(Entity entity, InventoryHorseChest inventoryhorsechest) {
|
||||
@ -884,31 +884,31 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
|
||||
public void e(float f, float f1) {
|
||||
if (this.passenger != null && this.passenger instanceof EntityLiving && this.cs()) { // CraftBukkit - Check type of passenger
|
||||
if (this.passenger != null && this.passenger instanceof EntityLiving && this.cu()) {
|
||||
this.lastYaw = this.yaw = this.passenger.yaw;
|
||||
this.pitch = this.passenger.pitch * 0.5F;
|
||||
this.b(this.yaw, this.pitch);
|
||||
this.aP = this.aN = this.yaw;
|
||||
f = ((EntityLiving) this.passenger).be * 0.5F;
|
||||
f1 = ((EntityLiving) this.passenger).bf;
|
||||
this.aO = this.aM = this.yaw;
|
||||
f = ((EntityLiving) this.passenger).bd * 0.5F;
|
||||
f1 = ((EntityLiving) this.passenger).be;
|
||||
if (f1 <= 0.0F) {
|
||||
f1 *= 0.25F;
|
||||
this.bP = 0;
|
||||
}
|
||||
|
||||
if (this.onGround && this.bt == 0.0F && this.cl() && !this.bI) {
|
||||
if (this.onGround && this.bt == 0.0F && this.cn() && !this.bI) {
|
||||
f = 0.0F;
|
||||
f1 = 0.0F;
|
||||
}
|
||||
|
||||
if (this.bt > 0.0F && !this.ch() && this.onGround) {
|
||||
if (this.bt > 0.0F && !this.cj() && this.onGround) {
|
||||
this.motY = this.getJumpStrength() * (double) this.bt;
|
||||
if (this.hasEffect(MobEffectList.JUMP)) {
|
||||
this.motY += (double) ((float) (this.getEffect(MobEffectList.JUMP).getAmplifier() + 1) * 0.1F);
|
||||
}
|
||||
|
||||
this.j(true);
|
||||
this.am = true;
|
||||
this.al = true;
|
||||
if (f1 > 0.0F) {
|
||||
float f2 = MathHelper.sin(this.yaw * 3.1415927F / 180.0F);
|
||||
float f3 = MathHelper.cos(this.yaw * 3.1415927F / 180.0F);
|
||||
@ -921,8 +921,8 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
this.bt = 0.0F;
|
||||
}
|
||||
|
||||
this.X = 1.0F;
|
||||
this.aR = this.bl() * 0.1F;
|
||||
this.W = 1.0F;
|
||||
this.aQ = this.bk() * 0.1F;
|
||||
if (!this.world.isStatic) {
|
||||
this.i((float) this.getAttributeInstance(GenericAttributes.d).getValue());
|
||||
super.e(f, f1);
|
||||
@ -933,7 +933,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
this.j(false);
|
||||
}
|
||||
|
||||
this.aF = this.aG;
|
||||
this.aE = this.aF;
|
||||
double d0 = this.locX - this.lastX;
|
||||
double d1 = this.locZ - this.lastZ;
|
||||
float f4 = MathHelper.sqrt(d0 * d0 + d1 * d1) * 4.0F;
|
||||
@ -942,21 +942,21 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
f4 = 1.0F;
|
||||
}
|
||||
|
||||
this.aG += (f4 - this.aG) * 0.4F;
|
||||
this.aH += this.aG;
|
||||
this.aF += (f4 - this.aF) * 0.4F;
|
||||
this.aG += this.aF;
|
||||
} else {
|
||||
this.X = 0.5F;
|
||||
this.aR = 0.02F;
|
||||
this.W = 0.5F;
|
||||
this.aQ = 0.02F;
|
||||
super.e(f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
public void b(NBTTagCompound nbttagcompound) {
|
||||
super.b(nbttagcompound);
|
||||
nbttagcompound.setBoolean("EatingHaystack", this.ck());
|
||||
nbttagcompound.setBoolean("EatingHaystack", this.cm());
|
||||
nbttagcompound.setBoolean("ChestedHorse", this.hasChest());
|
||||
nbttagcompound.setBoolean("HasReproduced", this.cn());
|
||||
nbttagcompound.setBoolean("Bred", this.cm());
|
||||
nbttagcompound.setBoolean("HasReproduced", this.cp());
|
||||
nbttagcompound.setBoolean("Bred", this.co());
|
||||
nbttagcompound.setInt("Type", this.getType());
|
||||
nbttagcompound.setInt("Variant", this.getVariant());
|
||||
nbttagcompound.setInt("Temper", this.getTemper());
|
||||
@ -1008,7 +1008,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
this.maxDomestication = nbttagcompound.getInt("Bukkit.MaxDomestication");
|
||||
}
|
||||
// CraftBukkit end
|
||||
AttributeInstance attributeinstance = this.bc().a("Speed");
|
||||
AttributeInstance attributeinstance = this.bb().a("Speed");
|
||||
|
||||
if (attributeinstance != null) {
|
||||
this.getAttributeInstance(GenericAttributes.d).setValue(attributeinstance.b() * 0.25D);
|
||||
@ -1047,7 +1047,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
this.inventoryChest.setItem(0, new ItemStack(Items.SADDLE));
|
||||
}
|
||||
|
||||
this.cM();
|
||||
this.cO();
|
||||
}
|
||||
|
||||
public boolean mate(EntityAnimal entityanimal) {
|
||||
@ -1058,7 +1058,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
} else {
|
||||
EntityHorse entityhorse = (EntityHorse) entityanimal;
|
||||
|
||||
if (this.cR() && entityhorse.cR()) {
|
||||
if (this.cT() && entityhorse.cT()) {
|
||||
int i = this.getType();
|
||||
int j = entityhorse.getType();
|
||||
|
||||
@ -1108,13 +1108,13 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
|
||||
entityhorse1.setType(k);
|
||||
double d0 = this.getAttributeInstance(GenericAttributes.a).b() + entityageable.getAttributeInstance(GenericAttributes.a).b() + (double) this.cT();
|
||||
double d0 = this.getAttributeInstance(GenericAttributes.a).b() + entityageable.getAttributeInstance(GenericAttributes.a).b() + (double) this.cV();
|
||||
|
||||
entityhorse1.getAttributeInstance(GenericAttributes.a).setValue(d0 / 3.0D);
|
||||
double d1 = this.getAttributeInstance(attributeJumpStrength).b() + entityageable.getAttributeInstance(attributeJumpStrength).b() + this.cU();
|
||||
double d1 = this.getAttributeInstance(attributeJumpStrength).b() + entityageable.getAttributeInstance(attributeJumpStrength).b() + this.cW();
|
||||
|
||||
entityhorse1.getAttributeInstance(attributeJumpStrength).setValue(d1 / 3.0D);
|
||||
double d2 = this.getAttributeInstance(GenericAttributes.d).b() + entityageable.getAttributeInstance(GenericAttributes.d).b() + this.cV();
|
||||
double d2 = this.getAttributeInstance(GenericAttributes.d).b() + entityageable.getAttributeInstance(GenericAttributes.d).b() + this.cX();
|
||||
|
||||
entityhorse1.getAttributeInstance(GenericAttributes.d).setValue(d2 / 3.0D);
|
||||
return entityhorse1;
|
||||
@ -1150,9 +1150,9 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
|
||||
if (j != 4 && j != 3) {
|
||||
this.getAttributeInstance(GenericAttributes.a).setValue((double) this.cT());
|
||||
this.getAttributeInstance(GenericAttributes.a).setValue((double) this.cV());
|
||||
if (j == 0) {
|
||||
this.getAttributeInstance(GenericAttributes.d).setValue(this.cV());
|
||||
this.getAttributeInstance(GenericAttributes.d).setValue(this.cX());
|
||||
} else {
|
||||
this.getAttributeInstance(GenericAttributes.d).setValue(0.17499999701976776D);
|
||||
}
|
||||
@ -1162,7 +1162,7 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
}
|
||||
|
||||
if (j != 2 && j != 1) {
|
||||
this.getAttributeInstance(attributeJumpStrength).setValue(this.cU());
|
||||
this.getAttributeInstance(attributeJumpStrength).setValue(this.cW());
|
||||
} else {
|
||||
this.getAttributeInstance(attributeJumpStrength).setValue(0.5D);
|
||||
}
|
||||
@ -1171,12 +1171,12 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
return (GroupDataEntity) object;
|
||||
}
|
||||
|
||||
protected boolean bk() {
|
||||
protected boolean bj() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void w(int i) {
|
||||
if (this.cs()) {
|
||||
if (this.cu()) {
|
||||
// CraftBukkit start - fire HorseJumpEvent, use event power
|
||||
if (i < 0) {
|
||||
i = 0;
|
||||
@ -1189,40 +1189,40 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
power = 0.4F + 0.4F * (float) i / 90.0F;
|
||||
}
|
||||
|
||||
org.bukkit.event.entity.HorseJumpEvent event = org.bukkit.craftbukkit.v1_7_R1.event.CraftEventFactory.callHorseJumpEvent(this, power);
|
||||
org.bukkit.event.entity.HorseJumpEvent event = org.bukkit.craftbukkit.v1_7_R2.event.CraftEventFactory.callHorseJumpEvent(this, power);
|
||||
if (!event.isCancelled()) {
|
||||
this.bI = true;
|
||||
this.cS();
|
||||
this.cU();
|
||||
this.bt = event.getPower();
|
||||
}
|
||||
// CraftBukkit end
|
||||
}
|
||||
}
|
||||
|
||||
public void ac() {
|
||||
super.ac();
|
||||
public void ab() {
|
||||
super.ab();
|
||||
if (this.bM > 0.0F) {
|
||||
float f = MathHelper.sin(this.aN * 3.1415927F / 180.0F);
|
||||
float f1 = MathHelper.cos(this.aN * 3.1415927F / 180.0F);
|
||||
float f = MathHelper.sin(this.aM * 3.1415927F / 180.0F);
|
||||
float f1 = MathHelper.cos(this.aM * 3.1415927F / 180.0F);
|
||||
float f2 = 0.7F * this.bM;
|
||||
float f3 = 0.15F * this.bM;
|
||||
|
||||
this.passenger.setPosition(this.locX + (double) (f2 * f), this.locY + this.ae() + this.passenger.ad() + (double) f3, this.locZ - (double) (f2 * f1));
|
||||
this.passenger.setPosition(this.locX + (double) (f2 * f), this.locY + this.ad() + this.passenger.ac() + (double) f3, this.locZ - (double) (f2 * f1));
|
||||
if (this.passenger instanceof EntityLiving) {
|
||||
((EntityLiving) this.passenger).aN = this.aN;
|
||||
((EntityLiving) this.passenger).aM = this.aM;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private float cT() {
|
||||
private float cV() {
|
||||
return 15.0F + (float) this.random.nextInt(8) + (float) this.random.nextInt(9);
|
||||
}
|
||||
|
||||
private double cU() {
|
||||
private double cW() {
|
||||
return 0.4000000059604645D + this.random.nextDouble() * 0.2D + this.random.nextDouble() * 0.2D + this.random.nextDouble() * 0.2D;
|
||||
}
|
||||
|
||||
private double cV() {
|
||||
private double cX() {
|
||||
return (0.44999998807907104D + this.random.nextDouble() * 0.3D + this.random.nextDouble() * 0.3D + this.random.nextDouble() * 0.3D) * 0.25D;
|
||||
}
|
||||
|
||||
@ -1233,4 +1233,4 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener {
|
||||
public boolean h_() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package net.minecraft.server.v1_7_R1;
|
||||
package net.minecraft.server.v1_7_R2;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
@ -9,9 +9,9 @@ import net.minecraft.util.com.google.common.base.Charsets;
|
||||
import net.minecraft.util.com.mojang.authlib.GameProfile;
|
||||
|
||||
// CraftBukkit start
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftHumanEntity;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftItem;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.inventory.CraftItemStack;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftHumanEntity;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftItem;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.inventory.CraftItemStack;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.entity.EntityCombustByEntityEvent;
|
||||
import org.bukkit.event.player.PlayerBedEnterEvent;
|
||||
@ -27,16 +27,16 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
public Container defaultContainer;
|
||||
public Container activeContainer;
|
||||
protected FoodMetaData foodData = new FoodMetaData(this); // CraftBukkit - add "this" to constructor
|
||||
protected int br;
|
||||
protected int bq;
|
||||
public float br;
|
||||
public float bs;
|
||||
public float bt;
|
||||
public int bu;
|
||||
public int bt;
|
||||
public double bu;
|
||||
public double bv;
|
||||
public double bw;
|
||||
public double bx;
|
||||
public double by;
|
||||
public double bz;
|
||||
public double bA;
|
||||
// CraftBukkit start
|
||||
public boolean sleeping; // protected -> public
|
||||
public boolean fauxSleeping;
|
||||
@ -48,22 +48,22 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
public ChunkCoordinates bC;
|
||||
public ChunkCoordinates bB;
|
||||
public int sleepTicks; // CraftBukkit - private -> public
|
||||
public float bC;
|
||||
public float bD;
|
||||
public float bE;
|
||||
private ChunkCoordinates c;
|
||||
private boolean d;
|
||||
private ChunkCoordinates e;
|
||||
public PlayerAbilities abilities = new PlayerAbilities();
|
||||
public int oldLevel = -1; // CraftBukkit
|
||||
public int oldLevel = -1; // CraftBukkit - add field
|
||||
public int expLevel;
|
||||
public int expTotal;
|
||||
public float exp;
|
||||
private ItemStack f;
|
||||
private int g;
|
||||
protected float bJ = 0.1F;
|
||||
protected float bK = 0.02F;
|
||||
protected float bI = 0.1F;
|
||||
protected float bJ = 0.02F;
|
||||
private int h;
|
||||
private final GameProfile i;
|
||||
public EntityFishingHook hookedFish;
|
||||
@ -78,13 +78,13 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
ChunkCoordinates chunkcoordinates = world.getSpawn();
|
||||
|
||||
this.setPositionRotation((double) chunkcoordinates.x + 0.5D, (double) (chunkcoordinates.y + 1), (double) chunkcoordinates.z + 0.5D, 0.0F, 0.0F);
|
||||
this.ba = 180.0F;
|
||||
this.az = 180.0F;
|
||||
this.maxFireTicks = 20;
|
||||
}
|
||||
|
||||
protected void aD() {
|
||||
super.aD();
|
||||
this.bc().b(GenericAttributes.e).setValue(1.0D);
|
||||
protected void aC() {
|
||||
super.aC();
|
||||
this.bb().b(GenericAttributes.e).setValue(1.0D);
|
||||
}
|
||||
|
||||
protected void c() {
|
||||
@ -94,19 +94,19 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.datawatcher.a(18, Integer.valueOf(0));
|
||||
}
|
||||
|
||||
public boolean bw() {
|
||||
public boolean bx() {
|
||||
return this.f != null;
|
||||
}
|
||||
|
||||
public void by() {
|
||||
public void bz() {
|
||||
if (this.f != null) {
|
||||
this.f.b(this.world, this, this.g);
|
||||
}
|
||||
|
||||
this.bz();
|
||||
this.bA();
|
||||
}
|
||||
|
||||
public void bz() {
|
||||
public void bA() {
|
||||
this.f = null;
|
||||
this.g = 0;
|
||||
if (!this.world.isStatic) {
|
||||
@ -115,7 +115,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
|
||||
public boolean isBlocking() {
|
||||
return this.bw() && this.f.getItem().d(this.f) == EnumAnimation.BLOCK;
|
||||
return this.bx() && this.f.getItem().d(this.f) == EnumAnimation.BLOCK;
|
||||
}
|
||||
|
||||
public void h() {
|
||||
@ -131,12 +131,12 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.p();
|
||||
}
|
||||
} else {
|
||||
this.bz();
|
||||
this.bA();
|
||||
}
|
||||
}
|
||||
|
||||
if (this.bu > 0) {
|
||||
--this.bu;
|
||||
if (this.bt > 0) {
|
||||
--this.bt;
|
||||
}
|
||||
|
||||
if (this.isSleeping()) {
|
||||
@ -148,7 +148,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
if (!this.world.isStatic) {
|
||||
if (!this.j()) {
|
||||
this.a(true, true, false);
|
||||
} else if (this.world.v()) {
|
||||
} else if (this.world.w()) {
|
||||
this.a(false, true, true);
|
||||
}
|
||||
}
|
||||
@ -169,41 +169,41 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.extinguish();
|
||||
}
|
||||
|
||||
this.bu = this.bx;
|
||||
this.bv = this.by;
|
||||
this.bw = this.bz;
|
||||
this.bx = this.bA;
|
||||
double d0 = this.locX - this.by;
|
||||
double d1 = this.locY - this.bz;
|
||||
double d2 = this.locZ - this.bA;
|
||||
double d0 = this.locX - this.bx;
|
||||
double d1 = this.locY - this.by;
|
||||
double d2 = this.locZ - this.bz;
|
||||
double d3 = 10.0D;
|
||||
|
||||
if (d0 > d3) {
|
||||
this.bv = this.by = this.locX;
|
||||
this.bu = this.bx = this.locX;
|
||||
}
|
||||
|
||||
if (d2 > d3) {
|
||||
this.bx = this.bA = this.locZ;
|
||||
this.bw = this.bz = this.locZ;
|
||||
}
|
||||
|
||||
if (d1 > d3) {
|
||||
this.bw = this.bz = this.locY;
|
||||
this.bv = this.by = this.locY;
|
||||
}
|
||||
|
||||
if (d0 < -d3) {
|
||||
this.bv = this.by = this.locX;
|
||||
this.bu = this.by = this.locX;
|
||||
}
|
||||
|
||||
if (d2 < -d3) {
|
||||
this.bx = this.bA = this.locZ;
|
||||
this.bw = this.bz = this.locZ;
|
||||
}
|
||||
|
||||
if (d1 < -d3) {
|
||||
this.bw = this.bz = this.locY;
|
||||
this.bv = this.bz = this.locY;
|
||||
}
|
||||
|
||||
this.by += d0 * 0.25D;
|
||||
this.bA += d2 * 0.25D;
|
||||
this.bz += d1 * 0.25D;
|
||||
this.bx += d0 * 0.25D;
|
||||
this.bz += d2 * 0.25D;
|
||||
this.by += d1 * 0.25D;
|
||||
if (this.vehicle == null) {
|
||||
this.e = null;
|
||||
}
|
||||
@ -214,19 +214,19 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
}
|
||||
|
||||
public int D() {
|
||||
public int C() {
|
||||
return this.abilities.isInvulnerable ? 0 : 80;
|
||||
}
|
||||
|
||||
protected String H() {
|
||||
protected String G() {
|
||||
return "game.player.swim";
|
||||
}
|
||||
|
||||
protected String O() {
|
||||
protected String N() {
|
||||
return "game.player.swim.splash";
|
||||
}
|
||||
|
||||
public int ai() {
|
||||
public int ah() {
|
||||
return 10;
|
||||
}
|
||||
|
||||
@ -241,11 +241,11 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
|
||||
if (itemstack.o() == EnumAnimation.EAT) {
|
||||
for (int j = 0; j < i; ++j) {
|
||||
Vec3D vec3d = this.world.getVec3DPool().create(((double) this.random.nextFloat() - 0.5D) * 0.1D, Math.random() * 0.1D + 0.1D, 0.0D);
|
||||
Vec3D vec3d = Vec3D.a(((double) this.random.nextFloat() - 0.5D) * 0.1D, Math.random() * 0.1D + 0.1D, 0.0D);
|
||||
|
||||
vec3d.a(-this.pitch * 3.1415927F / 180.0F);
|
||||
vec3d.b(-this.yaw * 3.1415927F / 180.0F);
|
||||
Vec3D vec3d1 = this.world.getVec3DPool().create(((double) this.random.nextFloat() - 0.5D) * 0.3D, (double) (-this.random.nextFloat()) * 0.6D - 0.3D, 0.6D);
|
||||
Vec3D vec3d1 = Vec3D.a(((double) this.random.nextFloat() - 0.5D) * 0.3D, (double) (-this.random.nextFloat()) * 0.6D - 0.3D, 0.6D);
|
||||
|
||||
vec3d1.a(-this.pitch * 3.1415927F / 180.0F);
|
||||
vec3d1.b(-this.yaw * 3.1415927F / 180.0F);
|
||||
@ -256,7 +256,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
s = s + "_" + itemstack.getData();
|
||||
}
|
||||
|
||||
this.world.addParticle(s, vec3d1.c, vec3d1.d, vec3d1.e, vec3d.c, vec3d.d + 0.05D, vec3d.e);
|
||||
this.world.addParticle(s, vec3d1.a, vec3d1.b, vec3d1.c, vec3d.a, vec3d.b + 0.05D, vec3d.c);
|
||||
}
|
||||
|
||||
this.makeSound("random.eat", 0.5F + 0.5F * (float) this.random.nextInt(2), (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
|
||||
@ -268,7 +268,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.c(this.f, 16);
|
||||
int i = this.f.count;
|
||||
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - fire PlayerItemConsumeEvent
|
||||
org.bukkit.inventory.ItemStack craftItem = CraftItemStack.asBukkitCopy(this.f);
|
||||
PlayerItemConsumeEvent event = new PlayerItemConsumeEvent((Player) this.getBukkitEntity(), craftItem);
|
||||
world.getServer().getPluginManager().callEvent(event);
|
||||
@ -302,11 +302,11 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
}
|
||||
|
||||
this.bz();
|
||||
this.bA();
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean bh() {
|
||||
protected boolean bg() {
|
||||
return this.getHealth() <= 0.0F || this.isSleeping();
|
||||
}
|
||||
|
||||
@ -339,7 +339,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
*/
|
||||
super.setPassengerOf(entity);
|
||||
if (!this.world.isStatic && this.vehicle == null) {
|
||||
this.l(originalVehicle);
|
||||
this.m(originalVehicle);
|
||||
}
|
||||
// CraftBukkit end
|
||||
} else {
|
||||
@ -347,7 +347,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
}
|
||||
|
||||
public void ab() {
|
||||
public void aa() {
|
||||
if (!this.world.isStatic && this.isSneaking()) {
|
||||
this.mount((Entity) null);
|
||||
this.setSneaking(false);
|
||||
@ -358,26 +358,26 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
float f = this.yaw;
|
||||
float f1 = this.pitch;
|
||||
|
||||
super.ab();
|
||||
this.bs = this.bt;
|
||||
this.bt = 0.0F;
|
||||
super.aa();
|
||||
this.br = this.bs;
|
||||
this.bs = 0.0F;
|
||||
this.l(this.locX - d0, this.locY - d1, this.locZ - d2);
|
||||
if (this.vehicle instanceof EntityPig) {
|
||||
this.pitch = f1;
|
||||
this.yaw = f;
|
||||
this.aN = ((EntityPig) this.vehicle).aN;
|
||||
this.aM = ((EntityPig) this.vehicle).aM;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void bq() {
|
||||
super.bq();
|
||||
this.bb();
|
||||
protected void bp() {
|
||||
super.bp();
|
||||
this.ba();
|
||||
}
|
||||
|
||||
public void e() {
|
||||
if (this.br > 0) {
|
||||
--this.br;
|
||||
if (this.bq > 0) {
|
||||
--this.bq;
|
||||
}
|
||||
|
||||
if (this.world.difficulty == EnumDifficulty.PEACEFUL && this.getHealth() < this.getMaxHealth() && this.world.getGameRules().getBoolean("naturalRegeneration") && this.ticksLived % 20 * 12 == 0) {
|
||||
@ -386,7 +386,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
|
||||
this.inventory.k();
|
||||
this.bs = this.bt;
|
||||
this.br = this.bs;
|
||||
super.e();
|
||||
AttributeInstance attributeinstance = this.getAttributeInstance(GenericAttributes.d);
|
||||
|
||||
@ -394,15 +394,15 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
attributeinstance.setValue((double) this.abilities.b());
|
||||
}
|
||||
|
||||
this.aR = this.bK;
|
||||
this.aQ = this.bJ;
|
||||
if (this.isSprinting()) {
|
||||
this.aR = (float) ((double) this.aR + (double) this.bK * 0.3D);
|
||||
this.aQ = (float) ((double) this.aQ + (double) this.bJ * 0.3D);
|
||||
}
|
||||
|
||||
this.i((float) attributeinstance.getValue());
|
||||
float f = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ);
|
||||
// CraftBukkit - Math -> TrigMath
|
||||
float f1 = (float) org.bukkit.craftbukkit.v1_7_R1.TrigMath.atan(-this.motY * 0.20000000298023224D) * 15.0F;
|
||||
float f1 = (float) org.bukkit.craftbukkit.v1_7_R2.TrigMath.atan(-this.motY * 0.20000000298023224D) * 15.0F;
|
||||
|
||||
if (f > 0.1F) {
|
||||
f = 0.1F;
|
||||
@ -416,8 +416,8 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
f1 = 0.0F;
|
||||
}
|
||||
|
||||
this.bt += (f - this.bt) * 0.4F;
|
||||
this.aK += (f1 - this.aK) * 0.8F;
|
||||
this.bs += (f - this.bs) * 0.4F;
|
||||
this.aJ += (f1 - this.aJ) * 0.8F;
|
||||
if (this.getHealth() > 0.0F) {
|
||||
AxisAlignedBB axisalignedbb = null;
|
||||
|
||||
@ -434,14 +434,14 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
Entity entity = (Entity) list.get(i);
|
||||
|
||||
if (!entity.dead) {
|
||||
this.r(entity);
|
||||
this.d(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void r(Entity entity) {
|
||||
private void d(Entity entity) {
|
||||
entity.b_(this);
|
||||
}
|
||||
|
||||
@ -473,8 +473,8 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
|
||||
if (damagesource != null) {
|
||||
this.motX = (double) (-MathHelper.cos((this.aA + this.yaw) * 3.1415927F / 180.0F) * 0.1F);
|
||||
this.motZ = (double) (-MathHelper.sin((this.aA + this.yaw) * 3.1415927F / 180.0F) * 0.1F);
|
||||
this.motX = (double) (-MathHelper.cos((this.az + this.yaw) * 3.1415927F / 180.0F) * 0.1F);
|
||||
this.motZ = (double) (-MathHelper.sin((this.az + this.yaw) * 3.1415927F / 180.0F) * 0.1F);
|
||||
} else {
|
||||
this.motX = this.motZ = 0.0D;
|
||||
}
|
||||
@ -483,11 +483,11 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.a(StatisticList.v, 1);
|
||||
}
|
||||
|
||||
protected String aT() {
|
||||
protected String aS() {
|
||||
return "game.player.hurt";
|
||||
}
|
||||
|
||||
protected String aU() {
|
||||
protected String aT() {
|
||||
return "game.player.die";
|
||||
}
|
||||
|
||||
@ -557,7 +557,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
entityitem.motZ += Math.sin((double) f1) * (double) f;
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - fire PlayerDropItemEvent
|
||||
Player player = (Player) this.getBukkitEntity();
|
||||
CraftItem drop = new CraftItem(this.world.getServer(), entityitem);
|
||||
|
||||
@ -635,7 +635,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.expTotal = nbttagcompound.getInt("XpTotal");
|
||||
this.setScore(nbttagcompound.getInt("Score"));
|
||||
if (this.sleeping) {
|
||||
this.bC = new ChunkCoordinates(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ));
|
||||
this.bB = new ChunkCoordinates(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ));
|
||||
this.a(true, true, false);
|
||||
}
|
||||
|
||||
@ -711,7 +711,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
} else if (this.abilities.isInvulnerable && !damagesource.ignoresInvulnerability()) {
|
||||
return false;
|
||||
} else {
|
||||
this.aV = 0;
|
||||
this.aU = 0;
|
||||
if (this.getHealth() <= 0.0F) {
|
||||
return false;
|
||||
} else {
|
||||
@ -779,11 +779,11 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.inventory.a(f);
|
||||
}
|
||||
|
||||
public int aV() {
|
||||
public int aU() {
|
||||
return this.inventory.l();
|
||||
}
|
||||
|
||||
public float bC() {
|
||||
public float bD() {
|
||||
int i = 0;
|
||||
ItemStack[] aitemstack = this.inventory.armor;
|
||||
int j = aitemstack.length;
|
||||
@ -809,14 +809,14 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
f = this.c(damagesource, f);
|
||||
float f1 = f;
|
||||
|
||||
f = Math.max(f - this.bs(), 0.0F);
|
||||
this.m(this.bs() - (f1 - f));
|
||||
f = Math.max(f - this.br(), 0.0F);
|
||||
this.m(this.br() - (f1 - f));
|
||||
if (f != 0.0F) {
|
||||
this.a(damagesource.f());
|
||||
float f2 = this.getHealth();
|
||||
|
||||
this.setHealth(this.getHealth() - f);
|
||||
this.aW().a(damagesource, f2, f);
|
||||
this.aV().a(damagesource, f2, f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -837,8 +837,8 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
|
||||
public void b(ItemStack itemstack) {}
|
||||
|
||||
public boolean p(Entity entity) {
|
||||
ItemStack itemstack = this.bD();
|
||||
public boolean q(Entity entity) {
|
||||
ItemStack itemstack = this.bE();
|
||||
ItemStack itemstack1 = itemstack != null ? itemstack.cloneItemStack() : null;
|
||||
|
||||
if (!entity.c(this)) {
|
||||
@ -850,7 +850,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
if (itemstack.a(this, (EntityLiving) entity)) {
|
||||
// CraftBukkit - bypass infinite items; <= 0 -> == 0
|
||||
if (itemstack.count == 0 && !this.abilities.canInstantlyBuild) {
|
||||
this.bE();
|
||||
this.bF();
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -859,9 +859,9 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
|
||||
return false;
|
||||
} else {
|
||||
if (itemstack != null && itemstack == this.bD()) {
|
||||
if (itemstack != null && itemstack == this.bE()) {
|
||||
if (itemstack.count <= 0 && !this.abilities.canInstantlyBuild) {
|
||||
this.bE();
|
||||
this.bF();
|
||||
} else if (itemstack.count < itemstack1.count && this.abilities.canInstantlyBuild) {
|
||||
itemstack.count = itemstack1.count;
|
||||
}
|
||||
@ -871,21 +871,21 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack bD() {
|
||||
public ItemStack bE() {
|
||||
return this.inventory.getItemInHand();
|
||||
}
|
||||
|
||||
public void bE() {
|
||||
public void bF() {
|
||||
this.inventory.setItem(this.inventory.itemInHandIndex, (ItemStack) null);
|
||||
}
|
||||
|
||||
public double ad() {
|
||||
public double ac() {
|
||||
return (double) (this.height - 0.5F);
|
||||
}
|
||||
|
||||
public void attack(Entity entity) {
|
||||
if (entity.av()) {
|
||||
if (!entity.i(this)) {
|
||||
if (entity.au()) {
|
||||
if (!entity.j(this)) {
|
||||
float f = (float) this.getAttributeInstance(GenericAttributes.e).getValue();
|
||||
int i = 0;
|
||||
float f1 = 0.0F;
|
||||
@ -900,7 +900,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
|
||||
if (f > 0.0F || f1 > 0.0F) {
|
||||
boolean flag = this.fallDistance > 0.0F && !this.onGround && !this.h_() && !this.M() && !this.hasEffect(MobEffectList.BLINDNESS) && this.vehicle == null && entity instanceof EntityLiving;
|
||||
boolean flag = this.fallDistance > 0.0F && !this.onGround && !this.h_() && !this.L() && !this.hasEffect(MobEffectList.BLINDNESS) && this.vehicle == null && entity instanceof EntityLiving;
|
||||
|
||||
if (flag && f > 0.0F) {
|
||||
f *= 1.5F;
|
||||
@ -937,13 +937,13 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.a((Statistic) AchievementList.F);
|
||||
}
|
||||
|
||||
this.k(entity);
|
||||
this.l(entity);
|
||||
if (entity instanceof EntityLiving) {
|
||||
EnchantmentManager.a((EntityLiving) entity, (Entity) this);
|
||||
}
|
||||
|
||||
EnchantmentManager.b(this, entity);
|
||||
ItemStack itemstack = this.bD();
|
||||
ItemStack itemstack = this.bE();
|
||||
Object object = entity;
|
||||
|
||||
if (entity instanceof EntityComplexPart) {
|
||||
@ -958,7 +958,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
itemstack.a((EntityLiving) object, this);
|
||||
// CraftBukkit - bypass infinite items; <= 0 -> == 0
|
||||
if (itemstack.count == 0) {
|
||||
this.bE();
|
||||
this.bF();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1015,7 +1015,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
return EnumBedResult.NOT_POSSIBLE_HERE;
|
||||
}
|
||||
|
||||
if (this.world.v()) {
|
||||
if (this.world.w()) {
|
||||
return EnumBedResult.NOT_POSSIBLE_NOW;
|
||||
}
|
||||
|
||||
@ -1025,18 +1025,18 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
|
||||
double d0 = 8.0D;
|
||||
double d1 = 5.0D;
|
||||
List list = this.world.a(EntityMonster.class, AxisAlignedBB.a().a((double) i - d0, (double) j - d1, (double) k - d0, (double) i + d0, (double) j + d1, (double) k + d0));
|
||||
List list = this.world.a(EntityMonster.class, AxisAlignedBB.a((double) i - d0, (double) j - d1, (double) k - d0, (double) i + d0, (double) j + d1, (double) k + d0));
|
||||
|
||||
if (!list.isEmpty()) {
|
||||
return EnumBedResult.NOT_SAFE;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.am()) {
|
||||
if (this.al()) {
|
||||
this.mount((Entity) null);
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - fire PlayerBedEnterEvent
|
||||
if (this.getBukkitEntity() instanceof Player) {
|
||||
Player player = (Player) this.getBukkitEntity();
|
||||
org.bukkit.block.Block bed = this.world.getWorld().getBlockAt(i, j, k);
|
||||
@ -1083,7 +1083,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
|
||||
this.sleeping = true;
|
||||
this.sleepTicks = 0;
|
||||
this.bC = new ChunkCoordinates(i, j, k);
|
||||
this.bB = new ChunkCoordinates(i, j, k);
|
||||
this.motX = this.motZ = this.motY = 0.0D;
|
||||
if (!this.world.isStatic) {
|
||||
this.world.everyoneSleeping();
|
||||
@ -1093,31 +1093,31 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
|
||||
private void w(int i) {
|
||||
this.bC = 0.0F;
|
||||
this.bD = 0.0F;
|
||||
this.bE = 0.0F;
|
||||
switch (i) {
|
||||
case 0:
|
||||
this.bE = -1.8F;
|
||||
this.bD = -1.8F;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
this.bD = 1.8F;
|
||||
this.bC = 1.8F;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
this.bE = 1.8F;
|
||||
this.bD = 1.8F;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
this.bD = -1.8F;
|
||||
this.bC = -1.8F;
|
||||
}
|
||||
}
|
||||
|
||||
public void a(boolean flag, boolean flag1, boolean flag2) {
|
||||
this.a(0.6F, 1.8F);
|
||||
this.e_();
|
||||
ChunkCoordinates chunkcoordinates = this.bC;
|
||||
ChunkCoordinates chunkcoordinates1 = this.bC;
|
||||
ChunkCoordinates chunkcoordinates = this.bB;
|
||||
ChunkCoordinates chunkcoordinates1 = this.bB;
|
||||
|
||||
if (chunkcoordinates != null && this.world.getType(chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z) == Blocks.BED) {
|
||||
BlockBed.a(this.world, chunkcoordinates.x, chunkcoordinates.y, chunkcoordinates.z, false);
|
||||
@ -1134,7 +1134,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.world.everyoneSleeping();
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - fire PlayerBedLeaveEvent
|
||||
if (this.getBukkitEntity() instanceof Player) {
|
||||
Player player = (Player) this.getBukkitEntity();
|
||||
|
||||
@ -1157,16 +1157,16 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
|
||||
if (flag2) {
|
||||
this.setRespawnPosition(this.bC, false);
|
||||
this.setRespawnPosition(this.bB, false);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean j() {
|
||||
return this.world.getType(this.bC.x, this.bC.y, this.bC.z) == Blocks.BED;
|
||||
return this.world.getType(this.bB.x, this.bB.y, this.bB.z) == Blocks.BED;
|
||||
}
|
||||
|
||||
public static ChunkCoordinates getBed(World world, ChunkCoordinates chunkcoordinates, boolean flag) {
|
||||
IChunkProvider ichunkprovider = world.K();
|
||||
IChunkProvider ichunkprovider = world.L();
|
||||
|
||||
ichunkprovider.getChunkAt(chunkcoordinates.x - 3 >> 4, chunkcoordinates.z - 3 >> 4);
|
||||
ichunkprovider.getChunkAt(chunkcoordinates.x + 3 >> 4, chunkcoordinates.z - 3 >> 4);
|
||||
@ -1232,8 +1232,8 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
|
||||
public void a(Statistic statistic, int i) {}
|
||||
|
||||
public void bj() {
|
||||
super.bj();
|
||||
public void bi() {
|
||||
super.bi();
|
||||
this.a(StatisticList.r, 1);
|
||||
if (this.isSprinting()) {
|
||||
this.a(0.8F);
|
||||
@ -1249,12 +1249,12 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
|
||||
if (this.abilities.isFlying && this.vehicle == null) {
|
||||
double d3 = this.motY;
|
||||
float f2 = this.aR;
|
||||
float f2 = this.aQ;
|
||||
|
||||
this.aR = this.abilities.a();
|
||||
this.aQ = this.abilities.a();
|
||||
super.e(f, f1);
|
||||
this.motY = d3 * 0.6D;
|
||||
this.aR = f2;
|
||||
this.aQ = f2;
|
||||
} else {
|
||||
super.e(f, f1);
|
||||
}
|
||||
@ -1262,7 +1262,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.checkMovement(this.locX - d0, this.locY - d1, this.locZ - d2);
|
||||
}
|
||||
|
||||
public float bl() {
|
||||
public float bk() {
|
||||
return (float) this.getAttributeInstance(GenericAttributes.d).getValue();
|
||||
}
|
||||
|
||||
@ -1276,7 +1276,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.a(StatisticList.m, i);
|
||||
this.a(0.015F * (float) i * 0.01F);
|
||||
}
|
||||
} else if (this.M()) {
|
||||
} else if (this.L()) {
|
||||
i = Math.round(MathHelper.sqrt(d0 * d0 + d2 * d2) * 100.0F);
|
||||
if (i > 0) {
|
||||
this.a(StatisticList.i, i);
|
||||
@ -1348,16 +1348,16 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
|
||||
int i = EntityTypes.a(entityliving);
|
||||
MonsterEggInfo monsteregginfo = (MonsterEggInfo) EntityTypes.a.get(Integer.valueOf(i));
|
||||
MonsterEggInfo monsteregginfo = (MonsterEggInfo) EntityTypes.eggInfo.get(Integer.valueOf(i));
|
||||
|
||||
if (monsteregginfo != null) {
|
||||
this.a(monsteregginfo.d, 1);
|
||||
this.a(monsteregginfo.killEntityStatistic, 1);
|
||||
}
|
||||
}
|
||||
|
||||
public void as() {
|
||||
public void ar() {
|
||||
if (!this.abilities.isFlying) {
|
||||
super.as();
|
||||
super.ar();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1417,7 +1417,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
return (flag || this.foodData.c()) && !this.abilities.isInvulnerable;
|
||||
}
|
||||
|
||||
public boolean bP() {
|
||||
public boolean bQ() {
|
||||
return this.getHealth() > 0.0F && this.getHealth() < this.getMaxHealth();
|
||||
}
|
||||
|
||||
@ -1442,8 +1442,8 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
return true;
|
||||
}
|
||||
|
||||
if (this.bD() != null) {
|
||||
ItemStack itemstack = this.bD();
|
||||
if (this.bE() != null) {
|
||||
ItemStack itemstack = this.bE();
|
||||
|
||||
if (itemstack.b(block) || itemstack.a(block) > 1.0F) {
|
||||
return true;
|
||||
@ -1482,7 +1482,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.expTotal = entityhuman.expTotal;
|
||||
this.exp = entityhuman.exp;
|
||||
this.setScore(entityhuman.getScore());
|
||||
this.ar = entityhuman.ar;
|
||||
this.aq = entityhuman.aq;
|
||||
} else if (this.world.getGameRules().getBoolean("keepInventory")) {
|
||||
this.inventory.b(entityhuman.inventory);
|
||||
this.expLevel = entityhuman.expLevel;
|
||||
@ -1518,7 +1518,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
return i == 0 ? this.inventory.getItemInHand() : this.inventory.armor[i - 1];
|
||||
}
|
||||
|
||||
public ItemStack be() {
|
||||
public ItemStack bd() {
|
||||
return this.inventory.getItemInHand();
|
||||
}
|
||||
|
||||
@ -1530,7 +1530,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
return this.inventory.armor;
|
||||
}
|
||||
|
||||
public boolean aC() {
|
||||
public boolean aB() {
|
||||
return !this.abilities.isFlying;
|
||||
}
|
||||
|
||||
@ -1543,10 +1543,10 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
}
|
||||
|
||||
public IChatBaseComponent getScoreboardDisplayName() {
|
||||
// CraftBukkit todo: fun
|
||||
// CraftBukkit - todo: fun
|
||||
ChatComponentText chatcomponenttext = new ChatComponentText(ScoreboardTeam.getPlayerDisplayName(this.getScoreboardTeam(), this.getName()));
|
||||
|
||||
chatcomponenttext.b().a(new ChatClickable(EnumClickAction.SUGGEST_COMMAND, "/msg " + this.getName() + " "));
|
||||
chatcomponenttext.getChatModifier().setChatClickable(new ChatClickable(EnumClickAction.SUGGEST_COMMAND, "/msg " + this.getName() + " "));
|
||||
return chatcomponenttext;
|
||||
}
|
||||
|
||||
@ -1558,7 +1558,7 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
this.getDataWatcher().watch(17, Float.valueOf(f));
|
||||
}
|
||||
|
||||
public float bs() {
|
||||
public float br() {
|
||||
return this.getDataWatcher().getFloat(17);
|
||||
}
|
||||
|
||||
@ -1571,4 +1571,4 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
||||
|
||||
return uuid;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,11 +1,11 @@
|
||||
package net.minecraft.server.v1_7_R1;
|
||||
package net.minecraft.server.v1_7_R2;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
// CraftBukkit start
|
||||
import org.bukkit.craftbukkit.v1_7_R1.event.CraftEventFactory;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.event.CraftEventFactory;
|
||||
import org.bukkit.event.entity.EntityUnleashEvent;
|
||||
import org.bukkit.event.entity.EntityUnleashEvent.UnleashReason;
|
||||
// CraftBukkit end
|
||||
@ -14,9 +14,9 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
|
||||
public int a_;
|
||||
protected int b;
|
||||
private ControllerLook h;
|
||||
private ControllerLook lookController;
|
||||
private ControllerMove moveController;
|
||||
private ControllerJump lookController;
|
||||
private ControllerJump bm;
|
||||
private EntityAIBodyControl bn;
|
||||
private Navigation navigation;
|
||||
protected final PathfinderGoalSelector goalSelector;
|
||||
@ -42,9 +42,9 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
super(world);
|
||||
this.goalSelector = new PathfinderGoalSelector(world != null && world.methodProfiler != null ? world.methodProfiler : null);
|
||||
this.targetSelector = new PathfinderGoalSelector(world != null && world.methodProfiler != null ? world.methodProfiler : null);
|
||||
this.h = new ControllerLook(this);
|
||||
this.lookController = new ControllerLook(this);
|
||||
this.moveController = new ControllerMove(this);
|
||||
this.lookController = new ControllerJump(this);
|
||||
this.bm = new ControllerJump(this);
|
||||
this.bn = new EntityAIBodyControl(this);
|
||||
this.navigation = new Navigation(this, world);
|
||||
this.bq = new EntitySenses(this);
|
||||
@ -54,13 +54,13 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
}
|
||||
}
|
||||
|
||||
protected void aD() {
|
||||
super.aD();
|
||||
this.bc().b(GenericAttributes.b).setValue(16.0D);
|
||||
protected void aC() {
|
||||
super.aC();
|
||||
this.bb().b(GenericAttributes.b).setValue(16.0D);
|
||||
}
|
||||
|
||||
public ControllerLook getControllerLook() {
|
||||
return this.h;
|
||||
return this.lookController;
|
||||
}
|
||||
|
||||
public ControllerMove getControllerMove() {
|
||||
@ -68,7 +68,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
}
|
||||
|
||||
public ControllerJump getControllerJump() {
|
||||
return this.lookController;
|
||||
return this.bm;
|
||||
}
|
||||
|
||||
public Navigation getNavigation() {
|
||||
@ -107,12 +107,12 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
String s = this.t();
|
||||
|
||||
if (s != null) {
|
||||
this.makeSound(s, this.bf(), this.bg());
|
||||
this.makeSound(s, this.be(), this.bf());
|
||||
}
|
||||
}
|
||||
|
||||
public void C() {
|
||||
super.C();
|
||||
public void B() {
|
||||
super.B();
|
||||
this.world.methodProfiler.a("mobBaseTick");
|
||||
if (this.isAlive() && !Silent && this.random.nextInt(1000) < this.a_++) {
|
||||
this.a_ = -this.q();
|
||||
@ -158,7 +158,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
}
|
||||
|
||||
protected float f(float f, float f1) {
|
||||
if (this.bk()) {
|
||||
if (this.bj()) {
|
||||
this.bn.a();
|
||||
return f1;
|
||||
} else {
|
||||
@ -187,7 +187,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
}
|
||||
|
||||
if (j > 0) {
|
||||
loot.add(new org.bukkit.inventory.ItemStack(org.bukkit.craftbukkit.v1_7_R1.util.CraftMagicNumbers.getMaterial(item), j));
|
||||
loot.add(new org.bukkit.inventory.ItemStack(org.bukkit.craftbukkit.v1_7_R2.util.CraftMagicNumbers.getMaterial(item), j));
|
||||
}
|
||||
}
|
||||
|
||||
@ -198,7 +198,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
if (k < 5) {
|
||||
ItemStack itemstack = this.getRareDrop(k <= 0 ? 1 : 0);
|
||||
if (itemstack != null) {
|
||||
loot.add(org.bukkit.craftbukkit.v1_7_R1.inventory.CraftItemStack.asCraftMirror(itemstack));
|
||||
loot.add(org.bukkit.craftbukkit.v1_7_R2.inventory.CraftItemStack.asCraftMirror(itemstack));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -209,7 +209,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
|
||||
public void b(NBTTagCompound nbttagcompound) {
|
||||
super.b(nbttagcompound);
|
||||
nbttagcompound.setBoolean("CanPickUpLoot", this.bH());
|
||||
nbttagcompound.setBoolean("CanPickUpLoot", this.bJ());
|
||||
nbttagcompound.setBoolean("PersistenceRequired", this.persistent);
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
|
||||
@ -298,7 +298,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
}
|
||||
|
||||
public void n(float f) {
|
||||
this.bf = f;
|
||||
this.be = f;
|
||||
}
|
||||
|
||||
public void i(float f) {
|
||||
@ -309,7 +309,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
public void e() {
|
||||
super.e();
|
||||
this.world.methodProfiler.a("looting");
|
||||
if (!this.world.isStatic && this.bH() && !this.aU && this.world.getGameRules().getBoolean("mobGriefing")) {
|
||||
if (!this.world.isStatic && this.bJ() && !this.aT && this.world.getGameRules().getBoolean("mobGriefing")) {
|
||||
List list = this.world.a(EntityItem.class, this.boundingBox.grow(1.0D, 0.0D, 1.0D));
|
||||
Iterator iterator = list.iterator();
|
||||
|
||||
@ -383,7 +383,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
this.world.methodProfiler.b();
|
||||
}
|
||||
|
||||
protected boolean bk() {
|
||||
protected boolean bj() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -393,7 +393,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
|
||||
protected void w() {
|
||||
if (this.persistent) {
|
||||
this.aV = 0;
|
||||
this.aU = 0;
|
||||
} else {
|
||||
EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D);
|
||||
|
||||
@ -407,17 +407,17 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
this.die();
|
||||
}
|
||||
|
||||
if (this.aV > 600 && this.random.nextInt(800) == 0 && d3 > 1024.0D) { // CraftBukkit - remove isTypeNotPersistent() check
|
||||
if (this.aU > 600 && this.random.nextInt(800) == 0 && d3 > 1024.0D) { // CraftBukkit - remove isTypeNotPersistent() check
|
||||
this.die();
|
||||
} else if (d3 < 1024.0D) {
|
||||
this.aV = 0;
|
||||
this.aU = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void bn() {
|
||||
++this.aV;
|
||||
protected void bm() {
|
||||
++this.aU;
|
||||
this.world.methodProfiler.a("checkDespawn");
|
||||
this.w();
|
||||
this.world.methodProfiler.b();
|
||||
@ -434,23 +434,23 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
this.navigation.f();
|
||||
this.world.methodProfiler.b();
|
||||
this.world.methodProfiler.a("mob tick");
|
||||
this.bp();
|
||||
this.bo();
|
||||
this.world.methodProfiler.b();
|
||||
this.world.methodProfiler.a("controls");
|
||||
this.world.methodProfiler.a("move");
|
||||
this.moveController.c();
|
||||
this.world.methodProfiler.c("look");
|
||||
this.h.a();
|
||||
this.lookController.a();
|
||||
this.world.methodProfiler.c("jump");
|
||||
this.lookController.b();
|
||||
this.bm.b();
|
||||
this.world.methodProfiler.b();
|
||||
this.world.methodProfiler.b();
|
||||
}
|
||||
|
||||
protected void bq() {
|
||||
super.bq();
|
||||
protected void bp() {
|
||||
super.bp();
|
||||
this.bd = 0.0F;
|
||||
this.be = 0.0F;
|
||||
this.bf = 0.0F;
|
||||
this.w();
|
||||
float f = 8.0F;
|
||||
|
||||
@ -461,33 +461,33 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
this.bu = entityhuman;
|
||||
this.g = 10 + this.random.nextInt(20);
|
||||
} else {
|
||||
this.bg = (this.random.nextFloat() - 0.5F) * 20.0F;
|
||||
this.bf = (this.random.nextFloat() - 0.5F) * 20.0F;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.bu != null) {
|
||||
this.a(this.bu, 10.0F, (float) this.x());
|
||||
if (this.g-- <= 0 || this.bu.dead || this.bu.e((Entity) this) > (double) (f * f)) {
|
||||
this.a(this.bu, 10.0F, (float) this.bv());
|
||||
if (this.g-- <= 0 || this.bu.dead || this.bu.f((Entity) this) > (double) (f * f)) {
|
||||
this.bu = null;
|
||||
}
|
||||
} else {
|
||||
if (this.random.nextFloat() < 0.05F) {
|
||||
this.bg = (this.random.nextFloat() - 0.5F) * 20.0F;
|
||||
this.bf = (this.random.nextFloat() - 0.5F) * 20.0F;
|
||||
}
|
||||
|
||||
this.yaw += this.bg;
|
||||
this.yaw += this.bf;
|
||||
this.pitch = this.f;
|
||||
}
|
||||
|
||||
boolean flag = this.M();
|
||||
boolean flag1 = this.P();
|
||||
boolean flag = this.L();
|
||||
boolean flag1 = this.O();
|
||||
|
||||
if (flag || flag1) {
|
||||
this.bd = this.random.nextFloat() < 0.8F;
|
||||
this.bc = this.random.nextFloat() < 0.8F;
|
||||
}
|
||||
}
|
||||
|
||||
public int x() {
|
||||
public int bv() {
|
||||
return 40;
|
||||
}
|
||||
|
||||
@ -530,11 +530,11 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
return this.world.b(this.boundingBox) && this.world.getCubes(this, this.boundingBox).isEmpty() && !this.world.containsLiquid(this.boundingBox);
|
||||
}
|
||||
|
||||
public int bz() {
|
||||
public int bB() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
public int ax() {
|
||||
public int aw() {
|
||||
if (this.getGoalTarget() == null) {
|
||||
return 3;
|
||||
} else {
|
||||
@ -549,7 +549,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack be() {
|
||||
public ItemStack bd() {
|
||||
return this.equipment[0];
|
||||
}
|
||||
|
||||
@ -595,7 +595,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
}
|
||||
}
|
||||
|
||||
protected void bA() {
|
||||
protected void bC() {
|
||||
if (this.random.nextFloat() < 0.15F * this.world.b(this.locX, this.locY, this.locZ)) {
|
||||
int i = this.random.nextInt(2);
|
||||
float f = this.world.difficulty == EnumDifficulty.HARD ? 0.1F : 0.25F;
|
||||
@ -713,11 +713,11 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
}
|
||||
}
|
||||
|
||||
protected void bB() {
|
||||
protected void bD() {
|
||||
float f = this.world.b(this.locX, this.locY, this.locZ);
|
||||
|
||||
if (this.be() != null && this.random.nextFloat() < 0.25F * f) {
|
||||
EnchantmentManager.a(this.random, this.be(), (int) (5.0F + f * (float) this.random.nextInt(18)));
|
||||
if (this.bd() != null && this.random.nextFloat() < 0.25F * f) {
|
||||
EnchantmentManager.a(this.random, this.bd(), (int) (5.0F + f * (float) this.random.nextInt(18)));
|
||||
}
|
||||
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
@ -734,7 +734,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
return groupdataentity;
|
||||
}
|
||||
|
||||
public boolean bC() {
|
||||
public boolean bE() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -742,7 +742,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
return this.hasCustomName() ? this.getCustomName() : super.getName();
|
||||
}
|
||||
|
||||
public void bD() {
|
||||
public void bF() {
|
||||
this.persistent = true;
|
||||
}
|
||||
|
||||
@ -770,7 +770,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
this.dropChances[i] = f;
|
||||
}
|
||||
|
||||
public boolean bH() {
|
||||
public boolean bJ() {
|
||||
return this.canPickUpLoot;
|
||||
}
|
||||
|
||||
@ -783,8 +783,8 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
}
|
||||
|
||||
public final boolean c(EntityHuman entityhuman) {
|
||||
if (this.bL() && this.getLeashHolder() == entityhuman && BreakLeash) {
|
||||
// CraftBukkit start
|
||||
if (this.bN() && this.getLeashHolder() == entityhuman && BreakLeash) {
|
||||
// CraftBukkit start - fire PlayerUnleashEntityEvent
|
||||
if (CraftEventFactory.callPlayerUnleashEntityEvent(this, entityhuman).isCancelled()) {
|
||||
((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutAttachEntity(1, this, this.getLeashHolder()));
|
||||
return false;
|
||||
@ -795,9 +795,9 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
} else {
|
||||
ItemStack itemstack = entityhuman.inventory.getItemInHand();
|
||||
|
||||
if (itemstack != null && itemstack.getItem() == Items.LEASH && this.bK()) {
|
||||
if (itemstack != null && itemstack.getItem() == Items.LEASH && this.bM()) {
|
||||
if (!(this instanceof EntityTameableAnimal) || !((EntityTameableAnimal) this).isTamed()) {
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - fire PlayerLeashEntityEvent
|
||||
if (CraftEventFactory.callPlayerLeashEntityEvent(this, entityhuman, entityhuman).isCancelled()) {
|
||||
((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutAttachEntity(1, this, this.getLeashHolder()));
|
||||
return false;
|
||||
@ -809,7 +809,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
}
|
||||
|
||||
if (entityhuman.getName().equalsIgnoreCase(((EntityTameableAnimal) this).getOwnerName())) {
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - fire PlayerLeashEntityEvent
|
||||
if (CraftEventFactory.callPlayerLeashEntityEvent(this, entityhuman, entityhuman).isCancelled()) {
|
||||
((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutAttachEntity(1, this, this.getLeashHolder()));
|
||||
return false;
|
||||
@ -829,9 +829,9 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void bJ() {
|
||||
protected void bL() {
|
||||
if (this.bx != null) {
|
||||
this.bN();
|
||||
this.bP();
|
||||
}
|
||||
|
||||
if (this.bv) {
|
||||
@ -856,11 +856,11 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean bK() {
|
||||
return !this.bL() && !(this instanceof IMonster);
|
||||
public boolean bM() {
|
||||
return !this.bN() && !(this instanceof IMonster);
|
||||
}
|
||||
|
||||
public boolean bL() {
|
||||
public boolean bN() {
|
||||
return this.bv;
|
||||
}
|
||||
|
||||
@ -876,7 +876,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
}
|
||||
}
|
||||
|
||||
private void bN() {
|
||||
private void bP() {
|
||||
if (this.bv && this.bx != null) {
|
||||
if (this.bx.hasKeyOfType("UUIDMost", 4) && this.bx.hasKeyOfType("UUIDLeast", 4)) {
|
||||
UUID uuid = new UUID(this.bx.getLong("UUIDMost"), this.bx.getLong("UUIDLeast"));
|
||||
@ -910,4 +910,4 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
|
||||
this.bx = null;
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
package net.minecraft.server.v1_7_R1;
|
||||
package net.minecraft.server.v1_7_R2;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
@ -19,25 +19,25 @@ import org.apache.logging.log4j.Logger;
|
||||
// CraftBukkit start
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.WeatherType;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.event.CraftEventFactory;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.inventory.CraftItemStack;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.event.CraftEventFactory;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.inventory.CraftItemStack;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
// CraftBukkit end
|
||||
|
||||
public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
|
||||
private static final Logger bM = LogManager.getLogger();
|
||||
private String locale = "en_US";
|
||||
private static final Logger bL = LogManager.getLogger();
|
||||
public String locale = "en_US";
|
||||
public PlayerConnection playerConnection;
|
||||
public final MinecraftServer server;
|
||||
public final PlayerInteractManager playerInteractManager;
|
||||
public double d;
|
||||
public double e;
|
||||
public final List chunkCoordIntPairQueue = new LinkedList();
|
||||
public final List removeQueue = new LinkedList();
|
||||
public final List removeQueue = new LinkedList(); // CraftBukkit - private -> public
|
||||
private final ServerStatisticManager bO;
|
||||
private float bP = Float.MIN_VALUE;
|
||||
private float bQ = -1.0E8F;
|
||||
@ -45,12 +45,11 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
private boolean bS = true;
|
||||
public int lastSentExp = -99999999; // CraftBukkit - private -> public
|
||||
public int invulnerableTicks = 60; // CraftBukkit - private -> public
|
||||
private int bV;
|
||||
private EnumChatVisibility bW;
|
||||
private boolean bX = true;
|
||||
private long bY = 0L;
|
||||
private EnumChatVisibility bV;
|
||||
private boolean bW = true;
|
||||
private long bX = 0L;
|
||||
private int containerCounter;
|
||||
public boolean h;
|
||||
public boolean g;
|
||||
public int ping;
|
||||
public boolean viewingCredits;
|
||||
// CraftBukkit start
|
||||
@ -70,7 +69,6 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
super(worldserver, gameprofile);
|
||||
playerinteractmanager.player = this;
|
||||
this.playerInteractManager = playerinteractmanager;
|
||||
this.bV = minecraftserver.getPlayerList().o();
|
||||
ChunkCoordinates chunkcoordinates = worldserver.getSpawn();
|
||||
int i = chunkcoordinates.x;
|
||||
int j = chunkcoordinates.z;
|
||||
@ -86,7 +84,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
|
||||
this.server = minecraftserver;
|
||||
this.bO = minecraftserver.getPlayerList().i(this.getName());
|
||||
this.X = 0.0F;
|
||||
this.W = 0.0F;
|
||||
this.height = 0.0F;
|
||||
this.setPositionRotation((double) i + 0.5D, (double) k, (double) j + 0.5D, 0.0F, 0.0F);
|
||||
|
||||
@ -232,7 +230,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.bY > 0L && this.server.aq() > 0 && MinecraftServer.ap() - this.bY > (long) (this.server.aq() * 1000 * 60)) {
|
||||
if (this.bX > 0L && this.server.getIdleTimeout() > 0 && MinecraftServer.aq() - this.bX > (long) (this.server.getIdleTimeout() * 1000 * 60)) {
|
||||
this.playerConnection.disconnect("You have been idle for too long!");
|
||||
}
|
||||
}
|
||||
@ -261,8 +259,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
this.bS = this.foodData.e() == 0.0F;
|
||||
}
|
||||
|
||||
if (this.getHealth() + this.bs() != this.bP) {
|
||||
this.bP = this.getHealth() + this.bs();
|
||||
if (this.getHealth() + this.br() != this.bP) {
|
||||
this.bP = this.getHealth() + this.br();
|
||||
// CraftBukkit - Update ALL the scores!
|
||||
this.world.getServer().getScoreboardManager().updateAllScoresForList(IScoreboardCriteria.f, this.getName(), com.google.common.collect.ImmutableList.of(this));
|
||||
}
|
||||
@ -278,11 +276,11 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
this.playerConnection.sendPacket(new PacketPlayOutExperience(this.exp, this.expTotal, this.expLevel));
|
||||
}
|
||||
|
||||
if (this.ticksLived % 20 * 5 == 0 && !this.x().a(AchievementList.L)) {
|
||||
if (this.ticksLived % 20 * 5 == 0 && !this.getStatisticManager().a(AchievementList.L)) {
|
||||
this.j();
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - initialize oldLevel and fire PlayerLevelChangeEvent
|
||||
if (this.oldLevel == -1) {
|
||||
this.oldLevel = this.expLevel;
|
||||
}
|
||||
@ -306,14 +304,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
|
||||
if (biomebase != null) {
|
||||
String s = biomebase.af;
|
||||
AchievementSet achievementset = (AchievementSet) this.x().b((Statistic) AchievementList.L); // CraftBukkit - fix decompile error
|
||||
AchievementSet achievementset = (AchievementSet) this.getStatisticManager().b((Statistic) AchievementList.L); // CraftBukkit - fix decompile error
|
||||
|
||||
if (achievementset == null) {
|
||||
achievementset = (AchievementSet) this.x().a(AchievementList.L, new AchievementSet());
|
||||
achievementset = (AchievementSet) this.getStatisticManager().a(AchievementList.L, new AchievementSet());
|
||||
}
|
||||
|
||||
achievementset.add(s);
|
||||
if (this.x().b(AchievementList.L) && achievementset.size() == BiomeBase.n.size()) {
|
||||
if (this.getStatisticManager().b(AchievementList.L) && achievementset.size() == BiomeBase.n.size()) {
|
||||
HashSet hashset = Sets.newHashSet(BiomeBase.n);
|
||||
Iterator iterator = achievementset.iterator();
|
||||
|
||||
@ -342,7 +340,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
}
|
||||
|
||||
public void die(DamageSource damagesource) {
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - fire PlayerDeathEvent
|
||||
if (this.dead) {
|
||||
return;
|
||||
}
|
||||
@ -364,7 +362,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
}
|
||||
}
|
||||
|
||||
IChatBaseComponent chatmessage = this.aW().b();
|
||||
IChatBaseComponent chatmessage = this.aV().b();
|
||||
|
||||
String deathmessage = chatmessage.c();
|
||||
org.bukkit.event.entity.PlayerDeathEvent event = CraftEventFactory.callPlayerDeathEvent(this, loot, deathmessage);
|
||||
@ -375,7 +373,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
if (deathMessage.equals(deathmessage)) {
|
||||
this.server.getPlayerList().sendMessage(chatmessage);
|
||||
} else {
|
||||
this.server.getPlayerList().sendMessage(org.bukkit.craftbukkit.v1_7_R1.util.CraftChatMessage.fromString(deathMessage));
|
||||
this.server.getPlayerList().sendMessage(org.bukkit.craftbukkit.v1_7_R2.util.CraftChatMessage.fromString(deathMessage));
|
||||
}
|
||||
}
|
||||
|
||||
@ -403,20 +401,21 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
scoreboardscore.incrementScore();
|
||||
}
|
||||
|
||||
EntityLiving entityliving = this.aX();
|
||||
EntityLiving entityliving = this.aW();
|
||||
|
||||
if (entityliving != null) {
|
||||
int i = EntityTypes.a(entityliving);
|
||||
MonsterEggInfo monsteregginfo = (MonsterEggInfo) EntityTypes.a.get(Integer.valueOf(i));
|
||||
MonsterEggInfo monsteregginfo = (MonsterEggInfo) EntityTypes.eggInfo.get(Integer.valueOf(i));
|
||||
|
||||
if (monsteregginfo != null) {
|
||||
this.a(monsteregginfo.e, 1);
|
||||
}
|
||||
|
||||
entityliving.b(this, this.bb);
|
||||
entityliving.b(this, this.ba);
|
||||
}
|
||||
|
||||
this.a(StatisticList.v, 1);
|
||||
this.aV().g();
|
||||
}
|
||||
|
||||
public boolean damageEntity(DamageSource damagesource, float f) {
|
||||
@ -424,7 +423,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
return false;
|
||||
} else {
|
||||
// CraftBukkit - this.server.getPvP() -> this.world.pvpMode
|
||||
boolean flag = this.server.V() && this.world.pvpMode && "fall".equals(damagesource.translationIndex);
|
||||
boolean flag = this.server.W() && this.world.pvpMode && "fall".equals(damagesource.translationIndex);
|
||||
|
||||
if (!flag && this.invulnerableTicks > 0 && damagesource != DamageSource.OUT_OF_WORLD) {
|
||||
return false;
|
||||
@ -478,7 +477,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
} else {
|
||||
this.a((Statistic) AchievementList.y);
|
||||
}
|
||||
|
||||
|
||||
// CraftBukkit start
|
||||
TeleportCause cause = (this.dimension == 1 || i == 1) ? TeleportCause.END_PORTAL : TeleportCause.NETHER_PORTAL;
|
||||
|
||||
@ -502,6 +501,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean Q()
|
||||
{
|
||||
return !spectating;
|
||||
}
|
||||
|
||||
public void receive(Entity entity, int i) {
|
||||
super.receive(entity, i);
|
||||
@ -723,14 +728,16 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
MerchantRecipeList merchantrecipelist = imerchant.getOffers(this);
|
||||
|
||||
if (merchantrecipelist != null) {
|
||||
try {
|
||||
PacketDataSerializer packetdataserializer = new PacketDataSerializer(Unpooled.buffer());
|
||||
PacketDataSerializer packetdataserializer = new PacketDataSerializer(Unpooled.buffer());
|
||||
|
||||
try {
|
||||
packetdataserializer.writeInt(this.containerCounter);
|
||||
merchantrecipelist.a(packetdataserializer);
|
||||
this.playerConnection.sendPacket(new PacketPlayOutCustomPayload("MC|TrList", packetdataserializer));
|
||||
} catch (Exception ioexception) { // CraftBukkit - IOException -> Exception
|
||||
bM.error("Couldn\'t send trade list", ioexception);
|
||||
bL.error("Couldn\'t send trade list", ioexception);
|
||||
} finally {
|
||||
packetdataserializer.release();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -754,7 +761,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
|
||||
public void a(Container container, int i, ItemStack itemstack) {
|
||||
if (!(container.getSlot(i) instanceof SlotResult)) {
|
||||
if (!this.h) {
|
||||
if (!this.g) {
|
||||
this.playerConnection.sendPacket(new PacketPlayOutSetSlot(container.windowId, i, itemstack));
|
||||
}
|
||||
}
|
||||
@ -785,7 +792,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
}
|
||||
|
||||
public void broadcastCarriedItem() {
|
||||
if (!this.h) {
|
||||
if (!this.g) {
|
||||
this.playerConnection.sendPacket(new PacketPlayOutSetSlot(-1, -1, this.inventory.getCarried()));
|
||||
}
|
||||
}
|
||||
@ -798,14 +805,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
public void a(float f, float f1, boolean flag, boolean flag1) {
|
||||
if (this.vehicle != null) {
|
||||
if (f >= -1.0F && f <= 1.0F) {
|
||||
this.be = f;
|
||||
this.bd = f;
|
||||
}
|
||||
|
||||
if (f1 >= -1.0F && f1 <= 1.0F) {
|
||||
this.bf = f1;
|
||||
this.be = f1;
|
||||
}
|
||||
|
||||
this.bd = flag;
|
||||
this.bc = flag;
|
||||
this.setSneaking(flag1);
|
||||
}
|
||||
}
|
||||
@ -836,12 +843,6 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
this.a(true, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean R()
|
||||
{
|
||||
return !spectating;
|
||||
}
|
||||
|
||||
public void triggerHealthUpdate() {
|
||||
this.bQ = -1.0E8F;
|
||||
@ -927,7 +928,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
}
|
||||
|
||||
public boolean a(int i, String s) {
|
||||
return "seed".equals(s) && !this.server.V() ? true : (!"tell".equals(s) && !"help".equals(s) && !"me".equals(s) ? (this.server.getPlayerList().isOp(this.getName()) ? this.server.l() >= i : false) : true);
|
||||
return "seed".equals(s) && !this.server.W() ? true : (!"tell".equals(s) && !"help".equals(s) && !"me".equals(s) ? (this.server.getPlayerList().isOp(this.getName()) ? this.server.l() >= i : false) : true);
|
||||
}
|
||||
|
||||
public String s() {
|
||||
@ -942,13 +943,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
this.locale = packetplayinsettings.c();
|
||||
int i = 256 >> packetplayinsettings.d();
|
||||
|
||||
if (i > 3 && i < 15) {
|
||||
this.bV = i;
|
||||
if (i > 3 && i < 20) {
|
||||
;
|
||||
}
|
||||
|
||||
this.bW = packetplayinsettings.e();
|
||||
this.bX = packetplayinsettings.f();
|
||||
if (this.server.L() && this.server.K().equals(this.getName())) {
|
||||
this.bV = packetplayinsettings.e();
|
||||
this.bW = packetplayinsettings.f();
|
||||
if (this.server.M() && this.server.L().equals(this.getName())) {
|
||||
this.server.a(packetplayinsettings.g());
|
||||
}
|
||||
|
||||
@ -956,10 +957,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
}
|
||||
|
||||
public EnumChatVisibility getChatFlags() {
|
||||
return this.bW;
|
||||
return this.bV;
|
||||
}
|
||||
|
||||
public void a(String s) {
|
||||
public void setResourcePack(String s) {
|
||||
this.playerConnection.sendPacket(new PacketPlayOutCustomPayload("MC|RPack", s.getBytes(Charsets.UTF_8)));
|
||||
}
|
||||
|
||||
@ -967,15 +968,22 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
return new ChunkCoordinates(MathHelper.floor(this.locX), MathHelper.floor(this.locY + 0.5D), MathHelper.floor(this.locZ));
|
||||
}
|
||||
|
||||
public void w() {
|
||||
this.bY = MinecraftServer.ap();
|
||||
public void v() {
|
||||
this.bX = MinecraftServer.aq();
|
||||
}
|
||||
|
||||
public ServerStatisticManager x() {
|
||||
public ServerStatisticManager getStatisticManager() {
|
||||
return this.bO;
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
public void d(Entity entity) {
|
||||
if (entity instanceof EntityHuman) {
|
||||
this.playerConnection.sendPacket(new PacketPlayOutEntityDestroy(new int[] { entity.getId()}));
|
||||
} else {
|
||||
this.removeQueue.add(Integer.valueOf(entity.getId()));
|
||||
}
|
||||
}
|
||||
// CraftBukkit start - Add per-player time and weather.
|
||||
public long timeOffset = 0;
|
||||
public boolean relativeTime = true;
|
||||
|
||||
@ -1041,7 +1049,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
this.expTotal = this.newTotalExp;
|
||||
this.exp = 0;
|
||||
this.deathTicks = 0;
|
||||
this.aP(); // Should be remapped: removeAllEffects should be remapped to this.
|
||||
this.removeAllEffects();
|
||||
this.updateEffects = true;
|
||||
this.activeContainer = this.defaultContainer;
|
||||
this.killer = null;
|
||||
@ -1061,4 +1069,4 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
return (CraftPlayer) super.getBukkitEntity();
|
||||
}
|
||||
// CraftBukkit end
|
||||
}
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
package net.minecraft.server.v1_7_R1;
|
||||
package net.minecraft.server.v1_7_R2;
|
||||
|
||||
// CraftBukkit start
|
||||
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_7_R1.event.CraftEventFactory;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_7_R2.event.CraftEventFactory;
|
||||
import org.bukkit.event.entity.EntityTargetEvent;
|
||||
import org.bukkit.event.entity.SlimeSplitEvent;
|
||||
// CraftBukkit end
|
||||
@ -11,7 +11,7 @@ public class EntitySlime extends EntityInsentient implements IMonster {
|
||||
|
||||
public float h;
|
||||
public float i;
|
||||
public float j;
|
||||
public float bm;
|
||||
private int jumpDelay;
|
||||
private Entity lastTarget; // CraftBukkit
|
||||
|
||||
@ -50,14 +50,20 @@ public class EntitySlime extends EntityInsentient implements IMonster {
|
||||
|
||||
public void a(NBTTagCompound nbttagcompound) {
|
||||
super.a(nbttagcompound);
|
||||
this.setSize(nbttagcompound.getInt("Size") + 1);
|
||||
int i = nbttagcompound.getInt("Size");
|
||||
|
||||
if (i < 0) {
|
||||
i = 0;
|
||||
}
|
||||
|
||||
this.setSize(i + 1);
|
||||
}
|
||||
|
||||
protected String bN() {
|
||||
protected String bP() {
|
||||
return "slime";
|
||||
}
|
||||
|
||||
protected String bT() {
|
||||
protected String bV() {
|
||||
return "mob.slime." + (this.getSize() > 1 ? "big" : "small");
|
||||
}
|
||||
|
||||
@ -67,7 +73,7 @@ public class EntitySlime extends EntityInsentient implements IMonster {
|
||||
}
|
||||
|
||||
this.i += (this.h - this.i) * 0.5F;
|
||||
this.j = this.i;
|
||||
this.bm = this.i;
|
||||
boolean flag = this.onGround;
|
||||
|
||||
super.h();
|
||||
@ -82,11 +88,11 @@ public class EntitySlime extends EntityInsentient implements IMonster {
|
||||
float f2 = MathHelper.sin(f) * (float) i * 0.5F * f1;
|
||||
float f3 = MathHelper.cos(f) * (float) i * 0.5F * f1;
|
||||
|
||||
this.world.addParticle(this.bN(), this.locX + (double) f2, this.boundingBox.b, this.locZ + (double) f3, 0.0D, 0.0D, 0.0D);
|
||||
this.world.addParticle(this.bP(), this.locX + (double) f2, this.boundingBox.b, this.locZ + (double) f3, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
|
||||
if (this.bU()) {
|
||||
this.makeSound(this.bT(), this.bf(), ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) / 0.8F);
|
||||
if (this.bW()) {
|
||||
this.makeSound(this.bV(), this.be(), ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) / 0.8F);
|
||||
}
|
||||
|
||||
this.h = -0.5F;
|
||||
@ -94,19 +100,19 @@ public class EntitySlime extends EntityInsentient implements IMonster {
|
||||
this.h = 1.0F;
|
||||
}
|
||||
|
||||
this.bQ();
|
||||
this.bS();
|
||||
if (this.world.isStatic) {
|
||||
i = this.getSize();
|
||||
this.a(0.6F * (float) i, 0.6F * (float) i);
|
||||
}
|
||||
}
|
||||
|
||||
protected void bq() {
|
||||
protected void bp() {
|
||||
this.w();
|
||||
|
||||
if (Vegetated)
|
||||
return;
|
||||
|
||||
|
||||
// CraftBukkit start
|
||||
Entity entityhuman = this.world.findNearbyVulnerablePlayer(this, 16.0D); // EntityHuman -> Entity
|
||||
EntityTargetEvent event = null;
|
||||
@ -129,35 +135,35 @@ public class EntitySlime extends EntityInsentient implements IMonster {
|
||||
}
|
||||
|
||||
if (this.onGround && this.jumpDelay-- <= 0) {
|
||||
this.jumpDelay = this.bP();
|
||||
this.jumpDelay = this.bR();
|
||||
if (entityhuman != null) {
|
||||
this.jumpDelay /= 3;
|
||||
}
|
||||
|
||||
this.bd = true;
|
||||
if (this.bW()) {
|
||||
this.makeSound(this.bT(), this.bf(), ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) * 0.8F);
|
||||
this.bc = true;
|
||||
if (this.bY()) {
|
||||
this.makeSound(this.bV(), this.be(), ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) * 0.8F);
|
||||
}
|
||||
|
||||
this.be = 1.0F - this.random.nextFloat() * 2.0F;
|
||||
this.bf = (float) (1 * this.getSize());
|
||||
this.bd = 1.0F - this.random.nextFloat() * 2.0F;
|
||||
this.be = (float) (1 * this.getSize());
|
||||
} else {
|
||||
this.bd = false;
|
||||
this.bc = false;
|
||||
if (this.onGround) {
|
||||
this.be = this.bf = 0.0F;
|
||||
this.bd = this.bf = 0.0F;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void bQ() {
|
||||
protected void bS() {
|
||||
this.h *= 0.6F;
|
||||
}
|
||||
|
||||
protected int bP() {
|
||||
protected int bR() {
|
||||
return this.random.nextInt(20) + 10;
|
||||
}
|
||||
|
||||
protected EntitySlime bO() {
|
||||
protected EntitySlime bQ() {
|
||||
return new EntitySlime(this.world);
|
||||
}
|
||||
|
||||
@ -182,7 +188,7 @@ public class EntitySlime extends EntityInsentient implements IMonster {
|
||||
for (int k = 0; k < j; ++k) {
|
||||
float f = ((float) (k % 2) - 0.5F) * (float) i / 4.0F;
|
||||
float f1 = ((float) (k / 2) - 0.5F) * (float) i / 4.0F;
|
||||
EntitySlime entityslime = this.bO();
|
||||
EntitySlime entityslime = this.bQ();
|
||||
|
||||
entityslime.setSize(i / 2);
|
||||
entityslime.setPositionRotation(this.locX + (double) f, this.locY + 0.5D, this.locZ + (double) f1, this.random.nextFloat() * 360.0F, 0.0F);
|
||||
@ -194,28 +200,28 @@ public class EntitySlime extends EntityInsentient implements IMonster {
|
||||
}
|
||||
|
||||
public void b_(EntityHuman entityhuman) {
|
||||
if (this.bR()) {
|
||||
if (this.bT()) {
|
||||
int i = this.getSize();
|
||||
|
||||
if (this.o(entityhuman) && this.e(entityhuman) < 0.6D * (double) i * 0.6D * (double) i && entityhuman.damageEntity(DamageSource.mobAttack(this), (float) this.bS())) {
|
||||
if (this.p(entityhuman) && this.f(entityhuman) < 0.6D * (double) i * 0.6D * (double) i && entityhuman.damageEntity(DamageSource.mobAttack(this), (float) this.bU())) {
|
||||
this.makeSound("mob.attack", 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean bR() {
|
||||
protected boolean bT() {
|
||||
return this.getSize() > 1;
|
||||
}
|
||||
|
||||
protected int bS() {
|
||||
protected int bU() {
|
||||
return this.getSize();
|
||||
}
|
||||
|
||||
protected String aT() {
|
||||
protected String aS() {
|
||||
return "mob.slime." + (this.getSize() > 1 ? "big" : "small");
|
||||
}
|
||||
|
||||
protected String aU() {
|
||||
protected String aT() {
|
||||
return "mob.slime." + (this.getSize() > 1 ? "big" : "small");
|
||||
}
|
||||
|
||||
@ -232,7 +238,7 @@ public class EntitySlime extends EntityInsentient implements IMonster {
|
||||
if (this.getSize() == 1 || this.world.difficulty != EnumDifficulty.PEACEFUL) {
|
||||
BiomeBase biomebase = this.world.getBiome(MathHelper.floor(this.locX), MathHelper.floor(this.locZ));
|
||||
|
||||
if (biomebase == BiomeBase.SWAMPLAND && this.locY > 50.0D && this.locY < 70.0D && this.random.nextFloat() < 0.5F && this.random.nextFloat() < this.world.x() && this.world.getLightLevel(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)) <= this.random.nextInt(8)) {
|
||||
if (biomebase == BiomeBase.SWAMPLAND && this.locY > 50.0D && this.locY < 70.0D && this.random.nextFloat() < 0.5F && this.random.nextFloat() < this.world.y() && this.world.getLightLevel(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)) <= this.random.nextInt(8)) {
|
||||
return super.canSpawn();
|
||||
}
|
||||
|
||||
@ -245,19 +251,19 @@ public class EntitySlime extends EntityInsentient implements IMonster {
|
||||
}
|
||||
}
|
||||
|
||||
protected float bf() {
|
||||
protected float be() {
|
||||
return 0.4F * (float) this.getSize();
|
||||
}
|
||||
|
||||
public int x() {
|
||||
public int bv() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected boolean bW() {
|
||||
protected boolean bY() {
|
||||
return this.getSize() > 0;
|
||||
}
|
||||
|
||||
protected boolean bU() {
|
||||
protected boolean bW() {
|
||||
return this.getSize() > 2;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package net.minecraft.server.v1_7_R1;
|
||||
package net.minecraft.server.v1_7_R2;
|
||||
|
||||
import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit
|
||||
|
||||
@ -6,14 +6,14 @@ public class EntityTNTPrimed extends Entity {
|
||||
|
||||
public int fuseTicks;
|
||||
private EntityLiving source;
|
||||
public float yield = 4; // CraftBukkit
|
||||
public boolean isIncendiary = false; // CraftBukkit
|
||||
|
||||
public boolean spectating = false;
|
||||
public float yield = 4; // CraftBukkit - add field
|
||||
public boolean isIncendiary = false; // CraftBukkit - add field
|
||||
|
||||
public boolean spectating = false;
|
||||
|
||||
public EntityTNTPrimed(World world) {
|
||||
super(world);
|
||||
this.l = true;
|
||||
this.k = true;
|
||||
this.a(0.98F, 0.98F);
|
||||
this.height = this.length / 2.0F;
|
||||
}
|
||||
@ -39,7 +39,7 @@ public class EntityTNTPrimed extends Entity {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean R() {
|
||||
public boolean Q() {
|
||||
return !this.dead && !spectating;
|
||||
}
|
||||
|
||||
@ -74,9 +74,9 @@ public class EntityTNTPrimed extends Entity {
|
||||
// CraftBukkit start
|
||||
// float f = 4.0F;
|
||||
|
||||
org.bukkit.craftbukkit.v1_7_R1.CraftServer server = this.world.getServer();
|
||||
org.bukkit.craftbukkit.v1_7_R2.CraftServer server = this.world.getServer();
|
||||
|
||||
ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity.getEntity(server, this));
|
||||
ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity.getEntity(server, this));
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
@ -97,4 +97,4 @@ public class EntityTNTPrimed extends Entity {
|
||||
public EntityLiving getSource() {
|
||||
return this.source;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package net.minecraft.server.v1_7_R1;
|
||||
package net.minecraft.server.v1_7_R2;
|
||||
|
||||
public interface IPacketVerifier
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
package net.minecraft.server.v1_7_R1;
|
||||
package net.minecraft.server.v1_7_R2;
|
||||
|
||||
public class PacketPlayInCloseWindow
|
||||
extends Packet
|
@ -1,4 +1,4 @@
|
||||
package net.minecraft.server.v1_7_R1;
|
||||
package net.minecraft.server.v1_7_R2;
|
||||
|
||||
public class PacketPlayOutAnimation extends Packet
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
package net.minecraft.server.v1_7_R1;
|
||||
package net.minecraft.server.v1_7_R2;
|
||||
|
||||
public class PacketPlayOutAttachEntity extends Packet
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
package net.minecraft.server.v1_7_R1;
|
||||
package net.minecraft.server.v1_7_R2;
|
||||
|
||||
public class PacketPlayOutEntity
|
||||
extends Packet
|
@ -1,4 +1,4 @@
|
||||
package net.minecraft.server.v1_7_R1;
|
||||
package net.minecraft.server.v1_7_R2;
|
||||
|
||||
public class PacketPlayOutEntityEquipment extends Packet
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
package net.minecraft.server.v1_7_R1;
|
||||
package net.minecraft.server.v1_7_R2;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package net.minecraft.server.v1_7_R1;
|
||||
package net.minecraft.server.v1_7_R2;
|
||||
|
||||
public class PacketPlayOutEntityTeleport extends Packet
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
package net.minecraft.server.v1_7_R1;
|
||||
package net.minecraft.server.v1_7_R2;
|
||||
|
||||
public class PacketPlayOutEntityVelocity
|
||||
extends Packet
|
@ -0,0 +1,100 @@
|
||||
package net.minecraft.server.v1_7_R2;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import net.minecraft.util.com.mojang.authlib.GameProfile;
|
||||
|
||||
public class PacketPlayOutNamedEntitySpawn extends Packet
|
||||
{
|
||||
public int a;
|
||||
public GameProfile b;
|
||||
public int c;
|
||||
public int d;
|
||||
public int e;
|
||||
public byte f;
|
||||
public byte g;
|
||||
public int h;
|
||||
public DataWatcher i;
|
||||
public List j;
|
||||
|
||||
public PacketPlayOutNamedEntitySpawn()
|
||||
{
|
||||
}
|
||||
|
||||
public PacketPlayOutNamedEntitySpawn(EntityHuman entityhuman)
|
||||
{
|
||||
this.a = entityhuman.getId();
|
||||
this.b = entityhuman.getProfile();
|
||||
this.c = MathHelper.floor(entityhuman.locX * 32.0D);
|
||||
this.d = MathHelper.floor(entityhuman.locY * 32.0D);
|
||||
this.e = MathHelper.floor(entityhuman.locZ * 32.0D);
|
||||
this.f = ((byte) (int) (entityhuman.yaw * 256.0F / 360.0F));
|
||||
this.g = ((byte) (int) (entityhuman.pitch * 256.0F / 360.0F));
|
||||
ItemStack itemstack = entityhuman.inventory.getItemInHand();
|
||||
|
||||
this.h = (itemstack == null ? 0 : Item.b(itemstack.getItem()));
|
||||
this.i = entityhuman.getDataWatcher();
|
||||
}
|
||||
|
||||
public void a(PacketDataSerializer packetdataserializer) throws IOException
|
||||
{
|
||||
this.a = packetdataserializer.a();
|
||||
this.b = new GameProfile(packetdataserializer.c(36), packetdataserializer.c(16));
|
||||
this.c = packetdataserializer.readInt();
|
||||
this.d = packetdataserializer.readInt();
|
||||
this.e = packetdataserializer.readInt();
|
||||
this.f = packetdataserializer.readByte();
|
||||
this.g = packetdataserializer.readByte();
|
||||
this.h = packetdataserializer.readShort();
|
||||
this.j = DataWatcher.b(packetdataserializer);
|
||||
}
|
||||
|
||||
public void b(PacketDataSerializer packetdataserializer) throws IOException
|
||||
{
|
||||
packetdataserializer.b(this.a);
|
||||
packetdataserializer.a(this.b.getId());
|
||||
packetdataserializer.a(this.b.getName().length() > 16 ? this.b.getName().substring(0, 16) : this.b.getName());
|
||||
packetdataserializer.writeInt(this.c);
|
||||
packetdataserializer.writeInt(this.d);
|
||||
packetdataserializer.writeInt(this.e);
|
||||
packetdataserializer.writeByte(this.f);
|
||||
packetdataserializer.writeByte(this.g);
|
||||
packetdataserializer.writeShort(this.h);
|
||||
this.i.a(packetdataserializer);
|
||||
}
|
||||
|
||||
// Spigot start
|
||||
@Override
|
||||
public void writeSnapshot(PacketDataSerializer packetdataserializer) throws IOException
|
||||
{ // CraftBukkit - added throws
|
||||
packetdataserializer.b(this.a);
|
||||
packetdataserializer.a(EntityHuman.a(this.b).toString());
|
||||
packetdataserializer.a(this.b.getName().length() > 16 ? this.b.getName().substring(0, 16) : this.b.getName()); // CraftBukkit
|
||||
packetdataserializer.b(0); // TODO
|
||||
packetdataserializer.writeInt(this.c);
|
||||
packetdataserializer.writeInt(this.d);
|
||||
packetdataserializer.writeInt(this.e);
|
||||
packetdataserializer.writeByte(this.f);
|
||||
packetdataserializer.writeByte(this.g);
|
||||
packetdataserializer.writeShort(this.h);
|
||||
this.i.a(packetdataserializer);
|
||||
}
|
||||
|
||||
public void a(PacketPlayOutListener packetplayoutlistener)
|
||||
{
|
||||
packetplayoutlistener.a(this);
|
||||
}
|
||||
|
||||
public String b()
|
||||
{
|
||||
return String.format(
|
||||
"id=%d, gameProfile='%s', x=%.2f, y=%.2f, z=%.2f, carried=%d",
|
||||
new Object[] { Integer.valueOf(this.a), this.b, Float.valueOf(this.c / 32.0F),
|
||||
Float.valueOf(this.d / 32.0F), Float.valueOf(this.e / 32.0F), Integer.valueOf(this.h) });
|
||||
}
|
||||
|
||||
public void handle(PacketListener packetlistener)
|
||||
{
|
||||
a((PacketPlayOutListener) packetlistener);
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user