2020-05-06 11:48:49 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2020-04-27 08:13:41 +02:00
|
|
|
From: zbk <zbk@projectsolaris.net>
|
|
|
|
Date: Sun, 26 Apr 2020 23:49:01 -0400
|
|
|
|
Subject: [PATCH] Villager Restocks API
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java
|
2020-06-26 03:53:21 +02:00
|
|
|
index 8d3811ead268635c4b728f5c9b8dd6c9b8ec6124..86b75e31ea1ed9deecae9756c6f838c302dd8df6 100644
|
2020-04-27 08:13:41 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityVillager.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityVillager.java
|
2020-05-30 10:54:40 +02:00
|
|
|
@@ -992,4 +992,13 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
2020-04-27 08:13:41 +02:00
|
|
|
|
2020-06-26 03:53:21 +02:00
|
|
|
return optional.isPresent() ? i - (Long) optional.get() < 24000L : false;
|
2020-04-27 08:13:41 +02:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ // Paper start
|
|
|
|
+ public int getRestocksToday(){
|
|
|
|
+ return this.bL;
|
|
|
|
+ }
|
|
|
|
+ public void setRestocksToday(int restocksToday){
|
|
|
|
+ this.bL = restocksToday;
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
|
2020-05-06 11:48:49 +02:00
|
|
|
index fe726e7884c9f091d73c8f5d2cb58a87a16649f8..a8384081c03884c86578dca677914d77441c1863 100644
|
2020-04-27 08:13:41 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
|
|
|
|
@@ -82,6 +82,18 @@ public class CraftVillager extends CraftAbstractVillager implements Villager {
|
|
|
|
getHandle().setExperience(experience);
|
|
|
|
}
|
|
|
|
|
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
|
|
|
+ public int getRestocksToday() {
|
|
|
|
+ return getHandle().getRestocksToday();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void setRestocksToday(int restocksToday) {
|
|
|
|
+ getHandle().setRestocksToday(restocksToday);
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
|
|
|
@Override
|
|
|
|
public boolean sleep(Location location) {
|
|
|
|
Preconditions.checkArgument(location != null, "Location cannot be null");
|