-
-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add configurable entity left handedness chance
- Loading branch information
1 parent
93e08ee
commit 40d8df2
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
patches/server/0149-Changeable-Mob-Left-Handed-Chance.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Ben Kerllenevich <me@notom3ga.me> | ||
Date: Mon, 30 Nov 2020 11:40:11 -0500 | ||
Subject: [PATCH] Changeable Mob Left Handed Chance | ||
|
||
|
||
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java | ||
index 9214b2a3c..3a79771d5 100644 | ||
--- a/src/main/java/net/minecraft/server/EntityInsentient.java | ||
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java | ||
@@ -1133,7 +1133,7 @@ public abstract class EntityInsentient extends EntityLiving { | ||
@Nullable | ||
public GroupDataEntity prepare(WorldAccess worldaccess, DifficultyDamageScaler difficultydamagescaler, EnumMobSpawn enummobspawn, @Nullable GroupDataEntity groupdataentity, @Nullable NBTTagCompound nbttagcompound) { | ||
this.getAttributeInstance(GenericAttributes.FOLLOW_RANGE).addModifier(new AttributeModifier("Random spawn bonus", this.random.nextGaussian() * 0.05D, AttributeModifier.Operation.MULTIPLY_BASE)); | ||
- if (this.random.nextFloat() < 0.05F) { | ||
+ if (this.random.nextFloat() < this.world.purpurConfig.entityLeftHandedChance) { // Purpur | ||
this.setLeftHanded(true); | ||
} else { | ||
this.setLeftHanded(false); | ||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | ||
index 79b345df7..8bdb6399e 100644 | ||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | ||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | ||
@@ -129,8 +129,10 @@ public class PurpurWorldConfig { | ||
} | ||
|
||
public int entityLifeSpan = 0; | ||
+ public float entityLeftHandedChance = 0.05f; | ||
private void entitySettings() { | ||
entityLifeSpan = getInt("gameplay-mechanics.entity-lifespan", entityLifeSpan); | ||
+ entityLeftHandedChance = (float) getDouble("gameplay-mechanics.entity-left-handed-chance", entityLeftHandedChance); | ||
} | ||
|
||
public List<Item> itemImmuneToExplosion = new ArrayList<>(); |