Skip to content

Commit 9a2e689

Browse files
Add ZERO room as a valid Gallifrey trade disk if enabled in config
1 parent b0ff781 commit 9a2e689

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/me/eccentric_nz/TARDIS/planets/GallifreyBlueprintTrade.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@ public void setTrades(Merchant villager) {
5454
}
5555

5656
public MerchantRecipe getRoom() {
57-
// room blueprint index 0 and 1 are not rooms, and the last index is the zero room which can't be grown with ARS
58-
BlueprintRoom bpr = BlueprintRoom.values()[TARDISConstants.RANDOM.nextInt(2, BlueprintRoom.values().length - 1)];
57+
// room blueprint index 0 is not a room, and the last index is the zero room which is a special case (requires config option)
58+
int index = plugin.getConfig().getBoolean("allow.zero_room") ? 0 : 1;
59+
BlueprintRoom bpr = BlueprintRoom.values()[TARDISConstants.RANDOM.nextInt(2, BlueprintRoom.values().length - index)];
5960
// get the blueprint item stack
6061
ItemStack ris = buildResult(bpr.getPermission(), bpr.toString());
6162
// single use?

0 commit comments

Comments
 (0)