HaruhiFanClub / MCHaruhiServer

凉宫春日MC部 凉宫春日的世界服务器
GNU General Public License v3.0
2 stars 1 forks source link

[战利品表]向多个原版战利品表添加物品 #10

Closed Libellule505 closed 3 years ago

Libellule505 commented 3 years ago
  1. 添加物品:春日酱的眷顾。 注:新id god_bless_danchou_armband 旧idepic_reinforcement_stone

  2. 战利品箱子

    原版table名抽取次数rolls权重weight品质quality空权emptyweight
    abandoned_mineshaft11123
    bastion_hoglin_stable12127
    bastion_other14195
    bastion_treasure31114
    buried_treasure21114
    desert_pyramid21114
    end_city_treasure23196
    igloo_chest61114
    jungle_temple11114
    nether_bridge22296
    pillager_outpost11114
    ruined_portal11114
    shipwreck_treasure31114
    simple_dungeon31114
    stronghold_corridor43196
    underwater_ruin_big31114
    underwater_ruin_small11114
    woodland_mansion31114
  3. 猪灵以物易物

    原版table名抽取次数rolls权重weight品质quality空权emptyweight
    piglin_bartering101255
  4. 钓鱼宝藏池

    原版table名抽取次数rolls权重weight品质quality空权emptyweight
    treasure110127
bgxd9592 commented 3 years ago

猪灵以物易物的无法使用quality: 猪灵以物易物创建的 LootContext 没有使用 withLuck 方法修改 luck 属性,即 luck 属性始为默认值0。

# net.minecraft.entity.monster.piglin.PiglinTasks.getBarterResponseItems
private static List<ItemStack> getBarterResponseItems(PiglinEntity p_234524_0_) {
    LootTable loottable = p_234524_0_.level.getServer().getLootTables().get(LootTables.PIGLIN_BARTERING);
    return loottable.getRandomItems(
        (new LootContext.Builder((ServerWorld) p_234524_0_.level))
            .withParameter(LootParameters.THIS_ENTITY, p_234524_0_)
            .withRandom(p_234524_0_.level.random)
            .create(LootParameterSets.PIGLIN_BARTER)
    );
}
Libellule505 commented 3 years ago

猪灵以物易物的无法使用quality: 猪灵以物易物创建的 LootContext 没有使用 withLuck 方法修改 luck 属性,即 luck 属性始为默认值0。

# net.minecraft.entity.monster.piglin.PiglinTasks.getBarterResponseItems
private static List<ItemStack> getBarterResponseItems(PiglinEntity p_234524_0_) {
    LootTable loottable = p_234524_0_.level.getServer().getLootTables().get(LootTables.PIGLIN_BARTERING);
    return loottable.getRandomItems(
        (new LootContext.Builder((ServerWorld) p_234524_0_.level))
            .withParameter(LootParameters.THIS_ENTITY, p_234524_0_)
            .withRandom(p_234524_0_.level.random)
            .create(LootParameterSets.PIGLIN_BARTER)
    );
}