@Override public boolean testCondition(@Nonnull Random rand, @Nonnull LootContext context) { return context.getLootedEntity() instanceof EntityDoppleganger && context.getKillerPlayer() == ((EntityDoppleganger) context.getLootedEntity()).trueKiller; }
@Nonnull @Override public ItemStack apply(@Nonnull ItemStack stack, @Nonnull Random rand, @Nonnull LootContext context) { if (context.getKillerPlayer() != null) { ((ItemRelic) ModItems.dice).bindToUUID(context.getKillerPlayer().getUniqueID(), stack); } return stack; }
@Override public boolean testCondition(Random rand, LootContext context) { return context.getLootedEntity() != null && CalendarHelper.isBetween(context.getLootedEntity().world, from, to); }
@Override public ItemStack apply(ItemStack stack, Random rand, LootContext context) { int id = context.getWorld().getUniqueDataId("map"); stack.setItemDamage(id); stack.setTranslatableName("quarkmisc.buried_chest_map"); NBTTagCompound cmp = ItemNBTHelper.getCompound(stack, "display", false); cmp.setInteger("MapColor", 0x8C0E0E); ItemNBTHelper.setCompound(stack, "display", cmp); ItemNBTHelper.setBoolean(stack, TAG_TREASURE_MAP_DELEGATE, true); return stack; }
@Override public boolean testCondition(Random rand, LootContext context) { if (context.getKillerPlayer() instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) context.getKillerPlayer(); return HFTrackers.getCalendar(player.world).getDate().getSeason() == season; } return false; }
public abstract boolean testCondition(World world, BlockPos pos); }
@Override public boolean testCondition(Random rand, LootContext context) { if (context.getKillerPlayer() instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) context.getKillerPlayer(); return testFloor(MiningHelper.getFloor(player.world.getChunkFromBlockCoords(new BlockPos(player)).xPosition, (int) player.posY)); } return false; }
@Override public ItemStack apply(ItemStack stack, Random rand, LootContext context) { Entity e = context.getLootedEntity(); if (e instanceof IAdjustableLevel) { int l = ((IAdjustableLevel) e).getLevel(); if (max != -1) { l = Math.min(max, l); } stack.setItemDamage(l); } return stack; }
@Override public boolean testCondition(Random rand, LootContext context) { if (context.getKillerPlayer() instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer)context.getKillerPlayer(); ItemStack held = player.getHeldItemMainhand(); if (held != null && held.getItem() == HFFishing.FISHING_ROD) { return HFFishing.FISHING_ROD.getTier(held).getToolLevel() >= level; } } return false; }
public ItemStack apply(ItemStack stack, Random rand, LootContext context) { if (!stack.isEmpty() && context.getLootedEntity() instanceof EntityDragonBase) { Random random = new Random(); EntityDragonBase dragon = (EntityDragonBase)context.getLootedEntity(); if(stack.getItem() == ModItems.dragonbone){ stack.setCount(1 + random.nextInt(1 + (dragon.getAgeInDays() / 25)));
public ItemStack apply(ItemStack stack, Random rand, LootContext context) { if (context.getKillerPlayer() instanceof EntityPlayer && stack.getItem() == HFFishing.FISH) { EntityPlayer player = (EntityPlayer)context.getKillerPlayer(); ItemStack held = player.getHeldItemMainhand(); if (held != null && held.getItem() == HFFishing.FISHING_ROD) { return applyFishSizeData(rand, held, stack); } } return stack; }
@Override @SuppressWarnings("ConstantConditions") public boolean testCondition(Random rand, LootContext context) { EntityPlayer player = context.getKillerPlayer() instanceof EntityPlayer ? ((EntityPlayer)context.getKillerPlayer()) : null; if (player != null && player.getHeldItemMainhand() != null) { FishingRod rod = FishingAPI.INSTANCE.getFishingRodFromStack(player.getHeldItemMainhand()); if (rod != null) { return contains(rod.getBestSizes()) ? rand.nextDouble() < 0.75D : rand.nextDouble() < 0.4D; } return false; } return false; }
@Override @SuppressWarnings("ConstantConditions") public boolean testCondition(Random rand, LootContext context) { EntityPlayer player = context.getKillerPlayer() instanceof EntityPlayer ? ((EntityPlayer)context.getKillerPlayer()) : null; if (player != null && player.getHeldItemMainhand() != null) { FishingRod rod = FishingAPI.INSTANCE.getFishingRodFromStack(player.getHeldItemMainhand()); if (rod != null) { return rod.getStrength() >= strength; } return false; } return false; }
@Override public boolean testCondition(Random rand, LootContext context) { Entity player = context.getKillerPlayer(); if (player instanceof EntityPlayer) { ItemStack active = ((EntityPlayer) player).getHeldItemMainhand(); if (!active.isEmpty() && active.getItem() instanceof ItemStake) { return true; } } return false; }
@Override public boolean testCondition(Random rand, LootContext context) { EntityPlayer player = (EntityPlayer) context.getKillerPlayer(); return player != null && HFTrackers.getPlayerTrackerFromPlayer(player).getTracking().hasObtainedItem(stack); }