Skip to content

Commit

Permalink
fix: methodToObtainItems -> specialMethodToObtainItems
Browse files Browse the repository at this point in the history
Co-Authored-By: pajlada <962989+pajlada@users.noreply.github.com>
  • Loading branch information
Zoinkwiz and pajlada committed Nov 22, 2024
1 parent c2c5257 commit 786b916
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/main/java/com/questhelper/QuestHelperPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import com.google.inject.Binder;
import com.google.inject.Injector;
import com.google.inject.Provides;
import com.questhelper.bank.banktab.BankTabItem;
import com.questhelper.bank.banktab.BankTabItems;
import com.questhelper.managers.*;
import com.questhelper.panel.QuestHelperPanel;
Expand Down Expand Up @@ -177,7 +176,7 @@ QuestHelperConfig getConfig(ConfigManager configManager)
protected void startUp() throws IOException
{
questBankManager.startUp(injector, eventBus);
QuestContainerManager.getBankData().setMethodToObtainItems(() -> questBankManager.getBankItems().toArray(new Item[0]));
QuestContainerManager.getBankData().setSpecialMethodToObtainItems(() -> questBankManager.getBankItems().toArray(new Item[0]));
eventBus.register(worldMapAreaManager);

injector.injectMembers(playerStateManager);
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/questhelper/managers/ItemAndLastUpdated.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class ItemAndLastUpdated
private Item[] items;

@Setter
private Callable<Item[]> methodToObtainItems;
private Callable<Item[]> specialMethodToObtainItems;

public ItemAndLastUpdated(TrackedContainers containerType)
{
Expand All @@ -60,18 +60,18 @@ public void update(int updateTick, Item[] items)

/**
* Get the Items contained within the Tracked Container.
* If this instance of ItemAndLastUpdated has a method to obtain the current state of the Container other than
* If this instance of ItemAndLastUpdated has a method in specialMethodToObtainItems to obtain the current state of the Container other than
* from the {@link Item}[] items variable, it will use that and return the value.
*
*
* @return an {@link Item}[] of items currently thought to be in the container.
*/
public @Nullable Item[] getItems()
{
if (methodToObtainItems != null)
if (specialMethodToObtainItems != null)
{
try
{
return methodToObtainItems.call();
return specialMethodToObtainItems.call();
} catch (Exception e)
{
log.warn("Failed to load container from method");
Expand Down

0 comments on commit 786b916

Please sign in to comment.