mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Dolphins naturally aggressive to players chance
This commit is contained in:
committed by
granny
parent
eab7420f71
commit
e256ff6ac7
@@ -30,7 +30,7 @@ index c7a7a65273801ee1c11aa9f72ee2327beac21ec0..69bd4d3401cf8432494be78ce5d8c009
|
||||
/* Drop global time updates
|
||||
if (this.tickCount % 20 == 0) {
|
||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||
index 4ad0cd0664384a671a538524c0d6ff5845c21ff0..8aa27a33f5f182937097427ed481152b7309fa56 100644
|
||||
index 704e618c1a71c5182bc927758eb3f91e5f008f7d..a55772a67bca2be0a36ce63e7b0143b825c40f01 100644
|
||||
--- a/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -217,6 +217,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -62,10 +62,10 @@ index 31739c5c9dfdd940263cc9b931068b3f624329ec..a8287654d3023f0a5fb183d4ad2dd418
|
||||
|
||||
private void updatePlayerAttributes() {
|
||||
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index a2832445eab54cc6d93f929ac061949002f1bd4b..6d19faa36b4f824533e1b76e7cda1f324d1c179f 100644
|
||||
index 1c28e91e46d16a77da00f6fc06b9be1bd61ee5df..6f4d69a0c8a3ce91954ee61381dd2ad87510c11d 100644
|
||||
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2818,6 +2818,8 @@ public class ServerGamePacketListenerImpl
|
||||
@@ -2819,6 +2819,8 @@ public class ServerGamePacketListenerImpl
|
||||
|
||||
ServerGamePacketListenerImpl.this.cserver.getPluginManager().callEvent(event);
|
||||
|
||||
@@ -841,13 +841,13 @@ index 8c1f74c6be53cbf48bd6b5641511359578801c08..656babc0c8810a85eb9f78ced1f3ad95
|
||||
// CraftBukkit end
|
||||
player.playSound(SoundEvents.COW_MILK, 1.0F, 1.0F);
|
||||
diff --git a/net/minecraft/world/entity/animal/Dolphin.java b/net/minecraft/world/entity/animal/Dolphin.java
|
||||
index 7b4b50a714829ed1a48c8ff1fed779432e079489..f6aa8c23afdccb093bcfb0643683614dad49caac 100644
|
||||
index 8be0dd148d88dfdfb9efab91124c829e60b5dea5..35bce598bb5857356823594d2a001006ce19f835 100644
|
||||
--- a/net/minecraft/world/entity/animal/Dolphin.java
|
||||
+++ b/net/minecraft/world/entity/animal/Dolphin.java
|
||||
@@ -71,14 +71,82 @@ public class Dolphin extends AgeableWaterCreature {
|
||||
private static final int TOTAL_MOISTNESS_LEVEL = 2400;
|
||||
@@ -72,14 +72,82 @@ public class Dolphin extends AgeableWaterCreature {
|
||||
public static final Predicate<ItemEntity> ALLOWED_ITEMS = itemEntity -> !itemEntity.hasPickUpDelay() && itemEntity.isAlive() && itemEntity.isInWater();
|
||||
public static final float BABY_SCALE = 0.65F;
|
||||
private boolean isNaturallyAggressiveToPlayers; // Purpur - Dolphins naturally aggressive to players chance
|
||||
+ private int spitCooldown; // Purpur - Ridables
|
||||
|
||||
public Dolphin(EntityType<? extends Dolphin> entityType, Level level) {
|
||||
@@ -928,23 +928,23 @@ index 7b4b50a714829ed1a48c8ff1fed779432e079489..f6aa8c23afdccb093bcfb0643683614d
|
||||
@Nullable
|
||||
@Override
|
||||
public SpawnGroupData finalizeSpawn(
|
||||
@@ -169,6 +237,7 @@ public class Dolphin extends AgeableWaterCreature {
|
||||
protected void registerGoals() {
|
||||
@@ -172,6 +240,7 @@ public class Dolphin extends AgeableWaterCreature {
|
||||
this.goalSelector.addGoal(0, new BreathAirGoal(this));
|
||||
this.goalSelector.addGoal(0, new TryFindWaterGoal(this));
|
||||
this.goalSelector.addGoal(1, new MeleeAttackGoal(this, 1.2000000476837158D, true)); // Purpur - Dolphins naturally aggressive to players chance
|
||||
+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables
|
||||
this.goalSelector.addGoal(1, new Dolphin.DolphinSwimToTreasureGoal(this));
|
||||
this.goalSelector.addGoal(2, new Dolphin.DolphinSwimWithPlayerGoal(this, 4.0));
|
||||
this.goalSelector.addGoal(4, new RandomSwimmingGoal(this, 1.0, 10));
|
||||
@@ -179,6 +248,7 @@ public class Dolphin extends AgeableWaterCreature {
|
||||
@@ -182,6 +251,7 @@ public class Dolphin extends AgeableWaterCreature {
|
||||
this.goalSelector.addGoal(8, new Dolphin.PlayWithItemsGoal());
|
||||
this.goalSelector.addGoal(8, new FollowBoatGoal(this));
|
||||
this.goalSelector.addGoal(9, new AvoidEntityGoal<>(this, Guardian.class, 8.0F, 1.0, 1.0));
|
||||
+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables
|
||||
this.targetSelector.addGoal(1, new HurtByTargetGoal(this, Guardian.class).setAlertOthers());
|
||||
this.targetSelector.addGoal(2, new net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, (ignored, ignored2) -> isNaturallyAggressiveToPlayers)); // Purpur - Dolphins naturally aggressive to players chance
|
||||
}
|
||||
|
||||
@@ -223,7 +293,7 @@ public class Dolphin extends AgeableWaterCreature {
|
||||
@@ -227,7 +297,7 @@ public class Dolphin extends AgeableWaterCreature {
|
||||
|
||||
@Override
|
||||
protected boolean canRide(Entity entity) {
|
||||
@@ -953,7 +953,7 @@ index 7b4b50a714829ed1a48c8ff1fed779432e079489..f6aa8c23afdccb093bcfb0643683614d
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -252,6 +322,11 @@ public class Dolphin extends AgeableWaterCreature {
|
||||
@@ -256,6 +326,11 @@ public class Dolphin extends AgeableWaterCreature {
|
||||
@Override
|
||||
public void tick() {
|
||||
super.tick();
|
||||
|
||||
Reference in New Issue
Block a user