Continue mapping migration

This commit is contained in:
Aleksey 2021-04-12 21:38:22 +03:00
parent 99ade39404
commit f03fd03bd0
499 changed files with 12567 additions and 12723 deletions

View file

@ -2,11 +2,11 @@ package ru.betterend.util;
import net.fabricmc.fabric.api.loot.v1.FabricLootPoolBuilder;
import net.fabricmc.fabric.api.loot.v1.event.LootTableLoadingCallback;
import net.minecraft.world.item.Items;
import net.minecraft.loot.UniformLootTableRange;
import net.minecraft.loot.condition.RandomChanceLootCondition;
import net.minecraft.loot.entry.ItemEntry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.storage.loot.RandomValueBounds;
import net.minecraft.world.level.storage.loot.entries.LootItem;
import net.minecraft.world.level.storage.loot.predicates.LootItemRandomChanceCondition;
import ru.betterend.registry.EndItems;
public class LootTableUtil {
@ -16,11 +16,11 @@ public class LootTableUtil {
LootTableLoadingCallback.EVENT.register((resourceManager, lootManager, id, supplier, setter) -> {
if (END_CITY_TREASURE_ID.equals(id)) {
FabricLootPoolBuilder builder = FabricLootPoolBuilder.builder();
builder.rolls(UniformLootTableRange.between(0, 5));
builder.withCondition(RandomChanceLootCondition.builder(0.5f).build());
builder.withEntry(ItemEntry.builder(Items.GHAST_TEAR).build());
builder.withEntry(ItemEntry.builder(EndItems.MUSIC_DISC_STRANGE_AND_ALIEN).build());
supplier.pool(builder);
builder.setRolls(RandomValueBounds.between(0, 5));
builder.withCondition(LootItemRandomChanceCondition.randomChance(0.5f).build());
builder.withEntry(LootItem.lootTableItem(Items.GHAST_TEAR).build());
builder.withEntry(LootItem.lootTableItem(EndItems.MUSIC_DISC_STRANGE_AND_ALIEN).build());
supplier.withPool(builder);
}
});
}