Skip to content

Commit

Permalink
Workaround for not always catching something in The End. Closes #208
Browse files Browse the repository at this point in the history
  • Loading branch information
GirafiStudios committed Feb 11, 2021
1 parent 055414f commit 417011d
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,16 @@ public int handleHookRetraction(@Nonnull ItemStack stack) {
builder.withParameter(LootParameters.KILLER_ENTITY, angler).withParameter(LootParameters.THIS_ENTITY, this);

List<ItemStack> lootEntries = getLoot(builder, serverWorld);

if (lootEntries.isEmpty()) {
if (!this.world.isAirBlock(this.getPosition())) {
ResourceLocation biomeFromRegistry = this.world.func_241828_r().getRegistry(Registry.BIOME_KEY).getKey(this.world.getBiome(this.getPosition()));
if (biomeFromRegistry != null) {
Aquaculture.LOG.error("Loot was empty in Biome: " + biomeFromRegistry + ". Please report on Github");
if (this.world.getDimensionKey() == World.THE_END) {
lootEntries.add(new ItemStack(AquaItems.FISH_BONES));
} else {
if (!this.world.isAirBlock(this.getPosition()) && (this.world.getFluidState(this.getPosition()).isSource())) {
ResourceLocation biomeFromRegistry = this.world.func_241828_r().getRegistry(Registry.BIOME_KEY).getKey(this.world.getBiome(this.getPosition()));
if (biomeFromRegistry != null) {
Aquaculture.LOG.error("Loot was empty in Biome: " + biomeFromRegistry + ". Please report on Github");
}
}
}
}
Expand Down Expand Up @@ -477,4 +482,4 @@ public void writeSpawnData(PacketBuffer buffer) {
@Override
public void readSpawnData(PacketBuffer additionalData) {
}
}
}

0 comments on commit 417011d

Please sign in to comment.