mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 04:55:47 +01:00
41647af74c
We cannot put blocking network I/O onto the worldgen threads, this will crash the server if it stalls
30 lines
1.1 KiB
Diff
30 lines
1.1 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
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
|
|
index 1400f8c0cac3d653465b3750078de4d2691ac2a1..1a8a49bd269ed52879866ff3853e131d04aa8bba 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");
|