mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@eb60bff Create raw chat type as resource file instead of in source (#9226) PaperMC/Paper@99b311d [ci skip] Clarify where furnace-related events are called (#8753) PaperMC/Paper@83cfeb1 Improve java version check (#9692) PaperMC/Paper@deb92c2 Add ItemStack#isEmpty and related methods (#9664) PaperMC/Paper@0c8e84c Enforce sign line nullability when setting line with Adventure Method (#9689) PaperMC/Paper@ede9c06 Fix Projectile#setOwner(null) not clearing owner (#9715) PaperMC/Paper@e312ebb Add DISPLAY tracking range type (#9668) PaperMC/Paper@06a741d Fix leashed pets teleporting to owner when loaded (#9686) PaperMC/Paper@064fb50 Cleanup old async commands patch (#8895) PaperMC/Paper@d8af99a Fix silent equipment change for mobs (#9677) PaperMC/Paper@3cec9c9 [ci skip] Add missing javadoc links (#9497) PaperMC/Paper@ba0e1f5 Fix sapling observer detection and grow event (#9654) PaperMC/Paper@a856073 Fix two beacon bugs (#9675) PaperMC/Paper@581b683 Fix spigot's Forced-Stats (#9663)
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 049a6b2186ff31ac9a815ac501b75488e2e19266..50747e73ab0a37073e431db82d79b1ebc024d347 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
|
@@ -1302,7 +1302,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
|
RandomSource randomsource = world.getRandom();
|
|
|
|
this.getAttribute(Attributes.FOLLOW_RANGE).addPermanentModifier(new AttributeModifier("Random spawn bonus", randomsource.triangle(0.0D, 0.11485000000000001D), AttributeModifier.Operation.MULTIPLY_BASE));
|
|
- if (randomsource.nextFloat() < 0.05F) {
|
|
+ if (randomsource.nextFloat() < world.getLevel().purpurConfig.entityLeftHandedChance) { // Purpur
|
|
this.setLeftHanded(true);
|
|
} else {
|
|
this.setLeftHanded(false);
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
index e9778b0e02fb94eeea2e8c6e2680b6564b11d399..4968d157692e71c54be0fd76069ece3ba0294e5f 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;
|