Repackage NMS

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-03-16 09:00:00 +11:00
parent 18496e998f
commit 9da047989c
968 changed files with 5448 additions and 5050 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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