mirror of
https://github.com/GTNewHorizons/IguanaTweaksTConstruct.git
synced 2026-10-26 14:24:06 +00:00
do not add back gravel if there is no gravel nor flint (#12)
This commit is contained in:
1 parent
318b87fdb3
commit
2429349e7b
1 file changed
+6
-4
@@ -17,15 +17,17 @@ public class FlintHandler {
|
||||
// remove flint drop
|
||||
if (event.block != null && event.block == Blocks.gravel) {
|
||||
ListIterator<ItemStack> iter = event.drops.listIterator();
|
||||
boolean hasGravel = false;
|
||||
boolean removedFlint = false;
|
||||
while (iter.hasNext()) {
|
||||
Item item = iter.next().getItem();
|
||||
if (item == Items.flint) iter.remove();
|
||||
else if (item == Item.getItemFromBlock(Blocks.gravel)) hasGravel = true;
|
||||
if (item == Items.flint) {
|
||||
iter.remove();
|
||||
removedFlint = true;
|
||||
}
|
||||
}
|
||||
|
||||
// ensure that gravel drops
|
||||
if (!hasGravel) event.drops.add(new ItemStack(Blocks.gravel));
|
||||
if (removedFlint) event.drops.add(new ItemStack(Blocks.gravel));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user