mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 02:17:42 +01:00
Start of the configurable base attributes
This commit is contained in:
@@ -5,7 +5,7 @@ Subject: [PATCH] Giants AI settings
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/AttributeMapBase.java b/src/main/java/net/minecraft/server/AttributeMapBase.java
|
||||
index c57e23e16b..92aa104dc5 100644
|
||||
index c57e23e16..92aa104dc 100644
|
||||
--- a/src/main/java/net/minecraft/server/AttributeMapBase.java
|
||||
+++ b/src/main/java/net/minecraft/server/AttributeMapBase.java
|
||||
@@ -41,6 +41,7 @@ public class AttributeMapBase {
|
||||
@@ -17,7 +17,7 @@ index c57e23e16b..92aa104dc5 100644
|
||||
public AttributeModifiable a(AttributeBase attributebase) {
|
||||
return (AttributeModifiable) this.b.computeIfAbsent(attributebase, (attributebase1) -> {
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 8fdfec3b8e..c90a767c78 100644
|
||||
index 8fdfec3b8..c90a767c7 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -136,7 +136,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@@ -30,10 +30,10 @@ index 8fdfec3b8e..c90a767c78 100644
|
||||
public float I;
|
||||
protected final Random random;
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityGiantZombie.java b/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
||||
index 9f4f56c47e..8dce2aad77 100644
|
||||
index 9f4f56c47..cf899bb6a 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
||||
@@ -4,9 +4,68 @@ public class EntityGiantZombie extends EntityMonster {
|
||||
@@ -4,9 +4,69 @@ public class EntityGiantZombie extends EntityMonster {
|
||||
|
||||
public EntityGiantZombie(EntityTypes<? extends EntityGiantZombie> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -70,6 +70,7 @@ index 9f4f56c47e..8dce2aad77 100644
|
||||
+ getAttributeMap().getAttribute(GenericAttributes.MAX_HEALTH).setValue(world.purpurConfig.giantMaxHealth);
|
||||
+ getAttributeMap().getAttribute(GenericAttributes.MOVEMENT_SPEED).setValue(world.purpurConfig.giantMovementSpeed);
|
||||
+ getAttributeMap().getAttribute(GenericAttributes.ATTACK_DAMAGE).setValue(world.purpurConfig.giantAttackDamage);
|
||||
+ setHealth(getMaxHealth());
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@@ -103,7 +104,7 @@ index 9f4f56c47e..8dce2aad77 100644
|
||||
@Override
|
||||
protected float b(EntityPose entitypose, EntitySize entitysize) {
|
||||
return 10.440001F;
|
||||
@@ -18,6 +77,6 @@ public class EntityGiantZombie extends EntityMonster {
|
||||
@@ -18,6 +78,6 @@ public class EntityGiantZombie extends EntityMonster {
|
||||
|
||||
@Override
|
||||
public float a(BlockPosition blockposition, IWorldReader iworldreader) {
|
||||
@@ -112,7 +113,7 @@ index 9f4f56c47e..8dce2aad77 100644
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
index 7b32a1fb79..b281ca841b 100644
|
||||
index 7b32a1fb7..b281ca841 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
@@ -948,6 +948,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
@@ -146,7 +147,7 @@ index 7b32a1fb79..b281ca841b 100644
|
||||
return false;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index 21b5b7d2c4..bc88db73b7 100644
|
||||
index 21b5b7d2c..bc88db73b 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -2159,7 +2159,7 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -159,28 +160,33 @@ index 21b5b7d2c4..bc88db73b7 100644
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index f403f9dc6c..f5004f221e 100644
|
||||
index f403f9dc6..3207b8b61 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -113,6 +113,23 @@ public class PurpurWorldConfig {
|
||||
@@ -113,6 +113,28 @@ public class PurpurWorldConfig {
|
||||
turtleEggsBreakFromMinecarts = getBoolean("blocks.turtle_egg.break-from-minecarts", turtleEggsBreakFromMinecarts);
|
||||
}
|
||||
|
||||
+ public float giantStepHeight = 2.0F;
|
||||
+ public float giantJumpHeight = 1.0F;
|
||||
+ public double giantMaxHealth = 100.0D;
|
||||
+ public double giantMovementSpeed = 0.5D;
|
||||
+ public double giantAttackDamage = 50.0D;
|
||||
+ public boolean giantHaveAI = false;
|
||||
+ public boolean giantHaveHostileAI = false;
|
||||
+ public double giantMaxHealth = 100.0D;
|
||||
+ private void giantSettings() {
|
||||
+ giantStepHeight = (float) getDouble("mobs.giant.step-height", giantStepHeight);
|
||||
+ giantJumpHeight = (float) getDouble("mobs.giant.jump-height", giantJumpHeight);
|
||||
+ giantMaxHealth = getDouble("mobs.giant.max-health", giantMaxHealth);
|
||||
+ giantMovementSpeed = getDouble("mobs.giant.movement-speed", giantMovementSpeed);
|
||||
+ giantAttackDamage = getDouble("mobs.giant.attack-damage", giantAttackDamage);
|
||||
+ giantHaveAI = getBoolean("mobs.giant.have-ai", giantHaveAI);
|
||||
+ giantHaveHostileAI = getBoolean("mobs.giant.have-hostile-ai", giantHaveHostileAI);
|
||||
+ if (PurpurConfig.version < 8) {
|
||||
+ double oldValue = getDouble("mobs.giant.max-health", giantMaxHealth);
|
||||
+ set("mobs.giant.attributes.max-health", oldValue);
|
||||
+ set("mobs.giant.max-health", null);
|
||||
+ }
|
||||
+ giantMaxHealth = getDouble("mobs.giant.attributes.max-health", giantMaxHealth);
|
||||
+ }
|
||||
+
|
||||
public int villagerBrainTicks = 1;
|
||||
|
||||
Reference in New Issue
Block a user