mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Changeable Mob Left Handed Chance
This commit is contained in:
@@ -1,34 +0,0 @@
|
|||||||
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/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
|
|
||||||
index 1f253d5ace885423aa25ebdd986e1909a15ba018..06fbac8a968971d9ec3305e98b136d88be19a9f7 100644
|
|
||||||
--- a/net/minecraft/world/entity/Mob.java
|
|
||||||
+++ b/net/minecraft/world/entity/Mob.java
|
|
||||||
@@ -1422,7 +1422,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
|
||||||
attributemodifiable.addPermanentModifier(new AttributeModifier(Mob.RANDOM_SPAWN_BONUS_ID, 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 3ec8e7ea1cf1eb5dd8fec5fefa7a77d68cb75632..897fac3caeab051cf2634d4e8b3dca62b389acd8 100644
|
|
||||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
||||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
||||||
@@ -152,8 +152,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;
|
|
||||||
@@ -65,6 +65,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -1280,7 +_,7 @@
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
- this.setLeftHanded(random.nextFloat() < 0.05F);
|
||||||
|
+ this.setLeftHanded(random.nextFloat() < level.getLevel().purpurConfig.entityLeftHandedChance); // Purpur - Changeable Mob Left Handed Chance
|
||||||
|
return spawnGroupData;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1619,6 +_,7 @@
|
@@ -1619,6 +_,7 @@
|
||||||
this.playAttackSound();
|
this.playAttackSound();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -143,8 +143,10 @@ public class PurpurWorldConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int entityLifeSpan = 0;
|
public int entityLifeSpan = 0;
|
||||||
|
public float entityLeftHandedChance = 0.05f;
|
||||||
private void entitySettings() {
|
private void entitySettings() {
|
||||||
entityLifeSpan = getInt("gameplay-mechanics.entity-lifespan", entityLifeSpan);
|
entityLifeSpan = getInt("gameplay-mechanics.entity-lifespan", entityLifeSpan);
|
||||||
|
entityLeftHandedChance = (float) getDouble("gameplay-mechanics.entity-left-handed-chance", entityLeftHandedChance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean infinityWorksWithoutArrows = false;
|
public boolean infinityWorksWithoutArrows = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user