PaperMC/patches/server/0390-Villager-Restocks-API.patch
Jake Potrebic afe633df08
convert API/server tests to mockito (#8848)
* convert API tests to mockito

* convert server tests to mockito

* add co-author
2023-02-15 13:27:40 -08:00

31 lines
1.2 KiB
Diff

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
== AT ==
public net.minecraft.world.entity.npc.Villager numberOfRestocksToday
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
index e4f0770b0c9a00b813f3473298fb0d5e21e7c008..4f73b71fb39eab10c44da31617632a83e4f0b83f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
@@ -91,6 +91,18 @@ public class CraftVillager extends CraftAbstractVillager implements Villager {
this.getHandle().setVillagerXp(experience);
}
+ // Paper start
+ @Override
+ public int getRestocksToday() {
+ return getHandle().numberOfRestocksToday;
+ }
+
+ @Override
+ public void setRestocksToday(int restocksToday) {
+ getHandle().numberOfRestocksToday = restocksToday;
+ }
+ // Paper end
+
@Override
public boolean sleep(Location location) {
Preconditions.checkArgument(location != null, "Location cannot be null");