mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
add back pufferfish patches \o/
This commit is contained in:
34
patches/server/0107-Changeable-Mob-Left-Handed-Chance.patch
Normal file
34
patches/server/0107-Changeable-Mob-Left-Handed-Chance.patch
Normal file
@@ -0,0 +1,34 @@
|
||||
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 906f3ed7883cd220734a92a5f032ec89674f5b97..f04fd84be60d5fc866aa6bf0b711c7e34c5c6369 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -1304,7 +1304,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 06558480c2f3b9b1e81ba48fe7c7a80ea5652599..d1792d16fe745c22a2408ca7b6446348563e5b63 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;
|
||||
Reference in New Issue
Block a user