mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-26 15:03:03 +00:00
Fix thermalilies not dropping with cooldown tag, combine other CopyNBT functions into one
This commit is contained in:
1 parent
c75abe2562
commit
b647196006
9 files changed
+39
-45
No files matched your search
@@ -24,13 +24,7 @@
|
||||
"source": "lastFood",
|
||||
"target": "BlockEntityTag.lastFood",
|
||||
"op": "replace"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"function": "minecraft:copy_nbt",
|
||||
"source": "block_entity",
|
||||
"ops": [
|
||||
},
|
||||
{
|
||||
"source": "lastFoodCount",
|
||||
"target": "BlockEntityTag.lastFoodCount",
|
||||
|
||||
@@ -24,13 +24,7 @@
|
||||
"source": "cooldown",
|
||||
"target": "BlockEntityTag.cooldown",
|
||||
"op": "replace"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"function": "minecraft:copy_nbt",
|
||||
"source": "block_entity",
|
||||
"ops": [
|
||||
},
|
||||
{
|
||||
"source": "passiveDecayTicks",
|
||||
"target": "BlockEntityTag.passiveDecayTicks",
|
||||
|
||||
@@ -24,13 +24,7 @@
|
||||
"source": "lastFlower",
|
||||
"target": "BlockEntityTag.lastFlower",
|
||||
"op": "replace"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"function": "minecraft:copy_nbt",
|
||||
"source": "block_entity",
|
||||
"ops": [
|
||||
},
|
||||
{
|
||||
"source": "lastFlowerTimes",
|
||||
"target": "BlockEntityTag.lastFlowerTimes",
|
||||
|
||||
@@ -14,6 +14,19 @@
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
],
|
||||
"functions": [
|
||||
{
|
||||
"function": "minecraft:copy_nbt",
|
||||
"source": "block_entity",
|
||||
"ops": [
|
||||
{
|
||||
"source": "cooldown",
|
||||
"target": "BlockEntityTag.cooldown",
|
||||
"op": "replace"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -24,13 +24,7 @@
|
||||
"source": "lastFood",
|
||||
"target": "BlockEntityTag.lastFood",
|
||||
"op": "replace"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"function": "minecraft:copy_nbt",
|
||||
"source": "block_entity",
|
||||
"ops": [
|
||||
},
|
||||
{
|
||||
"source": "lastFoodCount",
|
||||
"target": "BlockEntityTag.lastFoodCount",
|
||||
|
||||
@@ -24,13 +24,7 @@
|
||||
"source": "cooldown",
|
||||
"target": "BlockEntityTag.cooldown",
|
||||
"op": "replace"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"function": "minecraft:copy_nbt",
|
||||
"source": "block_entity",
|
||||
"ops": [
|
||||
},
|
||||
{
|
||||
"source": "passiveDecayTicks",
|
||||
"target": "BlockEntityTag.passiveDecayTicks",
|
||||
|
||||
@@ -24,13 +24,7 @@
|
||||
"source": "lastFlower",
|
||||
"target": "BlockEntityTag.lastFlower",
|
||||
"op": "replace"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"function": "minecraft:copy_nbt",
|
||||
"source": "block_entity",
|
||||
"ops": [
|
||||
},
|
||||
{
|
||||
"source": "lastFlowerTimes",
|
||||
"target": "BlockEntityTag.lastFlowerTimes",
|
||||
|
||||
@@ -14,6 +14,19 @@
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
],
|
||||
"functions": [
|
||||
{
|
||||
"function": "minecraft:copy_nbt",
|
||||
"source": "block_entity",
|
||||
"ops": [
|
||||
{
|
||||
"source": "cooldown",
|
||||
"target": "BlockEntityTag.cooldown",
|
||||
"op": "replace"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -109,6 +109,8 @@ public class BlockLootProvider implements IDataProvider {
|
||||
functionTable.put(ModSubtiles.rafflowsiaFloating, b -> genCopyNbt(b, SubTileRafflowsia.TAG_LAST_FLOWER, SubTileRafflowsia.TAG_LAST_FLOWER_TIMES));
|
||||
functionTable.put(ModSubtiles.spectrolus, b -> genCopyNbt(b, SubTileSpectrolus.TAG_NEXT_COLOR));
|
||||
functionTable.put(ModSubtiles.spectrolusFloating, b -> genCopyNbt(b, SubTileSpectrolus.TAG_NEXT_COLOR));
|
||||
functionTable.put(ModSubtiles.thermalily, b -> genCopyNbt(b, SubTileHydroangeas.TAG_COOLDOWN));
|
||||
functionTable.put(ModSubtiles.thermalilyFloating, b -> genCopyNbt(b, SubTileHydroangeas.TAG_COOLDOWN));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -138,11 +140,13 @@ public class BlockLootProvider implements IDataProvider {
|
||||
|
||||
private static LootTable.Builder genCopyNbt(Block b, String... tags) {
|
||||
LootEntry.Builder<?> entry = ItemLootEntry.builder(b);
|
||||
LootPool.Builder pool = LootPool.builder().name("main").rolls(ConstantRange.of(1)).addEntry(entry)
|
||||
.acceptCondition(SurvivesExplosion.builder());
|
||||
CopyNbt.Builder func = CopyNbt.func_215881_a(CopyNbt.Source.BLOCK_ENTITY);
|
||||
for (String tag : tags) {
|
||||
pool = pool.acceptFunction(CopyNbt.func_215881_a(CopyNbt.Source.BLOCK_ENTITY).func_216056_a(tag, "BlockEntityTag." + tag));
|
||||
func = func.func_216056_a(tag, "BlockEntityTag." + tag);
|
||||
}
|
||||
LootPool.Builder pool = LootPool.builder().name("main").rolls(ConstantRange.of(1)).addEntry(entry)
|
||||
.acceptCondition(SurvivesExplosion.builder())
|
||||
.acceptFunction(func);
|
||||
return LootTable.builder().addLootPool(pool);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user