Update to Minecraft 1.17

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-06-11 15:00:00 +10:00
parent 75faba7fde
commit b3a8254758
619 changed files with 10708 additions and 8451 deletions

View File

@@ -1,9 +1,9 @@
--- a/net/minecraft/world/entity/animal/EntityRabbit.java
+++ b/net/minecraft/world/entity/animal/EntityRabbit.java
@@ -72,8 +72,14 @@
@@ -86,8 +86,14 @@
super(entitytypes, world);
this.bi = new EntityRabbit.ControllerJumpRabbit(this);
this.moveController = new EntityRabbit.ControllerMoveRabbit(this);
this.jumpControl = new EntityRabbit.ControllerJumpRabbit(this);
this.moveControl = new EntityRabbit.ControllerMoveRabbit(this);
+ this.initializePathFinderGoals(); // CraftBukkit - moved code
+ }
+
@@ -15,7 +15,7 @@
@Override
public void initPathfinder() {
@@ -340,7 +346,7 @@
@@ -353,7 +359,7 @@
if (i == 99) {
this.getAttributeInstance(GenericAttributes.ARMOR).setValue(8.0D);
this.goalSelector.a(4, new EntityRabbit.PathfinderGoalKillerRabbitMeleeAttack(this));
@@ -24,27 +24,27 @@
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true));
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityWolf.class, true));
if (!this.hasCustomName()) {
@@ -456,9 +462,23 @@
Integer integer = (Integer) iblockdata.get(BlockCarrots.AGE);
@@ -556,9 +562,23 @@
int i = (Integer) iblockdata.get(BlockCarrots.AGE);
if (integer == 0) {
if (i == 0) {
+ // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.entity, blockposition, Blocks.AIR.getBlockData()).isCancelled()) {
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.rabbit, blockposition, Blocks.AIR.getBlockData()).isCancelled()) {
+ return;
+ }
+ // CraftBukkit end
world.setTypeAndData(blockposition, Blocks.AIR.getBlockData(), 2);
world.a(blockposition, true, this.entity);
world.a(blockposition, true, this.rabbit);
} else {
+ // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(
+ this.entity,
+ this.rabbit,
+ blockposition,
+ iblockdata.set(BlockCarrots.AGE, integer - 1)
+ iblockdata.set(BlockCarrots.AGE, i - 1)
+ ).isCancelled()) {
+ return;
+ }
+ // CraftBukkit end
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockCarrots.AGE, integer - 1), 2);
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockCarrots.AGE, i - 1), 2);
world.triggerEffect(2001, blockposition, Block.getCombinedId(iblockdata));
}