Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 20:40:07 +01:00
b6925c36af
This is now default vanilla behavior Fixes #3644
43 Zeilen
2.9 KiB
Diff
43 Zeilen
2.9 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/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java
|
|
index 8d3811ead268635c4b728f5c9b8dd6c9b8ec6124..9f28c7e4bd70abc280a8cf3cbf5ccc84246aff12 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityVillager.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityVillager.java
|
|
@@ -44,7 +44,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
|
private long bH;
|
|
private int bI;
|
|
private long bJ;
|
|
- private int bK;
|
|
+ private int bK; public int getRestocksToday(){ return this.bK; } public void setRestocksToday(int restocksToday){ this.bK = restocksToday; } // Paper OBFHELPER
|
|
private long bL;
|
|
private boolean bM;
|
|
private static final ImmutableList<MemoryModuleType<?>> bN = ImmutableList.of(MemoryModuleType.HOME, MemoryModuleType.JOB_SITE, MemoryModuleType.POTENTIAL_JOB_SITE, MemoryModuleType.MEETING_POINT, MemoryModuleType.MOBS, MemoryModuleType.VISIBLE_MOBS, MemoryModuleType.VISIBLE_VILLAGER_BABIES, MemoryModuleType.NEAREST_PLAYERS, MemoryModuleType.NEAREST_VISIBLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_WANTED_ITEM, MemoryModuleType.WALK_TARGET, new MemoryModuleType[]{MemoryModuleType.LOOK_TARGET, MemoryModuleType.INTERACTION_TARGET, MemoryModuleType.BREED_TARGET, MemoryModuleType.PATH, MemoryModuleType.INTERACTABLE_DOORS, MemoryModuleType.OPENED_DOORS, MemoryModuleType.NEAREST_BED, MemoryModuleType.HURT_BY, MemoryModuleType.HURT_BY_ENTITY, MemoryModuleType.NEAREST_HOSTILE, MemoryModuleType.SECONDARY_JOB_SITE, MemoryModuleType.HIDING_PLACE, MemoryModuleType.HEARD_BELL_TIME, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.LAST_SLEPT, MemoryModuleType.LAST_WOKEN, MemoryModuleType.LAST_WORKED_AT_POI, MemoryModuleType.GOLEM_LAST_SEEN_TIME});
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
|
|
index fe726e7884c9f091d73c8f5d2cb58a87a16649f8..a8384081c03884c86578dca677914d77441c1863 100644
|
|
--- 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");
|