geforkt von Mirrors/Paper
Villager resetOffers API
Dieser Commit ist enthalten in:
Ursprung
db1f178a92
Commit
ca25d24197
22
Spigot-API-Patches/Villager-resetOffers.patch
Normale Datei
22
Spigot-API-Patches/Villager-resetOffers.patch
Normale Datei
@ -0,0 +1,22 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Mon, 7 Oct 2019 00:15:28 -0500
|
||||
Subject: [PATCH] Villager#resetOffers
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/AbstractVillager.java b/src/main/java/org/bukkit/entity/AbstractVillager.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/entity/AbstractVillager.java
|
||||
+++ b/src/main/java/org/bukkit/entity/AbstractVillager.java
|
||||
@@ -0,0 +0,0 @@ public interface AbstractVillager extends Breedable, NPC, InventoryHolder, Merch
|
||||
@NotNull
|
||||
@Override
|
||||
Inventory getInventory();
|
||||
+
|
||||
+ // Paper start
|
||||
+ /**
|
||||
+ * Reset this villager's trade offers
|
||||
+ */
|
||||
+ public void resetOffers();
|
||||
+ // Paper end
|
||||
}
|
48
Spigot-Server-Patches/Villager-resetOffers.patch
Normale Datei
48
Spigot-Server-Patches/Villager-resetOffers.patch
Normale Datei
@ -0,0 +1,48 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Mon, 7 Oct 2019 00:15:37 -0500
|
||||
Subject: [PATCH] Villager#resetOffers
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityVillagerAbstract.java b/src/main/java/net/minecraft/server/EntityVillagerAbstract.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityVillagerAbstract.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityVillagerAbstract.java
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityVillagerAbstract extends EntityAgeable implements NP
|
||||
return this.tradingPlayer != null;
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
+ public void resetOffers() {
|
||||
+ this.trades = new MerchantRecipeList();
|
||||
+ this.updateTrades();
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
@Override
|
||||
public MerchantRecipeList getOffers() {
|
||||
if (this.trades == null) {
|
||||
@@ -0,0 +0,0 @@ public abstract class EntityVillagerAbstract extends EntityAgeable implements NP
|
||||
return this.world;
|
||||
}
|
||||
|
||||
+ protected final void updateTrades() { eW(); } // Paper - OBFHELPER
|
||||
protected abstract void eW();
|
||||
|
||||
protected void a(MerchantRecipeList merchantrecipelist, VillagerTrades.IMerchantRecipeOption[] avillagertrades_imerchantrecipeoption, int i) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java
|
||||
@@ -0,0 +0,0 @@ public class CraftAbstractVillager extends CraftAgeable implements AbstractVilla
|
||||
public HumanEntity getTrader() {
|
||||
return getMerchant().getTrader();
|
||||
}
|
||||
+
|
||||
+ // Paper start
|
||||
+ @Override
|
||||
+ public void resetOffers() {
|
||||
+ getHandle().resetOffers();
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren