Program: 174631
Project: 174631
Buggy source:
/** 
 * Returns a randomly generated ItemStack based on the tier of the monster.
 * @return
 */
private ItemStack getRandomWeapon(){
  EnemyInfo enemyInfo=(EnemyInfo)this.getCapability(CapabilityEnemyInfo.ENEMY_INFO,null);
  if (enemyInfo != null) {
    CustomLootContext context=new CustomLootContext.Builder(this.getServer().getWorld(this.dimension)).withChestPos(this.getPosition()).build();
    ItemStack stack=null;
    if (enemyInfo.getEnemyTier() == 1) {
      CustomLootTable commonTable=(CustomLootTable)this.world.getLootTableManager().getLootTableFromLocation(new ResourceLocation(Reference.MODID,"String_Node_Str"));
      List<ItemStack> items=commonTable.generateLootForPools(this.rand,context);
      stack=items.get(0);
    }
 else     if (enemyInfo.getEnemyTier() == 2) {
      CustomLootTable uncommonTable=(CustomLootTable)this.world.getLootTableManager().getLootTableFromLocation(new ResourceLocation(Reference.MODID,"String_Node_Str"));
      List<ItemStack> items=uncommonTable.generateLootForPools(this.rand,context);
      stack=items.get(0);
    }
 else     if (enemyInfo.getEnemyTier() == 3) {
      CustomLootTable rareTable=(CustomLootTable)this.world.getLootTableManager().getLootTableFromLocation(new ResourceLocation(Reference.MODID,"String_Node_Str"));
      List<ItemStack> items=rareTable.generateLootForPools(this.rand,context);
      stack=items.get(0);
    }
 else     if (enemyInfo.getEnemyTier() == 4) {
      CustomLootTable epicTable=(CustomLootTable)this.world.getLootTableManager().getLootTableFromLocation(new ResourceLocation(Reference.MODID,"String_Node_Str"));
      List<ItemStack> items=epicTable.generateLootForPools(this.rand,context);
      stack=items.get(0);
    }
 else     if (enemyInfo.getEnemyTier() == 5) {
      CustomLootTable legendaryTable=(CustomLootTable)this.world.getLootTableManager().getLootTableFromLocation(new ResourceLocation(Reference.MODID,"String_Node_Str"));
      List<ItemStack> items=legendaryTable.generateLootForPools(this.rand,context);
      stack=items.get(0);
    }
    if (stack != null) {
      NBTTagCompound nbt=NBTHelper.loadStackNBT(stack);
      ItemGenerator.create(stack,nbt,world,nbt.getInteger("String_Node_Str"));
      stack.setTagCompound(nbt);
      NameGenerator.generateName(stack,nbt);
      return stack;
    }
  }
  LootSlashConquer.LOGGER.info("String_Node_Str");
  return null;
}

Fixed version (ground truth):
/** 
 * Returns a randomly generated ItemStack based on the tier of the monster.
 * @return
 */
private ItemStack getRandomWeapon(){
  EnemyInfo enemyInfo=(EnemyInfo)this.getCapability(CapabilityEnemyInfo.ENEMY_INFO,null);
  if (enemyInfo != null) {
    LootContext context=new LootContext.Builder(this.getServer().getWorld(this.dimension)).withLootedEntity(this).build();
    ItemStack stack=null;
    if (enemyInfo.getEnemyTier() == 1) {
      LootTable commonTable=this.world.getLootTableManager().getLootTableFromLocation(new ResourceLocation(Reference.MODID,"String_Node_Str"));
      List<ItemStack> items=commonTable.generateLootForPools(this.rand,context);
      stack=items.get(0);
    }
 else     if (enemyInfo.getEnemyTier() == 2) {
      LootTable uncommonTable=this.world.getLootTableManager().getLootTableFromLocation(new ResourceLocation(Reference.MODID,"String_Node_Str"));
      List<ItemStack> items=uncommonTable.generateLootForPools(this.rand,context);
      stack=items.get(0);
    }
 else     if (enemyInfo.getEnemyTier() == 3) {
      LootTable rareTable=this.world.getLootTableManager().getLootTableFromLocation(new ResourceLocation(Reference.MODID,"String_Node_Str"));
      List<ItemStack> items=rareTable.generateLootForPools(this.rand,context);
      stack=items.get(0);
    }
 else     if (enemyInfo.getEnemyTier() == 4) {
      LootTable epicTable=this.world.getLootTableManager().getLootTableFromLocation(new ResourceLocation(Reference.MODID,"String_Node_Str"));
      List<ItemStack> items=epicTable.generateLootForPools(this.rand,context);
      stack=items.get(0);
    }
 else     if (enemyInfo.getEnemyTier() == 5) {
      LootTable legendaryTable=this.world.getLootTableManager().getLootTableFromLocation(new ResourceLocation(Reference.MODID,"String_Node_Str"));
      List<ItemStack> items=legendaryTable.generateLootForPools(this.rand,context);
      stack=items.get(0);
    }
    if (stack != null) {
      NBTTagCompound nbt=NBTHelper.loadStackNBT(stack);
      ItemGenerator.create(stack,nbt,world,nbt.getInteger("String_Node_Str"));
      stack.setTagCompound(nbt);
      NameGenerator.generateName(stack,nbt);
      return stack;
    }
  }
  return null;
}