@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/ai/behavior/BehaviorAttackTargetForget.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/BehaviorAttackTargetForget.java
|
||||
@@ -8,6 +8,12 @@
|
||||
@@ -7,6 +7,12 @@
|
||||
import net.minecraft.world.entity.ai.behavior.declarative.BehaviorBuilder;
|
||||
import net.minecraft.world.entity.ai.memory.MemoryModuleType;
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
public class BehaviorAttackTargetForget {
|
||||
|
||||
private static final int TIMEOUT_TO_GET_WITHIN_ATTACK_RANGE = 200;
|
||||
@@ -41,6 +47,17 @@
|
||||
if (entityinsentient.canAttack(entityliving) && (!flag || !isTiredOfTryingToReachTarget(entityinsentient, behaviorbuilder_b.tryGet(memoryaccessor1))) && entityliving.isAlive() && entityliving.level() == entityinsentient.level() && !predicate.test(entityliving)) {
|
||||
@@ -40,6 +46,17 @@
|
||||
if (entityinsentient.canAttack(entityliving) && (!flag || !isTiredOfTryingToReachTarget(entityinsentient, behaviorbuilder_b.tryGet(memoryaccessor1))) && entityliving.isAlive() && entityliving.level() == entityinsentient.level() && !behaviorattacktargetforget_a.test(worldserver, entityliving)) {
|
||||
return true;
|
||||
} else {
|
||||
+ // CraftBukkit start
|
||||
@@ -28,6 +28,6 @@
|
||||
+ return true;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
biconsumer.accept(entityinsentient, entityliving);
|
||||
behaviorattacktargetforget_b.accept(worldserver, entityinsentient, entityliving);
|
||||
memoryaccessor.erase();
|
||||
return true;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/ai/behavior/BehaviorAttackTargetSet.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/BehaviorAttackTargetSet.java
|
||||
@@ -8,6 +8,13 @@
|
||||
@@ -7,6 +7,13 @@
|
||||
import net.minecraft.world.entity.ai.behavior.declarative.BehaviorBuilder;
|
||||
import net.minecraft.world.entity.ai.memory.MemoryModuleType;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
public class BehaviorAttackTargetSet {
|
||||
|
||||
public BehaviorAttackTargetSet() {}
|
||||
@@ -35,6 +42,17 @@
|
||||
@@ -34,6 +41,17 @@
|
||||
if (!entityinsentient.canAttack(entityliving)) {
|
||||
return false;
|
||||
} else {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@@ -28,6 +28,20 @@
|
||||
EntityItem entityitem = (EntityItem) behaviorbuilder_b.get(memoryaccessor2);
|
||||
|
||||
if (behaviorbuilder_b.tryGet(memoryaccessor3).isEmpty() && predicate.test(entityliving) && entityitem.closerThan(entityliving, (double) i) && entityliving.level().getWorldBorder().isWithinBounds(entityitem.blockPosition())) {
|
||||
if (behaviorbuilder_b.tryGet(memoryaccessor3).isEmpty() && predicate.test(entityliving) && entityitem.closerThan(entityliving, (double) i) && entityliving.level().getWorldBorder().isWithinBounds(entityitem.blockPosition()) && entityliving.canPickUpLoot()) {
|
||||
+ // CraftBukkit start
|
||||
+ if (entityliving instanceof net.minecraft.world.entity.animal.allay.Allay) {
|
||||
+ org.bukkit.event.entity.EntityTargetEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTargetEvent(entityliving, entityitem, org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_ENTITY);
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
public static final int TIME_OUT_DURATION = 160;
|
||||
@@ -63,6 +70,13 @@
|
||||
return this.ramTargeting.test(entitycreature, entityliving);
|
||||
return this.ramTargeting.test(worldserver, entitycreature, entityliving);
|
||||
});
|
||||
}).ifPresent((entityliving) -> {
|
||||
+ // CraftBukkit start
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/ai/goal/PathfinderGoalBreakDoor.java
|
||||
+++ b/net/minecraft/world/entity/ai/goal/PathfinderGoalBreakDoor.java
|
||||
@@ -71,6 +71,12 @@
|
||||
@@ -72,6 +72,12 @@
|
||||
}
|
||||
|
||||
if (this.breakTime == this.getDoorBreakTime() && this.isValidDifficulty(this.mob.level().getDifficulty())) {
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
BlockPosition blockposition = this.mob.blockPosition();
|
||||
|
||||
if (PathfinderGoalEatTile.IS_TALL_GRASS.test(this.level.getBlockState(blockposition))) {
|
||||
- if (this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
|
||||
+ if (CraftEventFactory.callEntityChangeBlockEvent(this.mob, blockposition, Blocks.AIR.defaultBlockState(), !this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) { // CraftBukkit
|
||||
- if (getServerLevel(this.level).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
|
||||
+ if (CraftEventFactory.callEntityChangeBlockEvent(this.mob, blockposition, Blocks.AIR.defaultBlockState(), !getServerLevel(this.level).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) { // CraftBukkit
|
||||
this.level.destroyBlock(blockposition, false);
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
BlockPosition blockposition1 = blockposition.below();
|
||||
|
||||
if (this.level.getBlockState(blockposition1).is(Blocks.GRASS_BLOCK)) {
|
||||
- if (this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
|
||||
+ if (CraftEventFactory.callEntityChangeBlockEvent(this.mob, blockposition1, Blocks.AIR.defaultBlockState(), !this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) { // CraftBukkit
|
||||
- if (getServerLevel(this.level).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
|
||||
+ if (CraftEventFactory.callEntityChangeBlockEvent(this.mob, blockposition1, Blocks.AIR.defaultBlockState(), !getServerLevel(this.level).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) { // CraftBukkit
|
||||
this.level.levelEvent(2001, blockposition1, Block.getId(Blocks.GRASS_BLOCK.defaultBlockState()));
|
||||
this.level.setBlock(blockposition1, Blocks.DIRT.defaultBlockState(), 2);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/ai/goal/PathfinderGoalRemoveBlock.java
|
||||
+++ b/net/minecraft/world/entity/ai/goal/PathfinderGoalRemoveBlock.java
|
||||
@@ -21,6 +21,11 @@
|
||||
@@ -22,6 +22,11 @@
|
||||
import net.minecraft.world.level.chunk.status.ChunkStatus;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
public class PathfinderGoalRemoveBlock extends PathfinderGoalGotoTarget {
|
||||
|
||||
private final Block blockToRemove;
|
||||
@@ -96,6 +101,11 @@
|
||||
@@ -97,6 +102,11 @@
|
||||
}
|
||||
|
||||
if (this.ticksSinceReachedGoal > 60) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/ai/goal/PathfinderGoalTempt.java
|
||||
+++ b/net/minecraft/world/entity/ai/goal/PathfinderGoalTempt.java
|
||||
@@ -10,6 +10,13 @@
|
||||
@@ -11,6 +11,13 @@
|
||||
import net.minecraft.world.entity.player.EntityHuman;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
+
|
||||
public class PathfinderGoalTempt extends PathfinderGoal {
|
||||
|
||||
private static final PathfinderTargetCondition TEMP_TARGETING = PathfinderTargetCondition.forNonCombat().range(10.0D).ignoreLineOfSight();
|
||||
@@ -22,7 +29,7 @@
|
||||
private static final PathfinderTargetCondition TEMPT_TARGETING = PathfinderTargetCondition.forNonCombat().ignoreLineOfSight();
|
||||
@@ -23,7 +30,7 @@
|
||||
private double pRotX;
|
||||
private double pRotY;
|
||||
@Nullable
|
||||
@@ -23,10 +23,10 @@
|
||||
private int calmDown;
|
||||
private boolean isRunning;
|
||||
private final Predicate<ItemStack> items;
|
||||
@@ -44,6 +51,15 @@
|
||||
@@ -47,6 +54,15 @@
|
||||
return false;
|
||||
} else {
|
||||
this.player = this.mob.level().getNearestPlayer(this.targetingConditions, this.mob);
|
||||
this.player = getServerLevel((Entity) this.mob).getNearestPlayer(this.targetingConditions.range(this.mob.getAttributeValue(GenericAttributes.TEMPT_RANGE)), this.mob);
|
||||
+ // CraftBukkit start
|
||||
+ if (this.player != null) {
|
||||
+ EntityTargetLivingEntityEvent event = CraftEventFactory.callEntityTargetLivingEvent(this.mob, this.player, EntityTargetEvent.TargetReason.TEMPT);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/ai/goal/target/PathfinderGoalDefendVillage.java
|
||||
+++ b/net/minecraft/world/entity/ai/goal/target/PathfinderGoalDefendVillage.java
|
||||
@@ -58,7 +58,7 @@
|
||||
@@ -61,7 +61,7 @@
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/ai/goal/target/PathfinderGoalNearestAttackableTarget.java
|
||||
+++ b/net/minecraft/world/entity/ai/goal/target/PathfinderGoalNearestAttackableTarget.java
|
||||
@@ -67,7 +67,7 @@
|
||||
@@ -70,7 +70,7 @@
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/ai/sensing/TemptingSensor.java
|
||||
+++ b/net/minecraft/world/entity/ai/sensing/TemptingSensor.java
|
||||
@@ -18,6 +18,14 @@
|
||||
@@ -19,6 +19,14 @@
|
||||
import net.minecraft.world.entity.player.EntityHuman;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
||||
@@ -14,17 +14,17 @@
|
||||
+
|
||||
public class TemptingSensor extends Sensor<EntityCreature> {
|
||||
|
||||
public static final int TEMPTATION_RANGE = 10;
|
||||
@@ -30,7 +38,7 @@
|
||||
|
||||
private static final PathfinderTargetCondition TEMPT_TARGETING = PathfinderTargetCondition.forNonCombat().ignoreLineOfSight();
|
||||
@@ -31,7 +39,7 @@
|
||||
protected void doTick(WorldServer worldserver, EntityCreature entitycreature) {
|
||||
BehaviorController<?> behaviorcontroller = entitycreature.getBrain();
|
||||
PathfinderTargetCondition pathfindertargetcondition = TemptingSensor.TEMPT_TARGETING.copy().range((double) ((float) entitycreature.getAttributeValue(GenericAttributes.TEMPT_RANGE)));
|
||||
- Stream stream = worldserver.players().stream().filter(IEntitySelector.NO_SPECTATORS).filter((entityplayer) -> {
|
||||
+ Stream<net.minecraft.server.level.EntityPlayer> stream = worldserver.players().stream().filter(IEntitySelector.NO_SPECTATORS).filter((entityplayer) -> { // CraftBukkit - decompile error
|
||||
return TemptingSensor.TEMPT_TARGETING.test(entitycreature, entityplayer);
|
||||
}).filter((entityplayer) -> {
|
||||
return entitycreature.closerThan(entityplayer, 10.0D);
|
||||
@@ -44,7 +52,17 @@
|
||||
return pathfindertargetcondition.test(worldserver, entitycreature, entityplayer);
|
||||
}).filter(this::playerHoldingTemptation).filter((entityplayer) -> {
|
||||
return !entitycreature.hasPassenger((Entity) entityplayer);
|
||||
@@ -43,7 +51,17 @@
|
||||
if (!list.isEmpty()) {
|
||||
EntityHuman entityhuman = (EntityHuman) list.get(0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user