9
0
mirror of https://github.com/BX-Team/DivineMC.git synced 2025-12-24 01:09:29 +00:00
Files
DivineMC/divinemc-server/minecraft-patches/features/0004-Make-entity-goals-public.patch
2025-01-13 19:02:10 +03:00

140 lines
7.0 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Sun, 12 Jan 2025 02:05:38 +0300
Subject: [PATCH] Make entity goals public
diff --git a/net/minecraft/world/entity/animal/Bee.java b/net/minecraft/world/entity/animal/Bee.java
index 57c50ce5724b073b1aedf4df3129285143097303..1c3bbf91d9527ded33ec4b5a508d4c6c5b835167 100644
--- a/net/minecraft/world/entity/animal/Bee.java
+++ b/net/minecraft/world/entity/animal/Bee.java
@@ -786,7 +786,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
&& (!state.is(Blocks.SUNFLOWER) || state.getValue(DoublePlantBlock.HALF) == DoubleBlockHalf.UPPER);
}
- abstract class BaseBeeGoal extends Goal {
+ public abstract class BaseBeeGoal extends Goal { // DivineMC - make public
public abstract boolean canBeeUse();
public abstract boolean canBeeContinueToUse();
@@ -818,7 +818,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
}
}
- static class BeeBecomeAngryTargetGoal extends NearestAttackableTargetGoal<Player> {
+ public static class BeeBecomeAngryTargetGoal extends NearestAttackableTargetGoal<Player> { // DivineMC - make public
BeeBecomeAngryTargetGoal(Bee mob) {
super(mob, Player.class, 10, true, false, mob::isAngryAt);
}
@@ -845,7 +845,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
}
}
- class BeeEnterHiveGoal extends Bee.BaseBeeGoal {
+ public class BeeEnterHiveGoal extends Bee.BaseBeeGoal { // DivineMC - make public
@Override
public boolean canBeeUse() {
if (Bee.this.hivePos != null && Bee.this.wantsToEnterHive() && Bee.this.hivePos.closerToCenterThan(Bee.this.position(), 2.0)) {
@@ -1048,7 +1048,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
}
}
- class BeeGrowCropGoal extends Bee.BaseBeeGoal {
+ public class BeeGrowCropGoal extends Bee.BaseBeeGoal { // DivineMC - make public
static final int GROW_CHANCE = 30;
@Override
@@ -1104,7 +1104,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
}
}
- class BeeHurtByOtherGoal extends HurtByTargetGoal {
+ public class BeeHurtByOtherGoal extends HurtByTargetGoal { // DivineMC - make public
BeeHurtByOtherGoal(final Bee mob) {
super(mob);
}
@@ -1122,7 +1122,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
}
}
- class BeeLocateHiveGoal extends Bee.BaseBeeGoal {
+ public class BeeLocateHiveGoal extends Bee.BaseBeeGoal { // DivineMC - make public
@Override
public boolean canBeeUse() {
return Bee.this.remainingCooldownBeforeLocatingNewHive == 0 && !Bee.this.hasHive() && Bee.this.wantsToEnterHive();
@@ -1161,7 +1161,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
}
}
- class BeeLookControl extends org.purpurmc.purpur.controller.LookControllerWASD { // Purpur - Ridables
+ public class BeeLookControl extends org.purpurmc.purpur.controller.LookControllerWASD { // Purpur - Ridables // DivineMC - make public
BeeLookControl(final Mob mob) {
super(mob);
}
@@ -1179,7 +1179,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
}
}
- class BeePollinateGoal extends Bee.BaseBeeGoal {
+ public class BeePollinateGoal extends Bee.BaseBeeGoal { // DivineMC - make public
private static final int MIN_POLLINATION_TICKS = 400;
private static final double ARRIVAL_THRESHOLD = 0.1;
private static final int POSITION_CHANGE_CHANCE = 25;
@@ -1351,7 +1351,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
}
}
- class BeeWanderGoal extends Goal {
+ public class BeeWanderGoal extends Goal { // DivineMC - make public
BeeWanderGoal() {
this.setFlags(EnumSet.of(Goal.Flag.MOVE));
}
diff --git a/net/minecraft/world/entity/animal/Cat.java b/net/minecraft/world/entity/animal/Cat.java
index edd796fd34e43d66a48104201d885756fdd968c3..32eb4cd68f9caa42230ea50ec8ace12c455b21f8 100644
--- a/net/minecraft/world/entity/animal/Cat.java
+++ b/net/minecraft/world/entity/animal/Cat.java
@@ -517,7 +517,7 @@ public class Cat extends TamableAnimal implements VariantHolder<Holder<CatVarian
return this.isCrouching() || super.isSteppingCarefully();
}
- static class CatAvoidEntityGoal<T extends LivingEntity> extends AvoidEntityGoal<T> {
+ public static class CatAvoidEntityGoal<T extends LivingEntity> extends AvoidEntityGoal<T> { // DivineMC - make public
private final Cat cat;
public CatAvoidEntityGoal(Cat cat, Class<T> entityClassToAvoid, float maxDist, double walkSpeedModifier, double sprintSpeedModifier) {
@@ -536,7 +536,7 @@ public class Cat extends TamableAnimal implements VariantHolder<Holder<CatVarian
}
}
- static class CatRelaxOnOwnerGoal extends Goal {
+ public static class CatRelaxOnOwnerGoal extends Goal { // DivineMC - make public
private final Cat cat;
@Nullable
private Player ownerPlayer;
diff --git a/net/minecraft/world/entity/monster/Vindicator.java b/net/minecraft/world/entity/monster/Vindicator.java
index b584f71440a81ac09d24e59763a21e857f290e5a..81b9553b2354452258a9a520343d39c7cf4c0233 100644
--- a/net/minecraft/world/entity/monster/Vindicator.java
+++ b/net/minecraft/world/entity/monster/Vindicator.java
@@ -102,7 +102,7 @@ public class Vindicator extends AbstractIllager {
this.goalSelector.addGoal(1, new AvoidEntityGoal<>(this, Creaking.class, 8.0F, 1.0, 1.2));
this.goalSelector.addGoal(2, new Vindicator.VindicatorBreakDoorGoal(this));
this.goalSelector.addGoal(3, new AbstractIllager.RaiderOpenDoorGoal(this));
- this.goalSelector.addGoal(4, new Raider.HoldGroundAttackGoal(this, 10.0F));
+ this.goalSelector.addGoal(4, new HoldGroundAttackGoal(this, 10.0F)); // DivineMC - Remove Raider reference
this.goalSelector.addGoal(5, new MeleeAttackGoal(this, 1.0, false));
this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables
this.targetSelector.addGoal(1, new HurtByTargetGoal(this, Raider.class).setAlertOthers());
diff --git a/net/minecraft/world/entity/raid/Raider.java b/net/minecraft/world/entity/raid/Raider.java
index c06b589e669b055a26f662df60070d5908256220..458e76317f4cd10f881ae2fdf990c392d68f5241 100644
--- a/net/minecraft/world/entity/raid/Raider.java
+++ b/net/minecraft/world/entity/raid/Raider.java
@@ -475,7 +475,7 @@ public abstract class Raider extends PatrollingMonster {
}
}
- static class RaiderMoveThroughVillageGoal extends Goal {
+ public class RaiderMoveThroughVillageGoal extends Goal { // DivineMC - package-private static -> public non-static
private final Raider raider;
private final double speedModifier;
private BlockPos poiPos;