Merge remote-tracking branch 'remotes/origin/1.15' into 1.16

# Conflicts:
#	build.gradle
#	src/main/java/techreborn/init/ModLoot.java
This commit is contained in:
modmuss50 2020-06-01 22:25:00 +01:00
commit bbc4b2b765
4 changed files with 39 additions and 12 deletions

View file

@ -48,7 +48,8 @@ public class ModLoot {
LootEntry advancedalloyIngot = makeEntry(Ingots.ADVANCED_ALLOY);
LootEntry basicFrame = makeEntry(TRContent.MachineBlocks.BASIC.frame.asItem());
LootEntry basicCircuit = makeEntry(Parts.ELECTRONIC_CIRCUIT);
LootEntry rubberSapling = makeEntry(TRContent.RUBBER_SAPLING, 25);
LootEntry aluminumIngot = makeEntry(Ingots.ALUMINUM);
LootEntry electrumIngot = makeEntry(Ingots.ELECTRUM);
LootEntry invarIngot = makeEntry(Ingots.INVAR);
@ -73,7 +74,7 @@ public class ModLoot {
LootPool poolBasic = FabricLootPoolBuilder.builder().withEntry(copperIngot).withEntry(tinIngot)
.withEntry(leadIngot).withEntry(silverIngot).withEntry(refinedronIngot).withEntry(advancedalloyIngot)
.withEntry(basicFrame).withEntry(basicCircuit).rolls(UniformLootTableRange.between(1.0f, 2.0f))
.withEntry(basicFrame).withEntry(basicCircuit).withEntry(rubberSapling).rolls(UniformLootTableRange.between(1.0f, 2.0f))
.build();
LootPool poolAdvanced = FabricLootPoolBuilder.builder().withEntry(aluminumIngot).withEntry(electrumIngot)
@ -137,8 +138,18 @@ public class ModLoot {
* @return LootEntry for item provided
*/
private static LootEntry makeEntry(ItemConvertible item) {
return makeEntry(item, 5);
}
return ItemEntry.builder(item).weight(5)
/**
* Makes loot entry from item provided with weight provided
*
* @param item Item to include into LootEntry
* @param weight Weight of that item
* @return LootEntry for item and weight provided
*/
private static LootEntry makeEntry(ItemConvertible item, int weight){
return ItemEntry.builder(item).weight(weight)
.apply(SetCountLootFunction.builder(UniformLootTableRange.between(1.0f, 2.0f))).build();
}