mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Option to make drowned break doors
This commit is contained in:
@@ -1,38 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: 12emin34 <macanovic.emin@gmail.com>
|
|
||||||
Date: Fri, 25 Jun 2021 13:56:15 +0200
|
|
||||||
Subject: [PATCH] Option to make drowned break doors
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/monster/Drowned.java b/net/minecraft/world/entity/monster/Drowned.java
|
|
||||||
index 7651c29a6468e93bd10d58f76a86a68912509bd3..1e4208f720bfafe9542691b826e4b8dccd449ef3 100644
|
|
||||||
--- a/net/minecraft/world/entity/monster/Drowned.java
|
|
||||||
+++ b/net/minecraft/world/entity/monster/Drowned.java
|
|
||||||
@@ -133,6 +133,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
|
|
||||||
this.goalSelector.addGoal(2, new Drowned.DrownedAttackGoal(this, 1.0, false));
|
|
||||||
this.goalSelector.addGoal(5, new Drowned.DrownedGoToBeachGoal(this, 1.0));
|
|
||||||
this.goalSelector.addGoal(6, new Drowned.DrownedSwimUpGoal(this, 1.0, this.level().getSeaLevel()));
|
|
||||||
+ if (level().purpurConfig.drownedBreakDoors) this.goalSelector.addGoal(6, new net.minecraft.world.entity.ai.goal.MoveThroughVillageGoal(this, 1.0D, true, 4, this::canBreakDoors));
|
|
||||||
this.goalSelector.addGoal(7, new RandomStrollGoal(this, 1.0));
|
|
||||||
this.targetSelector.addGoal(1, new HurtByTargetGoal(this, Drowned.class).setAlertOthers(ZombifiedPiglin.class));
|
|
||||||
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, (target, world) -> this.okTarget(target)));
|
|
||||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
||||||
index 1e5bb7dc174bd43479534a9cab0b3bf05695ae51..7d4570b6cc775e73a64e0a7ec4fa15397636a0f3 100644
|
|
||||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
||||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
||||||
@@ -1083,6 +1083,7 @@ public class PurpurWorldConfig {
|
|
||||||
public double drownedJockeyChance = 0.05D;
|
|
||||||
public boolean drownedJockeyTryExistingChickens = true;
|
|
||||||
public boolean drownedTakeDamageFromWater = false;
|
|
||||||
+ public boolean drownedBreakDoors = false;
|
|
||||||
private void drownedSettings() {
|
|
||||||
drownedRidable = getBoolean("mobs.drowned.ridable", drownedRidable);
|
|
||||||
drownedRidableInWater = getBoolean("mobs.drowned.ridable-in-water", drownedRidableInWater);
|
|
||||||
@@ -1099,6 +1100,7 @@ public class PurpurWorldConfig {
|
|
||||||
drownedJockeyChance = getDouble("mobs.drowned.jockey.chance", drownedJockeyChance);
|
|
||||||
drownedJockeyTryExistingChickens = getBoolean("mobs.drowned.jockey.try-existing-chickens", drownedJockeyTryExistingChickens);
|
|
||||||
drownedTakeDamageFromWater = getBoolean("mobs.drowned.takes-damage-from-water", drownedTakeDamageFromWater);
|
|
||||||
+ drownedBreakDoors = getBoolean("mobs.drowned.can-break-doors", drownedBreakDoors);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean elderGuardianRidable = false;
|
|
||||||
@@ -1,6 +1,10 @@
|
|||||||
--- a/net/minecraft/world/entity/monster/Drowned.java
|
--- a/net/minecraft/world/entity/monster/Drowned.java
|
||||||
+++ b/net/minecraft/world/entity/monster/Drowned.java
|
+++ b/net/minecraft/world/entity/monster/Drowned.java
|
||||||
@@ -85,7 +_,19 @@
|
@@ -82,10 +_,23 @@
|
||||||
|
this.goalSelector.addGoal(2, new Drowned.DrownedAttackGoal(this, 1.0, false));
|
||||||
|
this.goalSelector.addGoal(5, new Drowned.DrownedGoToBeachGoal(this, 1.0));
|
||||||
|
this.goalSelector.addGoal(6, new Drowned.DrownedSwimUpGoal(this, 1.0, this.level().getSeaLevel()));
|
||||||
|
+ if (level().purpurConfig.drownedBreakDoors) this.goalSelector.addGoal(6, new net.minecraft.world.entity.ai.goal.MoveThroughVillageGoal(this, 1.0D, true, 4, this::canBreakDoors)); // Purpur - Option to make drowned break doors
|
||||||
this.goalSelector.addGoal(7, new RandomStrollGoal(this, 1.0));
|
this.goalSelector.addGoal(7, new RandomStrollGoal(this, 1.0));
|
||||||
this.targetSelector.addGoal(1, new HurtByTargetGoal(this, Drowned.class).setAlertOthers(ZombifiedPiglin.class));
|
this.targetSelector.addGoal(1, new HurtByTargetGoal(this, Drowned.class).setAlertOthers(ZombifiedPiglin.class));
|
||||||
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, (entity, level) -> this.okTarget(entity)));
|
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, (entity, level) -> this.okTarget(entity)));
|
||||||
|
|||||||
@@ -1075,6 +1075,7 @@ public class PurpurWorldConfig {
|
|||||||
public double drownedJockeyChance = 0.05D;
|
public double drownedJockeyChance = 0.05D;
|
||||||
public boolean drownedJockeyTryExistingChickens = true;
|
public boolean drownedJockeyTryExistingChickens = true;
|
||||||
public boolean drownedTakeDamageFromWater = false;
|
public boolean drownedTakeDamageFromWater = false;
|
||||||
|
public boolean drownedBreakDoors = false;
|
||||||
private void drownedSettings() {
|
private void drownedSettings() {
|
||||||
drownedRidable = getBoolean("mobs.drowned.ridable", drownedRidable);
|
drownedRidable = getBoolean("mobs.drowned.ridable", drownedRidable);
|
||||||
drownedRidableInWater = getBoolean("mobs.drowned.ridable-in-water", drownedRidableInWater);
|
drownedRidableInWater = getBoolean("mobs.drowned.ridable-in-water", drownedRidableInWater);
|
||||||
@@ -1091,6 +1092,7 @@ public class PurpurWorldConfig {
|
|||||||
drownedJockeyChance = getDouble("mobs.drowned.jockey.chance", drownedJockeyChance);
|
drownedJockeyChance = getDouble("mobs.drowned.jockey.chance", drownedJockeyChance);
|
||||||
drownedJockeyTryExistingChickens = getBoolean("mobs.drowned.jockey.try-existing-chickens", drownedJockeyTryExistingChickens);
|
drownedJockeyTryExistingChickens = getBoolean("mobs.drowned.jockey.try-existing-chickens", drownedJockeyTryExistingChickens);
|
||||||
drownedTakeDamageFromWater = getBoolean("mobs.drowned.takes-damage-from-water", drownedTakeDamageFromWater);
|
drownedTakeDamageFromWater = getBoolean("mobs.drowned.takes-damage-from-water", drownedTakeDamageFromWater);
|
||||||
|
drownedBreakDoors = getBoolean("mobs.drowned.can-break-doors", drownedBreakDoors);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean elderGuardianRidable = false;
|
public boolean elderGuardianRidable = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user