Files
Purpur/patches/server/0130-Changeable-Mob-Left-Handed-Chance.patch
William Blake Galbreath 2040a9ac8a Updated Upstream (Paper & Tuinity)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
8fe5611 Fix Player#playerListName nullability annotation (#6089)
8827886 Add back linking to Adventure Javadoc (#6088)
6ea4da4 AbstractSkeleton should extend RangedEntity (#6087)
a831634 add Optimize Light Engine patch (#5863)
56fd1a2 Update to Minecraft 1.17.1 (#6097)
f8d6cbd Deobfuscate stacktraces in sync load info (#6103)

Tuinity Changes:
5065deb Make CollisionContext initialisation lazy
388bdf5 Optimise ActivationRange#activateEntities again
2310a94 Update to 1.17.1
2021-07-07 04:05:03 -05:00

35 lines
2.0 KiB
Diff

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/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index df79f95ab2c8b9106cac889787b840b166ff0a9c..2f061e2825127e4a38e261ccacf56926a2421bb0 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -1204,7 +1204,7 @@ public abstract class Mob extends LivingEntity {
@Nullable
public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, DifficultyInstance difficulty, MobSpawnType spawnReason, @Nullable SpawnGroupData entityData, @Nullable CompoundTag entityNbt) {
this.getAttribute(Attributes.FOLLOW_RANGE).addPermanentModifier(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.level.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 1000177563e5681a8caa745f1cd40af37723e8bc..27f9e9e65b7773190af12513085136709cf18d44 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -128,8 +128,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;