Deliver claimed item rewards through planetary profiles
This commit is contained in:
parent
5c8361b920
commit
54aa55b2a1
3 changed files with 7 additions and 5 deletions
|
|
@ -152,7 +152,7 @@ public final class JarvisTranslator extends JavaPlugin implements Listener {
|
|||
exchangeInventory.configureHQ(itemPreview,new File(getDataFolder().getParentFile(),"DuneEss/website-bridge.yml"));
|
||||
ItemRedeemCommand.register(this,api,kitGrants);
|
||||
questObservations=new QuestObservations(this,api,serverKey);
|
||||
LetoQuestRewards.register(this,api,exchangeInventory);
|
||||
LetoQuestRewards.register(this,api,exchangeInventory,serverKey);
|
||||
new FlightObservations(this,questObservations,serverKey);
|
||||
ElytraAnvil.register(this, exchangeInventory, questObservations, serverKey);
|
||||
new HusbandryObservations(this,questObservations,serverKey);
|
||||
|
|
|
|||
|
|
@ -36,8 +36,9 @@ final class LetoQuestRewards implements Listener {
|
|||
private final Set<UUID> pending = new HashSet<>();
|
||||
private final Map<UUID, Set<UUID>> delivered = new HashMap<>();
|
||||
|
||||
static void register(JavaPlugin plugin, SharedGameApi api, ExchangeInventory inventory) {
|
||||
if (plugin.getConfig().getBoolean("golden-path.enabled", false)) {
|
||||
static void register(JavaPlugin plugin, SharedGameApi api, ExchangeInventory inventory, String server) {
|
||||
// Native item grants require a shared planetary inventory transaction.
|
||||
if (!server.equals("lobby") && plugin.getConfig().getBoolean("golden-path.enabled", false)) {
|
||||
new LetoQuestRewards(plugin, api, inventory);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,10 +53,11 @@ class GoldenPathMerge implements Opcodes {
|
|||
hook.add(new VarInsnNode(ALOAD, 0));
|
||||
loadField(old, hook, "api", JARVIS + "SharedGameApi");
|
||||
loadField(old, hook, "exchangeInventory", JARVIS + "ExchangeInventory");
|
||||
loadField(old, hook, "serverKey", "java/lang/String");
|
||||
hook.add(call(JARVIS + "LetoQuestRewards", "register",
|
||||
"(" + PLUGIN + "L" + JARVIS + "SharedGameApi;L" + JARVIS + "ExchangeInventory;)V"));
|
||||
"(" + PLUGIN + "L" + JARVIS + "SharedGameApi;L" + JARVIS + "ExchangeInventory;Ljava/lang/String;)V"));
|
||||
enable.instructions.insert(fieldWrite(enable, old.name, "questObservations", PUTFIELD), hook);
|
||||
enable.maxStack = Math.max(enable.maxStack, 3);
|
||||
enable.maxStack = Math.max(enable.maxStack, 4);
|
||||
}
|
||||
default -> throw new IllegalArgumentException("Unexpected quest graft target " + old.name);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue

Staff