Skip to content

Commit

Permalink
Rename methods in wanderer trading event
Browse files Browse the repository at this point in the history
  • Loading branch information
LLytho committed Nov 8, 2024
1 parent 5efa428 commit 1ae2461
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Changelog

## Unreleased
- /

- Rename methods in wanderer trading event to match villager trading event

## [0.14.0] - 2024-10-31

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,26 +65,50 @@ public void removeTrades(TradeFilter filter) {
});
}

public void removeVanillaTrades() {
public void removeVanillaTypedTrades() {
getTrades(1).removeIf(VillagerUtils::isVanillaTypedTrade);
getTrades(2).removeIf(VillagerUtils::isVanillaTypedTrade);
}

public void removeVanillaTrades(int level) {
@Deprecated(forRemoval = true)
public void removeVanillaTrades() {
ConsoleJS.SERVER.error("removeVanillaTrades is deprecated, use removeVanillaTypedTrades instead");
removeVanillaTypedTrades();
}

public void removeVanillaTypedTrades(int level) {
checkLevel(level);
getTrades(level).removeIf(VillagerUtils::isVanillaTypedTrade);
}

public void removeModdedTrades() {
@Deprecated(forRemoval = true)
public void removeVanillaTrades(int level) {
ConsoleJS.SERVER.error("removeVanillaTrades is deprecated, use removeVanillaTypedTrades instead");
removeVanillaTypedTrades(level);
}

public void removeModdedTypedTrades() {
getTrades(1).removeIf(VillagerUtils::isModdedTypedTrade);
getTrades(2).removeIf(VillagerUtils::isModdedTypedTrade);
}

public void removeModdedTrades(int level) {
@Deprecated(forRemoval = true)
public void removeModdedTrades() {
ConsoleJS.SERVER.error("removeModdedTrades is deprecated, use removeModdedTypedTrades instead");
removeModdedTypedTrades();
}

public void removeModdedTypedTrades(int level) {
checkLevel(level);
getTrades(level).removeIf(VillagerUtils::isModdedTypedTrade);
}

@Deprecated(forRemoval = true)
public void removeModdedTrades(int level) {
ConsoleJS.SERVER.error("removeModdedTrades is deprecated, use removeModdedTypedTrades instead");
removeModdedTypedTrades(level);
}

private void checkLevel(int level) {
Preconditions.checkArgument(1 <= level && level <= 2, "Level must be between 1 and 2");
}
Expand Down

0 comments on commit 1ae2461

Please sign in to comment.