mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
35 lines
1.9 KiB
Diff
35 lines
1.9 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Ben Kerllenevich <ben@omega24.dev>
|
|
Date: Mon, 30 Nov 2020 11:40:11 -0500
|
|
Subject: [PATCH] Changeable Mob Left Handed Chance
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
|
index 6415bc82e44629a08a2ec881acaa5d993e48bb9d..24755576d2c0e59fe5ed2d6019dfe33a5d6a64f9 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
|
@@ -1437,7 +1437,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti
|
|
RandomSource randomsource = world.getRandom();
|
|
|
|
this.getAttribute(Attributes.FOLLOW_RANGE).addPermanentModifier(new AttributeModifier("Random spawn bonus", randomsource.triangle(0.0D, 0.11485000000000001D), AttributeModifier.Operation.ADD_MULTIPLIED_BASE));
|
|
- this.setLeftHanded(randomsource.nextFloat() < 0.05F);
|
|
+ this.setLeftHanded(randomsource.nextFloat() < world.getLevel().purpurConfig.entityLeftHandedChance); // Purpur
|
|
return entityData;
|
|
}
|
|
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
index 3f3584399f56fd475f1a0baa1e29ecfd188fa469..aba8165029d6b614072f511f45bb16c35988fbfd 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -156,8 +156,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 boolean infinityWorksWithoutArrows = false;
|