2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: zbk <zbk@projectsolaris.net>
|
|
|
|
Date: Sun, 26 Apr 2020 23:49:01 -0400
|
|
|
|
Subject: [PATCH] Villager Restocks API
|
|
|
|
|
2022-11-20 00:53:20 +01:00
|
|
|
== AT ==
|
|
|
|
public net.minecraft.world.entity.npc.Villager numberOfRestocksToday
|
2021-06-11 14:02:28 +02:00
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
|
2023-05-12 13:10:08 +02:00
|
|
|
index 7479a68d9c1025c8f2cd784b2607b549d40f3638..ae8c32c3497125fa2d1959e3a44b7c3013646762 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
|
2023-05-12 13:10:08 +02:00
|
|
|
@@ -92,6 +92,18 @@ public class CraftVillager extends CraftAbstractVillager implements Villager {
|
2021-06-14 03:06:38 +02:00
|
|
|
this.getHandle().setVillagerXp(experience);
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
|
|
|
+ public int getRestocksToday() {
|
2021-06-17 22:20:03 +02:00
|
|
|
+ return getHandle().numberOfRestocksToday;
|
2021-06-11 14:02:28 +02:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void setRestocksToday(int restocksToday) {
|
2021-06-17 22:20:03 +02:00
|
|
|
+ getHandle().numberOfRestocksToday = restocksToday;
|
2021-06-11 14:02:28 +02:00
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
|
|
|
@Override
|
|
|
|
public boolean sleep(Location location) {
|
|
|
|
Preconditions.checkArgument(location != null, "Location cannot be null");
|