1.21.6 dev
Co-authored-by: Bjarne Koll <git@lynxplay.dev> Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Co-authored-by: Noah van der Aa <ndvdaa@gmail.com> Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
This commit is contained in:
committed by
Nassim Jahnke
parent
39203a65e0
commit
a24f9b204c
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/ai/attributes/AttributeInstance.java
|
||||
+++ b/net/minecraft/world/entity/ai/attributes/AttributeInstance.java
|
||||
@@ -155,20 +_,20 @@
|
||||
@@ -151,20 +_,20 @@
|
||||
double baseValue = this.getBaseValue();
|
||||
|
||||
for (AttributeModifier attributeModifier : this.getModifiersOrEmpty(AttributeModifier.Operation.ADD_VALUE)) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--- a/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||
+++ b/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||
@@ -148,4 +_,12 @@
|
||||
.ifPresent(attributeInstance -> attributeInstance.load(compoundOrEmpty));
|
||||
}
|
||||
}
|
||||
}
|
||||
+
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
public static final Holder<Attribute> ATTACK_KNOCKBACK = register("attack_knockback", new RangedAttribute("attribute.name.attack_knockback", 0.0, 0.0, 5.0));
|
||||
public static final Holder<Attribute> ATTACK_SPEED = register(
|
||||
"attack_speed", new RangedAttribute("attribute.name.attack_speed", 4.0, 0.0, 1024.0).setSyncable(true)
|
||||
@@ -49,10 +_,10 @@
|
||||
@@ -52,10 +_,10 @@
|
||||
);
|
||||
public static final Holder<Attribute> LUCK = register("luck", new RangedAttribute("attribute.name.luck", 0.0, -1024.0, 1024.0).setSyncable(true));
|
||||
public static final Holder<Attribute> MAX_ABSORPTION = register(
|
||||
@@ -22,7 +22,7 @@
|
||||
);
|
||||
public static final Holder<Attribute> MINING_EFFICIENCY = register(
|
||||
"mining_efficiency", new RangedAttribute("attribute.name.mining_efficiency", 0.0, 0.0, 1024.0).setSyncable(true)
|
||||
@@ -61,7 +_,7 @@
|
||||
@@ -64,7 +_,7 @@
|
||||
"movement_efficiency", new RangedAttribute("attribute.name.movement_efficiency", 0.0, 0.0, 1.0).setSyncable(true)
|
||||
);
|
||||
public static final Holder<Attribute> MOVEMENT_SPEED = register(
|
||||
|
||||
@@ -1,23 +1,20 @@
|
||||
--- a/net/minecraft/world/entity/ai/behavior/BabyFollowAdult.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/BabyFollowAdult.java
|
||||
@@ -24,8 +_,19 @@
|
||||
if (!mob.isBaby()) {
|
||||
return false;
|
||||
} else {
|
||||
- AgeableMob ageableMob = instance.get(nearestVisibleAdult);
|
||||
+ LivingEntity ageableMob = instance.get(nearestVisibleAdult); // CraftBukkit - type
|
||||
if (mob.closerThan(ageableMob, followRange.getMaxValue() + 1) && !mob.closerThan(ageableMob, followRange.getMinValue())) {
|
||||
+ // CraftBukkit start
|
||||
+ org.bukkit.event.entity.EntityTargetLivingEntityEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTargetLivingEvent(mob, ageableMob, org.bukkit.event.entity.EntityTargetEvent.TargetReason.FOLLOW_LEADER);
|
||||
+ if (event.isCancelled()) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ if (event.getTarget() == null) {
|
||||
+ nearestVisibleAdult.erase();
|
||||
+ return true;
|
||||
+ }
|
||||
+ ageableMob = ((org.bukkit.craftbukkit.entity.CraftLivingEntity) event.getTarget()).getHandle();
|
||||
+ // CraftBukkit end
|
||||
WalkTarget walkTarget1 = new WalkTarget(
|
||||
new EntityTracker(ageableMob, false), speedModifier.apply(mob), followRange.getMinValue() - 1
|
||||
);
|
||||
@@ -30,6 +_,17 @@
|
||||
} else {
|
||||
LivingEntity livingEntity = instance.get(memoryAccessor);
|
||||
if (entity.closerThan(livingEntity, followRange.getMaxValue() + 1) && !entity.closerThan(livingEntity, followRange.getMinValue())) {
|
||||
+ // CraftBukkit start
|
||||
+ org.bukkit.event.entity.EntityTargetLivingEntityEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTargetLivingEvent(entity, livingEntity, org.bukkit.event.entity.EntityTargetEvent.TargetReason.FOLLOW_LEADER);
|
||||
+ if (event.isCancelled()) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ if (event.getTarget() == null) {
|
||||
+ memoryAccessor.erase();
|
||||
+ return true;
|
||||
+ }
|
||||
+ livingEntity = ((org.bukkit.craftbukkit.entity.CraftLivingEntity) event.getTarget()).getHandle();
|
||||
+ // CraftBukkit end
|
||||
WalkTarget walkTarget = new WalkTarget(
|
||||
new EntityTracker(livingEntity, targetEyeHeight, targetEyeHeight),
|
||||
speedModifier.apply(entity),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/ai/goal/TemptGoal.java
|
||||
+++ b/net/minecraft/world/entity/ai/goal/TemptGoal.java
|
||||
@@ -21,7 +_,7 @@
|
||||
@@ -24,7 +_,7 @@
|
||||
private double pRotX;
|
||||
private double pRotY;
|
||||
@Nullable
|
||||
@@ -9,7 +9,7 @@
|
||||
private int calmDown;
|
||||
private boolean isRunning;
|
||||
private final Predicate<ItemStack> items;
|
||||
@@ -44,6 +_,15 @@
|
||||
@@ -57,6 +_,15 @@
|
||||
} else {
|
||||
this.player = getServerLevel(this.mob)
|
||||
.getNearestPlayer(this.targetingConditions.range(this.mob.getAttributeValue(Attributes.TEMPT_RANGE)), this.mob);
|
||||
@@ -25,3 +25,21 @@
|
||||
return this.player != null;
|
||||
}
|
||||
}
|
||||
@@ -123,7 +_,7 @@
|
||||
this.mob.getNavigation().stop();
|
||||
}
|
||||
|
||||
- protected void navigateTowards(Player player) {
|
||||
+ protected void navigateTowards(LivingEntity player) { // Paper
|
||||
this.mob.getNavigation().moveTo(player, this.speedModifier);
|
||||
}
|
||||
|
||||
@@ -142,7 +_,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
- protected void navigateTowards(Player player) {
|
||||
+ protected void navigateTowards(LivingEntity player) { // Paper
|
||||
Vec3 vec3 = player.getEyePosition().subtract(this.mob.position()).scale(this.mob.getRandom().nextDouble()).add(this.mob.position());
|
||||
this.mob.getMoveControl().setWantedPosition(vec3.x, vec3.y, vec3.z, this.speedModifier);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
@@ -54,7 +_,7 @@
|
||||
}
|
||||
|
||||
if (mutableBlockPos.getY() > this.level.getMinY()) {
|
||||
if (mutableBlockPos.getY() >= this.level.getMinY()) {
|
||||
- return super.createPath(mutableBlockPos.above(), accuracy);
|
||||
+ return super.createPath(mutableBlockPos.above(), entity, accuracy); // Paper - EntityPathfindEvent
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user