Skip to content

Commit 3381b5c

Browse files
committed
Added missing loot barrel textures. Implements #13
1 parent bead11a commit 3381b5c

14 files changed

+22
-18
lines changed

src/main/java/de/dafuqs/lootcrates/PredefinedLootBagsItemGroup.java

+6-4
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@ public void appendStacks(@NotNull DefaultedList<ItemStack> stacks) {
4949

5050
for(Item lootBagItem : allLootBags) {
5151
for (Identifier lootTable : allLootTables) {
52-
NbtCompound compound = LootBagItem.getItemCompoundTag(lootTable, 0);
53-
ItemStack itemStack = new ItemStack(lootBagItem);
54-
itemStack.setNbt(compound);
55-
stacks.add(itemStack);
52+
if(!lootTable.getPath().contains("entities")) { // to reduce the lists size a bit
53+
NbtCompound compound = LootBagItem.getItemCompoundTag(lootTable, 0);
54+
ItemStack itemStack = new ItemStack(lootBagItem);
55+
itemStack.setNbt(compound);
56+
stacks.add(itemStack);
57+
}
5658
}
5759
}
5860

src/main/java/de/dafuqs/lootcrates/PredefinedLootCratesItemGroup.java

+16-14
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,23 @@ private ArrayList<ItemStack> getPredefinedLootCrates() {
5656

5757
for(Item lootCrateItem : allLootCrates) {
5858
for (Identifier lootTable : allLootTables) {
59-
for (Long replenishTimeTicks : replenishTimeTicksValues) {
60-
for (boolean locked : booleans) {
61-
for (boolean trapped : booleans) {
62-
for (boolean doNotConsumeKeyOnUnlock : booleans) {
63-
for (boolean oncePerPlayer : booleans) {
64-
if (oncePerPlayer && replenishTimeTicks < 0) {
65-
// oncePerPlayer really is only useful when replenish time is positive
66-
} else {
67-
if (doNotConsumeKeyOnUnlock && !locked) {
68-
// no use in that tag when there is no lock, is there?
59+
if(!lootTable.getPath().contains("entities")) { // to reduce the lists size a bit
60+
for (Long replenishTimeTicks : replenishTimeTicksValues) {
61+
for (boolean locked : booleans) {
62+
for (boolean trapped : booleans) {
63+
for (boolean doNotConsumeKeyOnUnlock : booleans) {
64+
for (boolean oncePerPlayer : booleans) {
65+
if (oncePerPlayer && replenishTimeTicks < 0) {
66+
// oncePerPlayer really is only useful when replenish time is positive
6967
} else {
70-
NbtCompound compound = LootCrateItem.getLootCrateItemCompoundTag(lootTable, locked, doNotConsumeKeyOnUnlock, replenishTimeTicks, 0, oncePerPlayer, trapped);
71-
ItemStack itemStack = new ItemStack(lootCrateItem);
72-
itemStack.setNbt(compound);
73-
stacks.add(itemStack);
68+
if (doNotConsumeKeyOnUnlock && !locked) {
69+
// no use in that tag when there is no lock, is there?
70+
} else {
71+
NbtCompound compound = LootCrateItem.getLootCrateItemCompoundTag(lootTable, locked, doNotConsumeKeyOnUnlock, replenishTimeTicks, 0, oncePerPlayer, trapped);
72+
ItemStack itemStack = new ItemStack(lootCrateItem);
73+
itemStack.setNbt(compound);
74+
stacks.add(itemStack);
75+
}
7476
}
7577
}
7678
}
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)