This commit is contained in:
BillyGalbreath
2021-06-17 20:05:39 -05:00
parent fa4d6d5ee0
commit c8d6f33b0a
10 changed files with 745 additions and 182 deletions

View File

@@ -26,21 +26,22 @@ index 0fc358d5491900affb61545d89a788bbb2435c04..c150a898c60a3477012e7d49e30f98cf
return this.brain;
}
diff --git a/src/main/java/net/minecraft/world/entity/monster/Giant.java b/src/main/java/net/minecraft/world/entity/monster/Giant.java
index a183226bb0cf01c5aaf7babe1d08fa9ab7388648..8f86797cd47b338a599dc053a515e16cb23e56f4 100644
index 8be06ef6e876219cb8130938fabe7ec6c99cf408..4f0449ed1acdcc85a659973e5c40c6c62868ecf2 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Giant.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Giant.java
@@ -1,19 +1,93 @@
@@ -1,13 +1,36 @@
package net.minecraft.world.entity.monster;
import net.minecraft.core.BlockPos;
-import net.minecraft.world.entity.EntityDimensions;
-import net.minecraft.world.entity.EntityType;
-import net.minecraft.world.entity.Pose;
+import net.minecraft.nbt.CompoundTag;
+import net.minecraft.world.Difficulty;
+import net.minecraft.world.DifficultyInstance;
+import net.minecraft.world.entity.*;
+import net.minecraft.world.entity.ai.attributes.AttributeModifier;
import net.minecraft.world.entity.EntityDimensions;
import net.minecraft.world.entity.EntityType;
+import net.minecraft.world.entity.EquipmentSlot;
+import net.minecraft.world.entity.MobSpawnType;
import net.minecraft.world.entity.Pose;
+import net.minecraft.world.entity.SpawnGroupData;
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
import net.minecraft.world.entity.ai.attributes.Attributes;
+import net.minecraft.world.entity.ai.goal.FloatGoal;
@@ -65,22 +66,22 @@ index a183226bb0cf01c5aaf7babe1d08fa9ab7388648..8f86797cd47b338a599dc053a515e16c
public class Giant extends Monster {
public Giant(EntityType<? extends Giant> type, Level world) {
super(type, world);
this.safeFallDistance = 10.0F; // Purpur
+ maxUpStep = world.purpurConfig.giantStepHeight;
+ }
+
+ // Purpur start
+ @Override
+ protected void registerGoals() {
@@ -28,8 +51,56 @@ public class Giant extends Monster {
@Override
protected void registerGoals() {
- this.goalSelector.addGoal(0, new net.pl3x.purpur.entity.ai.HasRider(this));
- this.targetSelector.addGoal(0, new net.pl3x.purpur.entity.ai.HasRider(this));
+ if (level.purpurConfig.giantHaveAI) {
+ this.goalSelector.addGoal(0, new FloatGoal(this));
+ this.goalSelector.addGoal(0, new net.pl3x.purpur.entity.ai.HasRider(this));
+ this.goalSelector.addGoal(7, new WaterAvoidingRandomStrollGoal(this, 1.0D));
+ this.goalSelector.addGoal(8, new LookAtPlayerGoal(this, Player.class, 16.0F));
+ this.goalSelector.addGoal(8, new RandomLookAroundGoal(this));
+ this.goalSelector.addGoal(5, new MoveTowardsRestrictionGoal(this, 1.0D));
+ if (level.purpurConfig.giantHaveHostileAI) {
+ this.goalSelector.addGoal(2, new MeleeAttackGoal(this, 1.0D, false));
+ this.targetSelector.addGoal(0, new net.pl3x.purpur.entity.ai.HasRider(this));
+ this.targetSelector.addGoal(1, new HurtByTargetGoal(this).setAlertOthers(ZombifiedPiglin.class));
+ this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true));
+ this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, Villager.class, false));
@@ -122,11 +123,9 @@ index a183226bb0cf01c5aaf7babe1d08fa9ab7388648..8f86797cd47b338a599dc053a515e16c
+ // 1.0 makes bottom of feet about as high as their waist when they jump
+ return level.purpurConfig.giantJumpHeight;
}
+ // Purpur end
// Purpur end
@Override
protected float getStandingEyeHeight(Pose pose, EntityDimensions dimensions) {
@@ -26,6 +100,6 @@ public class Giant extends Monster {
@@ -44,6 +115,6 @@ public class Giant extends Monster {
@Override
public float getWalkTargetValue(BlockPos pos, LevelReader world) {
@@ -135,7 +134,7 @@ index a183226bb0cf01c5aaf7babe1d08fa9ab7388648..8f86797cd47b338a599dc053a515e16c
}
}
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 148cc428b17e0db46a86079bf4e2199b52f1ad84..3f92159deba19bb7257d920ec3b1f31c0e2bcf87 100644
index cee4c24b792c31e35c3d84fc3d435b3ebe1642cf..2d9319d3fcf3a52f404a44e38bb6a71de5ab7ef0 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -261,9 +261,28 @@ public class PurpurWorldConfig {