Skip to content

Commit

Permalink
fix fishing code a bit better
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Aug 19, 2019
1 parent c6a31c8 commit 5d10b4a
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -62,7 +62,8 @@ public ItemStack getRandomReward(EntityFishingHook hook, MinecraftKey key) {
LootTableInfo.Builder playerFishEvent2 = new LootTableInfo.Builder(worldServer);
LootTableRegistry registry = hook.getWorld().getMinecraftServer().getLootTableRegistry();
// registry.getLootTable(key).getLootContextParameterSet()
LootTableInfo info = playerFishEvent2.build(LootContextParameterSets.FISHING);
LootTableInfo info = playerFishEvent2.set(LootContextParameters.POSITION, new BlockPosition(hook.locX, hook.locY, hook.locZ))
.set(LootContextParameters.TOOL, new ItemStack(Items.FISHING_ROD)).build(LootContextParameterSets.FISHING);
List<ItemStack> itemStacks = registry.getLootTable(key).populateLoot(info);
return itemStacks.get(worldServer.random.nextInt(itemStacks.size()));
}
Expand Down

0 comments on commit 5d10b4a

Please sign in to comment.