mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Allow leashing villagers
This commit is contained in:
@@ -230,6 +230,11 @@ allow-sign-colors
|
|||||||
* **default**: true
|
* **default**: true
|
||||||
* **description**: Allow players to use color codes on signs
|
* **description**: Allow players to use color codes on signs
|
||||||
|
|
||||||
|
allow-leashing-villagers
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
* **default**: true
|
||||||
|
* **description**: Allow players to use leads on villagers (trader not included)
|
||||||
|
|
||||||
items-can-break-turtle-eggs
|
items-can-break-turtle-eggs
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
* **default**: false
|
* **default**: false
|
||||||
|
|||||||
45
patches/server/0047-Allow-leashing-villagers.patch
Normal file
45
patches/server/0047-Allow-leashing-villagers.patch
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
From 410c0124e6648f16ab4dcd569b1a2df1a22f3343 Mon Sep 17 00:00:00 2001
|
||||||
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
|
Date: Wed, 10 Jul 2019 20:14:07 -0500
|
||||||
|
Subject: [PATCH] Allow leashing villagers
|
||||||
|
|
||||||
|
---
|
||||||
|
src/main/java/net/minecraft/server/EntityVillager.java | 7 +++++++
|
||||||
|
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
||||||
|
2 files changed, 12 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java
|
||||||
|
index 07f7b90f5..d06889844 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/EntityVillager.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/EntityVillager.java
|
||||||
|
@@ -879,4 +879,11 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||||
|
|
||||||
|
return optional.isPresent() && optional1.isPresent() ? i - ((MinecraftSerializableLong) optional.get()).a() < 24000L && i - ((MinecraftSerializableLong) optional1.get()).a() < 36000L : false;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ // Purpur - start
|
||||||
|
+ @Override
|
||||||
|
+ public boolean a(EntityHuman entityhuman) {
|
||||||
|
+ return world.purpurConfig.allowLeashingVillagers && !this.isLeashed();
|
||||||
|
+ }
|
||||||
|
+ // Purpur - end
|
||||||
|
}
|
||||||
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
index a33eb6773..542e1b329 100644
|
||||||
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||||
|
@@ -107,6 +107,11 @@ public class PurpurWorldConfig {
|
||||||
|
allowSignColors = getBoolean("allow-sign-colors", allowSignColors);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ public boolean allowLeashingVillagers = true;
|
||||||
|
+ private void allowLeashingVillagers() {
|
||||||
|
+ allowLeashingVillagers = getBoolean("allow-leashing-villagers", allowLeashingVillagers);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
public boolean itemsCanBreakTurtleEggs = false;
|
||||||
|
private void itemsCanBreakTurtleEggs() {
|
||||||
|
itemsCanBreakTurtleEggs = getBoolean("items-can-break-turtle-eggs", itemsCanBreakTurtleEggs);
|
||||||
|
--
|
||||||
|
2.20.1
|
||||||
|
|
||||||
Reference in New Issue
Block a user