@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/server/ChestLock.java
|
||||
+++ b/net/minecraft/server/ChestLock.java
|
||||
@@ -2,6 +2,11 @@
|
||||
|
||||
import javax.annotation.concurrent.Immutable;
|
||||
--- a/net/minecraft/world/ChestLock.java
|
||||
+++ b/net/minecraft/world/ChestLock.java
|
||||
@@ -4,6 +4,11 @@
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.ChatColor;
|
||||
@@ -12,7 +12,7 @@
|
||||
@Immutable
|
||||
public class ChestLock {
|
||||
|
||||
@@ -13,7 +18,19 @@
|
||||
@@ -15,7 +20,19 @@
|
||||
}
|
||||
|
||||
public boolean a(ItemStack itemstack) {
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
--- a/net/minecraft/server/IInventory.java
|
||||
+++ b/net/minecraft/server/IInventory.java
|
||||
@@ -2,6 +2,8 @@
|
||||
--- a/net/minecraft/world/IInventory.java
|
||||
+++ b/net/minecraft/world/IInventory.java
|
||||
@@ -5,6 +5,11 @@
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
+import org.bukkit.craftbukkit.entity.CraftHumanEntity; // CraftBukkit
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.world.item.crafting.IRecipe;
|
||||
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public interface IInventory extends Clearable {
|
||||
|
||||
int getSize();
|
||||
@@ -16,9 +18,7 @@
|
||||
@@ -19,9 +24,7 @@
|
||||
|
||||
void setItem(int i, ItemStack itemstack);
|
||||
|
||||
@@ -20,7 +23,7 @@
|
||||
|
||||
void update();
|
||||
|
||||
@@ -57,4 +57,29 @@
|
||||
@@ -60,4 +63,29 @@
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
--- a/net/minecraft/server/InventoryLargeChest.java
|
||||
+++ b/net/minecraft/server/InventoryLargeChest.java
|
||||
@@ -1,10 +1,61 @@
|
||||
package net.minecraft.server;
|
||||
--- a/net/minecraft/world/InventoryLargeChest.java
|
||||
+++ b/net/minecraft/world/InventoryLargeChest.java
|
||||
@@ -3,11 +3,62 @@
|
||||
import net.minecraft.world.entity.player.EntityHuman;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import java.util.ArrayList;
|
||||
@@ -62,7 +63,7 @@
|
||||
public InventoryLargeChest(IInventory iinventory, IInventory iinventory1) {
|
||||
if (iinventory == null) {
|
||||
iinventory = iinventory1;
|
||||
@@ -59,7 +110,7 @@
|
||||
@@ -62,7 +113,7 @@
|
||||
|
||||
@Override
|
||||
public int getMaxStackSize() {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/server/InventorySubcontainer.java
|
||||
+++ b/net/minecraft/server/InventorySubcontainer.java
|
||||
@@ -5,13 +5,64 @@
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
--- a/net/minecraft/world/InventorySubcontainer.java
|
||||
+++ b/net/minecraft/world/InventorySubcontainer.java
|
||||
@@ -13,13 +13,64 @@
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.Location;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/DamageSource.java
|
||||
+++ b/net/minecraft/server/DamageSource.java
|
||||
@@ -35,6 +35,18 @@
|
||||
--- a/net/minecraft/world/damagesource/DamageSource.java
|
||||
+++ b/net/minecraft/world/damagesource/DamageSource.java
|
||||
@@ -46,6 +46,18 @@
|
||||
private boolean D;
|
||||
private boolean E;
|
||||
public final String translationIndex;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityDamageSourceIndirect.java
|
||||
+++ b/net/minecraft/server/EntityDamageSourceIndirect.java
|
||||
@@ -32,4 +32,10 @@
|
||||
--- a/net/minecraft/world/damagesource/EntityDamageSourceIndirect.java
|
||||
+++ b/net/minecraft/world/damagesource/EntityDamageSourceIndirect.java
|
||||
@@ -37,4 +37,10 @@
|
||||
|
||||
return !itemstack.isEmpty() && itemstack.hasName() ? new ChatMessage(s1, new Object[]{entityliving.getScoreboardDisplayName(), ichatbasecomponent, itemstack.C()}) : new ChatMessage(s, new Object[]{entityliving.getScoreboardDisplayName(), ichatbasecomponent});
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
--- a/net/minecraft/server/MobEffectList.java
|
||||
+++ b/net/minecraft/server/MobEffectList.java
|
||||
@@ -7,6 +7,11 @@
|
||||
import java.util.UUID;
|
||||
import javax.annotation.Nullable;
|
||||
--- a/net/minecraft/world/effect/MobEffectList.java
|
||||
+++ b/net/minecraft/world/effect/MobEffectList.java
|
||||
@@ -19,6 +19,13 @@
|
||||
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.world.entity.player.EntityHuman;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.network.protocol.game.PacketPlayOutUpdateHealth;
|
||||
+import net.minecraft.server.level.EntityPlayer;
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
+import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
|
||||
+// CraftBukkit end
|
||||
@@ -12,7 +14,7 @@
|
||||
public class MobEffectList {
|
||||
|
||||
private final Map<AttributeBase, AttributeModifier> a = Maps.newHashMap();
|
||||
@@ -21,7 +26,7 @@
|
||||
@@ -33,7 +40,7 @@
|
||||
}
|
||||
|
||||
public static int getId(MobEffectList mobeffectlist) {
|
||||
@@ -21,7 +23,7 @@
|
||||
}
|
||||
|
||||
protected MobEffectList(MobEffectInfo mobeffectinfo, int i) {
|
||||
@@ -32,26 +37,37 @@
|
||||
@@ -44,26 +51,37 @@
|
||||
public void tick(EntityLiving entityliving, int i) {
|
||||
if (this == MobEffects.REGENERATION) {
|
||||
if (entityliving.getHealth() < entityliving.getMaxHealth()) {
|
||||
@@ -64,7 +66,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -72,7 +88,7 @@
|
||||
@@ -84,7 +102,7 @@
|
||||
}
|
||||
} else {
|
||||
j = (int) (d0 * (double) (4 << i) + 0.5D);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/MobEffects.java
|
||||
+++ b/net/minecraft/server/MobEffects.java
|
||||
@@ -57,6 +57,14 @@
|
||||
--- a/net/minecraft/world/effect/MobEffects.java
|
||||
+++ b/net/minecraft/world/effect/MobEffects.java
|
||||
@@ -65,6 +65,14 @@
|
||||
});
|
||||
public static final MobEffectList HERO_OF_THE_VILLAGE = a(32, "hero_of_the_village", new MobEffectList(MobEffectInfo.BENEFICIAL, 4521796));
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/Entity.java
|
||||
+++ b/net/minecraft/server/Entity.java
|
||||
@@ -21,8 +21,58 @@
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -106,8 +106,58 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
protected static final Logger LOGGER = LogManager.getLogger();
|
||||
private static final AtomicInteger entityCount = new AtomicInteger();
|
||||
private static final List<ItemStack> c = Collections.emptyList();
|
||||
@@ -106,6 +156,21 @@
|
||||
@@ -191,6 +241,21 @@
|
||||
private long aB;
|
||||
private EntitySize size;
|
||||
private float headHeight;
|
||||
@@ -81,7 +81,7 @@
|
||||
|
||||
public Entity(EntityTypes<?> entitytypes, World world) {
|
||||
this.id = Entity.entityCount.incrementAndGet();
|
||||
@@ -212,6 +277,12 @@
|
||||
@@ -297,6 +362,12 @@
|
||||
}
|
||||
|
||||
public void setPose(EntityPose entitypose) {
|
||||
@@ -94,7 +94,7 @@
|
||||
this.datawatcher.set(Entity.POSE, entitypose);
|
||||
}
|
||||
|
||||
@@ -228,6 +299,33 @@
|
||||
@@ -313,6 +384,33 @@
|
||||
}
|
||||
|
||||
protected void setYawPitch(float f, float f1) {
|
||||
@@ -128,7 +128,7 @@
|
||||
this.yaw = f % 360.0F;
|
||||
this.pitch = f1 % 360.0F;
|
||||
}
|
||||
@@ -235,6 +333,7 @@
|
||||
@@ -320,6 +418,7 @@
|
||||
public void setPosition(double d0, double d1, double d2) {
|
||||
this.setPositionRaw(d0, d1, d2);
|
||||
this.a(this.size.a(d0, d1, d2));
|
||||
@@ -136,7 +136,7 @@
|
||||
}
|
||||
|
||||
protected void af() {
|
||||
@@ -249,6 +348,15 @@
|
||||
@@ -334,6 +433,15 @@
|
||||
this.entityBaseTick();
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
public void entityBaseTick() {
|
||||
this.world.getMethodProfiler().enter("entityBaseTick");
|
||||
if (this.isPassenger() && this.getVehicle().dead) {
|
||||
@@ -262,7 +370,7 @@
|
||||
@@ -347,7 +455,7 @@
|
||||
this.z = this.A;
|
||||
this.lastPitch = this.pitch;
|
||||
this.lastYaw = this.yaw;
|
||||
@@ -161,7 +161,7 @@
|
||||
if (this.aO()) {
|
||||
this.aP();
|
||||
}
|
||||
@@ -325,12 +433,44 @@
|
||||
@@ -410,12 +518,44 @@
|
||||
|
||||
protected void burnFromLava() {
|
||||
if (!this.isFireProof()) {
|
||||
@@ -207,7 +207,7 @@
|
||||
int j = i * 20;
|
||||
|
||||
if (this instanceof EntityLiving) {
|
||||
@@ -427,6 +567,28 @@
|
||||
@@ -512,6 +652,28 @@
|
||||
block.a((IBlockAccess) this.world, this);
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@
|
||||
if (this.onGround && !this.bv()) {
|
||||
block.stepOn(this.world, blockposition, this);
|
||||
}
|
||||
@@ -700,6 +862,7 @@
|
||||
@@ -785,6 +947,7 @@
|
||||
AxisAlignedBB axisalignedbb = this.getBoundingBox();
|
||||
|
||||
this.setPositionRaw((axisalignedbb.minX + axisalignedbb.maxX) / 2.0D, axisalignedbb.minY, (axisalignedbb.minZ + axisalignedbb.maxZ) / 2.0D);
|
||||
@@ -244,7 +244,7 @@
|
||||
}
|
||||
|
||||
protected SoundEffect getSoundSwim() {
|
||||
@@ -1025,6 +1188,13 @@
|
||||
@@ -1110,6 +1273,13 @@
|
||||
}
|
||||
|
||||
public void spawnIn(World world) {
|
||||
@@ -258,7 +258,7 @@
|
||||
this.world = world;
|
||||
}
|
||||
|
||||
@@ -1044,6 +1214,7 @@
|
||||
@@ -1129,6 +1299,7 @@
|
||||
this.lastY = d1;
|
||||
this.lastZ = d4;
|
||||
this.setPosition(d3, d1, d4);
|
||||
@@ -266,7 +266,7 @@
|
||||
}
|
||||
|
||||
public void d(Vec3D vec3d) {
|
||||
@@ -1218,6 +1389,12 @@
|
||||
@@ -1303,6 +1474,12 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@
|
||||
public void a(Entity entity, int i, DamageSource damagesource) {
|
||||
if (entity instanceof EntityPlayer) {
|
||||
CriterionTriggers.c.a((EntityPlayer) entity, this, damagesource);
|
||||
@@ -1228,7 +1405,7 @@
|
||||
@@ -1313,7 +1490,7 @@
|
||||
public boolean a_(NBTTagCompound nbttagcompound) {
|
||||
String s = this.getSaveID();
|
||||
|
||||
@@ -288,7 +288,7 @@
|
||||
nbttagcompound.setString("id", s);
|
||||
this.save(nbttagcompound);
|
||||
return true;
|
||||
@@ -1252,6 +1429,18 @@
|
||||
@@ -1337,6 +1514,18 @@
|
||||
Vec3D vec3d = this.getMot();
|
||||
|
||||
nbttagcompound.set("Motion", this.a(vec3d.x, vec3d.y, vec3d.z));
|
||||
@@ -307,7 +307,7 @@
|
||||
nbttagcompound.set("Rotation", this.a(this.yaw, this.pitch));
|
||||
nbttagcompound.setFloat("FallDistance", this.fallDistance);
|
||||
nbttagcompound.setShort("Fire", (short) this.fireTicks);
|
||||
@@ -1260,6 +1449,18 @@
|
||||
@@ -1345,6 +1534,18 @@
|
||||
nbttagcompound.setBoolean("Invulnerable", this.invulnerable);
|
||||
nbttagcompound.setInt("PortalCooldown", this.portalCooldown);
|
||||
nbttagcompound.a("UUID", this.getUniqueID());
|
||||
@@ -326,7 +326,7 @@
|
||||
IChatBaseComponent ichatbasecomponent = this.getCustomName();
|
||||
|
||||
if (ichatbasecomponent != null) {
|
||||
@@ -1317,6 +1518,11 @@
|
||||
@@ -1402,6 +1603,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -338,7 +338,7 @@
|
||||
return nbttagcompound;
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.a(throwable, "Saving entity NBT");
|
||||
@@ -1394,6 +1600,49 @@
|
||||
@@ -1479,6 +1685,49 @@
|
||||
} else {
|
||||
throw new IllegalStateException("Entity has invalid position");
|
||||
}
|
||||
@@ -388,7 +388,7 @@
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.a(throwable, "Loading entity NBT");
|
||||
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being loaded");
|
||||
@@ -1469,9 +1718,22 @@
|
||||
@@ -1554,9 +1803,22 @@
|
||||
} else if (this.world.isClientSide) {
|
||||
return null;
|
||||
} else {
|
||||
@@ -411,7 +411,7 @@
|
||||
this.world.addEntity(entityitem);
|
||||
return entityitem;
|
||||
}
|
||||
@@ -1555,7 +1817,7 @@
|
||||
@@ -1640,7 +1902,7 @@
|
||||
|
||||
this.setPose(EntityPose.STANDING);
|
||||
this.vehicle = entity;
|
||||
@@ -420,7 +420,7 @@
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1580,7 +1842,7 @@
|
||||
@@ -1665,7 +1927,7 @@
|
||||
Entity entity = this.vehicle;
|
||||
|
||||
this.vehicle = null;
|
||||
@@ -429,7 +429,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1589,10 +1851,31 @@
|
||||
@@ -1674,10 +1936,31 @@
|
||||
this.bf();
|
||||
}
|
||||
|
||||
@@ -462,7 +462,7 @@
|
||||
if (!this.world.isClientSide && entity instanceof EntityHuman && !(this.getRidingPassenger() instanceof EntityHuman)) {
|
||||
this.passengers.add(0, entity);
|
||||
} else {
|
||||
@@ -1600,15 +1883,36 @@
|
||||
@@ -1685,15 +1968,36 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -500,7 +500,7 @@
|
||||
}
|
||||
|
||||
protected boolean q(Entity entity) {
|
||||
@@ -1646,14 +1950,20 @@
|
||||
@@ -1731,14 +2035,20 @@
|
||||
|
||||
if (this.inPortal) {
|
||||
MinecraftServer minecraftserver = worldserver.getMinecraftServer();
|
||||
@@ -524,7 +524,7 @@
|
||||
this.world.getMethodProfiler().exit();
|
||||
}
|
||||
|
||||
@@ -1753,6 +2063,13 @@
|
||||
@@ -1838,6 +2148,13 @@
|
||||
}
|
||||
|
||||
public void setSwimming(boolean flag) {
|
||||
@@ -538,7 +538,7 @@
|
||||
this.setFlag(4, flag);
|
||||
}
|
||||
|
||||
@@ -1785,8 +2102,12 @@
|
||||
@@ -1870,8 +2187,12 @@
|
||||
return this.getScoreboardTeam() != null ? this.getScoreboardTeam().isAlly(scoreboardteambase) : false;
|
||||
}
|
||||
|
||||
@@ -552,7 +552,7 @@
|
||||
}
|
||||
|
||||
public boolean getFlag(int i) {
|
||||
@@ -1813,16 +2134,56 @@
|
||||
@@ -1898,16 +2219,56 @@
|
||||
}
|
||||
|
||||
public void setAirTicks(int i) {
|
||||
@@ -612,7 +612,7 @@
|
||||
}
|
||||
|
||||
public void k(boolean flag) {
|
||||
@@ -1972,15 +2333,32 @@
|
||||
@@ -2057,15 +2418,32 @@
|
||||
|
||||
@Nullable
|
||||
public Entity b(WorldServer worldserver) {
|
||||
@@ -647,7 +647,7 @@
|
||||
this.world.getMethodProfiler().exitEnter("reloading");
|
||||
Entity entity = this.getEntityType().a((World) worldserver);
|
||||
|
||||
@@ -1989,9 +2367,17 @@
|
||||
@@ -2074,9 +2452,17 @@
|
||||
entity.setPositionRotation(shapedetectorshape.position.x, shapedetectorshape.position.y, shapedetectorshape.position.z, shapedetectorshape.yaw, entity.pitch);
|
||||
entity.setMot(shapedetectorshape.velocity);
|
||||
worldserver.addEntityTeleport(entity);
|
||||
@@ -667,7 +667,7 @@
|
||||
}
|
||||
|
||||
this.bN();
|
||||
@@ -2012,13 +2398,18 @@
|
||||
@@ -2097,13 +2483,18 @@
|
||||
|
||||
@Nullable
|
||||
protected ShapeDetectorShape a(WorldServer worldserver) {
|
||||
@@ -690,7 +690,7 @@
|
||||
return null;
|
||||
} else {
|
||||
WorldBorder worldborder = worldserver.getWorldBorder();
|
||||
@@ -2028,8 +2419,16 @@
|
||||
@@ -2113,8 +2504,16 @@
|
||||
double d3 = Math.min(2.9999872E7D, worldborder.h() - 16.0D);
|
||||
double d4 = DimensionManager.a(this.world.getDimensionManager(), worldserver.getDimensionManager());
|
||||
BlockPosition blockposition = new BlockPosition(MathHelper.a(this.locX() * d4, d0, d2), this.locY(), MathHelper.a(this.locZ() * d4, d1, d3));
|
||||
@@ -708,7 +708,7 @@
|
||||
IBlockData iblockdata = this.world.getType(this.ac);
|
||||
EnumDirection.EnumAxis enumdirection_enumaxis;
|
||||
Vec3D vec3d;
|
||||
@@ -2046,8 +2445,8 @@
|
||||
@@ -2131,8 +2530,8 @@
|
||||
vec3d = new Vec3D(0.5D, 0.0D, 0.0D);
|
||||
}
|
||||
|
||||
@@ -719,7 +719,7 @@
|
||||
}
|
||||
} else {
|
||||
BlockPosition blockposition1;
|
||||
@@ -2057,8 +2456,15 @@
|
||||
@@ -2142,8 +2541,15 @@
|
||||
} else {
|
||||
blockposition1 = worldserver.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING_NO_LEAVES, worldserver.getSpawn());
|
||||
}
|
||||
@@ -736,7 +736,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2066,8 +2472,23 @@
|
||||
@@ -2151,8 +2557,23 @@
|
||||
return BlockPortalShape.a(blockutil_rectangle, enumdirection_enumaxis, this.getPositionVector(), this.a(this.getPose()));
|
||||
}
|
||||
|
||||
@@ -762,7 +762,7 @@
|
||||
}
|
||||
|
||||
public boolean canPortal() {
|
||||
@@ -2253,7 +2674,26 @@
|
||||
@@ -2338,7 +2759,26 @@
|
||||
}
|
||||
|
||||
public void a(AxisAlignedBB axisalignedbb) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityAgeable.java
|
||||
+++ b/net/minecraft/server/EntityAgeable.java
|
||||
@@ -8,6 +8,7 @@
|
||||
--- a/net/minecraft/world/entity/EntityAgeable.java
|
||||
+++ b/net/minecraft/world/entity/EntityAgeable.java
|
||||
@@ -17,6 +17,7 @@
|
||||
protected int b;
|
||||
protected int c;
|
||||
protected int d;
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
protected EntityAgeable(EntityTypes<? extends EntityAgeable> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -91,6 +92,7 @@
|
||||
@@ -100,6 +101,7 @@
|
||||
super.saveData(nbttagcompound);
|
||||
nbttagcompound.setInt("Age", this.getAge());
|
||||
nbttagcompound.setInt("ForcedAge", this.c);
|
||||
@@ -16,7 +16,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -98,6 +100,7 @@
|
||||
@@ -107,6 +109,7 @@
|
||||
super.loadData(nbttagcompound);
|
||||
this.setAgeRaw(nbttagcompound.getInt("Age"));
|
||||
this.c = nbttagcompound.getInt("ForcedAge");
|
||||
@@ -24,7 +24,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -112,7 +115,7 @@
|
||||
@@ -121,7 +124,7 @@
|
||||
@Override
|
||||
public void movementTick() {
|
||||
super.movementTick();
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
--- a/net/minecraft/server/EntityAreaEffectCloud.java
|
||||
+++ b/net/minecraft/server/EntityAreaEffectCloud.java
|
||||
@@ -14,6 +14,11 @@
|
||||
--- a/net/minecraft/world/entity/EntityAreaEffectCloud.java
|
||||
+++ b/net/minecraft/world/entity/EntityAreaEffectCloud.java
|
||||
@@ -33,6 +33,12 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.resources.MinecraftKey;
|
||||
+import org.bukkit.craftbukkit.entity.CraftLivingEntity;
|
||||
+import org.bukkit.entity.LivingEntity;
|
||||
+// CraftBukkit end
|
||||
@@ -12,7 +13,7 @@
|
||||
public class EntityAreaEffectCloud extends Entity {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
@@ -105,6 +110,22 @@
|
||||
@@ -124,6 +130,22 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -35,7 +36,7 @@
|
||||
public int getColor() {
|
||||
return (Integer) this.getDataWatcher().get(EntityAreaEffectCloud.COLOR);
|
||||
}
|
||||
@@ -249,6 +270,7 @@
|
||||
@@ -268,6 +290,7 @@
|
||||
if (!list1.isEmpty()) {
|
||||
Iterator iterator2 = list1.iterator();
|
||||
|
||||
@@ -43,7 +44,7 @@
|
||||
while (iterator2.hasNext()) {
|
||||
EntityLiving entityliving = (EntityLiving) iterator2.next();
|
||||
|
||||
@@ -258,6 +280,17 @@
|
||||
@@ -277,6 +300,17 @@
|
||||
double d2 = d0 * d0 + d1 * d1;
|
||||
|
||||
if (d2 <= (double) (f * f)) {
|
||||
@@ -61,7 +62,7 @@
|
||||
this.affectedEntities.put(entityliving, this.ticksLived + this.reapplicationDelay);
|
||||
Iterator iterator3 = list.iterator();
|
||||
|
||||
@@ -267,7 +300,7 @@
|
||||
@@ -286,7 +320,7 @@
|
||||
if (mobeffect1.getMobEffect().isInstant()) {
|
||||
mobeffect1.getMobEffect().applyInstantEffect(this, this.getSource(), entityliving, mobeffect1.getAmplifier(), 0.5D);
|
||||
} else {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
--- a/net/minecraft/server/EntityCreature.java
|
||||
+++ b/net/minecraft/server/EntityCreature.java
|
||||
@@ -1,5 +1,9 @@
|
||||
package net.minecraft.server;
|
||||
--- a/net/minecraft/world/entity/EntityCreature.java
|
||||
+++ b/net/minecraft/world/entity/EntityCreature.java
|
||||
@@ -7,6 +7,10 @@
|
||||
import net.minecraft.world.level.World;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.event.entity.EntityUnleashEvent;
|
||||
@@ -10,7 +11,7 @@
|
||||
public abstract class EntityCreature extends EntityInsentient {
|
||||
|
||||
protected EntityCreature(EntityTypes<? extends EntityCreature> entitytypes, World world) {
|
||||
@@ -34,6 +38,7 @@
|
||||
@@ -41,6 +45,7 @@
|
||||
|
||||
if (this instanceof EntityTameableAnimal && ((EntityTameableAnimal) this).isSitting()) {
|
||||
if (f > 10.0F) {
|
||||
@@ -18,7 +19,7 @@
|
||||
this.unleash(true, true);
|
||||
}
|
||||
|
||||
@@ -42,6 +47,7 @@
|
||||
@@ -49,6 +54,7 @@
|
||||
|
||||
this.x(f);
|
||||
if (f > 10.0F) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/server/EntityExperienceOrb.java
|
||||
+++ b/net/minecraft/server/EntityExperienceOrb.java
|
||||
@@ -2,6 +2,12 @@
|
||||
|
||||
import java.util.Map.Entry;
|
||||
--- a/net/minecraft/world/entity/EntityExperienceOrb.java
|
||||
+++ b/net/minecraft/world/entity/EntityExperienceOrb.java
|
||||
@@ -16,6 +16,12 @@
|
||||
import net.minecraft.world.level.World;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
@@ -13,7 +13,7 @@
|
||||
public class EntityExperienceOrb extends Entity {
|
||||
|
||||
public int b;
|
||||
@@ -36,6 +42,7 @@
|
||||
@@ -50,6 +56,7 @@
|
||||
@Override
|
||||
public void tick() {
|
||||
super.tick();
|
||||
@@ -21,7 +21,7 @@
|
||||
if (this.d > 0) {
|
||||
--this.d;
|
||||
}
|
||||
@@ -72,7 +79,22 @@
|
||||
@@ -86,7 +93,22 @@
|
||||
this.targetPlayer = null;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
Vec3D vec3d = new Vec3D(this.targetPlayer.locX() - this.locX(), this.targetPlayer.locY() + (double) this.targetPlayer.getHeadHeight() / 2.0D - this.locY(), this.targetPlayer.locZ() - this.locZ());
|
||||
double d1 = vec3d.g();
|
||||
|
||||
@@ -155,13 +177,19 @@
|
||||
@@ -169,13 +191,19 @@
|
||||
if (!itemstack.isEmpty() && itemstack.f()) {
|
||||
int i = Math.min(this.c(this.value), itemstack.getDamage());
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
}
|
||||
|
||||
this.die();
|
||||
@@ -183,6 +211,24 @@
|
||||
@@ -197,6 +225,24 @@
|
||||
}
|
||||
|
||||
public static int getOrbValue(int i) {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
--- a/net/minecraft/server/EntityInsentient.java
|
||||
+++ b/net/minecraft/server/EntityInsentient.java
|
||||
@@ -10,6 +10,18 @@
|
||||
import java.util.UUID;
|
||||
import javax.annotation.Nullable;
|
||||
--- a/net/minecraft/world/entity/EntityInsentient.java
|
||||
+++ b/net/minecraft/world/entity/EntityInsentient.java
|
||||
@@ -74,6 +74,19 @@
|
||||
import net.minecraft.world.level.pathfinder.PathType;
|
||||
import net.minecraft.world.level.storage.loot.LootTableInfo;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.server.level.EntityPlayer;
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
+import org.bukkit.craftbukkit.entity.CraftLivingEntity;
|
||||
+import org.bukkit.event.entity.CreatureSpawnEvent;
|
||||
@@ -19,7 +20,7 @@
|
||||
public abstract class EntityInsentient extends EntityLiving {
|
||||
|
||||
private static final DataWatcherObject<Byte> b = DataWatcher.a(EntityInsentient.class, DataWatcherRegistry.a);
|
||||
@@ -28,7 +40,7 @@
|
||||
@@ -92,7 +105,7 @@
|
||||
public final float[] dropChanceHand;
|
||||
private final NonNullList<ItemStack> bq;
|
||||
public final float[] dropChanceArmor;
|
||||
@@ -28,7 +29,7 @@
|
||||
public boolean persistent;
|
||||
private final Map<PathType, Float> bt;
|
||||
public MinecraftKey lootTableKey;
|
||||
@@ -41,6 +53,8 @@
|
||||
@@ -105,6 +118,8 @@
|
||||
private BlockPosition bz;
|
||||
private float bA;
|
||||
|
||||
@@ -37,7 +38,7 @@
|
||||
protected EntityInsentient(EntityTypes<? extends EntityInsentient> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
this.bp = NonNullList.a(2, ItemStack.b);
|
||||
@@ -64,6 +78,9 @@
|
||||
@@ -128,6 +143,9 @@
|
||||
this.initPathfinder();
|
||||
}
|
||||
|
||||
@@ -47,7 +48,7 @@
|
||||
}
|
||||
|
||||
protected void initPathfinder() {}
|
||||
@@ -144,7 +161,38 @@
|
||||
@@ -208,7 +226,38 @@
|
||||
}
|
||||
|
||||
public void setGoalTarget(@Nullable EntityLiving entityliving) {
|
||||
@@ -86,7 +87,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -361,16 +409,26 @@
|
||||
@@ -425,16 +474,26 @@
|
||||
nbttagcompound.setBoolean("NoAI", this.isNoAI());
|
||||
}
|
||||
|
||||
@@ -115,7 +116,7 @@
|
||||
NBTTagList nbttaglist;
|
||||
int i;
|
||||
|
||||
@@ -417,6 +475,11 @@
|
||||
@@ -481,6 +540,11 @@
|
||||
}
|
||||
|
||||
this.setNoAI(nbttagcompound.getBoolean("NoAI"));
|
||||
@@ -127,7 +128,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -424,6 +487,11 @@
|
||||
@@ -488,6 +552,11 @@
|
||||
super.a(damagesource, flag);
|
||||
this.lootTableKey = null;
|
||||
}
|
||||
@@ -139,7 +140,7 @@
|
||||
|
||||
@Override
|
||||
protected LootTableInfo.Builder a(boolean flag, DamageSource damagesource) {
|
||||
@@ -480,7 +548,7 @@
|
||||
@@ -544,7 +613,7 @@
|
||||
protected void b(EntityItem entityitem) {
|
||||
ItemStack itemstack = entityitem.getItemStack();
|
||||
|
||||
@@ -148,7 +149,7 @@
|
||||
this.a(entityitem);
|
||||
this.receive(entityitem, itemstack.getCount());
|
||||
entityitem.die();
|
||||
@@ -489,15 +557,29 @@
|
||||
@@ -553,15 +622,29 @@
|
||||
}
|
||||
|
||||
public boolean g(ItemStack itemstack) {
|
||||
@@ -179,7 +180,7 @@
|
||||
}
|
||||
|
||||
this.b(enumitemslot, itemstack);
|
||||
@@ -610,18 +692,18 @@
|
||||
@@ -674,18 +757,18 @@
|
||||
EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D);
|
||||
|
||||
if (entityhuman != null) {
|
||||
@@ -201,7 +202,7 @@
|
||||
this.die();
|
||||
} else if (d0 < (double) l) {
|
||||
this.ticksFarFromPlayer = 0;
|
||||
@@ -636,6 +718,7 @@
|
||||
@@ -700,6 +783,7 @@
|
||||
@Override
|
||||
protected final void doTick() {
|
||||
++this.ticksFarFromPlayer;
|
||||
@@ -209,7 +210,7 @@
|
||||
this.world.getMethodProfiler().enter("sensing");
|
||||
this.bo.a();
|
||||
this.world.getMethodProfiler().exit();
|
||||
@@ -1024,6 +1107,12 @@
|
||||
@@ -1088,6 +1172,12 @@
|
||||
if (!this.isAlive()) {
|
||||
return EnumInteractionResult.PASS;
|
||||
} else if (this.getLeashHolder() == entityhuman) {
|
||||
@@ -222,7 +223,7 @@
|
||||
this.unleash(true, !entityhuman.abilities.canInstantlyBuild);
|
||||
return EnumInteractionResult.a(this.world.isClientSide);
|
||||
} else {
|
||||
@@ -1042,6 +1131,12 @@
|
||||
@@ -1106,6 +1196,12 @@
|
||||
ItemStack itemstack = entityhuman.b(enumhand);
|
||||
|
||||
if (itemstack.getItem() == Items.LEAD && this.a(entityhuman)) {
|
||||
@@ -235,7 +236,7 @@
|
||||
this.setLeashHolder(entityhuman, true);
|
||||
itemstack.subtract(1);
|
||||
return EnumInteractionResult.a(this.world.isClientSide);
|
||||
@@ -1057,7 +1152,7 @@
|
||||
@@ -1121,7 +1217,7 @@
|
||||
if (itemstack.getItem() instanceof ItemMonsterEgg) {
|
||||
if (this.world instanceof WorldServer) {
|
||||
ItemMonsterEgg itemmonsteregg = (ItemMonsterEgg) itemstack.getItem();
|
||||
@@ -244,7 +245,7 @@
|
||||
|
||||
optional.ifPresent((entityinsentient) -> {
|
||||
this.a(entityhuman, entityinsentient);
|
||||
@@ -1103,12 +1198,19 @@
|
||||
@@ -1167,12 +1263,19 @@
|
||||
return this.bA != -1.0F;
|
||||
}
|
||||
|
||||
@@ -265,7 +266,7 @@
|
||||
|
||||
t0.u(this);
|
||||
t0.setBaby(this.isBaby());
|
||||
@@ -1140,7 +1242,12 @@
|
||||
@@ -1204,7 +1307,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,7 +280,7 @@
|
||||
if (this.isPassenger()) {
|
||||
Entity entity = this.getVehicle();
|
||||
|
||||
@@ -1160,6 +1267,7 @@
|
||||
@@ -1224,6 +1332,7 @@
|
||||
|
||||
if (this.leashHolder != null) {
|
||||
if (!this.isAlive() || !this.leashHolder.isAlive()) {
|
||||
@@ -287,7 +288,7 @@
|
||||
this.unleash(true, true);
|
||||
}
|
||||
|
||||
@@ -1176,7 +1284,9 @@
|
||||
@@ -1240,7 +1349,9 @@
|
||||
this.leashHolder = null;
|
||||
this.by = null;
|
||||
if (!this.world.isClientSide && flag1) {
|
||||
@@ -297,7 +298,7 @@
|
||||
}
|
||||
|
||||
if (!this.world.isClientSide && flag && this.world instanceof WorldServer) {
|
||||
@@ -1226,6 +1336,7 @@
|
||||
@@ -1290,6 +1401,7 @@
|
||||
boolean flag1 = super.a(entity, flag);
|
||||
|
||||
if (flag1 && this.isLeashed()) {
|
||||
@@ -305,7 +306,7 @@
|
||||
this.unleash(true, true);
|
||||
}
|
||||
|
||||
@@ -1358,7 +1469,14 @@
|
||||
@@ -1422,7 +1534,14 @@
|
||||
int i = EnchantmentManager.getFireAspectEnchantmentLevel(this);
|
||||
|
||||
if (i > 0) {
|
||||
@@ -321,7 +322,7 @@
|
||||
}
|
||||
|
||||
boolean flag = entity.damageEntity(DamageSource.mobAttack(this), f);
|
||||
@@ -1420,6 +1538,7 @@
|
||||
@@ -1484,6 +1603,7 @@
|
||||
@Override
|
||||
protected void bN() {
|
||||
super.bN();
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
--- a/net/minecraft/server/EntityLightning.java
|
||||
+++ b/net/minecraft/server/EntityLightning.java
|
||||
@@ -5,6 +5,8 @@
|
||||
import java.util.List;
|
||||
import javax.annotation.Nullable;
|
||||
--- a/net/minecraft/world/entity/EntityLightning.java
|
||||
+++ b/net/minecraft/world/entity/EntityLightning.java
|
||||
@@ -22,6 +22,11 @@
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.network.protocol.game.PacketPlayOutNamedSoundEffect;
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class EntityLightning extends Entity {
|
||||
|
||||
private int lifeTicks;
|
||||
@@ -45,7 +47,24 @@
|
||||
@@ -62,7 +67,24 @@
|
||||
this.a(4);
|
||||
}
|
||||
|
||||
@@ -35,7 +38,7 @@
|
||||
this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_LIGHTNING_BOLT_IMPACT, SoundCategory.WEATHER, 2.0F, 0.5F + this.random.nextFloat() * 0.2F);
|
||||
}
|
||||
|
||||
@@ -61,7 +80,7 @@
|
||||
@@ -78,7 +100,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +47,7 @@
|
||||
if (!(this.world instanceof WorldServer)) {
|
||||
this.world.c(2);
|
||||
} else if (!this.isEffect) {
|
||||
@@ -89,7 +108,11 @@
|
||||
@@ -106,7 +128,11 @@
|
||||
IBlockData iblockdata = BlockFireAbstract.a((IBlockAccess) this.world, blockposition);
|
||||
|
||||
if (this.world.getType(blockposition).isAir() && iblockdata.canPlace(this.world, blockposition)) {
|
||||
@@ -57,7 +60,7 @@
|
||||
}
|
||||
|
||||
for (int j = 0; j < i; ++j) {
|
||||
@@ -97,7 +120,11 @@
|
||||
@@ -114,7 +140,11 @@
|
||||
|
||||
iblockdata = BlockFireAbstract.a((IBlockAccess) this.world, blockposition1);
|
||||
if (this.world.getType(blockposition1).isAir() && iblockdata.canPlace(this.world, blockposition1)) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--- a/net/minecraft/server/EntityLiving.java
|
||||
+++ b/net/minecraft/server/EntityLiving.java
|
||||
@@ -21,6 +21,27 @@
|
||||
import javax.annotation.Nullable;
|
||||
--- a/net/minecraft/world/entity/EntityLiving.java
|
||||
+++ b/net/minecraft/world/entity/EntityLiving.java
|
||||
@@ -111,6 +111,30 @@
|
||||
import net.minecraft.world.scores.ScoreboardTeam;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
+// CraftBukkit start
|
||||
@@ -9,6 +9,9 @@
|
||||
+import java.util.HashSet;
|
||||
+import java.util.Set;
|
||||
+import com.google.common.base.Function;
|
||||
+import net.minecraft.nbt.NBTTagFloat;
|
||||
+import net.minecraft.nbt.NBTTagInt;
|
||||
+import net.minecraft.world.entity.animal.EntityAnimal;
|
||||
+import org.bukkit.Location;
|
||||
+import org.bukkit.craftbukkit.attribute.CraftAttributeMap;
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
@@ -28,15 +31,15 @@
|
||||
public abstract class EntityLiving extends Entity {
|
||||
|
||||
private static final UUID b = UUID.fromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D");
|
||||
@@ -106,6 +127,21 @@
|
||||
@@ -196,6 +220,21 @@
|
||||
private float bB;
|
||||
private float bC;
|
||||
protected BehaviorController<?> bg;
|
||||
+ // CraftBukkit start
|
||||
+ public int expToDrop;
|
||||
+ public int maxAirTicks = 300;
|
||||
+ boolean forceDrops;
|
||||
+ ArrayList<org.bukkit.inventory.ItemStack> drops = new ArrayList<org.bukkit.inventory.ItemStack>();
|
||||
+ public boolean forceDrops;
|
||||
+ public ArrayList<org.bukkit.inventory.ItemStack> drops = new ArrayList<org.bukkit.inventory.ItemStack>();
|
||||
+ public final org.bukkit.craftbukkit.attribute.CraftAttributeMap craftAttributes;
|
||||
+ public boolean collides = true;
|
||||
+ public Set<UUID> collidableExemptions = new HashSet<>();
|
||||
@@ -50,7 +53,7 @@
|
||||
|
||||
protected EntityLiving(EntityTypes<? extends EntityLiving> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -117,7 +153,9 @@
|
||||
@@ -207,7 +246,9 @@
|
||||
this.activeItem = ItemStack.b;
|
||||
this.by = Optional.empty();
|
||||
this.attributeMap = new AttributeMapBase(AttributeDefaults.a(entitytypes));
|
||||
@@ -61,7 +64,7 @@
|
||||
this.i = true;
|
||||
this.az = (float) ((Math.random() + 1.0D) * 0.009999999776482582D);
|
||||
this.af();
|
||||
@@ -184,7 +222,13 @@
|
||||
@@ -274,7 +315,13 @@
|
||||
double d1 = Math.min((double) (0.2F + f / 15.0F), 2.5D);
|
||||
int i = (int) (150.0D * d1);
|
||||
|
||||
@@ -76,7 +79,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -406,7 +450,7 @@
|
||||
@@ -496,7 +543,7 @@
|
||||
|
||||
protected void cU() {
|
||||
++this.deathTicks;
|
||||
@@ -85,7 +88,7 @@
|
||||
this.die();
|
||||
|
||||
for (int i = 0; i < 20; ++i) {
|
||||
@@ -497,7 +541,13 @@
|
||||
@@ -587,7 +634,13 @@
|
||||
}
|
||||
|
||||
protected void playEquipSound(ItemStack itemstack) {
|
||||
@@ -100,7 +103,7 @@
|
||||
SoundEffect soundeffect = SoundEffects.ITEM_ARMOR_EQUIP_GENERIC;
|
||||
Item item = itemstack.getItem();
|
||||
|
||||
@@ -567,6 +617,17 @@
|
||||
@@ -657,6 +710,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +121,7 @@
|
||||
if (nbttagcompound.hasKeyOfType("Health", 99)) {
|
||||
this.setHealth(nbttagcompound.getFloat("Health"));
|
||||
}
|
||||
@@ -604,9 +665,32 @@
|
||||
@@ -694,9 +758,32 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -151,7 +154,7 @@
|
||||
try {
|
||||
while (iterator.hasNext()) {
|
||||
MobEffectList mobeffectlist = (MobEffectList) iterator.next();
|
||||
@@ -616,6 +700,12 @@
|
||||
@@ -706,6 +793,12 @@
|
||||
this.a(mobeffect, true);
|
||||
})) {
|
||||
if (!this.world.isClientSide) {
|
||||
@@ -164,7 +167,7 @@
|
||||
iterator.remove();
|
||||
this.b(mobeffect);
|
||||
}
|
||||
@@ -626,6 +716,17 @@
|
||||
@@ -716,6 +809,17 @@
|
||||
} catch (ConcurrentModificationException concurrentmodificationexception) {
|
||||
;
|
||||
}
|
||||
@@ -182,7 +185,7 @@
|
||||
|
||||
if (this.updateEffects) {
|
||||
if (!this.world.isClientSide) {
|
||||
@@ -735,7 +836,13 @@
|
||||
@@ -825,7 +929,13 @@
|
||||
this.datawatcher.set(EntityLiving.f, 0);
|
||||
}
|
||||
|
||||
@@ -196,7 +199,7 @@
|
||||
if (this.world.isClientSide) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -744,7 +851,14 @@
|
||||
@@ -834,7 +944,14 @@
|
||||
boolean flag;
|
||||
|
||||
for (flag = false; iterator.hasNext(); flag = true) {
|
||||
@@ -212,7 +215,7 @@
|
||||
iterator.remove();
|
||||
}
|
||||
|
||||
@@ -769,18 +883,44 @@
|
||||
@@ -859,18 +976,44 @@
|
||||
return (MobEffect) this.effects.get(mobeffectlist);
|
||||
}
|
||||
|
||||
@@ -258,7 +261,7 @@
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -804,13 +944,39 @@
|
||||
@@ -894,13 +1037,39 @@
|
||||
return this.getMonsterType() == EnumMonsterType.UNDEAD;
|
||||
}
|
||||
|
||||
@@ -299,7 +302,7 @@
|
||||
|
||||
if (mobeffect != null) {
|
||||
this.b(mobeffect);
|
||||
@@ -847,20 +1013,55 @@
|
||||
@@ -937,20 +1106,55 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -356,7 +359,7 @@
|
||||
this.datawatcher.set(EntityLiving.HEALTH, MathHelper.a(f, 0.0F, this.getMaxHealth()));
|
||||
}
|
||||
|
||||
@@ -874,7 +1075,7 @@
|
||||
@@ -964,7 +1168,7 @@
|
||||
return false;
|
||||
} else if (this.world.isClientSide) {
|
||||
return false;
|
||||
@@ -365,7 +368,7 @@
|
||||
return false;
|
||||
} else if (damagesource.isFire() && this.hasEffect(MobEffects.FIRE_RESISTANCE)) {
|
||||
return false;
|
||||
@@ -886,17 +1087,19 @@
|
||||
@@ -976,17 +1180,19 @@
|
||||
this.ticksFarFromPlayer = 0;
|
||||
float f1 = f;
|
||||
|
||||
@@ -388,7 +391,7 @@
|
||||
this.damageShield(f);
|
||||
f2 = f;
|
||||
f = 0.0F;
|
||||
@@ -914,22 +1117,41 @@
|
||||
@@ -1004,22 +1210,41 @@
|
||||
this.av = 1.5F;
|
||||
boolean flag1 = true;
|
||||
|
||||
@@ -434,7 +437,7 @@
|
||||
this.ap = 0.0F;
|
||||
Entity entity1 = damagesource.getEntity();
|
||||
|
||||
@@ -1050,19 +1272,29 @@
|
||||
@@ -1140,19 +1365,29 @@
|
||||
EnumHand[] aenumhand = EnumHand.values();
|
||||
int i = aenumhand.length;
|
||||
|
||||
@@ -468,7 +471,7 @@
|
||||
EntityPlayer entityplayer = (EntityPlayer) this;
|
||||
|
||||
entityplayer.b(StatisticList.ITEM_USED.b(Items.TOTEM_OF_UNDYING));
|
||||
@@ -1070,14 +1302,16 @@
|
||||
@@ -1160,14 +1395,16 @@
|
||||
}
|
||||
|
||||
this.setHealth(1.0F);
|
||||
@@ -490,7 +493,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1175,6 +1409,13 @@
|
||||
@@ -1265,6 +1502,13 @@
|
||||
if (!flag) {
|
||||
EntityItem entityitem = new EntityItem(this.world, this.locX(), this.locY(), this.locZ(), new ItemStack(Items.bt));
|
||||
|
||||
@@ -504,7 +507,7 @@
|
||||
this.world.addEntity(entityitem);
|
||||
}
|
||||
}
|
||||
@@ -1194,28 +1435,46 @@
|
||||
@@ -1284,28 +1528,46 @@
|
||||
|
||||
boolean flag = this.lastDamageByPlayerTime > 0;
|
||||
|
||||
@@ -553,7 +556,7 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -1336,9 +1595,14 @@
|
||||
@@ -1426,9 +1688,14 @@
|
||||
int i = this.e(f, f1);
|
||||
|
||||
if (i > 0) {
|
||||
@@ -569,7 +572,7 @@
|
||||
return true;
|
||||
} else {
|
||||
return flag;
|
||||
@@ -1378,7 +1642,7 @@
|
||||
@@ -1468,7 +1735,7 @@
|
||||
|
||||
protected float applyArmorModifier(DamageSource damagesource, float f) {
|
||||
if (!damagesource.ignoresArmor()) {
|
||||
@@ -578,7 +581,7 @@
|
||||
f = CombatMath.a(f, (float) this.getArmorStrength(), (float) this.b(GenericAttributes.ARMOR_TOUGHNESS));
|
||||
}
|
||||
|
||||
@@ -1391,7 +1655,8 @@
|
||||
@@ -1481,7 +1748,8 @@
|
||||
} else {
|
||||
int i;
|
||||
|
||||
@@ -588,7 +591,7 @@
|
||||
i = (this.getEffect(MobEffects.RESISTANCE).getAmplifier() + 1) * 5;
|
||||
int j = 25 - i;
|
||||
float f1 = f * (float) j;
|
||||
@@ -1422,28 +1687,173 @@
|
||||
@@ -1512,28 +1780,173 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -772,7 +775,7 @@
|
||||
}
|
||||
|
||||
public CombatTracker getCombatTracker() {
|
||||
@@ -1464,9 +1874,19 @@
|
||||
@@ -1554,9 +1967,19 @@
|
||||
}
|
||||
|
||||
public final void setArrowCount(int i) {
|
||||
@@ -793,7 +796,7 @@
|
||||
public final int dz() {
|
||||
return (Integer) this.datawatcher.get(EntityLiving.bi);
|
||||
}
|
||||
@@ -1594,6 +2014,12 @@
|
||||
@@ -1684,6 +2107,12 @@
|
||||
|
||||
public abstract ItemStack getEquipment(EnumItemSlot enumitemslot);
|
||||
|
||||
@@ -806,7 +809,7 @@
|
||||
@Override
|
||||
public abstract void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack);
|
||||
|
||||
@@ -1816,6 +2242,7 @@
|
||||
@@ -1906,6 +2335,7 @@
|
||||
}
|
||||
|
||||
if (this.onGround && !this.world.isClientSide) {
|
||||
@@ -814,25 +817,25 @@
|
||||
this.setFlag(7, false);
|
||||
}
|
||||
} else {
|
||||
@@ -1957,7 +2384,7 @@
|
||||
@@ -2047,7 +2477,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- this.p();
|
||||
- this.updateEquipment();
|
||||
+ this.updateEquipment(); // PAIL rename
|
||||
if (this.ticksLived % 20 == 0) {
|
||||
this.getCombatTracker().g();
|
||||
}
|
||||
@@ -2058,7 +2485,7 @@
|
||||
@@ -2148,7 +2578,7 @@
|
||||
|
||||
}
|
||||
|
||||
- private void p() {
|
||||
- public void updateEquipment() {
|
||||
+ public void updateEquipment() { // PAIL private->public; updateEquipment
|
||||
Map<EnumItemSlot, ItemStack> map = this.q();
|
||||
|
||||
if (map != null) {
|
||||
@@ -2321,6 +2748,7 @@
|
||||
@@ -2411,6 +2841,7 @@
|
||||
}
|
||||
|
||||
if (!this.world.isClientSide) {
|
||||
@@ -840,7 +843,7 @@
|
||||
this.setFlag(7, flag);
|
||||
}
|
||||
|
||||
@@ -2441,6 +2869,7 @@
|
||||
@@ -2531,6 +2962,7 @@
|
||||
}
|
||||
|
||||
public boolean hasLineOfSight(Entity entity) {
|
||||
@@ -848,7 +851,7 @@
|
||||
Vec3D vec3d = new Vec3D(this.locX(), this.getHeadY(), this.locZ());
|
||||
Vec3D vec3d1 = new Vec3D(entity.locX(), entity.getHeadY(), entity.locZ());
|
||||
|
||||
@@ -2458,14 +2887,21 @@
|
||||
@@ -2548,14 +2980,21 @@
|
||||
|
||||
@Override
|
||||
public boolean isInteractable() {
|
||||
@@ -872,7 +875,7 @@
|
||||
@Override
|
||||
protected void velocityChanged() {
|
||||
this.velocityChanged = this.random.nextDouble() >= this.b(GenericAttributes.KNOCKBACK_RESISTANCE);
|
||||
@@ -2658,7 +3094,25 @@
|
||||
@@ -2748,7 +3187,25 @@
|
||||
} else {
|
||||
if (!this.activeItem.isEmpty() && this.isHandRaised()) {
|
||||
this.b(this.activeItem, 16);
|
||||
@@ -899,7 +902,7 @@
|
||||
|
||||
if (itemstack != this.activeItem) {
|
||||
this.a(enumhand, itemstack);
|
||||
@@ -2750,10 +3204,18 @@
|
||||
@@ -2840,10 +3297,18 @@
|
||||
}
|
||||
|
||||
if (flag2) {
|
||||
@@ -921,7 +924,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2850,7 +3312,7 @@
|
||||
@@ -2940,7 +3405,7 @@
|
||||
}
|
||||
|
||||
public void entityWakeup() {
|
||||
@@ -930,7 +933,7 @@
|
||||
World world = this.world;
|
||||
|
||||
this.world.getClass();
|
||||
@@ -2921,7 +3383,7 @@
|
||||
@@ -3011,7 +3476,7 @@
|
||||
Pair<MobEffect, Float> pair = (Pair) iterator.next();
|
||||
|
||||
if (!world.isClientSide && pair.getFirst() != null && world.random.nextFloat() < (Float) pair.getSecond()) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityTypes.java
|
||||
+++ b/net/minecraft/server/EntityTypes.java
|
||||
@@ -12,7 +12,7 @@
|
||||
--- a/net/minecraft/world/entity/EntityTypes.java
|
||||
+++ b/net/minecraft/world/entity/EntityTypes.java
|
||||
@@ -142,7 +142,7 @@
|
||||
public class EntityTypes<T extends Entity> {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
@@ -9,7 +9,7 @@
|
||||
public static final EntityTypes<EntityArmorStand> ARMOR_STAND = a("armor_stand", EntityTypes.Builder.a(EntityArmorStand::new, EnumCreatureType.MISC).a(0.5F, 1.975F).trackingRange(10));
|
||||
public static final EntityTypes<EntityTippedArrow> ARROW = a("arrow", EntityTypes.Builder.a(EntityTippedArrow::new, EnumCreatureType.MISC).a(0.5F, 0.5F).trackingRange(4).updateInterval(20));
|
||||
public static final EntityTypes<EntityBat> BAT = a("bat", EntityTypes.Builder.a(EntityBat::new, EnumCreatureType.AMBIENT).a(0.5F, 0.9F).trackingRange(5));
|
||||
@@ -137,7 +137,7 @@
|
||||
@@ -267,7 +267,7 @@
|
||||
private MinecraftKey bq;
|
||||
private final EntitySize br;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
return (EntityTypes) IRegistry.a((IRegistry) IRegistry.ENTITY_TYPE, s, (Object) entitytypes_builder.a(s));
|
||||
}
|
||||
|
||||
@@ -169,10 +169,18 @@
|
||||
@@ -299,10 +299,18 @@
|
||||
|
||||
@Nullable
|
||||
public T spawnCreature(WorldServer worldserver, @Nullable NBTTagCompound nbttagcompound, @Nullable IChatBaseComponent ichatbasecomponent, @Nullable EntityHuman entityhuman, BlockPosition blockposition, EnumMobSpawn enummobspawn, boolean flag, boolean flag1) {
|
||||
@@ -38,7 +38,7 @@
|
||||
}
|
||||
|
||||
return t0;
|
||||
@@ -208,7 +216,7 @@
|
||||
@@ -338,7 +346,7 @@
|
||||
t0.setCustomName(ichatbasecomponent);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
return t0;
|
||||
}
|
||||
}
|
||||
@@ -351,7 +359,7 @@
|
||||
@@ -481,7 +489,7 @@
|
||||
}
|
||||
|
||||
return entity;
|
||||
@@ -56,7 +56,7 @@
|
||||
}
|
||||
|
||||
private static Optional<Entity> b(NBTTagCompound nbttagcompound, World world) {
|
||||
@@ -403,7 +411,7 @@
|
||||
@@ -533,7 +541,7 @@
|
||||
this.g = enumcreaturetype == EnumCreatureType.CREATURE || enumcreaturetype == EnumCreatureType.MISC;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/IEntityAngerable.java
|
||||
+++ b/net/minecraft/server/IEntityAngerable.java
|
||||
@@ -98,7 +98,7 @@
|
||||
--- a/net/minecraft/world/entity/IEntityAngerable.java
|
||||
+++ b/net/minecraft/world/entity/IEntityAngerable.java
|
||||
@@ -103,7 +103,7 @@
|
||||
default void pacify() {
|
||||
this.setLastDamager((EntityLiving) null);
|
||||
this.setAngerTarget((UUID) null);
|
||||
@@ -9,7 +9,7 @@
|
||||
this.setAnger(0);
|
||||
}
|
||||
|
||||
@@ -108,6 +108,8 @@
|
||||
@@ -113,6 +113,8 @@
|
||||
|
||||
void setGoalTarget(@Nullable EntityLiving entityliving);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/IEntitySelector.java
|
||||
+++ b/net/minecraft/server/IEntitySelector.java
|
||||
@@ -37,7 +37,7 @@
|
||||
--- a/net/minecraft/world/entity/IEntitySelector.java
|
||||
+++ b/net/minecraft/world/entity/IEntitySelector.java
|
||||
@@ -42,7 +42,7 @@
|
||||
ScoreboardTeamBase.EnumTeamPush scoreboardteambase_enumteampush = scoreboardteambase == null ? ScoreboardTeamBase.EnumTeamPush.ALWAYS : scoreboardteambase.getCollisionRule();
|
||||
|
||||
return (Predicate) (scoreboardteambase_enumteampush == ScoreboardTeamBase.EnumTeamPush.NEVER ? Predicates.alwaysFalse() : IEntitySelector.g.and((entity1) -> {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/SaddleStorage.java
|
||||
+++ b/net/minecraft/server/SaddleStorage.java
|
||||
@@ -35,6 +35,15 @@
|
||||
--- a/net/minecraft/world/entity/SaddleStorage.java
|
||||
+++ b/net/minecraft/world/entity/SaddleStorage.java
|
||||
@@ -38,6 +38,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/AttributeRanged.java
|
||||
+++ b/net/minecraft/server/AttributeRanged.java
|
||||
@@ -20,6 +20,8 @@
|
||||
--- a/net/minecraft/world/entity/ai/attributes/AttributeRanged.java
|
||||
+++ b/net/minecraft/world/entity/ai/attributes/AttributeRanged.java
|
||||
@@ -22,6 +22,8 @@
|
||||
|
||||
@Override
|
||||
public double a(double d0) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/server/BehaviorAttackTargetForget.java
|
||||
+++ b/net/minecraft/server/BehaviorAttackTargetForget.java
|
||||
@@ -4,6 +4,12 @@
|
||||
import java.util.Optional;
|
||||
import java.util.function.Predicate;
|
||||
--- a/net/minecraft/world/entity/ai/behavior/BehaviorAttackTargetForget.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/BehaviorAttackTargetForget.java
|
||||
@@ -10,6 +10,12 @@
|
||||
import net.minecraft.world.entity.ai.memory.MemoryModuleType;
|
||||
import net.minecraft.world.entity.ai.memory.MemoryStatus;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.entity.CraftLivingEntity;
|
||||
@@ -13,7 +13,7 @@
|
||||
public class BehaviorAttackTargetForget<E extends EntityInsentient> extends Behavior<E> {
|
||||
|
||||
private final Predicate<EntityLiving> b;
|
||||
@@ -54,6 +60,17 @@
|
||||
@@ -60,6 +66,17 @@
|
||||
}
|
||||
|
||||
private void d(E e0) {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
--- a/net/minecraft/server/BehaviorAttackTargetSet.java
|
||||
+++ b/net/minecraft/server/BehaviorAttackTargetSet.java
|
||||
@@ -5,6 +5,12 @@
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
--- a/net/minecraft/world/entity/ai/behavior/BehaviorAttackTargetSet.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/BehaviorAttackTargetSet.java
|
||||
@@ -10,6 +10,13 @@
|
||||
import net.minecraft.world.entity.ai.memory.MemoryModuleType;
|
||||
import net.minecraft.world.entity.ai.memory.MemoryStatus;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.server.level.EntityPlayer;
|
||||
+import org.bukkit.craftbukkit.entity.CraftLivingEntity;
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
+import org.bukkit.event.entity.EntityTargetEvent;
|
||||
@@ -13,7 +14,7 @@
|
||||
public class BehaviorAttackTargetSet<E extends EntityInsentient> extends Behavior<E> {
|
||||
|
||||
private final Predicate<E> b;
|
||||
@@ -33,13 +39,21 @@
|
||||
@@ -38,13 +45,21 @@
|
||||
}
|
||||
|
||||
protected void a(WorldServer worldserver, E e0, long i) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/server/BehaviorCareer.java
|
||||
+++ b/net/minecraft/server/BehaviorCareer.java
|
||||
@@ -3,6 +3,12 @@
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import java.util.Optional;
|
||||
--- a/net/minecraft/world/entity/ai/behavior/BehaviorCareer.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/BehaviorCareer.java
|
||||
@@ -13,6 +13,12 @@
|
||||
import net.minecraft.world.entity.npc.EntityVillager;
|
||||
import net.minecraft.world.entity.npc.VillagerProfession;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.entity.CraftVillager;
|
||||
@@ -13,7 +13,7 @@
|
||||
public class BehaviorCareer extends Behavior<EntityVillager> {
|
||||
|
||||
public BehaviorCareer() {
|
||||
@@ -19,7 +25,7 @@
|
||||
@@ -29,7 +35,7 @@
|
||||
GlobalPos globalpos = (GlobalPos) entityvillager.getBehaviorController().getMemory(MemoryModuleType.POTENTIAL_JOB_SITE).get();
|
||||
|
||||
entityvillager.getBehaviorController().removeMemory(MemoryModuleType.POTENTIAL_JOB_SITE);
|
||||
@@ -22,7 +22,7 @@
|
||||
worldserver.broadcastEntityEffect(entityvillager, (byte) 14);
|
||||
if (entityvillager.getVillagerData().getProfession() == VillagerProfession.NONE) {
|
||||
MinecraftServer minecraftserver = worldserver.getMinecraftServer();
|
||||
@@ -31,7 +37,14 @@
|
||||
@@ -41,7 +47,14 @@
|
||||
return villagerprofession.b() == villageplacetype;
|
||||
}).findFirst();
|
||||
}).ifPresent((villagerprofession) -> {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/BehaviorFarm.java
|
||||
+++ b/net/minecraft/server/BehaviorFarm.java
|
||||
@@ -58,8 +58,8 @@
|
||||
--- a/net/minecraft/world/entity/ai/behavior/BehaviorFarm.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/BehaviorFarm.java
|
||||
@@ -78,8 +78,8 @@
|
||||
|
||||
protected void a(WorldServer worldserver, EntityVillager entityvillager, long i) {
|
||||
if (i > this.c && this.farmBlock != null) {
|
||||
@@ -11,7 +11,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -79,7 +79,11 @@
|
||||
@@ -99,7 +99,11 @@
|
||||
Block block1 = worldserver.getType(this.farmBlock.down()).getBlock();
|
||||
|
||||
if (block instanceof BlockCrops && ((BlockCrops) block).isRipe(iblockdata)) {
|
||||
@@ -24,7 +24,7 @@
|
||||
}
|
||||
|
||||
if (iblockdata.isAir() && block1 instanceof BlockSoil && entityvillager.canPlant()) {
|
||||
@@ -90,19 +94,28 @@
|
||||
@@ -110,19 +114,28 @@
|
||||
boolean flag = false;
|
||||
|
||||
if (!itemstack.isEmpty()) {
|
||||
@@ -57,7 +57,7 @@
|
||||
}
|
||||
|
||||
if (flag) {
|
||||
@@ -121,8 +134,8 @@
|
||||
@@ -141,8 +154,8 @@
|
||||
this.farmBlock = this.a(worldserver);
|
||||
if (this.farmBlock != null) {
|
||||
this.c = i + 20L;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/BehaviorInteractDoor.java
|
||||
+++ b/net/minecraft/server/BehaviorInteractDoor.java
|
||||
@@ -52,6 +52,13 @@
|
||||
--- a/net/minecraft/world/entity/ai/behavior/BehaviorInteractDoor.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/BehaviorInteractDoor.java
|
||||
@@ -66,6 +66,13 @@
|
||||
BlockDoor blockdoor = (BlockDoor) iblockdata.getBlock();
|
||||
|
||||
if (!blockdoor.h(iblockdata)) {
|
||||
@@ -14,7 +14,7 @@
|
||||
blockdoor.setDoor(worldserver, iblockdata, blockposition, true);
|
||||
}
|
||||
|
||||
@@ -65,6 +72,13 @@
|
||||
@@ -79,6 +86,13 @@
|
||||
BlockDoor blockdoor1 = (BlockDoor) iblockdata1.getBlock();
|
||||
|
||||
if (!blockdoor1.h(iblockdata1)) {
|
||||
@@ -28,7 +28,7 @@
|
||||
blockdoor1.setDoor(worldserver, iblockdata1, blockposition1, true);
|
||||
this.c(worldserver, entityliving, blockposition1);
|
||||
}
|
||||
@@ -113,7 +127,7 @@
|
||||
@@ -127,7 +141,7 @@
|
||||
private static boolean a(WorldServer worldserver, EntityLiving entityliving, BlockPosition blockposition) {
|
||||
BehaviorController<?> behaviorcontroller = entityliving.getBehaviorController();
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
return entityliving1.getEntityType() == entityliving.getEntityType();
|
||||
}).filter((entityliving1) -> {
|
||||
return blockposition.a((IPosition) entityliving1.getPositionVector(), 2.0D);
|
||||
@@ -155,7 +169,7 @@
|
||||
@@ -169,7 +183,7 @@
|
||||
if (behaviorcontroller.getMemory(MemoryModuleType.DOORS_TO_CLOSE).isPresent()) {
|
||||
((Set) behaviorcontroller.getMemory(MemoryModuleType.DOORS_TO_CLOSE).get()).add(globalpos);
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/BehaviorMakeLove.java
|
||||
+++ b/net/minecraft/server/BehaviorMakeLove.java
|
||||
@@ -93,6 +93,11 @@
|
||||
--- a/net/minecraft/world/entity/ai/behavior/BehaviorMakeLove.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/BehaviorMakeLove.java
|
||||
@@ -106,6 +106,11 @@
|
||||
|
||||
private Optional<EntityVillager> b(WorldServer worldserver, EntityVillager entityvillager, EntityVillager entityvillager1) {
|
||||
EntityVillager entityvillager2 = entityvillager.createChild(worldserver, entityvillager1);
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
if (entityvillager2 == null) {
|
||||
return Optional.empty();
|
||||
@@ -101,7 +106,7 @@
|
||||
@@ -114,7 +119,7 @@
|
||||
entityvillager1.setAgeRaw(6000);
|
||||
entityvillager2.setAgeRaw(-24000);
|
||||
entityvillager2.setPositionRotation(entityvillager.locX(), entityvillager.locY(), entityvillager.locZ(), 0.0F, 0.0F);
|
||||
@@ -21,7 +21,7 @@
|
||||
worldserver.broadcastEntityEffect(entityvillager2, (byte) 12);
|
||||
return Optional.of(entityvillager2);
|
||||
}
|
||||
@@ -110,6 +115,6 @@
|
||||
@@ -123,6 +128,6 @@
|
||||
private void a(WorldServer worldserver, EntityVillager entityvillager, BlockPosition blockposition) {
|
||||
GlobalPos globalpos = GlobalPos.create(worldserver.getDimensionKey(), blockposition);
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/server/BehaviorProfession.java
|
||||
+++ b/net/minecraft/server/BehaviorProfession.java
|
||||
@@ -2,6 +2,12 @@
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
--- a/net/minecraft/world/entity/ai/behavior/BehaviorProfession.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/BehaviorProfession.java
|
||||
@@ -8,6 +8,12 @@
|
||||
import net.minecraft.world.entity.npc.VillagerData;
|
||||
import net.minecraft.world.entity.npc.VillagerProfession;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.entity.CraftVillager;
|
||||
@@ -13,7 +13,7 @@
|
||||
public class BehaviorProfession extends Behavior<EntityVillager> {
|
||||
|
||||
public BehaviorProfession() {
|
||||
@@ -15,7 +21,14 @@
|
||||
@@ -21,7 +27,14 @@
|
||||
}
|
||||
|
||||
protected void a(WorldServer worldserver, EntityVillager entityvillager, long i) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/BehaviorUtil.java
|
||||
+++ b/net/minecraft/server/BehaviorUtil.java
|
||||
@@ -38,7 +38,7 @@
|
||||
--- a/net/minecraft/world/entity/ai/behavior/BehaviorUtil.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/BehaviorUtil.java
|
||||
@@ -54,7 +54,7 @@
|
||||
}
|
||||
|
||||
public static void a(EntityLiving entityliving, EntityLiving entityliving1) {
|
||||
@@ -9,7 +9,7 @@
|
||||
}
|
||||
|
||||
private static void b(EntityLiving entityliving, EntityLiving entityliving1, float f) {
|
||||
@@ -51,18 +51,19 @@
|
||||
@@ -67,18 +67,19 @@
|
||||
public static void a(EntityLiving entityliving, Entity entity, float f, int i) {
|
||||
MemoryTarget memorytarget = new MemoryTarget(new BehaviorPositionEntity(entity, false), f, i);
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
double d0 = entityliving.getHeadY() - 0.30000001192092896D;
|
||||
EntityItem entityitem = new EntityItem(entityliving.world, entityliving.locX(), d0, entityliving.locZ(), itemstack);
|
||||
float f = 0.3F;
|
||||
@@ -71,12 +72,19 @@
|
||||
@@ -87,12 +88,19 @@
|
||||
vec3d1 = vec3d1.d().a(0.30000001192092896D);
|
||||
entityitem.setMot(vec3d1);
|
||||
entityitem.defaultPickupDelay();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/BehaviorWorkComposter.java
|
||||
+++ b/net/minecraft/server/BehaviorWorkComposter.java
|
||||
@@ -11,7 +11,7 @@
|
||||
--- a/net/minecraft/world/entity/ai/behavior/BehaviorWorkComposter.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/BehaviorWorkComposter.java
|
||||
@@ -24,7 +24,7 @@
|
||||
public BehaviorWorkComposter() {}
|
||||
|
||||
@Override
|
||||
@@ -9,7 +9,7 @@
|
||||
Optional<GlobalPos> optional = entityvillager.getBehaviorController().getMemory(MemoryModuleType.JOB_SITE);
|
||||
|
||||
if (optional.isPresent()) {
|
||||
@@ -30,7 +30,7 @@
|
||||
@@ -43,7 +43,7 @@
|
||||
BlockPosition blockposition = globalpos.getBlockPosition();
|
||||
|
||||
if ((Integer) iblockdata.get(BlockComposter.a) == 8) {
|
||||
@@ -18,7 +18,7 @@
|
||||
}
|
||||
|
||||
int i = 20;
|
||||
@@ -55,7 +55,7 @@
|
||||
@@ -68,7 +68,7 @@
|
||||
i -= k1;
|
||||
|
||||
for (int l1 = 0; l1 < k1; ++l1) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/PathfinderGoalBreakDoor.java
|
||||
+++ b/net/minecraft/server/PathfinderGoalBreakDoor.java
|
||||
@@ -66,6 +66,12 @@
|
||||
--- a/net/minecraft/world/entity/ai/goal/PathfinderGoalBreakDoor.java
|
||||
+++ b/net/minecraft/world/entity/ai/goal/PathfinderGoalBreakDoor.java
|
||||
@@ -71,6 +71,12 @@
|
||||
}
|
||||
|
||||
if (this.a == this.f() && this.a(this.entity.world.getDifficulty())) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/server/PathfinderGoalEatTile.java
|
||||
+++ b/net/minecraft/server/PathfinderGoalEatTile.java
|
||||
@@ -3,6 +3,10 @@
|
||||
import java.util.EnumSet;
|
||||
import java.util.function.Predicate;
|
||||
--- a/net/minecraft/world/entity/ai/goal/PathfinderGoalEatTile.java
|
||||
+++ b/net/minecraft/world/entity/ai/goal/PathfinderGoalEatTile.java
|
||||
@@ -11,6 +11,10 @@
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import net.minecraft.world.level.block.state.predicate.BlockStatePredicate;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
@@ -11,7 +11,7 @@
|
||||
public class PathfinderGoalEatTile extends PathfinderGoal {
|
||||
|
||||
private static final Predicate<IBlockData> a = BlockStatePredicate.a(Blocks.GRASS);
|
||||
@@ -55,7 +59,8 @@
|
||||
@@ -63,7 +67,8 @@
|
||||
BlockPosition blockposition = this.b.getChunkCoordinates();
|
||||
|
||||
if (PathfinderGoalEatTile.a.test(this.c.getType(blockposition))) {
|
||||
@@ -21,7 +21,7 @@
|
||||
this.c.b(blockposition, false);
|
||||
}
|
||||
|
||||
@@ -64,7 +69,8 @@
|
||||
@@ -72,7 +77,8 @@
|
||||
BlockPosition blockposition1 = blockposition.down();
|
||||
|
||||
if (this.c.getType(blockposition1).a(Blocks.GRASS_BLOCK)) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/server/PathfinderGoalFollowOwner.java
|
||||
+++ b/net/minecraft/server/PathfinderGoalFollowOwner.java
|
||||
@@ -2,6 +2,12 @@
|
||||
|
||||
import java.util.EnumSet;
|
||||
--- a/net/minecraft/world/entity/ai/goal/PathfinderGoalFollowOwner.java
|
||||
+++ b/net/minecraft/world/entity/ai/goal/PathfinderGoalFollowOwner.java
|
||||
@@ -15,6 +15,12 @@
|
||||
import net.minecraft.world.level.pathfinder.PathType;
|
||||
import net.minecraft.world.level.pathfinder.PathfinderNormal;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.Location;
|
||||
@@ -13,7 +13,7 @@
|
||||
public class PathfinderGoalFollowOwner extends PathfinderGoal {
|
||||
|
||||
private final EntityTameableAnimal a;
|
||||
@@ -104,7 +110,18 @@
|
||||
@@ -117,7 +123,18 @@
|
||||
} else if (!this.a(new BlockPosition(i, j, k))) {
|
||||
return false;
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,17 @@
|
||||
--- a/net/minecraft/server/PathfinderGoalPanic.java
|
||||
+++ b/net/minecraft/server/PathfinderGoalPanic.java
|
||||
@@ -68,6 +68,12 @@
|
||||
--- a/net/minecraft/world/entity/ai/goal/PathfinderGoalPanic.java
|
||||
+++ b/net/minecraft/world/entity/ai/goal/PathfinderGoalPanic.java
|
||||
@@ -11,6 +11,10 @@
|
||||
import net.minecraft.world.level.IBlockAccess;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.world.entity.EntityLiving;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class PathfinderGoalPanic extends PathfinderGoal {
|
||||
|
||||
protected final EntityCreature a;
|
||||
@@ -76,6 +80,12 @@
|
||||
|
||||
@Override
|
||||
public boolean b() {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/server/PathfinderGoalRemoveBlock.java
|
||||
+++ b/net/minecraft/server/PathfinderGoalRemoveBlock.java
|
||||
@@ -3,6 +3,11 @@
|
||||
import java.util.Random;
|
||||
import javax.annotation.Nullable;
|
||||
--- a/net/minecraft/world/entity/ai/goal/PathfinderGoalRemoveBlock.java
|
||||
+++ b/net/minecraft/world/entity/ai/goal/PathfinderGoalRemoveBlock.java
|
||||
@@ -20,6 +20,11 @@
|
||||
import net.minecraft.world.level.chunk.IChunkAccess;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.block.CraftBlock;
|
||||
@@ -12,7 +12,7 @@
|
||||
public class PathfinderGoalRemoveBlock extends PathfinderGoalGotoTarget {
|
||||
|
||||
private final Block g;
|
||||
@@ -81,6 +86,14 @@
|
||||
@@ -98,6 +103,14 @@
|
||||
}
|
||||
|
||||
if (this.i > 60) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/PathfinderGoalSit.java
|
||||
+++ b/net/minecraft/server/PathfinderGoalSit.java
|
||||
@@ -19,7 +19,7 @@
|
||||
--- a/net/minecraft/world/entity/ai/goal/PathfinderGoalSit.java
|
||||
+++ b/net/minecraft/world/entity/ai/goal/PathfinderGoalSit.java
|
||||
@@ -22,7 +22,7 @@
|
||||
@Override
|
||||
public boolean a() {
|
||||
if (!this.entity.isTamed()) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/PathfinderGoalTame.java
|
||||
+++ b/net/minecraft/server/PathfinderGoalTame.java
|
||||
@@ -57,7 +57,8 @@
|
||||
--- a/net/minecraft/world/entity/ai/goal/PathfinderGoalTame.java
|
||||
+++ b/net/minecraft/world/entity/ai/goal/PathfinderGoalTame.java
|
||||
@@ -62,7 +62,8 @@
|
||||
int i = this.entity.getTemper();
|
||||
int j = this.entity.getMaxDomestication();
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/server/PathfinderGoalTempt.java
|
||||
+++ b/net/minecraft/server/PathfinderGoalTempt.java
|
||||
@@ -2,6 +2,13 @@
|
||||
|
||||
import java.util.EnumSet;
|
||||
--- a/net/minecraft/world/entity/ai/goal/PathfinderGoalTempt.java
|
||||
+++ b/net/minecraft/world/entity/ai/goal/PathfinderGoalTempt.java
|
||||
@@ -11,6 +11,13 @@
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.crafting.RecipeItemStack;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.entity.CraftLivingEntity;
|
||||
@@ -14,7 +14,7 @@
|
||||
public class PathfinderGoalTempt extends PathfinderGoal {
|
||||
|
||||
private static final PathfinderTargetCondition c = (new PathfinderTargetCondition()).a(10.0D).a().b().d().c();
|
||||
@@ -12,7 +19,7 @@
|
||||
@@ -21,7 +28,7 @@
|
||||
private double g;
|
||||
private double h;
|
||||
private double i;
|
||||
@@ -23,7 +23,7 @@
|
||||
private int j;
|
||||
private boolean k;
|
||||
private final RecipeItemStack l;
|
||||
@@ -40,7 +47,17 @@
|
||||
@@ -49,7 +56,17 @@
|
||||
return false;
|
||||
} else {
|
||||
this.target = this.a.world.a(PathfinderGoalTempt.c, (EntityLiving) this.a);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/PathfinderGoalDefendVillage.java
|
||||
+++ b/net/minecraft/server/PathfinderGoalDefendVillage.java
|
||||
@@ -49,7 +49,7 @@
|
||||
--- a/net/minecraft/world/entity/ai/goal/target/PathfinderGoalDefendVillage.java
|
||||
+++ b/net/minecraft/world/entity/ai/goal/target/PathfinderGoalDefendVillage.java
|
||||
@@ -56,7 +56,7 @@
|
||||
|
||||
@Override
|
||||
public void c() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/PathfinderGoalHurtByTarget.java
|
||||
+++ b/net/minecraft/server/PathfinderGoalHurtByTarget.java
|
||||
@@ -53,7 +53,7 @@
|
||||
--- a/net/minecraft/world/entity/ai/goal/target/PathfinderGoalHurtByTarget.java
|
||||
+++ b/net/minecraft/world/entity/ai/goal/target/PathfinderGoalHurtByTarget.java
|
||||
@@ -62,7 +62,7 @@
|
||||
|
||||
@Override
|
||||
public void c() {
|
||||
@@ -9,7 +9,7 @@
|
||||
this.g = this.e.getGoalTarget();
|
||||
this.c = this.e.da();
|
||||
this.h = 300;
|
||||
@@ -100,6 +100,6 @@
|
||||
@@ -109,6 +109,6 @@
|
||||
}
|
||||
|
||||
protected void a(EntityInsentient entityinsentient, EntityLiving entityliving) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/PathfinderGoalNearestAttackableTarget.java
|
||||
+++ b/net/minecraft/server/PathfinderGoalNearestAttackableTarget.java
|
||||
@@ -52,7 +52,7 @@
|
||||
--- a/net/minecraft/world/entity/ai/goal/target/PathfinderGoalNearestAttackableTarget.java
|
||||
+++ b/net/minecraft/world/entity/ai/goal/target/PathfinderGoalNearestAttackableTarget.java
|
||||
@@ -59,7 +59,7 @@
|
||||
|
||||
@Override
|
||||
public void c() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/PathfinderGoalOwnerHurtByTarget.java
|
||||
+++ b/net/minecraft/server/PathfinderGoalOwnerHurtByTarget.java
|
||||
@@ -34,7 +34,7 @@
|
||||
--- a/net/minecraft/world/entity/ai/goal/target/PathfinderGoalOwnerHurtByTarget.java
|
||||
+++ b/net/minecraft/world/entity/ai/goal/target/PathfinderGoalOwnerHurtByTarget.java
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
@Override
|
||||
public void c() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/PathfinderGoalOwnerHurtTarget.java
|
||||
+++ b/net/minecraft/server/PathfinderGoalOwnerHurtTarget.java
|
||||
@@ -34,7 +34,7 @@
|
||||
--- a/net/minecraft/world/entity/ai/goal/target/PathfinderGoalOwnerHurtTarget.java
|
||||
+++ b/net/minecraft/world/entity/ai/goal/target/PathfinderGoalOwnerHurtTarget.java
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
@Override
|
||||
public void c() {
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
--- a/net/minecraft/server/PathfinderGoalTarget.java
|
||||
+++ b/net/minecraft/server/PathfinderGoalTarget.java
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
--- a/net/minecraft/world/entity/ai/goal/target/PathfinderGoalTarget.java
|
||||
+++ b/net/minecraft/world/entity/ai/goal/target/PathfinderGoalTarget.java
|
||||
@@ -13,6 +13,8 @@
|
||||
import net.minecraft.world.level.pathfinder.PathPoint;
|
||||
import net.minecraft.world.scores.ScoreboardTeamBase;
|
||||
|
||||
+import org.bukkit.event.entity.EntityTargetEvent; // CraftBukkit
|
||||
+
|
||||
public abstract class PathfinderGoalTarget extends PathfinderGoal {
|
||||
|
||||
protected final EntityInsentient e;
|
||||
@@ -59,7 +61,7 @@
|
||||
@@ -70,7 +72,7 @@
|
||||
if (entityliving instanceof EntityHuman && ((EntityHuman) entityliving).abilities.isInvulnerable) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -18,7 +18,7 @@
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -80,7 +82,7 @@
|
||||
@@ -91,7 +93,7 @@
|
||||
|
||||
@Override
|
||||
public void d() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/VillageSiege.java
|
||||
+++ b/net/minecraft/server/VillageSiege.java
|
||||
@@ -108,7 +108,7 @@
|
||||
--- a/net/minecraft/world/entity/ai/village/VillageSiege.java
|
||||
+++ b/net/minecraft/world/entity/ai/village/VillageSiege.java
|
||||
@@ -123,7 +123,7 @@
|
||||
}
|
||||
|
||||
entityzombie.setPositionRotation(vec3d.x, vec3d.y, vec3d.z, worldserver.random.nextFloat() * 360.0F, 0.0F);
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
--- a/net/minecraft/server/EntityBat.java
|
||||
+++ b/net/minecraft/server/EntityBat.java
|
||||
@@ -5,6 +5,8 @@
|
||||
import java.util.Random;
|
||||
import javax.annotation.Nullable;
|
||||
--- a/net/minecraft/world/entity/ambient/EntityBat.java
|
||||
+++ b/net/minecraft/world/entity/ambient/EntityBat.java
|
||||
@@ -30,6 +30,8 @@
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
||||
+
|
||||
public class EntityBat extends EntityAmbient {
|
||||
|
||||
private static final DataWatcherObject<Byte> b = DataWatcher.a(EntityBat.class, DataWatcherRegistry.a);
|
||||
@@ -105,16 +107,24 @@
|
||||
@@ -130,16 +132,24 @@
|
||||
}
|
||||
|
||||
if (this.world.a(EntityBat.c, (EntityLiving) this) != null) {
|
||||
@@ -39,7 +39,7 @@
|
||||
}
|
||||
} else {
|
||||
if (this.d != null && (!this.world.isEmpty(this.d) || this.d.getY() < 1)) {
|
||||
@@ -138,7 +148,11 @@
|
||||
@@ -163,7 +173,11 @@
|
||||
this.aT = 0.5F;
|
||||
this.yaw += f1;
|
||||
if (this.random.nextInt(100) == 0 && this.world.getType(blockposition1).isOccluding(this.world, blockposition1)) {
|
||||
@@ -52,7 +52,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,7 +182,11 @@
|
||||
@@ -193,7 +207,11 @@
|
||||
return false;
|
||||
} else {
|
||||
if (!this.world.isClientSide && this.isAsleep()) {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
--- a/net/minecraft/server/EntityAnimal.java
|
||||
+++ b/net/minecraft/server/EntityAnimal.java
|
||||
@@ -4,10 +4,16 @@
|
||||
import java.util.UUID;
|
||||
import javax.annotation.Nullable;
|
||||
--- a/net/minecraft/world/entity/animal/EntityAnimal.java
|
||||
+++ b/net/minecraft/world/entity/animal/EntityAnimal.java
|
||||
@@ -27,10 +27,17 @@
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.pathfinder.PathType;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.world.entity.EntityTameableAnimal;
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
+import org.bukkit.event.entity.EntityEnterLoveModeEvent;
|
||||
+// CraftBukkit end
|
||||
@@ -17,7 +18,7 @@
|
||||
|
||||
protected EntityAnimal(EntityTypes<? extends EntityAnimal> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -44,6 +50,9 @@
|
||||
@@ -67,6 +74,9 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -27,7 +28,7 @@
|
||||
@Override
|
||||
public boolean damageEntity(DamageSource damagesource, float f) {
|
||||
if (this.isInvulnerable(damagesource)) {
|
||||
@@ -53,6 +62,7 @@
|
||||
@@ -76,6 +86,7 @@
|
||||
return super.damageEntity(damagesource, f);
|
||||
}
|
||||
}
|
||||
@@ -35,7 +36,7 @@
|
||||
|
||||
@Override
|
||||
public float a(BlockPosition blockposition, IWorldReader iworldreader) {
|
||||
@@ -143,10 +153,17 @@
|
||||
@@ -166,10 +177,17 @@
|
||||
}
|
||||
|
||||
public void g(@Nullable EntityHuman entityhuman) {
|
||||
@@ -54,7 +55,7 @@
|
||||
|
||||
this.world.broadcastEntityEffect(this, (byte) 18);
|
||||
}
|
||||
@@ -186,11 +203,24 @@
|
||||
@@ -209,11 +227,24 @@
|
||||
EntityAgeable entityageable = this.createChild(worldserver, entityanimal);
|
||||
|
||||
if (entityageable != null) {
|
||||
@@ -79,7 +80,7 @@
|
||||
|
||||
if (entityplayer != null) {
|
||||
entityplayer.a(StatisticList.ANIMALS_BRED);
|
||||
@@ -203,10 +233,14 @@
|
||||
@@ -226,10 +257,14 @@
|
||||
entityanimal.resetLove();
|
||||
entityageable.setBaby(true);
|
||||
entityageable.setPositionRotation(this.locX(), this.locY(), this.locZ(), 0.0F, 0.0F);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityBee.java
|
||||
+++ b/net/minecraft/server/EntityBee.java
|
||||
@@ -137,7 +137,7 @@
|
||||
--- a/net/minecraft/world/entity/animal/EntityBee.java
|
||||
+++ b/net/minecraft/world/entity/animal/EntityBee.java
|
||||
@@ -211,7 +211,7 @@
|
||||
}
|
||||
|
||||
if (b0 > 0) {
|
||||
@@ -9,7 +9,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -512,11 +512,15 @@
|
||||
@@ -586,11 +586,15 @@
|
||||
} else {
|
||||
Entity entity = damagesource.getEntity();
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -537,7 +541,7 @@
|
||||
@@ -611,7 +615,7 @@
|
||||
class d extends EntityBee.a {
|
||||
|
||||
private d() {
|
||||
@@ -36,7 +36,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -597,7 +601,7 @@
|
||||
@@ -671,7 +675,7 @@
|
||||
class g extends EntityBee.a {
|
||||
|
||||
private g() {
|
||||
@@ -45,7 +45,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -646,7 +650,7 @@
|
||||
@@ -720,7 +724,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
EntityBee.this.world.triggerEffect(2005, blockposition, 0);
|
||||
EntityBee.this.world.setTypeUpdate(blockposition, (IBlockData) iblockdata.set(blockstateinteger, (Integer) iblockdata.get(blockstateinteger) + 1));
|
||||
EntityBee.this.fi();
|
||||
@@ -661,7 +665,7 @@
|
||||
@@ -735,7 +739,7 @@
|
||||
class i extends EntityBee.a {
|
||||
|
||||
private i() {
|
||||
@@ -63,7 +63,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -725,7 +729,7 @@
|
||||
@@ -799,7 +803,7 @@
|
||||
private int h = 0;
|
||||
|
||||
k() {
|
||||
@@ -72,7 +72,7 @@
|
||||
this.a(EnumSet.of(PathfinderGoal.Type.MOVE));
|
||||
}
|
||||
|
||||
@@ -909,7 +913,7 @@
|
||||
@@ -983,7 +987,7 @@
|
||||
private int c;
|
||||
|
||||
f() {
|
||||
@@ -81,7 +81,7 @@
|
||||
this.c = EntityBee.this.world.random.nextInt(10);
|
||||
this.a(EnumSet.of(PathfinderGoal.Type.MOVE));
|
||||
}
|
||||
@@ -967,7 +971,7 @@
|
||||
@@ -1041,7 +1045,7 @@
|
||||
private int f;
|
||||
|
||||
e() {
|
||||
@@ -90,7 +90,7 @@
|
||||
this.c = EntityBee.this.world.random.nextInt(10);
|
||||
this.d = Lists.newArrayList();
|
||||
this.e = null;
|
||||
@@ -1187,7 +1191,7 @@
|
||||
@@ -1261,7 +1265,7 @@
|
||||
@Override
|
||||
protected void a(EntityInsentient entityinsentient, EntityLiving entityliving) {
|
||||
if (entityinsentient instanceof EntityBee && this.e.hasLineOfSight(entityliving)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityCat.java
|
||||
+++ b/net/minecraft/server/EntityCat.java
|
||||
@@ -15,7 +15,7 @@
|
||||
--- a/net/minecraft/world/entity/animal/EntityCat.java
|
||||
+++ b/net/minecraft/world/entity/animal/EntityCat.java
|
||||
@@ -78,7 +78,7 @@
|
||||
private static final DataWatcherObject<Boolean> bt = DataWatcher.a(EntityCat.class, DataWatcherRegistry.i);
|
||||
private static final DataWatcherObject<Boolean> bu = DataWatcher.a(EntityCat.class, DataWatcherRegistry.i);
|
||||
private static final DataWatcherObject<Integer> bv = DataWatcher.a(EntityCat.class, DataWatcherRegistry.b);
|
||||
@@ -9,7 +9,7 @@
|
||||
hashmap.put(0, new MinecraftKey("textures/entity/cat/tabby.png"));
|
||||
hashmap.put(1, new MinecraftKey("textures/entity/cat/black.png"));
|
||||
hashmap.put(2, new MinecraftKey("textures/entity/cat/red.png"));
|
||||
@@ -341,7 +341,7 @@
|
||||
@@ -404,7 +404,7 @@
|
||||
}
|
||||
} else if (this.k(itemstack)) {
|
||||
this.a(entityhuman, itemstack);
|
||||
@@ -18,7 +18,7 @@
|
||||
this.tame(entityhuman);
|
||||
this.setWillSit(true);
|
||||
this.world.broadcastEntityEffect(this, (byte) 7);
|
||||
@@ -499,7 +499,15 @@
|
||||
@@ -562,7 +562,15 @@
|
||||
while (iterator.hasNext()) {
|
||||
ItemStack itemstack = (ItemStack) iterator.next();
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -529,7 +537,7 @@
|
||||
@@ -592,7 +600,7 @@
|
||||
static class PathfinderGoalTemptChance extends PathfinderGoalTempt {
|
||||
|
||||
@Nullable
|
||||
@@ -44,7 +44,7 @@
|
||||
private final EntityCat d;
|
||||
|
||||
public PathfinderGoalTemptChance(EntityCat entitycat, double d0, RecipeItemStack recipeitemstack, boolean flag) {
|
||||
@@ -564,9 +572,9 @@
|
||||
@@ -627,9 +635,9 @@
|
||||
private final EntityCat i;
|
||||
|
||||
public a(EntityCat entitycat, Class<T> oclass, float f, double d0, double d1) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityChicken.java
|
||||
+++ b/net/minecraft/server/EntityChicken.java
|
||||
@@ -40,6 +40,11 @@
|
||||
--- a/net/minecraft/world/entity/animal/EntityChicken.java
|
||||
+++ b/net/minecraft/world/entity/animal/EntityChicken.java
|
||||
@@ -74,6 +74,11 @@
|
||||
|
||||
@Override
|
||||
public void movementTick() {
|
||||
@@ -12,7 +12,7 @@
|
||||
super.movementTick();
|
||||
this.br = this.bo;
|
||||
this.bq = this.bp;
|
||||
@@ -59,7 +64,9 @@
|
||||
@@ -93,7 +98,9 @@
|
||||
this.bo += this.bs * 2.0F;
|
||||
if (!this.world.isClientSide && this.isAlive() && !this.isBaby() && !this.isChickenJockey() && --this.eggLayTime <= 0) {
|
||||
this.playSound(SoundEffects.ENTITY_CHICKEN_EGG, 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
--- a/net/minecraft/server/EntityCow.java
|
||||
+++ b/net/minecraft/server/EntityCow.java
|
||||
@@ -1,5 +1,10 @@
|
||||
package net.minecraft.server;
|
||||
--- a/net/minecraft/world/entity/animal/EntityCow.java
|
||||
+++ b/net/minecraft/world/entity/animal/EntityCow.java
|
||||
@@ -30,6 +30,11 @@
|
||||
import net.minecraft.world.level.World;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
@@ -11,7 +12,7 @@
|
||||
public class EntityCow extends EntityAnimal {
|
||||
|
||||
public EntityCow(EntityTypes<? extends EntityCow> entitytypes, World world) {
|
||||
@@ -52,8 +57,16 @@
|
||||
@@ -82,8 +87,16 @@
|
||||
ItemStack itemstack = entityhuman.b(enumhand);
|
||||
|
||||
if (itemstack.getItem() == Items.BUCKET && !this.isBaby()) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityDolphin.java
|
||||
+++ b/net/minecraft/server/EntityDolphin.java
|
||||
@@ -109,7 +109,7 @@
|
||||
--- a/net/minecraft/world/entity/animal/EntityDolphin.java
|
||||
+++ b/net/minecraft/world/entity/animal/EntityDolphin.java
|
||||
@@ -173,7 +173,7 @@
|
||||
this.goalSelector.a(8, new EntityDolphin.d());
|
||||
this.goalSelector.a(8, new PathfinderGoalFollowBoat(this));
|
||||
this.goalSelector.a(9, new PathfinderGoalAvoidTarget<>(this, EntityGuardian.class, 8.0F, 1.0D, 1.0D));
|
||||
@@ -9,7 +9,7 @@
|
||||
}
|
||||
|
||||
public static AttributeProvider.Builder eM() {
|
||||
@@ -176,6 +176,12 @@
|
||||
@@ -240,6 +240,12 @@
|
||||
ItemStack itemstack = entityitem.getItemStack();
|
||||
|
||||
if (this.canPickup(itemstack)) {
|
||||
@@ -22,7 +22,7 @@
|
||||
this.a(entityitem);
|
||||
this.setSlot(EnumItemSlot.MAINHAND, itemstack);
|
||||
this.dropChanceHand[EnumItemSlot.MAINHAND.b()] = 2.0F;
|
||||
@@ -323,7 +329,7 @@
|
||||
@@ -387,7 +393,7 @@
|
||||
|
||||
@Override
|
||||
public boolean a() {
|
||||
@@ -31,7 +31,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -432,7 +438,7 @@
|
||||
@@ -496,7 +502,7 @@
|
||||
|
||||
@Override
|
||||
public void c() {
|
||||
@@ -40,7 +40,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -451,7 +457,7 @@
|
||||
@@ -515,7 +521,7 @@
|
||||
}
|
||||
|
||||
if (this.c.isSwimming() && this.c.world.random.nextInt(6) == 0) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityFish.java
|
||||
+++ b/net/minecraft/server/EntityFish.java
|
||||
@@ -32,7 +32,7 @@
|
||||
--- a/net/minecraft/world/entity/animal/EntityFish.java
|
||||
+++ b/net/minecraft/world/entity/animal/EntityFish.java
|
||||
@@ -70,7 +70,7 @@
|
||||
|
||||
@Override
|
||||
public boolean isTypeNotPersistent(double d0) {
|
||||
@@ -9,7 +9,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -52,6 +52,7 @@
|
||||
@@ -90,6 +90,7 @@
|
||||
|
||||
public void setFromBucket(boolean flag) {
|
||||
this.datawatcher.set(EntityFish.FROM_BUCKET, flag);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityFox.java
|
||||
+++ b/net/minecraft/server/EntityFox.java
|
||||
@@ -264,8 +264,8 @@
|
||||
--- a/net/minecraft/world/entity/animal/EntityFox.java
|
||||
+++ b/net/minecraft/world/entity/animal/EntityFox.java
|
||||
@@ -334,8 +334,8 @@
|
||||
private List<UUID> fa() {
|
||||
List<UUID> list = Lists.newArrayList();
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -401,7 +401,8 @@
|
||||
@@ -471,7 +471,8 @@
|
||||
protected void b(EntityItem entityitem) {
|
||||
ItemStack itemstack = entityitem.getItemStack();
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
int i = itemstack.getCount();
|
||||
|
||||
if (i > 1) {
|
||||
@@ -923,6 +924,11 @@
|
||||
@@ -993,6 +994,11 @@
|
||||
int i = (Integer) iblockdata.get(BlockSweetBerryBush.a);
|
||||
|
||||
iblockdata.set(BlockSweetBerryBush.a, 1);
|
||||
@@ -33,7 +33,7 @@
|
||||
int j = 1 + EntityFox.this.world.random.nextInt(2) + (i == 3 ? 1 : 0);
|
||||
ItemStack itemstack = EntityFox.this.getEquipment(EnumItemSlot.MAINHAND);
|
||||
|
||||
@@ -962,7 +968,7 @@
|
||||
@@ -1032,7 +1038,7 @@
|
||||
private int f;
|
||||
|
||||
public r() {
|
||||
@@ -42,7 +42,7 @@
|
||||
this.a(EnumSet.of(PathfinderGoal.Type.MOVE, PathfinderGoal.Type.LOOK));
|
||||
}
|
||||
|
||||
@@ -1014,7 +1020,7 @@
|
||||
@@ -1084,7 +1090,7 @@
|
||||
private int c;
|
||||
|
||||
public t() {
|
||||
@@ -51,7 +51,7 @@
|
||||
this.c = EntityFox.this.random.nextInt(140);
|
||||
this.a(EnumSet.of(PathfinderGoal.Type.MOVE, PathfinderGoal.Type.LOOK, PathfinderGoal.Type.JUMP));
|
||||
}
|
||||
@@ -1125,7 +1131,7 @@
|
||||
@@ -1195,7 +1201,7 @@
|
||||
private EntityLiving k;
|
||||
private int l;
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
super(EntityFox.this, oclass, 10, flag, flag1, predicate);
|
||||
}
|
||||
|
||||
@@ -1205,6 +1211,14 @@
|
||||
@@ -1275,6 +1281,14 @@
|
||||
if (entityplayer1 != null && entityplayer != entityplayer1) {
|
||||
entityfox.b(entityplayer1.getUniqueID());
|
||||
}
|
||||
@@ -75,7 +75,7 @@
|
||||
|
||||
if (entityplayer2 != null) {
|
||||
entityplayer2.a(StatisticList.ANIMALS_BRED);
|
||||
@@ -1217,10 +1231,14 @@
|
||||
@@ -1287,10 +1301,14 @@
|
||||
this.partner.resetLove();
|
||||
entityfox.setAgeRaw(-24000);
|
||||
entityfox.setPositionRotation(this.animal.locX(), this.animal.locY(), this.animal.locZ(), 0.0F, 0.0F);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityIronGolem.java
|
||||
+++ b/net/minecraft/server/EntityIronGolem.java
|
||||
@@ -58,7 +58,7 @@
|
||||
--- a/net/minecraft/world/entity/animal/EntityIronGolem.java
|
||||
+++ b/net/minecraft/world/entity/animal/EntityIronGolem.java
|
||||
@@ -104,7 +104,7 @@
|
||||
@Override
|
||||
protected void C(Entity entity) {
|
||||
if (entity instanceof IMonster && !(entity instanceof EntityCreeper) && this.getRandom().nextInt(20) == 0) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--- a/net/minecraft/server/EntityMushroomCow.java
|
||||
+++ b/net/minecraft/server/EntityMushroomCow.java
|
||||
@@ -5,6 +5,11 @@
|
||||
import java.util.UUID;
|
||||
--- a/net/minecraft/world/entity/animal/EntityMushroomCow.java
|
||||
+++ b/net/minecraft/world/entity/animal/EntityMushroomCow.java
|
||||
@@ -41,6 +41,11 @@
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
+// CraftBukkit start
|
||||
@@ -12,7 +12,7 @@
|
||||
public class EntityMushroomCow extends EntityCow implements IShearable {
|
||||
|
||||
private static final DataWatcherObject<String> bo = DataWatcher.a(EntityMushroomCow.class, DataWatcherRegistry.d);
|
||||
@@ -75,6 +80,11 @@
|
||||
@@ -111,6 +116,11 @@
|
||||
this.playSound(soundeffect, 1.0F, 1.0F);
|
||||
return EnumInteractionResult.a(this.world.isClientSide);
|
||||
} else if (itemstack.getItem() == Items.SHEARS && this.canShear()) {
|
||||
@@ -24,7 +24,7 @@
|
||||
this.shear(SoundCategory.PLAYERS);
|
||||
if (!this.world.isClientSide) {
|
||||
itemstack.damage(1, entityhuman, (entityhuman1) -> {
|
||||
@@ -121,7 +131,7 @@
|
||||
@@ -157,7 +167,7 @@
|
||||
this.world.playSound((EntityHuman) null, (Entity) this, SoundEffects.ENTITY_MOOSHROOM_SHEAR, soundcategory, 1.0F, 1.0F);
|
||||
if (!this.world.s_()) {
|
||||
((WorldServer) this.world).a(Particles.EXPLOSION, this.locX(), this.e(0.5D), this.locZ(), 1, 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
@@ -33,7 +33,7 @@
|
||||
EntityCow entitycow = (EntityCow) EntityTypes.COW.a(this.world);
|
||||
|
||||
entitycow.setPositionRotation(this.locX(), this.locY(), this.locZ(), this.yaw, this.pitch);
|
||||
@@ -137,7 +147,14 @@
|
||||
@@ -173,7 +183,14 @@
|
||||
}
|
||||
|
||||
entitycow.setInvulnerable(this.isInvulnerable());
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityOcelot.java
|
||||
+++ b/net/minecraft/server/EntityOcelot.java
|
||||
@@ -81,7 +81,7 @@
|
||||
--- a/net/minecraft/world/entity/animal/EntityOcelot.java
|
||||
+++ b/net/minecraft/world/entity/animal/EntityOcelot.java
|
||||
@@ -128,7 +128,7 @@
|
||||
|
||||
@Override
|
||||
public boolean isTypeNotPersistent(double d0) {
|
||||
@@ -9,7 +9,7 @@
|
||||
}
|
||||
|
||||
public static AttributeProvider.Builder eK() {
|
||||
@@ -135,7 +135,8 @@
|
||||
@@ -182,7 +182,8 @@
|
||||
if ((this.br == null || this.br.h()) && !this.isTrusting() && this.k(itemstack) && entityhuman.h((Entity) this) < 9.0D) {
|
||||
this.a(entityhuman, itemstack);
|
||||
if (!this.world.isClientSide) {
|
||||
@@ -19,7 +19,7 @@
|
||||
this.setTrusting(true);
|
||||
this.u(true);
|
||||
this.world.broadcastEntityEffect(this, (byte) 41);
|
||||
@@ -243,9 +244,9 @@
|
||||
@@ -290,9 +291,9 @@
|
||||
private final EntityOcelot i;
|
||||
|
||||
public a(EntityOcelot entityocelot, Class<T> oclass, float f, double d0, double d1) {
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
--- a/net/minecraft/server/EntityPanda.java
|
||||
+++ b/net/minecraft/server/EntityPanda.java
|
||||
@@ -9,6 +9,8 @@
|
||||
import java.util.function.Predicate;
|
||||
import javax.annotation.Nullable;
|
||||
--- a/net/minecraft/world/entity/animal/EntityPanda.java
|
||||
+++ b/net/minecraft/world/entity/animal/EntityPanda.java
|
||||
@@ -64,6 +64,8 @@
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
+import org.bukkit.event.entity.EntityTargetEvent; // CraftBukkit
|
||||
+
|
||||
public class EntityPanda extends EntityAnimal {
|
||||
|
||||
private static final DataWatcherObject<Integer> bp = DataWatcher.a(EntityPanda.class, DataWatcherRegistry.b);
|
||||
@@ -445,7 +447,7 @@
|
||||
@@ -500,7 +502,7 @@
|
||||
|
||||
@Override
|
||||
protected void b(EntityItem entityitem) {
|
||||
@@ -18,7 +18,7 @@
|
||||
this.a(entityitem);
|
||||
ItemStack itemstack = entityitem.getItemStack();
|
||||
|
||||
@@ -666,7 +668,7 @@
|
||||
@@ -721,7 +723,7 @@
|
||||
@Override
|
||||
protected void a(EntityInsentient entityinsentient, EntityLiving entityliving) {
|
||||
if (entityinsentient instanceof EntityPanda && ((EntityPanda) entityinsentient).isAggressive()) {
|
||||
@@ -27,7 +27,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -770,9 +772,9 @@
|
||||
@@ -825,9 +827,9 @@
|
||||
private final EntityPanda i;
|
||||
|
||||
public c(EntityPanda entitypanda, Class<T> oclass, float f, double d0, double d1) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityParrot.java
|
||||
+++ b/net/minecraft/server/EntityParrot.java
|
||||
@@ -20,7 +20,7 @@
|
||||
--- a/net/minecraft/world/entity/animal/EntityParrot.java
|
||||
+++ b/net/minecraft/world/entity/animal/EntityParrot.java
|
||||
@@ -74,7 +74,7 @@
|
||||
};
|
||||
private static final Item bw = Items.COOKIE;
|
||||
private static final Set<Item> bx = Sets.newHashSet(new Item[]{Items.WHEAT_SEEDS, Items.MELON_SEEDS, Items.PUMPKIN_SEEDS, Items.BEETROOT_SEEDS});
|
||||
@@ -9,7 +9,7 @@
|
||||
hashmap.put(EntityTypes.BLAZE, SoundEffects.ENTITY_PARROT_IMITATE_BLAZE);
|
||||
hashmap.put(EntityTypes.CAVE_SPIDER, SoundEffects.ENTITY_PARROT_IMITATE_SPIDER);
|
||||
hashmap.put(EntityTypes.CREEPER, SoundEffects.ENTITY_PARROT_IMITATE_CREEPER);
|
||||
@@ -187,7 +187,7 @@
|
||||
@@ -241,7 +241,7 @@
|
||||
}
|
||||
|
||||
if (!this.world.isClientSide) {
|
||||
@@ -18,7 +18,7 @@
|
||||
this.tame(entityhuman);
|
||||
this.world.broadcastEntityEffect(this, (byte) 7);
|
||||
} else {
|
||||
@@ -201,7 +201,7 @@
|
||||
@@ -255,7 +255,7 @@
|
||||
itemstack.subtract(1);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
if (entityhuman.isCreative() || !this.isInvulnerable()) {
|
||||
this.damageEntity(DamageSource.playerAttack(entityhuman), Float.MAX_VALUE);
|
||||
}
|
||||
@@ -315,7 +315,7 @@
|
||||
@@ -369,7 +369,7 @@
|
||||
|
||||
@Override
|
||||
public boolean isCollidable() {
|
||||
@@ -36,7 +36,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -330,7 +330,7 @@
|
||||
@@ -384,7 +384,7 @@
|
||||
if (this.isInvulnerable(damagesource)) {
|
||||
return false;
|
||||
} else {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/server/EntityPig.java
|
||||
+++ b/net/minecraft/server/EntityPig.java
|
||||
@@ -3,6 +3,10 @@
|
||||
import com.google.common.collect.UnmodifiableIterator;
|
||||
import javax.annotation.Nullable;
|
||||
--- a/net/minecraft/world/entity/animal/EntityPig.java
|
||||
+++ b/net/minecraft/world/entity/animal/EntityPig.java
|
||||
@@ -50,6 +50,10 @@
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
@@ -11,7 +11,7 @@
|
||||
public class EntityPig extends EntityAnimal implements ISteerable, ISaddleable {
|
||||
|
||||
private static final DataWatcherObject<Boolean> bo = DataWatcher.a(EntityPig.class, DataWatcherRegistry.i);
|
||||
@@ -204,7 +208,13 @@
|
||||
@@ -251,7 +255,13 @@
|
||||
}
|
||||
|
||||
entitypigzombie.setPersistent();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityPufferFish.java
|
||||
+++ b/net/minecraft/server/EntityPufferFish.java
|
||||
@@ -114,7 +114,7 @@
|
||||
--- a/net/minecraft/world/entity/animal/EntityPufferFish.java
|
||||
+++ b/net/minecraft/world/entity/animal/EntityPufferFish.java
|
||||
@@ -136,7 +136,7 @@
|
||||
int i = this.getPuffState();
|
||||
|
||||
if (entityinsentient.damageEntity(DamageSource.mobAttack(this), (float) (1 + i))) {
|
||||
@@ -9,7 +9,7 @@
|
||||
this.playSound(SoundEffects.ENTITY_PUFFER_FISH_STING, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
@@ -151,7 +151,7 @@
|
||||
((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.j, 0.0F));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityRabbit.java
|
||||
+++ b/net/minecraft/server/EntityRabbit.java
|
||||
@@ -17,8 +17,14 @@
|
||||
--- a/net/minecraft/world/entity/animal/EntityRabbit.java
|
||||
+++ b/net/minecraft/world/entity/animal/EntityRabbit.java
|
||||
@@ -72,8 +72,14 @@
|
||||
super(entitytypes, world);
|
||||
this.bi = new EntityRabbit.ControllerJumpRabbit(this);
|
||||
this.moveController = new EntityRabbit.ControllerMoveRabbit(this);
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
@Override
|
||||
public void initPathfinder() {
|
||||
@@ -285,7 +291,7 @@
|
||||
@@ -340,7 +346,7 @@
|
||||
if (i == 99) {
|
||||
this.getAttributeInstance(GenericAttributes.ARMOR).setValue(8.0D);
|
||||
this.goalSelector.a(4, new EntityRabbit.PathfinderGoalKillerRabbitMeleeAttack(this));
|
||||
@@ -24,7 +24,7 @@
|
||||
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true));
|
||||
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityWolf.class, true));
|
||||
if (!this.hasCustomName()) {
|
||||
@@ -401,9 +407,23 @@
|
||||
@@ -456,9 +462,23 @@
|
||||
Integer integer = (Integer) iblockdata.get(BlockCarrots.AGE);
|
||||
|
||||
if (integer == 0) {
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
--- a/net/minecraft/server/EntitySheep.java
|
||||
+++ b/net/minecraft/server/EntitySheep.java
|
||||
@@ -8,10 +8,16 @@
|
||||
import java.util.stream.Collectors;
|
||||
import javax.annotation.Nullable;
|
||||
--- a/net/minecraft/world/entity/animal/EntitySheep.java
|
||||
+++ b/net/minecraft/world/entity/animal/EntitySheep.java
|
||||
@@ -60,10 +60,18 @@
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import net.minecraft.world.level.storage.loot.LootTables;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.world.inventory.InventoryCraftResult;
|
||||
+import net.minecraft.world.item.Item;
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
+import org.bukkit.event.entity.SheepRegrowWoolEvent;
|
||||
+import org.bukkit.inventory.InventoryView;
|
||||
@@ -18,7 +20,7 @@
|
||||
enummap.put(EnumColor.WHITE, Blocks.WHITE_WOOL);
|
||||
enummap.put(EnumColor.ORANGE, Blocks.ORANGE_WOOL);
|
||||
enummap.put(EnumColor.MAGENTA, Blocks.MAGENTA_WOOL);
|
||||
@@ -138,6 +144,11 @@
|
||||
@@ -190,6 +198,11 @@
|
||||
|
||||
if (itemstack.getItem() == Items.SHEARS) {
|
||||
if (!this.world.isClientSide && this.canShear()) {
|
||||
@@ -30,7 +32,7 @@
|
||||
this.shear(SoundCategory.PLAYERS);
|
||||
itemstack.damage(1, entityhuman, (entityhuman1) -> {
|
||||
entityhuman1.broadcastItemBreak(enumhand);
|
||||
@@ -158,7 +169,9 @@
|
||||
@@ -210,7 +223,9 @@
|
||||
int i = 1 + this.random.nextInt(3);
|
||||
|
||||
for (int j = 0; j < i; ++j) {
|
||||
@@ -40,7 +42,7 @@
|
||||
|
||||
if (entityitem != null) {
|
||||
entityitem.setMot(entityitem.getMot().add((double) ((this.random.nextFloat() - this.random.nextFloat()) * 0.1F), (double) (this.random.nextFloat() * 0.05F), (double) ((this.random.nextFloat() - this.random.nextFloat()) * 0.1F)));
|
||||
@@ -248,6 +261,12 @@
|
||||
@@ -300,6 +315,12 @@
|
||||
|
||||
@Override
|
||||
public void blockEaten() {
|
||||
@@ -53,7 +55,7 @@
|
||||
this.setSheared(false);
|
||||
if (this.isBaby()) {
|
||||
this.setAge(60);
|
||||
@@ -266,7 +285,7 @@
|
||||
@@ -318,7 +339,7 @@
|
||||
EnumColor enumcolor = ((EntitySheep) entityanimal).getColor();
|
||||
EnumColor enumcolor1 = ((EntitySheep) entityanimal1).getColor();
|
||||
InventoryCrafting inventorycrafting = a(enumcolor, enumcolor1);
|
||||
@@ -62,7 +64,7 @@
|
||||
return recipecrafting.a(inventorycrafting);
|
||||
}).map(ItemStack::getItem);
|
||||
|
||||
@@ -284,10 +303,18 @@
|
||||
@@ -336,10 +357,18 @@
|
||||
public boolean canUse(EntityHuman entityhuman) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/server/EntitySnowman.java
|
||||
+++ b/net/minecraft/server/EntitySnowman.java
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
--- a/net/minecraft/world/entity/animal/EntitySnowman.java
|
||||
+++ b/net/minecraft/world/entity/animal/EntitySnowman.java
|
||||
@@ -38,6 +38,10 @@
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
@@ -11,7 +11,7 @@
|
||||
public class EntitySnowman extends EntityGolem implements IShearable, IRangedEntity {
|
||||
|
||||
private static final DataWatcherObject<Byte> b = DataWatcher.a(EntitySnowman.class, DataWatcherRegistry.a);
|
||||
@@ -60,7 +64,7 @@
|
||||
@@ -96,7 +100,7 @@
|
||||
int k = MathHelper.floor(this.locZ());
|
||||
|
||||
if (this.world.getBiome(new BlockPosition(i, 0, k)).getAdjustedTemperature(new BlockPosition(i, j, k)) > 1.0F) {
|
||||
@@ -20,7 +20,7 @@
|
||||
}
|
||||
|
||||
if (!this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) {
|
||||
@@ -76,7 +80,7 @@
|
||||
@@ -112,7 +116,7 @@
|
||||
BlockPosition blockposition = new BlockPosition(i, j, k);
|
||||
|
||||
if (this.world.getType(blockposition).isAir() && this.world.getBiome(blockposition).getAdjustedTemperature(blockposition) < 0.8F && iblockdata.canPlace(this.world, blockposition)) {
|
||||
@@ -29,7 +29,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -107,6 +111,11 @@
|
||||
@@ -143,6 +147,11 @@
|
||||
ItemStack itemstack = entityhuman.b(enumhand);
|
||||
|
||||
if (itemstack.getItem() == Items.SHEARS && this.canShear()) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityTurtle.java
|
||||
+++ b/net/minecraft/server/EntityTurtle.java
|
||||
@@ -252,7 +252,9 @@
|
||||
--- a/net/minecraft/world/entity/animal/EntityTurtle.java
|
||||
+++ b/net/minecraft/world/entity/animal/EntityTurtle.java
|
||||
@@ -314,7 +314,9 @@
|
||||
protected void m() {
|
||||
super.m();
|
||||
if (!this.isBaby() && this.world.getGameRules().getBoolean(GameRules.DO_MOB_LOOT)) {
|
||||
@@ -10,7 +10,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -279,7 +281,9 @@
|
||||
@@ -341,7 +343,9 @@
|
||||
|
||||
@Override
|
||||
public void onLightningStrike(WorldServer worldserver, EntityLightning entitylightning) {
|
||||
@@ -20,7 +20,7 @@
|
||||
}
|
||||
|
||||
static class g extends NavigationGuardian {
|
||||
@@ -438,8 +442,12 @@
|
||||
@@ -500,8 +504,12 @@
|
||||
} else if (this.g.bv > 200) {
|
||||
World world = this.g.world;
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
this.g.setHasEgg(false);
|
||||
this.g.u(false);
|
||||
this.g.setLoveTicks(600);
|
||||
@@ -519,7 +527,7 @@
|
||||
@@ -581,7 +589,7 @@
|
||||
--this.e;
|
||||
return false;
|
||||
} else {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/server/EntityWolf.java
|
||||
+++ b/net/minecraft/server/EntityWolf.java
|
||||
@@ -4,6 +4,11 @@
|
||||
import java.util.function.Predicate;
|
||||
import javax.annotation.Nullable;
|
||||
--- a/net/minecraft/world/entity/animal/EntityWolf.java
|
||||
+++ b/net/minecraft/world/entity/animal/EntityWolf.java
|
||||
@@ -62,6 +62,11 @@
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
@@ -12,7 +12,7 @@
|
||||
public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable {
|
||||
|
||||
private static final DataWatcherObject<Boolean> br = DataWatcher.a(EntityWolf.class, DataWatcherRegistry.i);
|
||||
@@ -43,7 +48,7 @@
|
||||
@@ -101,7 +106,7 @@
|
||||
this.goalSelector.a(10, new PathfinderGoalRandomLookaround(this));
|
||||
this.targetSelector.a(1, new PathfinderGoalOwnerHurtByTarget(this));
|
||||
this.targetSelector.a(2, new PathfinderGoalOwnerHurtTarget(this));
|
||||
@@ -21,7 +21,7 @@
|
||||
this.targetSelector.a(4, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, 10, true, false, this::a_));
|
||||
this.targetSelector.a(5, new PathfinderGoalRandomTargetNonTamed<>(this, EntityAnimal.class, false, EntityWolf.bq));
|
||||
this.targetSelector.a(6, new PathfinderGoalRandomTargetNonTamed<>(this, EntityTurtle.class, false, EntityTurtle.bo));
|
||||
@@ -55,6 +60,24 @@
|
||||
@@ -113,6 +118,24 @@
|
||||
return EntityInsentient.p().a(GenericAttributes.MOVEMENT_SPEED, 0.30000001192092896D).a(GenericAttributes.MAX_HEALTH, 8.0D).a(GenericAttributes.ATTACK_DAMAGE, 2.0D);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
@Override
|
||||
protected void initDatawatcher() {
|
||||
super.initDatawatcher();
|
||||
@@ -201,7 +224,7 @@
|
||||
@@ -259,7 +282,7 @@
|
||||
} else {
|
||||
Entity entity = damagesource.getEntity();
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
if (entity != null && !(entity instanceof EntityHuman) && !(entity instanceof EntityArrow)) {
|
||||
f = (f + 1.0F) / 2.0F;
|
||||
}
|
||||
@@ -226,7 +249,7 @@
|
||||
@@ -284,7 +307,7 @@
|
||||
super.setTamed(flag);
|
||||
if (flag) {
|
||||
this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(20.0D);
|
||||
@@ -64,7 +64,7 @@
|
||||
} else {
|
||||
this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(8.0D);
|
||||
}
|
||||
@@ -250,7 +273,7 @@
|
||||
@@ -308,7 +331,7 @@
|
||||
itemstack.subtract(1);
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
return EnumInteractionResult.SUCCESS;
|
||||
}
|
||||
|
||||
@@ -261,7 +284,7 @@
|
||||
@@ -319,7 +342,7 @@
|
||||
this.setWillSit(!this.isWillSit());
|
||||
this.jumping = false;
|
||||
this.navigation.o();
|
||||
@@ -82,7 +82,7 @@
|
||||
return EnumInteractionResult.SUCCESS;
|
||||
}
|
||||
|
||||
@@ -283,7 +306,8 @@
|
||||
@@ -341,7 +364,8 @@
|
||||
itemstack.subtract(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
--- a/net/minecraft/server/EntityHorseAbstract.java
|
||||
+++ b/net/minecraft/server/EntityHorseAbstract.java
|
||||
@@ -7,6 +7,8 @@
|
||||
import java.util.function.Predicate;
|
||||
import javax.annotation.Nullable;
|
||||
--- a/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.java
|
||||
+++ b/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.java
|
||||
@@ -68,6 +68,8 @@
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
+import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; // CraftBukkit
|
||||
+
|
||||
public abstract class EntityHorseAbstract extends EntityAnimal implements IInventoryListener, IJumpable, ISaddleable {
|
||||
|
||||
private static final Predicate<EntityLiving> bw = (entityliving) -> {
|
||||
@@ -34,6 +36,7 @@
|
||||
@@ -95,6 +97,7 @@
|
||||
private float bK;
|
||||
protected boolean bu = true;
|
||||
protected int bv;
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
protected EntityHorseAbstract(EntityTypes<? extends EntityHorseAbstract> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -218,7 +221,7 @@
|
||||
@@ -279,7 +282,7 @@
|
||||
public void loadChest() {
|
||||
InventorySubcontainer inventorysubcontainer = this.inventoryChest;
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
if (inventorysubcontainer != null) {
|
||||
inventorysubcontainer.b((IInventoryListener) this);
|
||||
int i = Math.min(inventorysubcontainer.getSize(), this.inventoryChest.getSize());
|
||||
@@ -334,7 +337,7 @@
|
||||
@@ -395,7 +398,7 @@
|
||||
}
|
||||
|
||||
public int getMaxDomestication() {
|
||||
@@ -35,7 +35,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -405,7 +408,7 @@
|
||||
@@ -466,7 +469,7 @@
|
||||
}
|
||||
|
||||
if (this.getHealth() < this.getMaxHealth() && f > 0.0F) {
|
||||
@@ -44,7 +44,7 @@
|
||||
flag = true;
|
||||
}
|
||||
|
||||
@@ -481,7 +484,7 @@
|
||||
@@ -542,7 +545,7 @@
|
||||
super.movementTick();
|
||||
if (!this.world.isClientSide && this.isAlive()) {
|
||||
if (this.random.nextInt(900) == 0 && this.deathTicks == 0) {
|
||||
@@ -53,7 +53,7 @@
|
||||
}
|
||||
|
||||
if (this.fl()) {
|
||||
@@ -718,6 +721,7 @@
|
||||
@@ -779,6 +782,7 @@
|
||||
if (this.getOwnerUUID() != null) {
|
||||
nbttagcompound.a("Owner", this.getOwnerUUID());
|
||||
}
|
||||
@@ -61,7 +61,7 @@
|
||||
|
||||
if (!this.inventoryChest.getItem(0).isEmpty()) {
|
||||
nbttagcompound.set("SaddleItem", this.inventoryChest.getItem(0).save(new NBTTagCompound()));
|
||||
@@ -745,6 +749,11 @@
|
||||
@@ -806,6 +810,11 @@
|
||||
if (uuid != null) {
|
||||
this.setOwnerUUID(uuid);
|
||||
}
|
||||
@@ -73,7 +73,7 @@
|
||||
|
||||
if (nbttagcompound.hasKeyOfType("SaddleItem", 10)) {
|
||||
ItemStack itemstack = ItemStack.a(nbttagcompound.getCompound("SaddleItem"));
|
||||
@@ -796,6 +805,18 @@
|
||||
@@ -857,6 +866,18 @@
|
||||
|
||||
@Override
|
||||
public void b(int i) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityLlamaTrader.java
|
||||
+++ b/net/minecraft/server/EntityLlamaTrader.java
|
||||
@@ -127,7 +127,7 @@
|
||||
--- a/net/minecraft/world/entity/animal/horse/EntityLlamaTrader.java
|
||||
+++ b/net/minecraft/world/entity/animal/horse/EntityLlamaTrader.java
|
||||
@@ -143,7 +143,7 @@
|
||||
|
||||
@Override
|
||||
public void c() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/PathfinderGoalHorseTrap.java
|
||||
+++ b/net/minecraft/server/PathfinderGoalHorseTrap.java
|
||||
@@ -25,19 +25,20 @@
|
||||
--- a/net/minecraft/world/entity/animal/horse/PathfinderGoalHorseTrap.java
|
||||
+++ b/net/minecraft/world/entity/animal/horse/PathfinderGoalHorseTrap.java
|
||||
@@ -40,19 +40,20 @@
|
||||
|
||||
entitylightning.teleportAndSync(this.a.locX(), this.a.locY(), this.a.locZ());
|
||||
entitylightning.setEffect(true);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/server/EntityEnderCrystal.java
|
||||
+++ b/net/minecraft/server/EntityEnderCrystal.java
|
||||
@@ -3,6 +3,11 @@
|
||||
import java.util.Optional;
|
||||
import javax.annotation.Nullable;
|
||||
--- a/net/minecraft/world/entity/boss/enderdragon/EntityEnderCrystal.java
|
||||
+++ b/net/minecraft/world/entity/boss/enderdragon/EntityEnderCrystal.java
|
||||
@@ -20,6 +20,11 @@
|
||||
import net.minecraft.world.level.block.BlockFireAbstract;
|
||||
import net.minecraft.world.level.dimension.end.EnderDragonBattle;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
@@ -12,7 +12,7 @@
|
||||
public class EntityEnderCrystal extends Entity {
|
||||
|
||||
private static final DataWatcherObject<Optional<BlockPosition>> c = DataWatcher.a(EntityEnderCrystal.class, DataWatcherRegistry.m);
|
||||
@@ -38,7 +43,11 @@
|
||||
@@ -55,7 +60,11 @@
|
||||
BlockPosition blockposition = this.getChunkCoordinates();
|
||||
|
||||
if (((WorldServer) this.world).getDragonBattle() != null && this.world.getType(blockposition).isAir()) {
|
||||
@@ -25,7 +25,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,9 +87,22 @@
|
||||
@@ -95,9 +104,22 @@
|
||||
return false;
|
||||
} else {
|
||||
if (!this.dead && !this.world.isClientSide) {
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
--- a/net/minecraft/server/EntityEnderDragon.java
|
||||
+++ b/net/minecraft/server/EntityEnderDragon.java
|
||||
@@ -7,6 +7,12 @@
|
||||
--- a/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java
|
||||
+++ b/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java
|
||||
@@ -51,6 +51,17 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.world.item.ItemStack;
|
||||
+import net.minecraft.world.level.Explosion;
|
||||
+import net.minecraft.world.level.block.entity.TileEntity;
|
||||
+import net.minecraft.world.level.storage.loot.LootTableInfo;
|
||||
+import net.minecraft.world.level.storage.loot.parameters.LootContextParameters;
|
||||
+import org.bukkit.craftbukkit.block.CraftBlock;
|
||||
+import org.bukkit.event.entity.EntityExplodeEvent;
|
||||
+import org.bukkit.event.entity.EntityRegainHealthEvent;
|
||||
@@ -13,7 +18,7 @@
|
||||
public class EntityEnderDragon extends EntityInsentient implements IMonster {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
@@ -38,6 +44,7 @@
|
||||
@@ -82,6 +93,7 @@
|
||||
private final PathPoint[] bJ = new PathPoint[24];
|
||||
private final int[] bK = new int[24];
|
||||
private final Path bL = new Path();
|
||||
@@ -21,7 +26,7 @@
|
||||
|
||||
public EntityEnderDragon(EntityTypes<? extends EntityEnderDragon> entitytypes, World world) {
|
||||
super(EntityTypes.ENDER_DRAGON, world);
|
||||
@@ -175,7 +182,7 @@
|
||||
@@ -219,7 +231,7 @@
|
||||
|
||||
Vec3D vec3d1 = idragoncontroller.g();
|
||||
|
||||
@@ -30,7 +35,7 @@
|
||||
d0 = vec3d1.x - this.locX();
|
||||
d1 = vec3d1.y - this.locY();
|
||||
d2 = vec3d1.z - this.locZ();
|
||||
@@ -313,7 +320,14 @@
|
||||
@@ -357,7 +369,14 @@
|
||||
if (this.currentEnderCrystal.dead) {
|
||||
this.currentEnderCrystal = null;
|
||||
} else if (this.ticksLived % 10 == 0 && this.getHealth() < this.getMaxHealth()) {
|
||||
@@ -46,7 +51,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -388,6 +402,9 @@
|
||||
@@ -432,6 +451,9 @@
|
||||
int j1 = MathHelper.floor(axisalignedbb.maxZ);
|
||||
boolean flag = false;
|
||||
boolean flag1 = false;
|
||||
@@ -56,7 +61,7 @@
|
||||
|
||||
for (int k1 = i; k1 <= l; ++k1) {
|
||||
for (int l1 = j; l1 <= i1; ++l1) {
|
||||
@@ -398,7 +415,11 @@
|
||||
@@ -442,7 +464,11 @@
|
||||
|
||||
if (!iblockdata.isAir() && iblockdata.getMaterial() != Material.FIRE) {
|
||||
if (this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) && !TagsBlock.DRAGON_IMMUNE.isTagged(block)) {
|
||||
@@ -69,7 +74,7 @@
|
||||
} else {
|
||||
flag = true;
|
||||
}
|
||||
@@ -407,6 +428,51 @@
|
||||
@@ -451,6 +477,51 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/DragonControllerManager.java
|
||||
+++ b/net/minecraft/server/DragonControllerManager.java
|
||||
@@ -3,6 +3,11 @@
|
||||
--- a/net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerManager.java
|
||||
+++ b/net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerManager.java
|
||||
@@ -4,6 +4,11 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
public class DragonControllerManager {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
@@ -21,6 +26,19 @@
|
||||
@@ -22,6 +27,19 @@
|
||||
this.currentDragonController.e();
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
this.currentDragonController = this.b(dragoncontrollerphase);
|
||||
if (!this.enderDragon.world.isClientSide) {
|
||||
this.enderDragon.getDataWatcher().set(EntityEnderDragon.PHASE, dragoncontrollerphase.b());
|
||||
@@ -42,6 +60,6 @@
|
||||
@@ -43,6 +61,6 @@
|
||||
this.dragonControllers[i] = dragoncontrollerphase.a(this.enderDragon);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
--- a/net/minecraft/server/EntityWither.java
|
||||
+++ b/net/minecraft/server/EntityWither.java
|
||||
@@ -6,6 +6,13 @@
|
||||
import java.util.function.Predicate;
|
||||
import javax.annotation.Nullable;
|
||||
--- a/net/minecraft/world/entity/boss/wither/EntityWither.java
|
||||
+++ b/net/minecraft/world/entity/boss/wither/EntityWither.java
|
||||
@@ -52,6 +52,17 @@
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.network.protocol.game.PacketPlayOutWorldEvent;
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
+import net.minecraft.server.level.WorldServer;
|
||||
+import net.minecraft.world.level.block.Blocks;
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
+import org.bukkit.event.entity.EntityRegainHealthEvent;
|
||||
+import org.bukkit.event.entity.EntityTargetEvent;
|
||||
@@ -14,7 +18,7 @@
|
||||
public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
|
||||
private static final DataWatcherObject<Integer> b = DataWatcher.a(EntityWither.class, DataWatcherRegistry.b);
|
||||
@@ -188,16 +195,40 @@
|
||||
@@ -234,16 +245,40 @@
|
||||
i = this.getInvul() - 1;
|
||||
if (i <= 0) {
|
||||
Explosion.Effect explosion_effect = this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? Explosion.Effect.DESTROY : Explosion.Effect.NONE;
|
||||
@@ -58,7 +62,7 @@
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -249,9 +280,11 @@
|
||||
@@ -295,9 +330,11 @@
|
||||
if (entityliving != this && entityliving.isAlive() && this.hasLineOfSight(entityliving)) {
|
||||
if (entityliving instanceof EntityHuman) {
|
||||
if (!((EntityHuman) entityliving).abilities.isInvulnerable) {
|
||||
@@ -70,7 +74,7 @@
|
||||
this.setHeadTarget(i, entityliving.getId());
|
||||
}
|
||||
break;
|
||||
@@ -287,6 +320,11 @@
|
||||
@@ -333,6 +370,11 @@
|
||||
IBlockData iblockdata = this.world.getType(blockposition);
|
||||
|
||||
if (c(iblockdata)) {
|
||||
@@ -82,7 +86,7 @@
|
||||
flag = this.world.a(blockposition, true, this) || flag;
|
||||
}
|
||||
}
|
||||
@@ -300,7 +338,7 @@
|
||||
@@ -346,7 +388,7 @@
|
||||
}
|
||||
|
||||
if (this.ticksLived % 20 == 0) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/server/EntityArmorStand.java
|
||||
+++ b/net/minecraft/server/EntityArmorStand.java
|
||||
@@ -5,6 +5,15 @@
|
||||
import java.util.function.Predicate;
|
||||
import javax.annotation.Nullable;
|
||||
--- a/net/minecraft/world/entity/decoration/EntityArmorStand.java
|
||||
+++ b/net/minecraft/world/entity/decoration/EntityArmorStand.java
|
||||
@@ -39,6 +39,15 @@
|
||||
import net.minecraft.world.level.material.EnumPistonReaction;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.inventory.EquipmentSlot;
|
||||
@@ -16,7 +16,7 @@
|
||||
public class EntityArmorStand extends EntityLiving {
|
||||
|
||||
private static final Vector3f bj = new Vector3f(0.0F, 0.0F, 0.0F);
|
||||
@@ -55,6 +64,13 @@
|
||||
@@ -89,6 +98,13 @@
|
||||
this.setPosition(d0, d1, d2);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
@Override
|
||||
public void updateSize() {
|
||||
double d0 = this.locX();
|
||||
@@ -110,13 +126,20 @@
|
||||
@@ -144,13 +160,20 @@
|
||||
|
||||
@Override
|
||||
public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
|
||||
@@ -53,7 +53,7 @@
|
||||
this.armorItems.set(enumitemslot.b(), itemstack);
|
||||
}
|
||||
|
||||
@@ -383,6 +406,21 @@
|
||||
@@ -417,6 +440,21 @@
|
||||
return false;
|
||||
} else {
|
||||
ItemStack itemstack2;
|
||||
@@ -75,7 +75,7 @@
|
||||
|
||||
if (entityhuman.abilities.canInstantlyBuild && itemstack1.isEmpty() && !itemstack.isEmpty()) {
|
||||
itemstack2 = itemstack.cloneItemStack();
|
||||
@@ -411,12 +449,22 @@
|
||||
@@ -445,12 +483,22 @@
|
||||
public boolean damageEntity(DamageSource damagesource, float f) {
|
||||
if (!this.world.isClientSide && !this.dead) {
|
||||
if (DamageSource.OUT_OF_WORLD.equals(damagesource)) {
|
||||
@@ -101,7 +101,7 @@
|
||||
return false;
|
||||
} else if (DamageSource.FIRE.equals(damagesource)) {
|
||||
if (this.isBurning()) {
|
||||
@@ -441,7 +489,7 @@
|
||||
@@ -475,7 +523,7 @@
|
||||
} else if (damagesource.v()) {
|
||||
this.F();
|
||||
this.D();
|
||||
@@ -110,7 +110,7 @@
|
||||
return flag1;
|
||||
} else {
|
||||
long i = this.world.getTime();
|
||||
@@ -452,7 +500,7 @@
|
||||
@@ -486,7 +534,7 @@
|
||||
} else {
|
||||
this.f(damagesource);
|
||||
this.D();
|
||||
@@ -119,7 +119,7 @@
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -479,7 +527,7 @@
|
||||
@@ -513,7 +561,7 @@
|
||||
f1 -= f;
|
||||
if (f1 <= 0.5F) {
|
||||
this.g(damagesource);
|
||||
@@ -128,7 +128,7 @@
|
||||
} else {
|
||||
this.setHealth(f1);
|
||||
}
|
||||
@@ -487,13 +535,13 @@
|
||||
@@ -521,13 +569,13 @@
|
||||
}
|
||||
|
||||
private void f(DamageSource damagesource) {
|
||||
@@ -144,7 +144,7 @@
|
||||
|
||||
ItemStack itemstack;
|
||||
int i;
|
||||
@@ -501,7 +549,7 @@
|
||||
@@ -535,7 +583,7 @@
|
||||
for (i = 0; i < this.handItems.size(); ++i) {
|
||||
itemstack = (ItemStack) this.handItems.get(i);
|
||||
if (!itemstack.isEmpty()) {
|
||||
@@ -153,7 +153,7 @@
|
||||
this.handItems.set(i, ItemStack.b);
|
||||
}
|
||||
}
|
||||
@@ -509,10 +557,11 @@
|
||||
@@ -543,10 +591,11 @@
|
||||
for (i = 0; i < this.armorItems.size(); ++i) {
|
||||
itemstack = (ItemStack) this.armorItems.get(i);
|
||||
if (!itemstack.isEmpty()) {
|
||||
@@ -166,7 +166,7 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -613,8 +662,16 @@
|
||||
@@ -647,8 +696,16 @@
|
||||
return this.isSmall();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
--- a/net/minecraft/server/EntityHanging.java
|
||||
+++ b/net/minecraft/server/EntityHanging.java
|
||||
@@ -4,6 +4,12 @@
|
||||
import javax.annotation.Nullable;
|
||||
--- a/net/minecraft/world/entity/decoration/EntityHanging.java
|
||||
+++ b/net/minecraft/world/entity/decoration/EntityHanging.java
|
||||
@@ -24,6 +24,14 @@
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.world.damagesource.EntityDamageSourceIndirect;
|
||||
+import net.minecraft.world.level.material.Material;
|
||||
+import org.bukkit.entity.Hanging;
|
||||
+import org.bukkit.event.hanging.HangingBreakByEntityEvent;
|
||||
+import org.bukkit.event.hanging.HangingBreakEvent;
|
||||
@@ -13,7 +15,7 @@
|
||||
public abstract class EntityHanging extends Entity {
|
||||
|
||||
protected static final Predicate<Entity> b = (entity) -> {
|
||||
@@ -37,26 +43,37 @@
|
||||
@@ -57,26 +65,37 @@
|
||||
|
||||
protected void updateBoundingBox() {
|
||||
if (this.direction != null) {
|
||||
@@ -64,7 +66,7 @@
|
||||
d8 = 1.0D;
|
||||
} else {
|
||||
d6 = 1.0D;
|
||||
@@ -65,11 +82,12 @@
|
||||
@@ -85,11 +104,12 @@
|
||||
d6 /= 32.0D;
|
||||
d7 /= 32.0D;
|
||||
d8 /= 32.0D;
|
||||
@@ -79,7 +81,7 @@
|
||||
return i % 32 == 0 ? 0.5D : 0.0D;
|
||||
}
|
||||
|
||||
@@ -83,6 +101,24 @@
|
||||
@@ -103,6 +123,24 @@
|
||||
if (this.e++ == 100) {
|
||||
this.e = 0;
|
||||
if (!this.dead && !this.survives()) {
|
||||
@@ -104,7 +106,7 @@
|
||||
this.die();
|
||||
this.a((Entity) null);
|
||||
}
|
||||
@@ -146,6 +182,22 @@
|
||||
@@ -166,6 +204,22 @@
|
||||
return false;
|
||||
} else {
|
||||
if (!this.dead && !this.world.isClientSide) {
|
||||
@@ -127,7 +129,7 @@
|
||||
this.die();
|
||||
this.velocityChanged();
|
||||
this.a(damagesource.getEntity());
|
||||
@@ -158,6 +210,18 @@
|
||||
@@ -178,6 +232,18 @@
|
||||
@Override
|
||||
public void move(EnumMoveType enummovetype, Vec3D vec3d) {
|
||||
if (!this.world.isClientSide && !this.dead && vec3d.g() > 0.0D) {
|
||||
@@ -146,7 +148,7 @@
|
||||
this.die();
|
||||
this.a((Entity) null);
|
||||
}
|
||||
@@ -166,7 +230,7 @@
|
||||
@@ -186,7 +252,7 @@
|
||||
|
||||
@Override
|
||||
public void i(double d0, double d1, double d2) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityItemFrame.java
|
||||
+++ b/net/minecraft/server/EntityItemFrame.java
|
||||
@@ -53,16 +53,27 @@
|
||||
--- a/net/minecraft/world/entity/decoration/EntityItemFrame.java
|
||||
+++ b/net/minecraft/world/entity/decoration/EntityItemFrame.java
|
||||
@@ -83,16 +83,27 @@
|
||||
@Override
|
||||
protected void updateBoundingBox() {
|
||||
if (this.direction != null) {
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
switch (enumdirection_enumaxis) {
|
||||
case X:
|
||||
@@ -78,9 +89,10 @@
|
||||
@@ -108,9 +119,10 @@
|
||||
d4 /= 32.0D;
|
||||
d5 /= 32.0D;
|
||||
d6 /= 32.0D;
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
@Override
|
||||
public boolean survives() {
|
||||
@@ -130,6 +142,11 @@
|
||||
@@ -160,6 +172,11 @@
|
||||
return false;
|
||||
} else if (!damagesource.isExplosion() && !this.getItem().isEmpty()) {
|
||||
if (!this.world.isClientSide) {
|
||||
@@ -61,7 +61,7 @@
|
||||
this.b(damagesource.getEntity(), false);
|
||||
this.playSound(SoundEffects.ENTITY_ITEM_FRAME_REMOVE_ITEM, 1.0F, 1.0F);
|
||||
}
|
||||
@@ -217,6 +234,12 @@
|
||||
@@ -247,6 +264,12 @@
|
||||
}
|
||||
|
||||
public void setItem(ItemStack itemstack, boolean flag) {
|
||||
@@ -74,7 +74,7 @@
|
||||
if (!itemstack.isEmpty()) {
|
||||
itemstack = itemstack.cloneItemStack();
|
||||
itemstack.setCount(1);
|
||||
@@ -224,7 +247,7 @@
|
||||
@@ -254,7 +277,7 @@
|
||||
}
|
||||
|
||||
this.getDataWatcher().set(EntityItemFrame.ITEM, itemstack);
|
||||
|
||||
@@ -1,15 +1,20 @@
|
||||
--- a/net/minecraft/server/EntityLeash.java
|
||||
+++ b/net/minecraft/server/EntityLeash.java
|
||||
@@ -4,6 +4,8 @@
|
||||
import java.util.List;
|
||||
import javax.annotation.Nullable;
|
||||
--- a/net/minecraft/world/entity/decoration/EntityLeash.java
|
||||
+++ b/net/minecraft/world/entity/decoration/EntityLeash.java
|
||||
@@ -23,6 +23,13 @@
|
||||
import net.minecraft.world.level.World;
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.network.protocol.game.PacketPlayOutAttachEntity;
|
||||
+import net.minecraft.server.level.EntityPlayer;
|
||||
+import net.minecraft.server.level.WorldServer;
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class EntityLeash extends EntityHanging {
|
||||
|
||||
public EntityLeash(EntityTypes<? extends EntityLeash> entitytypes, World world) {
|
||||
@@ -29,6 +31,7 @@
|
||||
@@ -48,6 +55,7 @@
|
||||
@Override
|
||||
protected void updateBoundingBox() {
|
||||
this.setPositionRaw((double) this.blockPosition.getX() + 0.5D, (double) this.blockPosition.getY() + 0.5D, (double) this.blockPosition.getZ() + 0.5D);
|
||||
@@ -17,7 +22,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -75,22 +78,42 @@
|
||||
@@ -94,22 +102,42 @@
|
||||
while (iterator.hasNext()) {
|
||||
entityinsentient = (EntityInsentient) iterator.next();
|
||||
if (entityinsentient.getLeashHolder() == entityhuman) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityPainting.java
|
||||
+++ b/net/minecraft/server/EntityPainting.java
|
||||
@@ -11,6 +11,10 @@
|
||||
--- a/net/minecraft/world/entity/decoration/EntityPainting.java
|
||||
+++ b/net/minecraft/world/entity/decoration/EntityPainting.java
|
||||
@@ -26,6 +26,10 @@
|
||||
|
||||
public EntityPainting(EntityTypes<? extends EntityPainting> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
--- a/net/minecraft/server/EntityFallingBlock.java
|
||||
+++ b/net/minecraft/server/EntityFallingBlock.java
|
||||
@@ -4,6 +4,8 @@
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
--- a/net/minecraft/world/entity/item/EntityFallingBlock.java
|
||||
+++ b/net/minecraft/world/entity/item/EntityFallingBlock.java
|
||||
@@ -43,6 +43,8 @@
|
||||
import net.minecraft.world.phys.MovingObjectPositionBlock;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
||||
+
|
||||
public class EntityFallingBlock extends Entity {
|
||||
|
||||
private IBlockData block;
|
||||
@@ -70,7 +72,7 @@
|
||||
@@ -109,7 +111,7 @@
|
||||
|
||||
if (this.ticksLived++ == 0) {
|
||||
blockposition = this.getChunkCoordinates();
|
||||
@@ -18,7 +18,7 @@
|
||||
this.world.a(blockposition, false);
|
||||
} else if (!this.world.isClientSide) {
|
||||
this.die();
|
||||
@@ -122,6 +124,11 @@
|
||||
@@ -161,6 +163,11 @@
|
||||
this.block = (IBlockData) this.block.set(BlockProperties.C, true);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
if (this.world.setTypeAndData(blockposition, this.block, 3)) {
|
||||
if (block instanceof BlockFalling) {
|
||||
((BlockFalling) block).a(this.world, blockposition, this.block, iblockdata, this);
|
||||
@@ -178,7 +185,9 @@
|
||||
@@ -217,7 +224,9 @@
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity = (Entity) iterator.next();
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
--- a/net/minecraft/server/EntityItem.java
|
||||
+++ b/net/minecraft/server/EntityItem.java
|
||||
@@ -6,6 +6,11 @@
|
||||
import java.util.UUID;
|
||||
import javax.annotation.Nullable;
|
||||
--- a/net/minecraft/world/entity/item/EntityItem.java
|
||||
+++ b/net/minecraft/world/entity/item/EntityItem.java
|
||||
@@ -31,6 +31,12 @@
|
||||
import net.minecraft.world.level.World;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
+import org.bukkit.event.entity.EntityPickupItemEvent;
|
||||
+import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||
+// CraftBukkit end
|
||||
@@ -12,7 +13,7 @@
|
||||
public class EntityItem extends Entity {
|
||||
|
||||
private static final DataWatcherObject<ItemStack> ITEM = DataWatcher.a(EntityItem.class, DataWatcherRegistry.g);
|
||||
@@ -15,6 +20,7 @@
|
||||
@@ -40,6 +46,7 @@
|
||||
private UUID thrower;
|
||||
private UUID owner;
|
||||
public final float b;
|
||||
@@ -20,7 +21,7 @@
|
||||
|
||||
public EntityItem(EntityTypes<? extends EntityItem> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -50,9 +56,12 @@
|
||||
@@ -75,9 +82,12 @@
|
||||
this.die();
|
||||
} else {
|
||||
super.tick();
|
||||
@@ -36,7 +37,7 @@
|
||||
|
||||
this.lastX = this.locX();
|
||||
this.lastY = this.locY();
|
||||
@@ -108,9 +117,11 @@
|
||||
@@ -133,9 +143,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +49,7 @@
|
||||
|
||||
this.impulse |= this.aK();
|
||||
if (!this.world.isClientSide) {
|
||||
@@ -122,6 +133,12 @@
|
||||
@@ -147,6 +159,12 @@
|
||||
}
|
||||
|
||||
if (!this.world.isClientSide && this.age >= 6000) {
|
||||
@@ -61,7 +62,7 @@
|
||||
this.die();
|
||||
}
|
||||
|
||||
@@ -197,10 +214,11 @@
|
||||
@@ -222,10 +240,11 @@
|
||||
private static void a(EntityItem entityitem, ItemStack itemstack, ItemStack itemstack1) {
|
||||
ItemStack itemstack2 = a(itemstack, itemstack1, 64);
|
||||
|
||||
@@ -74,7 +75,7 @@
|
||||
a(entityitem, itemstack, itemstack1);
|
||||
entityitem.pickupDelay = Math.max(entityitem.pickupDelay, entityitem1.pickupDelay);
|
||||
entityitem.age = Math.min(entityitem.age, entityitem1.age);
|
||||
@@ -224,6 +242,11 @@
|
||||
@@ -249,6 +268,11 @@
|
||||
} else if (!this.getItemStack().getItem().a(damagesource)) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -86,7 +87,7 @@
|
||||
this.velocityChanged();
|
||||
this.f = (int) ((float) this.f - f);
|
||||
if (this.f <= 0) {
|
||||
@@ -285,6 +308,46 @@
|
||||
@@ -310,6 +334,46 @@
|
||||
Item item = itemstack.getItem();
|
||||
int i = itemstack.getCount();
|
||||
|
||||
@@ -133,7 +134,7 @@
|
||||
if (this.pickupDelay == 0 && (this.owner == null || this.owner.equals(entityhuman.getUniqueID())) && entityhuman.inventory.pickup(itemstack)) {
|
||||
entityhuman.receive(this, i);
|
||||
if (itemstack.isEmpty()) {
|
||||
@@ -328,7 +391,9 @@
|
||||
@@ -353,7 +417,9 @@
|
||||
}
|
||||
|
||||
public void setItemStack(ItemStack itemstack) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/server/EntityTNTPrimed.java
|
||||
+++ b/net/minecraft/server/EntityTNTPrimed.java
|
||||
@@ -2,12 +2,16 @@
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
--- a/net/minecraft/world/entity/item/EntityTNTPrimed.java
|
||||
+++ b/net/minecraft/world/entity/item/EntityTNTPrimed.java
|
||||
@@ -17,12 +17,16 @@
|
||||
import net.minecraft.world.level.Explosion;
|
||||
import net.minecraft.world.level.World;
|
||||
|
||||
+import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit
|
||||
+
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
public EntityTNTPrimed(EntityTypes<? extends EntityTNTPrimed> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -57,10 +61,13 @@
|
||||
@@ -72,10 +76,13 @@
|
||||
|
||||
--this.fuseTicks;
|
||||
if (this.fuseTicks <= 0) {
|
||||
@@ -32,7 +32,7 @@
|
||||
} else {
|
||||
this.aK();
|
||||
if (this.world.isClientSide) {
|
||||
@@ -71,9 +78,16 @@
|
||||
@@ -86,9 +93,16 @@
|
||||
}
|
||||
|
||||
private void explode() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityCaveSpider.java
|
||||
+++ b/net/minecraft/server/EntityCaveSpider.java
|
||||
@@ -25,7 +25,7 @@
|
||||
--- a/net/minecraft/world/entity/monster/EntityCaveSpider.java
|
||||
+++ b/net/minecraft/world/entity/monster/EntityCaveSpider.java
|
||||
@@ -41,7 +41,7 @@
|
||||
}
|
||||
|
||||
if (b0 > 0) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/server/EntityCreeper.java
|
||||
+++ b/net/minecraft/server/EntityCreeper.java
|
||||
@@ -3,6 +3,12 @@
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
--- a/net/minecraft/world/entity/monster/EntityCreeper.java
|
||||
+++ b/net/minecraft/world/entity/monster/EntityCreeper.java
|
||||
@@ -38,6 +38,12 @@
|
||||
import net.minecraft.world.level.IMaterial;
|
||||
import net.minecraft.world.level.World;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
@@ -13,7 +13,7 @@
|
||||
public class EntityCreeper extends EntityMonster {
|
||||
|
||||
private static final DataWatcherObject<Integer> b = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.b);
|
||||
@@ -165,9 +171,19 @@
|
||||
@@ -200,9 +206,19 @@
|
||||
@Override
|
||||
public void onLightningStrike(WorldServer worldserver, EntityLightning entitylightning) {
|
||||
super.onLightningStrike(worldserver, entitylightning);
|
||||
@@ -34,7 +34,7 @@
|
||||
@Override
|
||||
protected EnumInteractionResult b(EntityHuman entityhuman, EnumHand enumhand) {
|
||||
ItemStack itemstack = entityhuman.b(enumhand);
|
||||
@@ -192,10 +208,18 @@
|
||||
@@ -227,10 +243,18 @@
|
||||
Explosion.Effect explosion_effect = this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? Explosion.Effect.DESTROY : Explosion.Effect.NONE;
|
||||
float f = this.isPowered() ? 2.0F : 1.0F;
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -206,6 +230,7 @@
|
||||
@@ -241,6 +265,7 @@
|
||||
if (!collection.isEmpty()) {
|
||||
EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(this.world, this.locX(), this.locY(), this.locZ());
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
entityareaeffectcloud.setRadius(2.5F);
|
||||
entityareaeffectcloud.setRadiusOnUse(-0.5F);
|
||||
entityareaeffectcloud.setWaitTime(10);
|
||||
@@ -219,7 +244,7 @@
|
||||
@@ -254,7 +279,7 @@
|
||||
entityareaeffectcloud.addEffect(new MobEffect(mobeffect));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityEnderman.java
|
||||
+++ b/net/minecraft/server/EntityEnderman.java
|
||||
@@ -51,7 +51,17 @@
|
||||
--- a/net/minecraft/world/entity/monster/EntityEnderman.java
|
||||
+++ b/net/minecraft/world/entity/monster/EntityEnderman.java
|
||||
@@ -105,7 +105,17 @@
|
||||
|
||||
@Override
|
||||
public void setGoalTarget(@Nullable EntityLiving entityliving) {
|
||||
@@ -19,7 +19,7 @@
|
||||
AttributeModifiable attributemodifiable = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
|
||||
|
||||
if (entityliving == null) {
|
||||
@@ -66,6 +76,7 @@
|
||||
@@ -120,6 +130,7 @@
|
||||
attributemodifiable.b(EntityEnderman.c);
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -359,8 +370,12 @@
|
||||
@@ -413,8 +424,12 @@
|
||||
boolean flag = movingobjectpositionblock.getBlockPosition().equals(blockposition);
|
||||
|
||||
if (block.a((Tag) TagsBlock.ENDERMAN_HOLDABLE) && flag) {
|
||||
@@ -42,7 +42,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -395,8 +410,12 @@
|
||||
@@ -449,8 +464,12 @@
|
||||
if (iblockdata2 != null) {
|
||||
iblockdata2 = Block.b(iblockdata2, (GeneratorAccess) this.a.world, blockposition);
|
||||
if (this.a(world, blockposition, iblockdata2, iblockdata, iblockdata1, blockposition1)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityGhast.java
|
||||
+++ b/net/minecraft/server/EntityGhast.java
|
||||
@@ -163,7 +163,8 @@
|
||||
--- a/net/minecraft/world/entity/monster/EntityGhast.java
|
||||
+++ b/net/minecraft/world/entity/monster/EntityGhast.java
|
||||
@@ -193,7 +193,8 @@
|
||||
|
||||
EntityLargeFireball entitylargefireball = new EntityLargeFireball(world, this.ghast, d2, d3, d4);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityGuardianElder.java
|
||||
+++ b/net/minecraft/server/EntityGuardianElder.java
|
||||
@@ -65,7 +65,7 @@
|
||||
--- a/net/minecraft/world/entity/monster/EntityGuardianElder.java
|
||||
+++ b/net/minecraft/world/entity/monster/EntityGuardianElder.java
|
||||
@@ -79,7 +79,7 @@
|
||||
|
||||
if (!entityplayer.hasEffect(mobeffectlist) || entityplayer.getEffect(mobeffectlist).getAmplifier() < 2 || entityplayer.getEffect(mobeffectlist).getDuration() < 1200) {
|
||||
entityplayer.playerConnection.sendPacket(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.k, this.isSilent() ? 0.0F : 1.0F));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityIllagerIllusioner.java
|
||||
+++ b/net/minecraft/server/EntityIllagerIllusioner.java
|
||||
@@ -30,7 +30,7 @@
|
||||
--- a/net/minecraft/world/entity/monster/EntityIllagerIllusioner.java
|
||||
+++ b/net/minecraft/world/entity/monster/EntityIllagerIllusioner.java
|
||||
@@ -67,7 +67,7 @@
|
||||
this.goalSelector.a(8, new PathfinderGoalRandomStroll(this, 0.6D));
|
||||
this.goalSelector.a(9, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 3.0F, 1.0F));
|
||||
this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 8.0F));
|
||||
@@ -9,7 +9,7 @@
|
||||
this.targetSelector.a(2, (new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)).a(300));
|
||||
this.targetSelector.a(3, (new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, false)).a(300));
|
||||
this.targetSelector.a(3, (new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, false)).a(300));
|
||||
@@ -169,7 +169,7 @@
|
||||
@@ -206,7 +206,7 @@
|
||||
|
||||
@Override
|
||||
protected void j() {
|
||||
@@ -18,7 +18,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -206,7 +206,7 @@
|
||||
@@ -243,7 +243,7 @@
|
||||
|
||||
@Override
|
||||
protected void j() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityIllagerWizard.java
|
||||
+++ b/net/minecraft/server/EntityIllagerWizard.java
|
||||
@@ -145,6 +145,11 @@
|
||||
--- a/net/minecraft/world/entity/monster/EntityIllagerWizard.java
|
||||
+++ b/net/minecraft/world/entity/monster/EntityIllagerWizard.java
|
||||
@@ -156,6 +156,11 @@
|
||||
public void e() {
|
||||
--this.b;
|
||||
if (this.b == 0) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityPhantom.java
|
||||
+++ b/net/minecraft/server/EntityPhantom.java
|
||||
@@ -207,7 +207,7 @@
|
||||
--- a/net/minecraft/world/entity/monster/EntityPhantom.java
|
||||
+++ b/net/minecraft/world/entity/monster/EntityPhantom.java
|
||||
@@ -243,7 +243,7 @@
|
||||
EntityHuman entityhuman = (EntityHuman) iterator.next();
|
||||
|
||||
if (EntityPhantom.this.a((EntityLiving) entityhuman, PathfinderTargetCondition.a)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityPigZombie.java
|
||||
+++ b/net/minecraft/server/EntityPigZombie.java
|
||||
@@ -35,7 +35,7 @@
|
||||
--- a/net/minecraft/world/entity/monster/EntityPigZombie.java
|
||||
+++ b/net/minecraft/world/entity/monster/EntityPigZombie.java
|
||||
@@ -69,7 +69,7 @@
|
||||
protected void m() {
|
||||
this.goalSelector.a(2, new PathfinderGoalZombieAttack(this, 1.0D, false));
|
||||
this.goalSelector.a(7, new PathfinderGoalRandomStrollLand(this, 1.0D));
|
||||
@@ -9,7 +9,7 @@
|
||||
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, 10, true, false, this::a_));
|
||||
this.targetSelector.a(3, new PathfinderGoalUniversalAngerReset<>(this, true));
|
||||
}
|
||||
@@ -108,7 +108,7 @@
|
||||
@@ -142,7 +142,7 @@
|
||||
}).filter((entitypigzombie) -> {
|
||||
return !entitypigzombie.r(this.getGoalTarget());
|
||||
}).forEach((entitypigzombie) -> {
|
||||
@@ -18,7 +18,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
@@ -151,7 +151,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -27,7 +27,7 @@
|
||||
if (this.getGoalTarget() == null && entityliving != null) {
|
||||
this.bo = EntityPigZombie.d.a(this.random);
|
||||
this.bt = EntityPigZombie.bs.a(this.random);
|
||||
@@ -127,12 +127,21 @@
|
||||
@@ -161,12 +161,21 @@
|
||||
this.e((EntityHuman) entityliving);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityPillager.java
|
||||
+++ b/net/minecraft/server/EntityPillager.java
|
||||
@@ -22,7 +22,7 @@
|
||||
--- a/net/minecraft/world/entity/monster/EntityPillager.java
|
||||
+++ b/net/minecraft/world/entity/monster/EntityPillager.java
|
||||
@@ -70,7 +70,7 @@
|
||||
this.goalSelector.a(8, new PathfinderGoalRandomStroll(this, 0.6D));
|
||||
this.goalSelector.a(9, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 15.0F, 1.0F));
|
||||
this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 15.0F));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityRavager.java
|
||||
+++ b/net/minecraft/server/EntityRavager.java
|
||||
@@ -28,7 +28,7 @@
|
||||
--- a/net/minecraft/world/entity/monster/EntityRavager.java
|
||||
+++ b/net/minecraft/world/entity/monster/EntityRavager.java
|
||||
@@ -69,7 +69,7 @@
|
||||
this.goalSelector.a(5, new PathfinderGoalRandomStrollLand(this, 0.4D));
|
||||
this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F));
|
||||
this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 8.0F));
|
||||
@@ -9,12 +9,12 @@
|
||||
this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true));
|
||||
this.targetSelector.a(4, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, true));
|
||||
this.targetSelector.a(4, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, true));
|
||||
@@ -119,7 +119,7 @@
|
||||
@@ -160,7 +160,7 @@
|
||||
IBlockData iblockdata = this.world.getType(blockposition);
|
||||
Block block = iblockdata.getBlock();
|
||||
|
||||
- if (block instanceof BlockLeaves) {
|
||||
+ if (block instanceof BlockLeaves && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, Blocks.AIR.getBlockData()).isCancelled()) { // CraftBukkit
|
||||
+ if (block instanceof BlockLeaves && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, net.minecraft.world.level.block.Blocks.AIR.getBlockData()).isCancelled()) { // CraftBukkit
|
||||
flag = this.world.a(blockposition, true, this) || flag;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
--- a/net/minecraft/server/EntityShulker.java
|
||||
+++ b/net/minecraft/server/EntityShulker.java
|
||||
@@ -7,6 +7,11 @@
|
||||
import java.util.UUID;
|
||||
import javax.annotation.Nullable;
|
||||
--- a/net/minecraft/world/entity/monster/EntityShulker.java
|
||||
+++ b/net/minecraft/world/entity/monster/EntityShulker.java
|
||||
@@ -47,6 +47,12 @@
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.server.level.WorldServer;
|
||||
+import org.bukkit.Location;
|
||||
+import org.bukkit.event.entity.EntityTeleportEvent;
|
||||
+// CraftBukkit end
|
||||
@@ -12,7 +13,7 @@
|
||||
public class EntityShulker extends EntityGolem implements IMonster {
|
||||
|
||||
private static final UUID bp = UUID.fromString("7E0292F2-9434-48D5-A29F-9583AF7DF27F");
|
||||
@@ -31,7 +36,7 @@
|
||||
@@ -71,7 +77,7 @@
|
||||
this.goalSelector.a(4, new EntityShulker.a());
|
||||
this.goalSelector.a(7, new EntityShulker.e());
|
||||
this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this));
|
||||
@@ -21,7 +22,7 @@
|
||||
this.targetSelector.a(2, new EntityShulker.d(this));
|
||||
this.targetSelector.a(3, new EntityShulker.c(this));
|
||||
}
|
||||
@@ -279,6 +284,16 @@
|
||||
@@ -319,6 +325,16 @@
|
||||
EnumDirection enumdirection = this.g(blockposition1);
|
||||
|
||||
if (enumdirection != null) {
|
||||
@@ -38,7 +39,7 @@
|
||||
this.datawatcher.set(EntityShulker.b, enumdirection);
|
||||
this.playSound(SoundEffects.ENTITY_SHULKER_TELEPORT, 1.0F, 1.0F);
|
||||
this.datawatcher.set(EntityShulker.c, Optional.of(blockposition1));
|
||||
@@ -319,6 +334,7 @@
|
||||
@@ -359,6 +375,7 @@
|
||||
}
|
||||
|
||||
this.g((double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntitySilverfish.java
|
||||
+++ b/net/minecraft/server/EntitySilverfish.java
|
||||
@@ -18,7 +18,7 @@
|
||||
--- a/net/minecraft/world/entity/monster/EntitySilverfish.java
|
||||
+++ b/net/minecraft/world/entity/monster/EntitySilverfish.java
|
||||
@@ -45,7 +45,7 @@
|
||||
this.goalSelector.a(3, this.b);
|
||||
this.goalSelector.a(4, new PathfinderGoalMeleeAttack(this, 1.0D, false));
|
||||
this.goalSelector.a(5, new EntitySilverfish.PathfinderGoalSilverfishHideInBlock(this));
|
||||
@@ -9,7 +9,7 @@
|
||||
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true));
|
||||
}
|
||||
|
||||
@@ -156,6 +156,11 @@
|
||||
@@ -183,6 +183,11 @@
|
||||
IBlockData iblockdata = world.getType(blockposition);
|
||||
|
||||
if (BlockMonsterEggs.h(iblockdata)) {
|
||||
@@ -21,12 +21,12 @@
|
||||
world.setTypeAndData(blockposition, BlockMonsterEggs.c(iblockdata.getBlock()), 3);
|
||||
this.a.doSpawnEffect();
|
||||
this.a.die();
|
||||
@@ -202,6 +207,11 @@
|
||||
@@ -229,6 +234,11 @@
|
||||
Block block = iblockdata.getBlock();
|
||||
|
||||
if (block instanceof BlockMonsterEggs) {
|
||||
+ // CraftBukkit start
|
||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.silverfish, blockposition1, Blocks.AIR.getBlockData()).isCancelled()) {
|
||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.silverfish, blockposition1, net.minecraft.world.level.block.Blocks.AIR.getBlockData()).isCancelled()) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
--- a/net/minecraft/server/EntitySkeletonAbstract.java
|
||||
+++ b/net/minecraft/server/EntitySkeletonAbstract.java
|
||||
@@ -154,8 +154,19 @@
|
||||
--- a/net/minecraft/world/entity/monster/EntitySkeletonAbstract.java
|
||||
+++ b/net/minecraft/world/entity/monster/EntitySkeletonAbstract.java
|
||||
@@ -196,8 +196,19 @@
|
||||
double d3 = (double) MathHelper.sqrt(d0 * d0 + d2 * d2);
|
||||
|
||||
entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.world.getDifficulty().a() * 4));
|
||||
+ // CraftBukkit start
|
||||
+ org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(this, this.getItemInMainHand(), null, entityarrow, EnumHand.MAIN_HAND, 0.8F, true);
|
||||
+ org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(this, this.getItemInMainHand(), null, entityarrow, net.minecraft.world.EnumHand.MAIN_HAND, 0.8F, true);
|
||||
+ if (event.isCancelled()) {
|
||||
+ event.getProjectile().remove();
|
||||
+ return;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntitySkeletonWither.java
|
||||
+++ b/net/minecraft/server/EntitySkeletonWither.java
|
||||
@@ -80,7 +80,7 @@
|
||||
--- a/net/minecraft/world/entity/monster/EntitySkeletonWither.java
|
||||
+++ b/net/minecraft/world/entity/monster/EntitySkeletonWither.java
|
||||
@@ -105,7 +105,7 @@
|
||||
return false;
|
||||
} else {
|
||||
if (entity instanceof EntityLiving) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/server/EntitySlime.java
|
||||
+++ b/net/minecraft/server/EntitySlime.java
|
||||
@@ -6,6 +6,14 @@
|
||||
import java.util.Random;
|
||||
import javax.annotation.Nullable;
|
||||
--- a/net/minecraft/world/entity/monster/EntitySlime.java
|
||||
+++ b/net/minecraft/world/entity/monster/EntitySlime.java
|
||||
@@ -45,6 +45,14 @@
|
||||
import net.minecraft.world.level.storage.loot.LootTables;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import java.util.ArrayList;
|
||||
@@ -15,7 +15,7 @@
|
||||
public class EntitySlime extends EntityInsentient implements IMonster {
|
||||
|
||||
private static final DataWatcherObject<Integer> bo = DataWatcher.a(EntitySlime.class, DataWatcherRegistry.b);
|
||||
@@ -149,7 +157,7 @@
|
||||
@@ -188,7 +196,7 @@
|
||||
|
||||
@Override
|
||||
public EntityTypes<? extends EntitySlime> getEntityType() {
|
||||
@@ -24,7 +24,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -163,6 +171,19 @@
|
||||
@@ -202,6 +210,19 @@
|
||||
int j = i / 2;
|
||||
int k = 2 + this.random.nextInt(3);
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
for (int l = 0; l < k; ++l) {
|
||||
float f1 = ((float) (l % 2) - 0.5F) * f;
|
||||
float f2 = ((float) (l / 2) - 0.5F) * f;
|
||||
@@ -177,8 +198,17 @@
|
||||
@@ -216,8 +237,17 @@
|
||||
entityslime.setInvulnerable(this.isInvulnerable());
|
||||
entityslime.setSize(j, true);
|
||||
entityslime.setPositionRotation(this.locX() + (double) f1, this.locY() + 0.5D, this.locZ() + (double) f2, this.random.nextFloat() * 360.0F, 0.0F);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntitySpider.java
|
||||
+++ b/net/minecraft/server/EntitySpider.java
|
||||
@@ -136,7 +136,7 @@
|
||||
--- a/net/minecraft/world/entity/monster/EntitySpider.java
|
||||
+++ b/net/minecraft/world/entity/monster/EntitySpider.java
|
||||
@@ -175,7 +175,7 @@
|
||||
MobEffectList mobeffectlist = ((EntitySpider.GroupDataSpider) object).a;
|
||||
|
||||
if (mobeffectlist != null) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityStrider.java
|
||||
+++ b/net/minecraft/server/EntityStrider.java
|
||||
@@ -252,7 +252,12 @@
|
||||
--- a/net/minecraft/world/entity/monster/EntityStrider.java
|
||||
+++ b/net/minecraft/world/entity/monster/EntityStrider.java
|
||||
@@ -318,7 +318,12 @@
|
||||
IBlockData iblockdata1 = this.aN();
|
||||
boolean flag = iblockdata.a((Tag) TagsBlock.STRIDER_WARM_BLOCKS) || iblockdata1.a((Tag) TagsBlock.STRIDER_WARM_BLOCKS) || this.b((Tag) TagsFluid.LAVA) > 0.0D;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/EntityVex.java
|
||||
+++ b/net/minecraft/server/EntityVex.java
|
||||
@@ -45,7 +45,7 @@
|
||||
--- a/net/minecraft/world/entity/monster/EntityVex.java
|
||||
+++ b/net/minecraft/world/entity/monster/EntityVex.java
|
||||
@@ -81,7 +81,7 @@
|
||||
this.goalSelector.a(8, new EntityVex.d());
|
||||
this.goalSelector.a(9, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 3.0F, 1.0F));
|
||||
this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 8.0F));
|
||||
@@ -9,7 +9,7 @@
|
||||
this.targetSelector.a(2, new EntityVex.b(this));
|
||||
this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true));
|
||||
}
|
||||
@@ -186,7 +186,7 @@
|
||||
@@ -222,7 +222,7 @@
|
||||
|
||||
@Override
|
||||
public void c() {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user