Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // Source code recreated from a .class file by IntelliJ IDEA
- // (powered by FernFlower decompiler)
- //
- package net.minecraft.world.entity.player;
- import com.destroystokyo.paper.event.player.PlayerReadyArrowEvent;
- import com.google.common.collect.ImmutableList;
- import com.google.common.collect.ImmutableMap;
- import com.google.common.collect.Lists;
- import com.mojang.authlib.GameProfile;
- import com.mojang.datafixers.util.Either;
- import io.papermc.paper.event.player.PlayerDeepSleepEvent;
- import java.nio.charset.StandardCharsets;
- import java.util.Collection;
- import java.util.Iterator;
- import java.util.List;
- import java.util.Map;
- import java.util.Optional;
- import java.util.OptionalInt;
- import java.util.UUID;
- import java.util.function.Predicate;
- import javax.annotation.Nullable;
- import net.minecraft.SharedConstants;
- import net.minecraft.SystemUtils;
- import net.minecraft.advancements.CriterionTriggers;
- import net.minecraft.core.BlockPosition;
- import net.minecraft.core.EnumDirection;
- import net.minecraft.core.particles.ParticleParam;
- import net.minecraft.core.particles.Particles;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.nbt.NBTTagList;
- import net.minecraft.network.chat.ChatClickable;
- import net.minecraft.network.chat.ChatComponentText;
- import net.minecraft.network.chat.ChatMessage;
- import net.minecraft.network.chat.IChatBaseComponent;
- import net.minecraft.network.chat.IChatMutableComponent;
- import net.minecraft.network.chat.ChatClickable.EnumClickAction;
- import net.minecraft.network.protocol.game.PacketPlayOutEntityVelocity;
- import net.minecraft.network.protocol.game.PacketPlayOutNamedSoundEffect;
- import net.minecraft.network.syncher.DataWatcher;
- import net.minecraft.network.syncher.DataWatcherObject;
- import net.minecraft.network.syncher.DataWatcherRegistry;
- import net.minecraft.resources.MinecraftKey;
- import net.minecraft.server.level.EntityPlayer;
- import net.minecraft.server.level.WorldServer;
- import net.minecraft.sounds.SoundCategory;
- import net.minecraft.sounds.SoundEffect;
- import net.minecraft.sounds.SoundEffects;
- import net.minecraft.stats.Statistic;
- import net.minecraft.stats.StatisticList;
- import net.minecraft.tags.Tag;
- import net.minecraft.tags.TagsFluid;
- import net.minecraft.util.MathHelper;
- import net.minecraft.util.Unit;
- import net.minecraft.world.EnumDifficulty;
- import net.minecraft.world.EnumHand;
- import net.minecraft.world.EnumInteractionResult;
- import net.minecraft.world.IInventory;
- import net.minecraft.world.ITileInventory;
- import net.minecraft.world.damagesource.DamageSource;
- import net.minecraft.world.effect.MobEffect;
- import net.minecraft.world.effect.MobEffectUtil;
- import net.minecraft.world.effect.MobEffects;
- import net.minecraft.world.entity.Entity;
- import net.minecraft.world.entity.EntityInsentient;
- import net.minecraft.world.entity.EntityLiving;
- import net.minecraft.world.entity.EntityPose;
- import net.minecraft.world.entity.EntitySize;
- import net.minecraft.world.entity.EntityTameableAnimal;
- import net.minecraft.world.entity.EntityTypes;
- import net.minecraft.world.entity.EnumItemSlot;
- import net.minecraft.world.entity.EnumMainHand;
- import net.minecraft.world.entity.EnumMonsterType;
- import net.minecraft.world.entity.EnumMoveType;
- import net.minecraft.world.entity.SlotAccess;
- import net.minecraft.world.entity.Entity.MovementEmission;
- import net.minecraft.world.entity.Entity.RemovalReason;
- import net.minecraft.world.entity.EnumItemSlot.Function;
- import net.minecraft.world.entity.ai.attributes.AttributeBase;
- import net.minecraft.world.entity.ai.attributes.GenericAttributes;
- import net.minecraft.world.entity.ai.attributes.AttributeProvider.Builder;
- import net.minecraft.world.entity.animal.EntityParrot;
- import net.minecraft.world.entity.animal.EntityPig;
- import net.minecraft.world.entity.animal.horse.EntityHorseAbstract;
- import net.minecraft.world.entity.boss.EntityComplexPart;
- import net.minecraft.world.entity.decoration.EntityArmorStand;
- import net.minecraft.world.entity.item.EntityItem;
- import net.minecraft.world.entity.monster.EntityStrider;
- import net.minecraft.world.entity.projectile.EntityFishingHook;
- import net.minecraft.world.entity.vehicle.EntityBoat;
- import net.minecraft.world.entity.vehicle.EntityMinecartAbstract;
- import net.minecraft.world.food.FoodMetaData;
- import net.minecraft.world.inventory.ClickAction;
- import net.minecraft.world.inventory.Container;
- import net.minecraft.world.inventory.ContainerPlayer;
- import net.minecraft.world.inventory.InventoryEnderChest;
- import net.minecraft.world.item.ItemAxe;
- import net.minecraft.world.item.ItemCooldown;
- import net.minecraft.world.item.ItemElytra;
- import net.minecraft.world.item.ItemProjectileWeapon;
- import net.minecraft.world.item.ItemStack;
- import net.minecraft.world.item.ItemSword;
- import net.minecraft.world.item.ItemWorldMap;
- import net.minecraft.world.item.Items;
- import net.minecraft.world.item.crafting.IRecipe;
- import net.minecraft.world.item.enchantment.EnchantmentManager;
- import net.minecraft.world.item.trading.MerchantRecipeList;
- import net.minecraft.world.level.CommandBlockListenerAbstract;
- import net.minecraft.world.level.EnumGamemode;
- import net.minecraft.world.level.GameRules;
- import net.minecraft.world.level.World;
- import net.minecraft.world.level.block.Block;
- import net.minecraft.world.level.block.BlockBed;
- import net.minecraft.world.level.block.BlockRespawnAnchor;
- import net.minecraft.world.level.block.entity.TileEntityCommand;
- import net.minecraft.world.level.block.entity.TileEntityJigsaw;
- import net.minecraft.world.level.block.entity.TileEntitySign;
- import net.minecraft.world.level.block.entity.TileEntityStructure;
- import net.minecraft.world.level.block.state.IBlockData;
- import net.minecraft.world.level.block.state.pattern.ShapeDetectorBlock;
- import net.minecraft.world.level.saveddata.maps.WorldMap;
- import net.minecraft.world.phys.AxisAlignedBB;
- import net.minecraft.world.phys.Vec3D;
- import net.minecraft.world.scores.Scoreboard;
- import net.minecraft.world.scores.ScoreboardTeam;
- import org.bukkit.Bukkit;
- import org.bukkit.OfflinePlayer;
- import org.bukkit.craftbukkit.v1_17_R1.entity.CraftHumanEntity;
- import org.bukkit.craftbukkit.v1_17_R1.event.CraftEventFactory;
- import org.bukkit.craftbukkit.v1_17_R1.inventory.CraftItemStack;
- import org.bukkit.craftbukkit.v1_17_R1.util.CraftVector;
- import org.bukkit.entity.Item;
- import org.bukkit.entity.Player;
- import org.bukkit.event.entity.EntityCombustByEntityEvent;
- import org.bukkit.event.entity.EntityExhaustionEvent;
- import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
- import org.bukkit.event.entity.EntityExhaustionEvent.ExhaustionReason;
- import org.bukkit.event.entity.EntityPotionEffectEvent.Cause;
- import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
- import org.bukkit.event.inventory.InventoryCloseEvent.Reason;
- import org.bukkit.event.player.PlayerDropItemEvent;
- import org.bukkit.event.player.PlayerVelocityEvent;
- import org.bukkit.scoreboard.Team;
- import org.bukkit.util.Vector;
- public abstract class EntityHuman extends EntityLiving {
- public static final String bE = "OfflinePlayer:";
- public static final int bF = 16;
- public static final int bG = 20;
- public static final int bH = 100;
- public static final int bI = 10;
- public static final int bJ = 200;
- public static final float bK = 1.5F;
- public static final float bL = 0.6F;
- public static final float bM = 0.6F;
- public static final float bN = 1.62F;
- public static final EntitySize bO = EntitySize.b(0.6F, 1.8F);
- private static final Map<EntityPose, EntitySize> b;
- private static final int c = 25;
- private static final DataWatcherObject<Float> d;
- private static final DataWatcherObject<Integer> e;
- public static final DataWatcherObject<Byte> bP;
- protected static final DataWatcherObject<Byte> bQ;
- protected static final DataWatcherObject<NBTTagCompound> bR;
- protected static final DataWatcherObject<NBTTagCompound> bS;
- private long f;
- private final PlayerInventory co = new PlayerInventory(this);
- protected InventoryEnderChest bT = new InventoryEnderChest(this);
- public final ContainerPlayer bU;
- public Container bV;
- protected FoodMetaData bW = new FoodMetaData(this);
- protected int bX;
- public float bY;
- public float bZ;
- public int ca;
- public double cb;
- public double cc;
- public double cd;
- public double ce;
- public double cf;
- public double cg;
- public int cp;
- protected boolean ch;
- private final PlayerAbilities cq = new PlayerAbilities();
- public int ci;
- public int cj;
- public float ck;
- protected int cl;
- protected final float cm = 0.02F;
- private int cr;
- public GameProfile cs;
- private boolean ct;
- private ItemStack cu;
- private final ItemCooldown cv;
- @Nullable
- public EntityFishingHook cn;
- public boolean affectsSpawning = true;
- public boolean fauxSleeping;
- public int oldLevel = -1;
- public CraftHumanEntity getBukkitEntity() {
- return (CraftHumanEntity)super.getBukkitEntity();
- }
- public EntityHuman(World world, BlockPosition pos, float yaw, GameProfile profile) {
- super(EntityTypes.bi, world);
- this.cu = ItemStack.b;
- this.cv = this.j();
- this.a_(a(profile));
- this.cs = profile;
- this.bU = new ContainerPlayer(this.co, !world.y, this);
- this.bV = this.bU;
- this.setPositionRotation((double)pos.getX() + 0.5D, (double)(pos.getY() + 1), (double)pos.getZ() + 0.5D, yaw, 0.0F);
- super.bk = 180.0F;
- }
- public boolean a(World world, BlockPosition pos, EnumGamemode gameMode) {
- if (!gameMode.e()) {
- return false;
- } else if (gameMode == EnumGamemode.d) {
- return true;
- } else if (this.fv()) {
- return false;
- } else {
- ItemStack itemstack = this.getItemInMainHand();
- return itemstack.isEmpty() || !itemstack.a(world.r(), new ShapeDetectorBlock(world, pos, false));
- }
- }
- public static Builder eY() {
- return EntityLiving.dq().a(GenericAttributes.f, 1.0D).a(GenericAttributes.d, 0.10000000149011612D).a(GenericAttributes.h).a(GenericAttributes.k);
- }
- protected void initDatawatcher() {
- super.initDatawatcher();
- super.Y.register(d, 0.0F);
- super.Y.register(e, 0);
- super.Y.register(bP, (byte)0);
- super.Y.register(bQ, (byte)1);
- super.Y.register(bR, new NBTTagCompound());
- super.Y.register(bS, new NBTTagCompound());
- }
- public void tick() {
- super.P = this.isSpectator();
- if (this.isSpectator()) {
- super.z = false;
- }
- if (this.ca > 0) {
- --this.ca;
- }
- if (this.isSleeping()) {
- ++this.cp;
- if (this.cp == 100 && !(new PlayerDeepSleepEvent((Player)this.getBukkitEntity())).callEvent()) {
- this.cp = -2147483648;
- }
- if (this.cp > 100) {
- this.cp = 100;
- }
- if (!super.t.y && super.t.isDay()) {
- this.wakeup(false, true);
- }
- } else if (this.cp > 0) {
- ++this.cp;
- if (this.cp >= 110) {
- this.cp = 0;
- }
- }
- this.fc();
- super.tick();
- if (!super.t.y && this.bV != null && !this.bV.canUse(this)) {
- this.closeContainer(Reason.CANT_USE);
- this.bV = this.bU;
- }
- this.q();
- if (!super.t.y) {
- this.bW.a(this);
- this.a(StatisticList.k);
- this.a(StatisticList.l);
- if (this.isAlive()) {
- this.a(StatisticList.m);
- }
- if (this.bG()) {
- this.a(StatisticList.o);
- }
- if (!this.isSleeping()) {
- this.a(StatisticList.n);
- }
- }
- int i = 29999999;
- double d0 = MathHelper.a(this.locX(), -2.9999999E7D, 2.9999999E7D);
- double d1 = MathHelper.a(this.locZ(), -2.9999999E7D, 2.9999999E7D);
- if (d0 != this.locX() || d1 != this.locZ()) {
- this.setPosition(d0, this.locY(), d1);
- }
- ++super.aQ;
- ItemStack itemstack = this.getItemInMainHand();
- if (!ItemStack.matches(this.cu, itemstack)) {
- if (!ItemStack.d(this.cu, itemstack)) {
- this.resetAttackCooldown();
- }
- this.cu = itemstack.cloneItemStack();
- }
- this.p();
- this.cv.a();
- this.fd();
- }
- public boolean eZ() {
- return this.isSneaking();
- }
- protected boolean fa() {
- return this.isSneaking();
- }
- protected boolean fb() {
- return this.isSneaking();
- }
- protected boolean fc() {
- this.ch = this.a((Tag)TagsFluid.b);
- return this.ch;
- }
- private void p() {
- ItemStack itemstack = this.getEquipment(EnumItemSlot.f);
- if (itemstack.a(Items.mc) && !this.a((Tag)TagsFluid.b)) {
- this.addEffect(new MobEffect(MobEffects.m, 200, 0, false, false, true), Cause.TURTLE_HELMET);
- }
- }
- protected ItemCooldown j() {
- return new ItemCooldown();
- }
- private void q() {
- this.cb = this.ce;
- this.cc = this.cf;
- this.cd = this.cg;
- double d0 = this.locX() - this.ce;
- double d1 = this.locY() - this.cf;
- double d2 = this.locZ() - this.cg;
- double d3 = 10.0D;
- if (d0 > 10.0D) {
- this.ce = this.locX();
- this.cb = this.ce;
- }
- if (d2 > 10.0D) {
- this.cg = this.locZ();
- this.cd = this.cg;
- }
- if (d1 > 10.0D) {
- this.cf = this.locY();
- this.cc = this.cf;
- }
- if (d0 < -10.0D) {
- this.ce = this.locX();
- this.cb = this.ce;
- }
- if (d2 < -10.0D) {
- this.cg = this.locZ();
- this.cd = this.cg;
- }
- if (d1 < -10.0D) {
- this.cf = this.locY();
- this.cc = this.cf;
- }
- this.ce += d0 * 0.25D;
- this.cg += d2 * 0.25D;
- this.cf += d1 * 0.25D;
- }
- protected void fd() {
- if (this.c((EntityPose)EntityPose.d)) {
- EntityPose entitypose;
- if (this.isGliding()) {
- entitypose = EntityPose.b;
- } else if (this.isSleeping()) {
- entitypose = EntityPose.c;
- } else if (this.isSwimming()) {
- entitypose = EntityPose.d;
- } else if (this.isRiptiding()) {
- entitypose = EntityPose.e;
- } else if (this.isSneaking() && !this.cq.b) {
- entitypose = EntityPose.f;
- } else {
- entitypose = EntityPose.a;
- }
- EntityPose entitypose1;
- if (!this.isSpectator() && !this.isPassenger() && !this.c((EntityPose)entitypose)) {
- if (this.c((EntityPose)EntityPose.f)) {
- entitypose1 = EntityPose.f;
- } else {
- entitypose1 = EntityPose.d;
- }
- } else {
- entitypose1 = entitypose;
- }
- this.setPose(entitypose1);
- }
- }
- public int am() {
- return this.cq.a ? 1 : 80;
- }
- protected SoundEffect getSoundSwim() {
- return SoundEffects.oC;
- }
- protected SoundEffect getSoundSplash() {
- return SoundEffects.oA;
- }
- protected SoundEffect getSoundSplashHighSpeed() {
- return SoundEffects.oB;
- }
- public int getDefaultPortalCooldown() {
- return 10;
- }
- public void playSound(SoundEffect sound, float volume, float pitch) {
- super.t.playSound(this, this.locX(), this.locY(), this.locZ(), sound, this.getSoundCategory(), volume, pitch);
- }
- public void a(SoundEffect event, SoundCategory category, float volume, float pitch) {
- }
- public SoundCategory getSoundCategory() {
- return SoundCategory.h;
- }
- public int getMaxFireTicks() {
- return 20;
- }
- public void a(byte status) {
- if (status == 9) {
- this.s();
- } else if (status == 23) {
- this.ct = false;
- } else if (status == 22) {
- this.ct = true;
- } else if (status == 43) {
- this.a((ParticleParam)Particles.g);
- } else {
- super.a(status);
- }
- }
- private void a(ParticleParam parameters) {
- for(int i = 0; i < 5; ++i) {
- double d0 = super.Q.nextGaussian() * 0.02D;
- double d1 = super.Q.nextGaussian() * 0.02D;
- double d2 = super.Q.nextGaussian() * 0.02D;
- super.t.addParticle(parameters, this.d(1.0D), this.da() + 1.0D, this.g(1.0D), d0, d1, d2);
- }
- }
- public void closeContainer(Reason reason) {
- this.closeInventory();
- this.bV = this.bU;
- }
- public void closeUnloadedInventory(Reason reason) {
- this.bV = this.bU;
- }
- public void closeInventory() {
- this.bV = this.bU;
- }
- public void passengerTick() {
- if (!super.t.y && this.fa() && this.isPassenger()) {
- this.stopRiding();
- this.setSneaking(false);
- } else {
- double d0 = this.locX();
- double d1 = this.locY();
- double d2 = this.locZ();
- super.passengerTick();
- this.bY = this.bZ;
- this.bZ = 0.0F;
- this.r(this.locX() - d0, this.locY() - d1, this.locZ() - d2);
- }
- }
- protected void doTick() {
- super.doTick();
- this.ei();
- super.aZ = this.getYRot();
- }
- public void movementTick() {
- if (this.bX > 0) {
- --this.bX;
- }
- if (super.t.getDifficulty() == EnumDifficulty.a && super.t.getGameRules().getBoolean(GameRules.j)) {
- if (this.getHealth() < this.getMaxHealth() && super.R % 20 == 0) {
- this.heal(1.0F, RegainReason.REGEN);
- }
- if (this.bW.c() && super.R % 10 == 0) {
- this.bW.a(this.bW.getFoodLevel() + 1);
- }
- }
- this.co.j();
- this.bY = this.bZ;
- super.movementTick();
- super.bb = 0.02F;
- if (this.isSprinting()) {
- super.bb = (float)((double)super.bb + 0.005999999865889549D);
- }
- this.r((float)this.b((AttributeBase)GenericAttributes.d));
- float f;
- if (super.z && !this.dV() && !this.isSwimming()) {
- f = Math.min(0.1F, (float)this.getMot().h());
- } else {
- f = 0.0F;
- }
- this.bZ += (f - this.bZ) * 0.4F;
- if (this.getHealth() > 0.0F && !this.isSpectator()) {
- AxisAlignedBB axisalignedbb;
- if (this.isPassenger() && !this.getVehicle().isRemoved()) {
- axisalignedbb = this.getBoundingBox().b(this.getVehicle().getBoundingBox()).grow(1.0D, 0.0D, 1.0D);
- } else {
- axisalignedbb = this.getBoundingBox().grow(1.0D, 0.5D, 1.0D);
- }
- List<Entity> list = super.t.getEntities(this, axisalignedbb);
- List<Entity> list1 = Lists.newArrayList();
- for(int i = 0; i < list.size(); ++i) {
- Entity entity = (Entity)list.get(i);
- if (entity.getEntityType() == EntityTypes.A) {
- list1.add(entity);
- } else if (!entity.isRemoved()) {
- this.c(entity);
- }
- }
- if (!list1.isEmpty()) {
- this.c((Entity)SystemUtils.a(list1, super.Q));
- }
- }
- this.c(this.getShoulderEntityLeft());
- this.c(this.getShoulderEntityRight());
- if ((!super.t.y && (super.K > 0.5F || this.isInWater()) || this.cq.b || this.isSleeping() || super.al) && !super.t.paperConfig.parrotsHangOnBetter) {
- this.releaseShoulderEntities();
- }
- }
- private void c(@Nullable NBTTagCompound entityNbt) {
- if (entityNbt != null && (!entityNbt.hasKey("Silent") || !entityNbt.getBoolean("Silent")) && super.t.w.nextInt(200) == 0) {
- String s = entityNbt.getString("id");
- EntityTypes.a(s).filter((entitytypes) -> {
- return entitytypes == EntityTypes.al;
- }).ifPresent((entitytypes) -> {
- if (!EntityParrot.a(super.t, this)) {
- super.t.playSound((EntityHuman)null, this.locX(), this.locY(), this.locZ(), EntityParrot.a(super.t, super.t.w), this.getSoundCategory(), 1.0F, EntityParrot.a(super.t.w));
- }
- });
- }
- }
- private void c(Entity entity) {
- entity.pickup(this);
- }
- public int getScore() {
- return (Integer)super.Y.get(e);
- }
- public void setScore(int score) {
- super.Y.set(e, score);
- }
- public void addScore(int score) {
- int j = this.getScore();
- super.Y.set(e, j + score);
- }
- public void die(DamageSource source) {
- super.die(source);
- this.ah();
- if (!this.isSpectator()) {
- this.dropAllDeathLoot(source);
- }
- if (source != null) {
- this.setMot((double)(-MathHelper.cos((super.aM + this.getYRot()) * 0.017453292F) * 0.1F), 0.10000000149011612D, (double)(-MathHelper.sin((super.aM + this.getYRot()) * 0.017453292F) * 0.1F));
- } else {
- this.setMot(0.0D, 0.1D, 0.0D);
- }
- this.a(StatisticList.N);
- this.a(StatisticList.i.b(StatisticList.m));
- this.a(StatisticList.i.b(StatisticList.n));
- this.extinguish();
- this.a_(false);
- }
- protected void dropInventory() {
- super.dropInventory();
- if (!super.t.getGameRules().getBoolean(GameRules.d)) {
- this.removeCursedItems();
- this.co.dropContents();
- }
- }
- protected void removeCursedItems() {
- for(int i = 0; i < this.co.getSize(); ++i) {
- ItemStack itemstack = this.co.getItem(i);
- if (!itemstack.isEmpty() && EnchantmentManager.shouldNotDrop(itemstack)) {
- this.co.splitWithoutUpdate(i);
- }
- }
- }
- protected SoundEffect getSoundHurt(DamageSource source) {
- return source == DamageSource.c ? SoundEffects.ow : (source == DamageSource.h ? SoundEffects.ou : (source == DamageSource.u ? SoundEffects.ox : (source == DamageSource.v ? SoundEffects.ov : SoundEffects.ot)));
- }
- public SoundEffect getSoundDeath() {
- return SoundEffects.os;
- }
- @Nullable
- public EntityItem drop(ItemStack stack, boolean retainOwnership) {
- return this.a(stack, false, retainOwnership);
- }
- @Nullable
- public EntityItem a(ItemStack stack, boolean throwRandomly, boolean retainOwnership) {
- return this.drop(stack, throwRandomly, retainOwnership, false);
- }
- @Nullable
- public EntityItem drop(ItemStack stack, boolean throwRandomly, boolean retainOwnership, boolean alwaysSucceed) {
- if (stack.isEmpty()) {
- return null;
- } else {
- if (super.t.y) {
- this.swingHand(EnumHand.a);
- }
- double d0 = this.getHeadY() - 0.30000001192092896D;
- ItemStack tmp = stack.cloneItemStack();
- stack.setCount(0);
- EntityItem entityitem = new EntityItem(super.t, this.locX(), d0, this.locZ(), tmp);
- entityitem.setPickupDelay(40);
- if (retainOwnership) {
- entityitem.setThrower(this.getUniqueID());
- }
- float f;
- float f1;
- if (throwRandomly) {
- f = super.Q.nextFloat() * 0.5F;
- f1 = super.Q.nextFloat() * 6.2831855F;
- entityitem.setMot((double)(-MathHelper.sin(f1) * f), 0.20000000298023224D, (double)(MathHelper.cos(f1) * f));
- } else {
- f = 0.3F;
- f1 = MathHelper.sin(this.getXRot() * 0.017453292F);
- float f2 = MathHelper.cos(this.getXRot() * 0.017453292F);
- float f3 = MathHelper.sin(this.getYRot() * 0.017453292F);
- float f4 = MathHelper.cos(this.getYRot() * 0.017453292F);
- float f5 = super.Q.nextFloat() * 6.2831855F;
- float f6 = 0.02F * super.Q.nextFloat();
- entityitem.setMot((double)(-f3 * f2 * 0.3F) + Math.cos((double)f5) * (double)f6, (double)(-f1 * 0.3F + 0.1F + (super.Q.nextFloat() - super.Q.nextFloat()) * 0.1F), (double)(f4 * f2 * 0.3F) + Math.sin((double)f5) * (double)f6);
- }
- Player player = (Player)this.getBukkitEntity();
- Item drop = (Item)entityitem.getBukkitEntity();
- PlayerDropItemEvent event = new PlayerDropItemEvent(player, drop);
- super.t.getCraftServer().getPluginManager().callEvent(event);
- if (event.isCancelled() && !alwaysSucceed) {
- org.bukkit.inventory.ItemStack cur = player.getInventory().getItemInHand();
- if (retainOwnership && (cur == null || cur.getAmount() == 0)) {
- player.getInventory().setItemInHand(drop.getItemStack());
- } else if (retainOwnership && cur.isSimilar(drop.getItemStack()) && cur.getAmount() < cur.getMaxStackSize() && drop.getItemStack().getAmount() == 1) {
- cur.setAmount(cur.getAmount() + 1);
- player.getInventory().setItemInHand(cur);
- } else {
- player.getInventory().addItem(new org.bukkit.inventory.ItemStack[]{drop.getItemStack()});
- }
- return null;
- } else {
- if (tmp.getItem() == Items.pp) {
- WorldMap worldmap = ItemWorldMap.getSavedMap(tmp, super.t);
- if (worldmap != null) {
- worldmap.a(this, tmp);
- }
- }
- return entityitem;
- }
- }
- }
- public float c(IBlockData block) {
- float f = this.co.a(block);
- if (f > 1.0F) {
- int i = EnchantmentManager.getDigSpeedEnchantmentLevel(this);
- ItemStack itemstack = this.getItemInMainHand();
- if (i > 0 && !itemstack.isEmpty()) {
- f += (float)(i * i + 1);
- }
- }
- if (MobEffectUtil.a(this)) {
- f *= 1.0F + (float)(MobEffectUtil.b(this) + 1) * 0.2F;
- }
- if (this.hasEffect(MobEffects.d)) {
- float f1;
- switch(this.getEffect(MobEffects.d).getAmplifier()) {
- case 0:
- f1 = 0.3F;
- break;
- case 1:
- f1 = 0.09F;
- break;
- case 2:
- f1 = 0.0027F;
- break;
- case 3:
- default:
- f1 = 8.1E-4F;
- }
- f *= f1;
- }
- if (this.a((Tag)TagsFluid.b) && !EnchantmentManager.h(this)) {
- f /= 5.0F;
- }
- if (!super.z) {
- f /= 5.0F;
- }
- return f;
- }
- public boolean hasBlock(IBlockData state) {
- return !state.isRequiresSpecialTool() || this.co.getItemInHand().canDestroySpecialBlock(state);
- }
- public void loadData(NBTTagCompound nbt) {
- super.loadData(nbt);
- this.a_(a(this.cs));
- NBTTagList nbttaglist = nbt.getList("Inventory", 10);
- this.co.b(nbttaglist);
- this.co.k = nbt.getInt("SelectedItemSlot");
- this.cp = nbt.getShort("SleepTimer");
- this.ck = nbt.getFloat("XpP");
- this.ci = nbt.getInt("XpLevel");
- this.cj = nbt.getInt("XpTotal");
- this.cl = nbt.getInt("XpSeed");
- if (this.cl == 0) {
- this.cl = super.Q.nextInt();
- }
- this.setScore(nbt.getInt("Score"));
- this.bW.a(nbt);
- this.cq.b(nbt);
- this.getAttributeInstance(GenericAttributes.d).setValue((double)this.cq.b());
- if (nbt.hasKeyOfType("EnderItems", 9)) {
- this.bT.a(nbt.getList("EnderItems", 10));
- }
- if (nbt.hasKeyOfType("ShoulderEntityLeft", 10)) {
- this.setShoulderEntityLeft(nbt.getCompound("ShoulderEntityLeft"));
- }
- if (nbt.hasKeyOfType("ShoulderEntityRight", 10)) {
- this.setShoulderEntityRight(nbt.getCompound("ShoulderEntityRight"));
- }
- }
- public void saveData(NBTTagCompound nbt) {
- super.saveData(nbt);
- nbt.setInt("DataVersion", SharedConstants.getGameVersion().getWorldVersion());
- nbt.set("Inventory", this.co.a(new NBTTagList()));
- nbt.setInt("SelectedItemSlot", this.co.k);
- nbt.setShort("SleepTimer", (short)this.cp);
- nbt.setFloat("XpP", this.ck);
- nbt.setInt("XpLevel", this.ci);
- nbt.setInt("XpTotal", this.cj);
- nbt.setInt("XpSeed", this.cl);
- nbt.setInt("Score", this.getScore());
- this.bW.b(nbt);
- this.cq.a(nbt);
- nbt.set("EnderItems", this.bT.g());
- if (!this.getShoulderEntityLeft().isEmpty()) {
- nbt.set("ShoulderEntityLeft", this.getShoulderEntityLeft());
- }
- if (!this.getShoulderEntityRight().isEmpty()) {
- nbt.set("ShoulderEntityRight", this.getShoulderEntityRight());
- }
- }
- public boolean isInvulnerable(DamageSource damageSource) {
- return super.isInvulnerable(damageSource) ? true : (damageSource == DamageSource.h ? !super.t.getGameRules().getBoolean(GameRules.B) : (damageSource.z() ? !super.t.getGameRules().getBoolean(GameRules.C) : (damageSource.isFire() ? !super.t.getGameRules().getBoolean(GameRules.D) : (damageSource == DamageSource.v ? !super.t.getGameRules().getBoolean(GameRules.E) : false))));
- }
- public boolean damageEntity(DamageSource source, float amount) {
- if (this.isInvulnerable(source)) {
- return false;
- } else if (this.cq.a && !source.ignoresInvulnerability()) {
- super.forceExplosionKnockback = true;
- return false;
- } else {
- super.bf = 0;
- if (this.dV()) {
- return false;
- } else {
- if (source.w()) {
- if (super.t.getDifficulty() == EnumDifficulty.a) {
- return false;
- }
- if (super.t.getDifficulty() == EnumDifficulty.b) {
- amount = Math.min(amount / 2.0F + 1.0F, amount);
- }
- if (super.t.getDifficulty() == EnumDifficulty.d) {
- amount = amount * 3.0F / 2.0F;
- }
- }
- boolean damaged = super.damageEntity(source, amount);
- if (damaged) {
- this.releaseShoulderEntities();
- }
- return damaged;
- }
- }
- }
- protected void shieldBlock(EntityLiving attacker) {
- super.shieldBlock(attacker);
- if (attacker.getItemInMainHand().getItem() instanceof ItemAxe) {
- this.r(true);
- }
- }
- public boolean dN() {
- return !this.getAbilities().a && super.dN();
- }
- public boolean a(EntityHuman player) {
- Team team;
- if (player instanceof EntityPlayer) {
- EntityPlayer thatPlayer = (EntityPlayer)player;
- team = thatPlayer.getBukkitEntity().getScoreboard().getPlayerTeam(thatPlayer.getBukkitEntity());
- if (team == null || team.allowFriendlyFire()) {
- return true;
- }
- } else {
- OfflinePlayer thisPlayer = player.t.getCraftServer().getOfflinePlayer(player.getName());
- team = player.t.getCraftServer().getScoreboardManager().getMainScoreboard().getPlayerTeam(thisPlayer);
- if (team == null || team.allowFriendlyFire()) {
- return true;
- }
- }
- if (this instanceof EntityPlayer) {
- return !team.hasPlayer(((EntityPlayer)this).getBukkitEntity());
- } else {
- return !team.hasPlayer(super.t.getCraftServer().getOfflinePlayer(this.getName()));
- }
- }
- protected void damageArmor(DamageSource source, float amount) {
- this.co.a(source, amount, PlayerInventory.f);
- }
- protected void damageHelmet(DamageSource source, float amount) {
- this.co.a(source, amount, PlayerInventory.g);
- }
- protected void damageShield(float amount) {
- if (super.bz.a(Items.sv)) {
- if (!super.t.y) {
- this.b(StatisticList.c.b(super.bz.getItem()));
- }
- if (amount >= 3.0F) {
- int i = 1 + MathHelper.d(amount);
- EnumHand enumhand = this.getRaisedHand();
- super.bz.damage(i, this, (entityhuman) -> {
- entityhuman.broadcastItemBreak(enumhand);
- });
- if (super.bz.isEmpty()) {
- if (enumhand == EnumHand.a) {
- this.setSlot(EnumItemSlot.a, ItemStack.b);
- } else {
- this.setSlot(EnumItemSlot.b, ItemStack.b);
- }
- super.bz = ItemStack.b;
- this.playSound(SoundEffects.qn, 0.8F, 0.8F + super.t.w.nextFloat() * 0.4F);
- }
- }
- }
- }
- protected boolean damageEntity0(DamageSource damagesource, float f) {
- return super.damageEntity0(damagesource, f);
- }
- protected boolean du() {
- return !this.cq.b && super.du();
- }
- public void openSign(TileEntitySign sign) {
- }
- public void a(CommandBlockListenerAbstract commandBlockExecutor) {
- }
- public void a(TileEntityCommand commandBlock) {
- }
- public void a(TileEntityStructure structureBlock) {
- }
- public void a(TileEntityJigsaw jigsaw) {
- }
- public void openHorseInventory(EntityHorseAbstract horse, IInventory inventory) {
- }
- public OptionalInt openContainer(@Nullable ITileInventory factory) {
- return OptionalInt.empty();
- }
- public void openTrade(int syncId, MerchantRecipeList offers, int levelProgress, int experience, boolean leveled, boolean refreshable) {
- }
- public void openBook(ItemStack book, EnumHand hand) {
- }
- public EnumInteractionResult a(Entity entity, EnumHand hand) {
- if (this.isSpectator()) {
- if (entity instanceof ITileInventory) {
- this.openContainer((ITileInventory)entity);
- }
- return EnumInteractionResult.d;
- } else {
- ItemStack itemstack = this.b((EnumHand)hand);
- ItemStack itemstack1 = itemstack.cloneItemStack();
- EnumInteractionResult enuminteractionresult = entity.a(this, hand);
- if (enuminteractionresult.a()) {
- if (this.cq.d && itemstack == this.b((EnumHand)hand) && itemstack.getCount() < itemstack1.getCount()) {
- itemstack.setCount(itemstack1.getCount());
- }
- return enuminteractionresult;
- } else {
- if (!itemstack.isEmpty() && entity instanceof EntityLiving) {
- if (this.cq.d) {
- itemstack = itemstack1;
- }
- EnumInteractionResult enuminteractionresult1 = itemstack.a(this, (EntityLiving)entity, hand);
- if (enuminteractionresult1.a()) {
- if (itemstack.isEmpty() && !this.cq.d) {
- this.a((EnumHand)hand, (ItemStack)ItemStack.b);
- }
- return enuminteractionresult1;
- }
- }
- return EnumInteractionResult.d;
- }
- }
- }
- public double bk() {
- return -0.35D;
- }
- public void bo() {
- this.stopRiding(false);
- }
- public void stopRiding(boolean suppressCancellation) {
- super.stopRiding(suppressCancellation);
- super.s = 0;
- }
- protected boolean isFrozen() {
- return super.isFrozen() || this.isSleeping() || this.isRemoved() || !super.valid;
- }
- public boolean dA() {
- return !this.cq.b;
- }
- protected Vec3D a(Vec3D movement, EnumMoveType type) {
- if (!this.cq.b && (type == EnumMoveType.a || type == EnumMoveType.b) && this.fb() && this.v()) {
- double d0 = movement.b;
- double d1 = movement.d;
- double var7 = 0.05D;
- while(true) {
- while(d0 != 0.0D && super.t.getCubes(this, this.getBoundingBox().d(d0, (double)(-super.O), 0.0D))) {
- if (d0 < 0.05D && d0 >= -0.05D) {
- d0 = 0.0D;
- } else if (d0 > 0.0D) {
- d0 -= 0.05D;
- } else {
- d0 += 0.05D;
- }
- }
- while(true) {
- while(d1 != 0.0D && super.t.getCubes(this, this.getBoundingBox().d(0.0D, (double)(-super.O), d1))) {
- if (d1 < 0.05D && d1 >= -0.05D) {
- d1 = 0.0D;
- } else if (d1 > 0.0D) {
- d1 -= 0.05D;
- } else {
- d1 += 0.05D;
- }
- }
- while(true) {
- while(d0 != 0.0D && d1 != 0.0D && super.t.getCubes(this, this.getBoundingBox().d(d0, (double)(-super.O), d1))) {
- if (d0 < 0.05D && d0 >= -0.05D) {
- d0 = 0.0D;
- } else if (d0 > 0.0D) {
- d0 -= 0.05D;
- } else {
- d0 += 0.05D;
- }
- if (d1 < 0.05D && d1 >= -0.05D) {
- d1 = 0.0D;
- } else if (d1 > 0.0D) {
- d1 -= 0.05D;
- } else {
- d1 += 0.05D;
- }
- }
- movement = new Vec3D(d0, movement.c, d1);
- return movement;
- }
- }
- }
- } else {
- return movement;
- }
- }
- private boolean v() {
- return super.z || super.K < super.O && !super.t.getCubes(this, this.getBoundingBox().d(0.0D, (double)(super.K - super.O), 0.0D));
- }
- public void attack(Entity target) {
- if (target.ca() && !target.r(this)) {
- float f = (float)this.b((AttributeBase)GenericAttributes.f);
- float f1;
- if (target instanceof EntityLiving) {
- f1 = EnchantmentManager.a(this.getItemInMainHand(), ((EntityLiving)target).getMonsterType());
- } else {
- f1 = EnchantmentManager.a(this.getItemInMainHand(), EnumMonsterType.a);
- }
- float f2 = this.getAttackCooldown(0.5F);
- f *= 0.2F + f2 * f2 * 0.8F;
- f1 *= f2;
- if (f > 0.0F || f1 > 0.0F) {
- boolean flag = f2 > 0.9F;
- boolean flag1 = false;
- byte b0 = 0;
- int i = b0 + EnchantmentManager.b(this);
- if (this.isSprinting() && flag) {
- sendSoundEffect(this, this.locX(), this.locY(), this.locZ(), SoundEffects.ok, this.getSoundCategory(), 1.0F, 1.0F);
- ++i;
- flag1 = true;
- }
- boolean flag2 = flag && super.K > 0.0F && !super.z && !this.isClimbing() && !this.isInWater() && !this.hasEffect(MobEffects.o) && !this.isPassenger() && target instanceof EntityLiving;
- flag2 = flag2 && !super.t.paperConfig.disablePlayerCrits;
- flag2 = flag2 && !this.isSprinting();
- if (flag2) {
- f *= 1.5F;
- }
- f += f1;
- boolean flag3 = false;
- double d0 = (double)(super.H - super.G);
- if (flag && !flag2 && !flag1 && super.z && d0 < (double)this.ew()) {
- ItemStack itemstack = this.b((EnumHand)EnumHand.a);
- if (itemstack.getItem() instanceof ItemSword) {
- flag3 = true;
- }
- }
- float f3 = 0.0F;
- boolean flag4 = false;
- int j = EnchantmentManager.getFireAspectEnchantmentLevel(this);
- if (target instanceof EntityLiving) {
- f3 = ((EntityLiving)target).getHealth();
- if (j > 0 && !target.isBurning()) {
- EntityCombustByEntityEvent combustEvent = new EntityCombustByEntityEvent(this.getBukkitEntity(), target.getBukkitEntity(), 1);
- Bukkit.getPluginManager().callEvent(combustEvent);
- if (!combustEvent.isCancelled()) {
- flag4 = true;
- target.setOnFire(combustEvent.getDuration(), false);
- }
- }
- }
- Vec3D vec3d = target.getMot();
- boolean flag5 = target.damageEntity(DamageSource.playerAttack(this).critical(flag2), f);
- if (flag5) {
- if (i > 0) {
- if (target instanceof EntityLiving) {
- ((EntityLiving)target).knockback((double)((float)i * 0.5F), (double)MathHelper.sin(this.getYRot() * 0.017453292F), (double)(-MathHelper.cos(this.getYRot() * 0.017453292F)), this);
- } else {
- target.i((double)(-MathHelper.sin(this.getYRot() * 0.017453292F) * (float)i * 0.5F), 0.1D, (double)(MathHelper.cos(this.getYRot() * 0.017453292F) * (float)i * 0.5F));
- }
- this.setMot(this.getMot().d(0.6D, 1.0D, 0.6D));
- if (!super.t.paperConfig.disableSprintInterruptionOnAttack) {
- this.setSprinting(false);
- }
- }
- if (flag3) {
- float f4 = 1.0F + EnchantmentManager.a(this) * f;
- List<EntityLiving> list = super.t.a(EntityLiving.class, target.getBoundingBox().grow(1.0D, 0.25D, 1.0D));
- Iterator iterator = list.iterator();
- label186:
- while(true) {
- EntityLiving entityliving;
- do {
- do {
- do {
- do {
- if (!iterator.hasNext()) {
- sendSoundEffect(this, this.locX(), this.locY(), this.locZ(), SoundEffects.on, this.getSoundCategory(), 1.0F, 1.0F);
- this.fg();
- break label186;
- }
- entityliving = (EntityLiving)iterator.next();
- } while(entityliving == this);
- } while(entityliving == target);
- } while(this.p(entityliving));
- } while(entityliving instanceof EntityArmorStand && ((EntityArmorStand)entityliving).isMarker());
- if (this.f(entityliving) < 9.0D && entityliving.damageEntity(DamageSource.playerAttack(this).sweep().critical(flag2), f4)) {
- entityliving.knockback(0.4000000059604645D, (double)MathHelper.sin(this.getYRot() * 0.017453292F), (double)(-MathHelper.cos(this.getYRot() * 0.017453292F)), this);
- }
- }
- }
- if (target instanceof EntityPlayer && target.C) {
- boolean cancelled = false;
- Player player = (Player)target.getBukkitEntity();
- Vector velocity = CraftVector.toBukkit(vec3d);
- PlayerVelocityEvent event = new PlayerVelocityEvent(player, velocity.clone());
- super.t.getCraftServer().getPluginManager().callEvent(event);
- if (event.isCancelled()) {
- cancelled = true;
- } else if (!velocity.equals(event.getVelocity())) {
- player.setVelocity(event.getVelocity());
- }
- if (!cancelled) {
- ((EntityPlayer)target).b.sendPacket(new PacketPlayOutEntityVelocity(target));
- target.C = false;
- target.setMot(vec3d);
- }
- }
- if (flag2) {
- sendSoundEffect(this, this.locX(), this.locY(), this.locZ(), SoundEffects.oj, this.getSoundCategory(), 1.0F, 1.0F);
- this.a(target);
- }
- if (!flag2 && !flag3) {
- if (flag) {
- sendSoundEffect(this, this.locX(), this.locY(), this.locZ(), SoundEffects.om, this.getSoundCategory(), 1.0F, 1.0F);
- } else {
- sendSoundEffect(this, this.locX(), this.locY(), this.locZ(), SoundEffects.oo, this.getSoundCategory(), 1.0F, 1.0F);
- }
- }
- if (f1 > 0.0F) {
- this.b(target);
- }
- this.x(target);
- if (target instanceof EntityLiving) {
- EnchantmentManager.a((EntityLiving)target, this);
- }
- EnchantmentManager.b(this, target);
- ItemStack itemstack1 = this.getItemInMainHand();
- Object object = target;
- if (target instanceof EntityComplexPart) {
- object = ((EntityComplexPart)target).b;
- }
- if (!super.t.y && !itemstack1.isEmpty() && object instanceof EntityLiving) {
- itemstack1.a((EntityLiving)object, this);
- if (itemstack1.isEmpty()) {
- this.a((EnumHand)EnumHand.a, (ItemStack)ItemStack.b);
- }
- }
- if (target instanceof EntityLiving) {
- float f5 = f3 - ((EntityLiving)target).getHealth();
- this.a(StatisticList.G, Math.round(f5 * 10.0F));
- if (j > 0) {
- EntityCombustByEntityEvent combustEvent = new EntityCombustByEntityEvent(this.getBukkitEntity(), target.getBukkitEntity(), j * 4);
- Bukkit.getPluginManager().callEvent(combustEvent);
- if (!combustEvent.isCancelled()) {
- target.setOnFire(combustEvent.getDuration(), false);
- }
- }
- if (super.t instanceof WorldServer && f5 > 2.0F) {
- int k = (int)((double)f5 * 0.5D);
- ((WorldServer)super.t).a(Particles.i, target.locX(), target.e(0.5D), target.locZ(), k, 0.1D, 0.0D, 0.1D, 0.2D);
- }
- }
- this.applyExhaustion(super.t.spigotConfig.combatExhaustion, ExhaustionReason.ATTACK);
- } else {
- sendSoundEffect(this, this.locX(), this.locY(), this.locZ(), SoundEffects.ol, this.getSoundCategory(), 1.0F, 1.0F);
- if (flag4) {
- target.extinguish();
- }
- if (this instanceof EntityPlayer) {
- ((EntityPlayer)this).getBukkitEntity().updateInventory();
- }
- }
- }
- }
- }
- protected void g(EntityLiving target) {
- this.attack(target);
- }
- public void r(boolean sprinting) {
- float f = 0.25F + (float)EnchantmentManager.getDigSpeedEnchantmentLevel(this) * 0.05F;
- if (sprinting) {
- f += 0.75F;
- }
- if (super.Q.nextFloat() < f) {
- this.getCooldownTracker().setCooldown(Items.sv, 100);
- this.clearActiveItem();
- super.t.broadcastEntityEffect(this, (byte)30);
- }
- }
- public void a(Entity target) {
- }
- public void b(Entity target) {
- }
- public void fg() {
- double d0 = (double)(-MathHelper.sin(this.getYRot() * 0.017453292F));
- double d1 = (double)MathHelper.cos(this.getYRot() * 0.017453292F);
- if (super.t instanceof WorldServer) {
- ((WorldServer)super.t).a(Particles.Z, this.locX() + d0, this.e(0.5D), this.locZ() + d1, 0, d0, 0.0D, d1, 0.0D);
- }
- }
- public void fh() {
- }
- public void a(RemovalReason reason) {
- super.a(reason);
- this.bU.b(this);
- if (this.bV != null) {
- this.bV.b(this);
- }
- }
- public boolean fi() {
- return false;
- }
- public GameProfile getProfile() {
- return this.cs;
- }
- public PlayerInventory getInventory() {
- return this.co;
- }
- public PlayerAbilities getAbilities() {
- return this.cq;
- }
- public void a(ItemStack cursorStack, ItemStack slotStack, ClickAction clickType) {
- }
- public Either<EntityHuman.EnumBedResult, Unit> sleep(BlockPosition pos) {
- return this.sleep(pos, false);
- }
- public Either<EntityHuman.EnumBedResult, Unit> sleep(BlockPosition blockposition, boolean force) {
- this.entitySleep(blockposition);
- this.cp = 0;
- return Either.right(Unit.a);
- }
- public void wakeup(boolean flag, boolean updateSleepingPlayers) {
- super.entityWakeup();
- if (super.t instanceof WorldServer && updateSleepingPlayers) {
- ((WorldServer)super.t).everyoneSleeping();
- }
- this.cp = flag ? 0 : 100;
- }
- public void entityWakeup() {
- this.wakeup(true, true);
- }
- public static Optional<Vec3D> getBed(WorldServer world, BlockPosition pos, float f, boolean flag, boolean flag1) {
- IBlockData iblockdata = world.getType(pos);
- Block block = iblockdata.getBlock();
- if (block instanceof BlockRespawnAnchor && (Integer)iblockdata.get(BlockRespawnAnchor.c) > 0 && BlockRespawnAnchor.a(world)) {
- Optional<Vec3D> optional = BlockRespawnAnchor.a(EntityTypes.bi, world, pos);
- if (!flag1 && optional.isPresent()) {
- world.setTypeAndData(pos, (IBlockData)iblockdata.set(BlockRespawnAnchor.c, (Integer)iblockdata.get(BlockRespawnAnchor.c) - 1), 3);
- }
- return optional;
- } else if (block instanceof BlockBed && BlockBed.a(world)) {
- return BlockBed.a(EntityTypes.bi, world, pos, f);
- } else if (!flag) {
- return Optional.empty();
- } else {
- boolean flag2 = block.W_();
- boolean flag3 = world.getType(pos.up()).getBlock().W_();
- return flag2 && flag3 ? Optional.of(new Vec3D((double)pos.getX() + 0.5D, (double)pos.getY() + 0.1D, (double)pos.getZ() + 0.5D)) : Optional.empty();
- }
- }
- public boolean isDeeplySleeping() {
- return this.isSleeping() && this.cp >= 100;
- }
- public int fn() {
- return this.cp;
- }
- public void a(IChatBaseComponent message, boolean actionBar) {
- }
- public void a(MinecraftKey stat) {
- this.b(StatisticList.i.b(stat));
- }
- public void a(MinecraftKey stat, int amount) {
- this.a(StatisticList.i.b(stat), amount);
- }
- public void b(Statistic<?> stat) {
- this.a((Statistic)stat, 1);
- }
- public void a(Statistic<?> stat, int amount) {
- }
- public void a(Statistic<?> stat) {
- }
- public int discoverRecipes(Collection<IRecipe<?>> recipes) {
- return 0;
- }
- public void a(MinecraftKey[] ids) {
- }
- public int undiscoverRecipes(Collection<IRecipe<?>> recipes) {
- return 0;
- }
- public void jump() {
- super.jump();
- this.a(StatisticList.E);
- if (this.isSprinting()) {
- this.applyExhaustion(super.t.spigotConfig.jumpSprintExhaustion, ExhaustionReason.JUMP_SPRINT);
- } else {
- this.applyExhaustion(super.t.spigotConfig.jumpWalkExhaustion, ExhaustionReason.JUMP);
- }
- }
- public void g(Vec3D movementInput) {
- double d0 = this.locX();
- double d1 = this.locY();
- double d2 = this.locZ();
- double d3;
- if (this.isSwimming() && !this.isPassenger()) {
- d3 = this.getLookDirection().c;
- double d4 = d3 < -0.2D ? 0.085D : 0.06D;
- if (d3 <= 0.0D || super.bn || !super.t.getType(new BlockPosition(this.locX(), this.locY() + 1.0D - 0.1D, this.locZ())).getFluid().isEmpty()) {
- Vec3D vec3d1 = this.getMot();
- this.setMot(vec3d1.add(0.0D, (d3 - vec3d1.c) * d4, 0.0D));
- }
- }
- if (this.cq.b && !this.isPassenger()) {
- d3 = this.getMot().c;
- float f = super.bb;
- super.bb = this.cq.a() * (float)(this.isSprinting() ? 2 : 1);
- super.g(movementInput);
- Vec3D vec3d2 = this.getMot();
- this.setMot(vec3d2.b, d3 * 0.6D, vec3d2.d);
- super.bb = f;
- super.K = 0.0F;
- if (this.getFlag(7) && !CraftEventFactory.callToggleGlideEvent(this, false).isCancelled()) {
- this.setFlag(7, false);
- }
- } else {
- super.g(movementInput);
- }
- this.checkMovement(this.locX() - d0, this.locY() - d1, this.locZ() - d2);
- }
- public void aQ() {
- if (this.cq.b) {
- this.setSwimming(false);
- } else {
- super.aQ();
- }
- }
- protected boolean f(BlockPosition pos) {
- return !super.t.getType(pos).o(super.t, pos);
- }
- public float ew() {
- return (float)this.b((AttributeBase)GenericAttributes.d);
- }
- public void checkMovement(double dx, double dy, double dz) {
- if (!this.isPassenger()) {
- int i;
- if (this.isSwimming()) {
- i = Math.round((float)Math.sqrt(dx * dx + dy * dy + dz * dz) * 100.0F);
- if (i > 0) {
- this.a(StatisticList.C, i);
- this.applyExhaustion(super.t.spigotConfig.swimMultiplier * (float)i * 0.01F, ExhaustionReason.SWIM);
- }
- } else if (this.a((Tag)TagsFluid.b)) {
- i = Math.round((float)Math.sqrt(dx * dx + dy * dy + dz * dz) * 100.0F);
- if (i > 0) {
- this.a(StatisticList.w, i);
- this.applyExhaustion(super.t.spigotConfig.swimMultiplier * (float)i * 0.01F, ExhaustionReason.WALK_UNDERWATER);
- }
- } else if (this.isInWater()) {
- i = Math.round((float)Math.sqrt(dx * dx + dz * dz) * 100.0F);
- if (i > 0) {
- this.a(StatisticList.s, i);
- this.applyExhaustion(super.t.spigotConfig.swimMultiplier * (float)i * 0.01F, ExhaustionReason.WALK_ON_WATER);
- }
- } else if (this.isClimbing()) {
- if (dy > 0.0D) {
- this.a(StatisticList.u, (int)Math.round(dy * 100.0D));
- }
- } else if (super.z) {
- i = Math.round((float)Math.sqrt(dx * dx + dz * dz) * 100.0F);
- if (i > 0) {
- if (this.isSprinting()) {
- this.a(StatisticList.r, i);
- this.applyExhaustion(super.t.spigotConfig.sprintMultiplier * (float)i * 0.01F, ExhaustionReason.SPRINT);
- } else if (this.isCrouching()) {
- this.a(StatisticList.q, i);
- this.applyExhaustion(super.t.spigotConfig.otherMultiplier * (float)i * 0.01F, ExhaustionReason.CROUCH);
- } else {
- this.a(StatisticList.p, i);
- this.applyExhaustion(super.t.spigotConfig.otherMultiplier * (float)i * 0.01F, ExhaustionReason.WALK);
- }
- }
- } else if (this.isGliding()) {
- i = Math.round((float)Math.sqrt(dx * dx + dy * dy + dz * dz) * 100.0F);
- this.a(StatisticList.B, i);
- } else {
- i = Math.round((float)Math.sqrt(dx * dx + dz * dz) * 100.0F);
- if (i > 25) {
- this.a(StatisticList.v, i);
- }
- }
- }
- }
- private void r(double dx, double dy, double dz) {
- if (this.isPassenger()) {
- int i = Math.round((float)Math.sqrt(dx * dx + dy * dy + dz * dz) * 100.0F);
- if (i > 0) {
- Entity entity = this.getVehicle();
- if (entity instanceof EntityMinecartAbstract) {
- this.a(StatisticList.x, i);
- } else if (entity instanceof EntityBoat) {
- this.a(StatisticList.y, i);
- } else if (entity instanceof EntityPig) {
- this.a(StatisticList.z, i);
- } else if (entity instanceof EntityHorseAbstract) {
- this.a(StatisticList.A, i);
- } else if (entity instanceof EntityStrider) {
- this.a(StatisticList.D, i);
- }
- }
- }
- }
- public boolean a(float fallDistance, float damageMultiplier, DamageSource damageSource) {
- if (this.cq.c) {
- return false;
- } else {
- if (fallDistance >= 2.0F) {
- this.a(StatisticList.t, (int)Math.round((double)fallDistance * 100.0D));
- }
- return super.a(fallDistance, damageMultiplier, damageSource);
- }
- }
- public boolean fo() {
- if (!super.z && !this.isGliding() && !this.isInWater() && !this.hasEffect(MobEffects.y)) {
- ItemStack itemstack = this.getEquipment(EnumItemSlot.e);
- if (itemstack.a(Items.lT) && ItemElytra.d(itemstack)) {
- this.startGliding();
- return true;
- }
- }
- return false;
- }
- public void startGliding() {
- if (!CraftEventFactory.callToggleGlideEvent(this, true).isCancelled()) {
- this.setFlag(7, true);
- } else {
- this.setFlag(7, true);
- this.setFlag(7, false);
- }
- }
- public void stopGliding() {
- if (!CraftEventFactory.callToggleGlideEvent(this, false).isCancelled()) {
- this.setFlag(7, true);
- this.setFlag(7, false);
- }
- }
- protected void aT() {
- if (!this.isSpectator()) {
- super.aT();
- }
- }
- protected SoundEffect getSoundFall(int distance) {
- return distance > 4 ? SoundEffects.op : SoundEffects.oz;
- }
- public void a(WorldServer world, EntityLiving other) {
- this.b(StatisticList.g.b(other.getEntityType()));
- }
- public void a(IBlockData state, Vec3D multiplier) {
- if (!this.cq.b) {
- super.a(state, multiplier);
- }
- }
- public void giveExp(int experience) {
- this.addScore(experience);
- this.ck += (float)experience / (float)this.getExpToLevel();
- this.cj = MathHelper.clamp(this.cj + experience, 0, 2147483647);
- while(this.ck < 0.0F) {
- float f = this.ck * (float)this.getExpToLevel();
- if (this.ci > 0) {
- this.levelDown(-1);
- this.ck = 1.0F + f / (float)this.getExpToLevel();
- } else {
- this.levelDown(-1);
- this.ck = 0.0F;
- }
- }
- while(this.ck >= 1.0F) {
- this.ck = (this.ck - 1.0F) * (float)this.getExpToLevel();
- this.levelDown(1);
- this.ck /= (float)this.getExpToLevel();
- }
- }
- public int fr() {
- return this.cl;
- }
- public void enchantDone(ItemStack enchantedItem, int experienceLevels) {
- this.ci -= experienceLevels;
- if (this.ci < 0) {
- this.ci = 0;
- this.ck = 0.0F;
- this.cj = 0;
- }
- this.cl = super.Q.nextInt();
- }
- public void levelDown(int levels) {
- this.ci += levels;
- if (this.ci < 0) {
- this.ci = 0;
- this.ck = 0.0F;
- this.cj = 0;
- }
- if (levels > 0 && this.ci % 5 == 0 && (float)this.cr < (float)super.R - 100.0F) {
- float f = this.ci > 30 ? 1.0F : (float)this.ci / 30.0F;
- super.t.playSound((EntityHuman)null, this.locX(), this.locY(), this.locZ(), SoundEffects.oy, this.getSoundCategory(), f * 0.75F, 1.0F);
- this.cr = super.R;
- }
- }
- public int getExpToLevel() {
- return this.ci >= 30 ? 112 + (this.ci - 30) * 9 : (this.ci >= 15 ? 37 + (this.ci - 15) * 5 : 7 + this.ci * 2);
- }
- private static void sendSoundEffect(EntityHuman fromEntity, double x, double y, double z, SoundEffect soundEffect, SoundCategory soundCategory, float volume, float pitch) {
- fromEntity.t.playSound(fromEntity, x, y, z, soundEffect, soundCategory, volume, pitch);
- if (fromEntity instanceof EntityPlayer) {
- ((EntityPlayer)fromEntity).b.sendPacket(new PacketPlayOutNamedSoundEffect(soundEffect, soundCategory, x, y, z, volume, pitch));
- }
- }
- public void applyExhaustion(float exhaustion) {
- this.applyExhaustion(exhaustion, ExhaustionReason.UNKNOWN);
- }
- public void applyExhaustion(float f, ExhaustionReason reason) {
- if (!this.cq.a && !super.t.y) {
- EntityExhaustionEvent event = CraftEventFactory.callPlayerExhaustionEvent(this, reason, f);
- if (!event.isCancelled()) {
- this.bW.a(event.getExhaustion());
- }
- }
- }
- public FoodMetaData getFoodData() {
- return this.bW;
- }
- public boolean s(boolean ignoreHunger) {
- return this.cq.a || ignoreHunger || this.bW.c();
- }
- public boolean fu() {
- return this.getHealth() > 0.0F && this.getHealth() < this.getMaxHealth();
- }
- public boolean fv() {
- return this.cq.e;
- }
- public boolean a(BlockPosition pos, EnumDirection facing, ItemStack stack) {
- if (this.cq.e) {
- return true;
- } else {
- BlockPosition blockposition1 = pos.shift(facing.opposite());
- ShapeDetectorBlock shapedetectorblock = new ShapeDetectorBlock(super.t, blockposition1, false);
- return stack.b(super.t.r(), shapedetectorblock);
- }
- }
- protected int getExpValue(EntityHuman player) {
- if (!super.t.getGameRules().getBoolean(GameRules.d) && !this.isSpectator()) {
- int i = this.ci * 7;
- return i > 100 ? 100 : i;
- } else {
- return 0;
- }
- }
- protected boolean alwaysGivesExp() {
- return true;
- }
- public boolean cn() {
- return true;
- }
- protected MovementEmission aI() {
- return this.cq.b || super.z && this.bG() ? MovementEmission.a : MovementEmission.d;
- }
- public void updateAbilities() {
- }
- public IChatBaseComponent getDisplayName() {
- return new ChatComponentText(this.cs.getName());
- }
- public InventoryEnderChest getEnderChest() {
- return this.bT;
- }
- public ItemStack getEquipment(EnumItemSlot slot) {
- return slot == EnumItemSlot.a ? this.co.getItemInHand() : (slot == EnumItemSlot.b ? (ItemStack)this.co.j.get(0) : (slot.a() == Function.b ? (ItemStack)this.co.i.get(slot.b()) : ItemStack.b));
- }
- public void setSlot(EnumItemSlot slot, ItemStack stack) {
- this.setSlot(slot, stack, false);
- }
- public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack, boolean silent) {
- this.f(itemstack);
- if (enumitemslot == EnumItemSlot.a) {
- this.playEquipSound(itemstack, silent);
- this.co.h.set(this.co.k, itemstack);
- } else if (enumitemslot == EnumItemSlot.b) {
- this.playEquipSound(itemstack, silent);
- this.co.j.set(0, itemstack);
- } else if (enumitemslot.a() == Function.b) {
- this.playEquipSound(itemstack, silent);
- this.co.i.set(enumitemslot.b(), itemstack);
- }
- }
- public boolean j(ItemStack stack) {
- this.playEquipSound(stack);
- return this.co.pickup(stack);
- }
- public Iterable<ItemStack> bw() {
- return Lists.newArrayList(new ItemStack[]{this.getItemInMainHand(), this.getItemInOffHand()});
- }
- public Iterable<ItemStack> getArmorItems() {
- return this.co.i;
- }
- public boolean h(NBTTagCompound entityNbt) {
- if (!this.isPassenger() && super.z && !this.isInWater() && !super.al) {
- if (this.getShoulderEntityLeft().isEmpty()) {
- this.setShoulderEntityLeft(entityNbt);
- this.f = super.t.getTime();
- return true;
- } else if (this.getShoulderEntityRight().isEmpty()) {
- this.setShoulderEntityRight(entityNbt);
- this.f = super.t.getTime();
- return true;
- } else {
- return false;
- }
- } else {
- return false;
- }
- }
- public void releaseShoulderEntities() {
- if (this.f + 20L < super.t.getTime()) {
- if (this.spawnEntityFromShoulder(this.getShoulderEntityLeft())) {
- this.setShoulderEntityLeft(new NBTTagCompound());
- }
- if (this.spawnEntityFromShoulder(this.getShoulderEntityRight())) {
- this.setShoulderEntityRight(new NBTTagCompound());
- }
- }
- }
- public Entity releaseLeftShoulderEntity() {
- Entity entity = this.spawnEntityFromShoulder0(this.getShoulderEntityLeft());
- if (entity != null) {
- this.setShoulderEntityLeft(new NBTTagCompound());
- }
- return entity;
- }
- public Entity releaseRightShoulderEntity() {
- Entity entity = this.spawnEntityFromShoulder0(this.getShoulderEntityRight());
- if (entity != null) {
- this.setShoulderEntityRight(new NBTTagCompound());
- }
- return entity;
- }
- private boolean spawnEntityFromShoulder(NBTTagCompound nbttagcompound) {
- return this.spawnEntityFromShoulder0(nbttagcompound) != null;
- }
- private Entity spawnEntityFromShoulder0(@Nullable NBTTagCompound nbttagcompound) {
- return !super.t.y && nbttagcompound != null && !nbttagcompound.isEmpty() ? (Entity)EntityTypes.a(nbttagcompound, super.t).map((entity) -> {
- if (entity instanceof EntityTameableAnimal) {
- ((EntityTameableAnimal)entity).setOwnerUUID(super.aj);
- }
- entity.setPosition(this.locX(), this.locY() + 0.699999988079071D, this.locZ());
- boolean addedToWorld = ((WorldServer)super.t).addEntitySerialized(entity, SpawnReason.SHOULDER_ENTITY);
- return addedToWorld ? entity : null;
- }).orElse((Object)null) : null;
- }
- public abstract boolean isSpectator();
- public boolean isSwimming() {
- return !this.cq.b && !this.isSpectator() && super.isSwimming();
- }
- public abstract boolean isCreative();
- public boolean ck() {
- return !this.cq.b;
- }
- public Scoreboard getScoreboard() {
- return super.t.getScoreboard();
- }
- public IChatBaseComponent getScoreboardDisplayName() {
- IChatMutableComponent ichatmutablecomponent = ScoreboardTeam.a(this.getScoreboardTeam(), this.getDisplayName());
- return this.a(ichatmutablecomponent);
- }
- private IChatMutableComponent a(IChatMutableComponent component) {
- String s = this.getProfile().getName();
- return component.format((chatmodifier) -> {
- return chatmodifier.setChatClickable(new ChatClickable(EnumClickAction.d, "/tell " + s + " ")).setChatHoverable(this.cq()).setInsertion(s);
- });
- }
- public String getName() {
- return this.getProfile().getName();
- }
- public float b(EntityPose pose, EntitySize dimensions) {
- switch(pose) {
- case d:
- case b:
- case e:
- return 0.4F;
- case f:
- return 1.27F;
- default:
- return 1.62F;
- }
- }
- public void setAbsorptionHearts(float amount) {
- if (amount < 0.0F) {
- amount = 0.0F;
- }
- this.getDataWatcher().set(d, amount);
- }
- public float getAbsorptionHearts() {
- return (Float)this.getDataWatcher().get(d);
- }
- public static UUID a(GameProfile profile) {
- UUID uuid = profile.getId();
- if (uuid == null) {
- uuid = getOfflineUUID(profile.getName());
- }
- return uuid;
- }
- public static UUID getOfflineUUID(String nickname) {
- return UUID.nameUUIDFromBytes(("OfflinePlayer:" + nickname).getBytes(StandardCharsets.UTF_8));
- }
- public boolean a(PlayerModelPart modelPart) {
- return ((Byte)this.getDataWatcher().get(bP) & modelPart.a()) == modelPart.a();
- }
- public SlotAccess k(int mappedIndex) {
- if (mappedIndex >= 0 && mappedIndex < this.co.h.size()) {
- return SlotAccess.a(this.co, mappedIndex);
- } else {
- int j = mappedIndex - 200;
- return j >= 0 && j < this.bT.getSize() ? SlotAccess.a(this.bT, j) : super.k(mappedIndex);
- }
- }
- public boolean fz() {
- return this.ct;
- }
- public void t(boolean reducedDebugInfo) {
- this.ct = reducedDebugInfo;
- }
- public void setFireTicks(int ticks) {
- super.setFireTicks(this.cq.a ? Math.min(ticks, 1) : ticks);
- }
- public EnumMainHand getMainHand() {
- return (Byte)super.Y.get(bQ) == 0 ? EnumMainHand.a : EnumMainHand.b;
- }
- public void a(EnumMainHand arm) {
- super.Y.set(bQ, (byte)(arm == EnumMainHand.a ? 0 : 1));
- }
- public NBTTagCompound getShoulderEntityLeft() {
- return (NBTTagCompound)super.Y.get(bR);
- }
- public void setShoulderEntityLeft(NBTTagCompound entityNbt) {
- super.Y.set(bR, entityNbt);
- }
- public NBTTagCompound getShoulderEntityRight() {
- return (NBTTagCompound)super.Y.get(bS);
- }
- public void setShoulderEntityRight(NBTTagCompound entityNbt) {
- super.Y.set(bS, entityNbt);
- }
- public float fC() {
- return (float)(1.0D / this.b((AttributeBase)GenericAttributes.h) * 20.0D);
- }
- public float getAttackCooldown(float baseTime) {
- return MathHelper.a(((float)super.aQ + baseTime) / this.fC(), 0.0F, 1.0F);
- }
- public void resetAttackCooldown() {
- super.aQ = 0;
- }
- public ItemCooldown getCooldownTracker() {
- return this.cv;
- }
- protected float getBlockSpeedFactor() {
- return !this.cq.b && !this.isGliding() ? super.getBlockSpeedFactor() : 1.0F;
- }
- public float fF() {
- return (float)this.b((AttributeBase)GenericAttributes.k);
- }
- public boolean isCreativeAndOp() {
- return this.cq.d && this.y() >= 2;
- }
- public boolean g(ItemStack stack) {
- EnumItemSlot enumitemslot = EntityInsentient.getEquipmentSlotForItem(stack);
- return this.getEquipment(enumitemslot).isEmpty();
- }
- public EntitySize a(EntityPose pose) {
- return (EntitySize)b.getOrDefault(pose, bO);
- }
- public ImmutableList<EntityPose> eS() {
- return ImmutableList.of(EntityPose.a, EntityPose.f, EntityPose.d);
- }
- protected boolean tryReadyArrow(ItemStack bow, ItemStack itemstack) {
- return !(this instanceof EntityPlayer) || (new PlayerReadyArrowEvent(((EntityPlayer)this).getBukkitEntity(), CraftItemStack.asCraftMirror(bow), CraftItemStack.asCraftMirror(itemstack))).callEvent();
- }
- public ItemStack h(ItemStack stack) {
- if (!(stack.getItem() instanceof ItemProjectileWeapon)) {
- return ItemStack.b;
- } else {
- Predicate<ItemStack> predicate = ((ItemProjectileWeapon)stack.getItem()).e();
- ItemStack itemstack1 = ItemProjectileWeapon.a(this, predicate);
- if (!itemstack1.isEmpty()) {
- return itemstack1;
- } else {
- predicate = ((ItemProjectileWeapon)stack.getItem()).b();
- for(int i = 0; i < this.co.getSize(); ++i) {
- ItemStack itemstack2 = this.co.getItem(i);
- if (predicate.test(itemstack2) && this.tryReadyArrow(stack, itemstack2)) {
- return itemstack2;
- }
- }
- return this.cq.d ? new ItemStack(Items.mh) : ItemStack.b;
- }
- }
- }
- public ItemStack a(World world, ItemStack stack) {
- this.getFoodData().a(stack.getItem(), stack);
- this.b(StatisticList.c.b(stack.getItem()));
- world.playSound((EntityHuman)null, this.locX(), this.locY(), this.locZ(), SoundEffects.or, SoundCategory.h, 0.5F, world.w.nextFloat() * 0.1F + 0.9F);
- if (this instanceof EntityPlayer) {
- CriterionTriggers.z.a((EntityPlayer)this, stack);
- }
- return super.a(world, stack);
- }
- protected boolean b(IBlockData landingState) {
- return this.cq.b || super.b(landingState);
- }
- public Vec3D n(float f) {
- double d0 = 0.22D * (this.getMainHand() == EnumMainHand.b ? -1.0D : 1.0D);
- float f1 = MathHelper.h(f * 0.5F, this.getXRot(), super.y) * 0.017453292F;
- float f2 = MathHelper.h(f, super.aY, super.aX) * 0.017453292F;
- double d1;
- if (!this.isGliding() && !this.isRiptiding()) {
- if (this.bL()) {
- return this.k(f).e((new Vec3D(d0, 0.2D, -0.15D)).a(-f1).b(-f2));
- } else {
- double d2 = this.getBoundingBox().c() - 1.0D;
- d1 = this.isCrouching() ? -0.2D : 0.07D;
- return this.k(f).e((new Vec3D(d0, d2, d1)).b(-f2));
- }
- } else {
- Vec3D vec3d = this.e(f);
- Vec3D vec3d1 = this.getMot();
- d1 = vec3d1.i();
- double d3 = vec3d.i();
- float f3;
- if (d1 > 0.0D && d3 > 0.0D) {
- double d4 = (vec3d1.b * vec3d.b + vec3d1.d * vec3d.d) / Math.sqrt(d1 * d3);
- double d5 = vec3d1.b * vec3d.d - vec3d1.d * vec3d.b;
- f3 = (float)(Math.signum(d5) * Math.acos(d4));
- } else {
- f3 = 0.0F;
- }
- return this.k(f).e((new Vec3D(d0, -0.11D, 0.85D)).c(-f3).a(-f1).b(-f2));
- }
- }
- public boolean dn() {
- return true;
- }
- public boolean fH() {
- return this.isHandRaised() && this.getActiveItem().a(Items.ot);
- }
- public boolean dm() {
- return false;
- }
- static {
- b = ImmutableMap.builder().put(EntityPose.a, bO).put(EntityPose.c, EntityLiving.aD).put(EntityPose.b, EntitySize.b(0.6F, 0.6F)).put(EntityPose.d, EntitySize.b(0.6F, 0.6F)).put(EntityPose.e, EntitySize.b(0.6F, 0.6F)).put(EntityPose.f, EntitySize.b(0.6F, 1.5F)).put(EntityPose.h, EntitySize.c(0.2F, 0.2F)).build();
- d = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.c);
- e = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.b);
- bP = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.a);
- bQ = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.a);
- bR = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p);
- bS = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p);
- }
- public static enum EnumBedResult {
- a,
- b(new ChatMessage("block.minecraft.bed.no_sleep")),
- c(new ChatMessage("block.minecraft.bed.too_far_away")),
- d(new ChatMessage("block.minecraft.bed.obstructed")),
- e,
- f(new ChatMessage("block.minecraft.bed.not_safe"));
- @Nullable
- private final IChatBaseComponent g;
- private EnumBedResult() {
- this.g = null;
- }
- private EnumBedResult(IChatBaseComponent ichatbasecomponent) {
- this.g = ichatbasecomponent;
- }
- @Nullable
- public IChatBaseComponent a() {
- return this.g;
- }
- }
- }
Add Comment
Please, Sign In to add comment