it compiles \o/

This commit is contained in:
granny
2024-10-26 23:46:33 -07:00
parent ab8264ec21
commit 76614d2235
92 changed files with 484 additions and 443 deletions

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Cows naturally aggressive to players chance
diff --git a/src/main/java/net/minecraft/world/entity/animal/Cow.java b/src/main/java/net/minecraft/world/entity/animal/Cow.java
index 9c3bdf70c70328df4bfc13cb09aeef4b190cd77e..234785a387f445b3e40978978a647140b3490072 100644
index 4ad3571403ee8044d17f53987bd47b6c43d42f0e..380bd41336d8d24bffd4e10885e46c95e5bb71fd 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Cow.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Cow.java
@@ -37,6 +37,7 @@ import org.bukkit.event.player.PlayerBucketFillEvent;
@@ -29,7 +29,7 @@ index 9c3bdf70c70328df4bfc13cb09aeef4b190cd77e..234785a387f445b3e40978978a647140
}
+ @Override
+ public net.minecraft.world.entity.SpawnGroupData finalizeSpawn(net.minecraft.world.level.ServerLevelAccessor world, net.minecraft.world.DifficultyInstance difficulty, net.minecraft.world.entity.MobSpawnType spawnReason, net.minecraft.world.entity.SpawnGroupData entityData) {
+ public net.minecraft.world.entity.SpawnGroupData finalizeSpawn(net.minecraft.world.level.ServerLevelAccessor world, net.minecraft.world.DifficultyInstance difficulty, net.minecraft.world.entity.EntitySpawnReason spawnReason, net.minecraft.world.entity.SpawnGroupData entityData) {
+ this.isNaturallyAggressiveToPlayers = world.getLevel().purpurConfig.cowNaturallyAggressiveToPlayersChance > 0.0D && random.nextDouble() <= world.getLevel().purpurConfig.cowNaturallyAggressiveToPlayersChance;
+ return super.finalizeSpawn(world, difficulty, spawnReason, entityData);
+ }
@@ -47,7 +47,7 @@ index 9c3bdf70c70328df4bfc13cb09aeef4b190cd77e..234785a387f445b3e40978978a647140
this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 1.0D));
this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 6.0F));
this.goalSelector.addGoal(7, new RandomLookAroundGoal(this));
+ this.targetSelector.addGoal(0, new net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, target -> isNaturallyAggressiveToPlayers)); // Purpur
+ this.targetSelector.addGoal(0, new net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, (ignored, ignored2) -> isNaturallyAggressiveToPlayers)); // Purpur
}
@Override
@@ -61,7 +61,7 @@ index 9c3bdf70c70328df4bfc13cb09aeef4b190cd77e..234785a387f445b3e40978978a647140
@Override
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 3f10fe595960a69ed372f80c1b28acd9e956516b..09465c479f1074d76be88713f727c648be61bf06 100644
index 93be2146696ec724cca8017708265953ee4f25b3..bbb0cfa4bbb36c6833785633ee6e616d6355894c 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -1288,7 +1288,14 @@ public class PurpurWorldConfig {