This commit is contained in:
modmuss50 2020-05-21 23:00:12 +01:00
parent 436a66ddfa
commit 8c39008636
18 changed files with 115 additions and 122 deletions

View file

@ -73,17 +73,17 @@ public class ModLoot {
LootPool poolBasic = FabricLootPoolBuilder.builder().withEntry(copperIngot).withEntry(tinIngot)
.withEntry(leadIngot).withEntry(silverIngot).withEntry(refinedronIngot).withEntry(advancedalloyIngot)
.withEntry(basicFrame).withEntry(basicCircuit).withRolls(UniformLootTableRange.between(1.0f, 2.0f))
.withEntry(basicFrame).withEntry(basicCircuit).rolls(UniformLootTableRange.between(1.0f, 2.0f))
.build();
LootPool poolAdvanced = FabricLootPoolBuilder.builder().withEntry(aluminumIngot).withEntry(electrumIngot)
.withEntry(invarIngot).withEntry(nickelIngot).withEntry(steelIngot).withEntry(zincIngot)
.withEntry(advancedFrame).withEntry(advancedCircuit).withEntry(dataStorageChip).withRolls(UniformLootTableRange.between(1.0f, 3.0f))
.withEntry(advancedFrame).withEntry(advancedCircuit).withEntry(dataStorageChip).rolls(UniformLootTableRange.between(1.0f, 3.0f))
.build();
LootPool poolIndustrial = FabricLootPoolBuilder.builder().withEntry(chromeIngot).withEntry(iridiumIngot)
.withEntry(platinumIngot).withEntry(titaniumIngot).withEntry(tungstenIngot).withEntry(tungstensteelIngot)
.withEntry(industrialFrame).withEntry(industrialCircuit).withEntry(energyFlowChip).withRolls(UniformLootTableRange.between(1.0f, 3.0f))
.withEntry(industrialFrame).withEntry(industrialCircuit).withEntry(energyFlowChip).rolls(UniformLootTableRange.between(1.0f, 3.0f))
.build();
LootTableLoadingCallback.EVENT.register((resourceManager, lootManager, ident, supplier, setter) -> {
@ -138,8 +138,8 @@ public class ModLoot {
*/
private static LootEntry makeEntry(ItemConvertible item) {
return ItemEntry.builder(item).setWeight(5)
.withFunction(SetCountLootFunction.builder(UniformLootTableRange.between(1.0f, 2.0f))).build();
return ItemEntry.builder(item).weight(5)
.apply(SetCountLootFunction.builder(UniformLootTableRange.between(1.0f, 2.0f))).build();
}

View file

@ -38,7 +38,7 @@ import net.minecraft.util.math.BlockPointer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.Position;
import net.minecraft.world.IWorld;
import net.minecraft.world.WorldAccess;
import reborncore.common.crafting.RebornRecipe;
import techreborn.config.TechRebornConfig;
import techreborn.items.DynamicCellItem;
@ -71,7 +71,7 @@ public class TRDispenserBehavior {
DispenserBlock.registerBehavior(TRContent.CELL, new ItemDispenserBehavior(){
public ItemStack dispenseSilently(BlockPointer pointer, ItemStack stack) {
DynamicCellItem cell = (DynamicCellItem)stack.getItem();
IWorld iWorld = pointer.getWorld();
WorldAccess iWorld = pointer.getWorld();
BlockPos blockPos = pointer.getBlockPos().offset(pointer.getBlockState().get(DispenserBlock.FACING));
BlockState blockState = iWorld.getBlockState(blockPos);
Block block = blockState.getBlock();