@Override public void apply(@Nonnull CapturedMob mob) { list.add(mob.toStack(BlockPoweredSpawner.this, 0, 1)); } });
public @Nonnull ItemStack createVesselWithEntityStub(ResourceLocation entityId) { CapturedMob capturedMob = CapturedMob.create(entityId); if (capturedMob == null) { return Prep.getEmpty(); } return capturedMob.toStack(this, 1, 1); }
public @Nonnull ItemStack createVesselWithEntity(Entity entity) { CapturedMob capturedMob = CapturedMob.create(entity); if (capturedMob == null) { return Prep.getEmpty(); } return capturedMob.toStack(this, 1, 1); }
@Override @Nonnull public ItemStack apply(@Nonnull ItemStack output, @Nonnull CapturedMob mobType) { return mobType.toStack(output.getItem(), output.getItemDamage(), output.getCount()); } },
@SuppressWarnings("null") @Override public void getSubItems(@Nonnull CreativeTabs tab, @Nonnull NonNullList<ItemStack> list) { if (tab == getCreativeTab()) { list.add(CapturedMob.create(new ResourceLocation("minecraft", "chicken")).toStack(this, 0, 1)); } else if (tab == EnderIOTab.tabEnderIOMobs) { for (CapturedMob capturedMob : CapturedMob.getAllSouls()) { list.add(capturedMob.toStack(this, 0, 1)); } } }
@Override public void getSubItems(@Nonnull CreativeTabs tab, @Nonnull NonNullList<ItemStack> list) { if (tab == getCreativeTab()) { super.getSubItems(tab, list); } else if (tab == EnderIOTab.tabEnderIOMobs) { for (CapturedMob capturedMob : CapturedMob.getAllSouls()) { list.add(capturedMob.toStack(this, 1, 1)); } } }
protected @Nonnull ItemStack getDrop(@Nonnull IBlockAccess world, @Nonnull BlockPos pos) { CapturedMob mobType = getMobType(world, pos); ItemStack drop = mobType != null ? mobType.toStack(Item.getItemFromBlock(this), getMetaForStack(world, pos), 1) : new ItemStack(Item.getItemFromBlock(this), 1, getMetaForStack(world, pos)); PaintUtil.setSourceBlock(drop, getPaintSource(world.getBlockState(pos), world, pos)); return drop; }
@SuppressWarnings("null") @Override @SideOnly(Side.CLIENT) public void getSubBlocks(@Nonnull CreativeTabs tab, @Nonnull NonNullList<ItemStack> list) { super.getSubBlocks(tab, list); if (SpawnerConfig.poweredSpawnerAddAllMobsCreative.get()) { CapturedMob.getAllSouls().apply(new Callback<CapturedMob>() { @Override public void apply(@Nonnull CapturedMob mob) { list.add(mob.toStack(BlockPoweredSpawner.this, 0, 1)); } }); } else { list.add(CapturedMob.create(new ResourceLocation("enderman")).toStack(this, 0, 1)); list.add(CapturedMob.create(new ResourceLocation("chicken")).toStack(this, 0, 1)); list.add(CapturedMob.create(new ResourceLocation("skeleton")).toStack(this, 0, 1)); list.add(CapturedMob.create(new ResourceLocation("wither_skeleton")).toStack(this, 0, 1)); list.add(CapturedMob.create(new ResourceLocation("stray")).toStack(this, 0, 1)); } }
public @Nonnull ItemStack toGenericStack(@Nonnull Item item, int meta, int amount) { NBTTagCompound data = new NBTTagCompound(); if (isUnspawnable(entityId)) { return toStack(item, meta, amount); } data.setString(ENTITY_ID_KEY, entityId.toString()); if (item == itemSoulVial.getItem() && customName == null && PIG.equals(entityId) && Math.random() < 0.01) { data.setString(CUSTOM_NAME_KEY, Lang.EASTER_PIGGY.get()); } ItemStack stack = new ItemStack(item, amount, meta); stack.setTagCompound(data); return stack; }
@Override public void getIngredients(@Nonnull IIngredients ingredients) { final ItemStack outputStack = recipe.getOutputStack(); final List<ResourceLocation> supportedSouls = recipe.getSupportedSouls(); final ItemStack inputStack = recipe.getInputStack(); final List<ItemStack> inputItemList = new NNList<>(); if (Prep.isValid(inputStack)) { inputItemList.add(inputStack); if (itemBrokenSpawner.getItem() == inputStack.getItem()) { // a Broken Spawner on the input side always means "any kind of", so put any kind of broken spawner into the input list. Skip the same type as the // output, that would be a wasteful NOP recipe CapturedMob resultMob = CapturedMob.create(outputStack); for (CapturedMob soul : CapturedMob.getAllSouls()) { if (resultMob == null || !resultMob.isSameType(soul)) { inputItemList.add(soul.toStack(itemBrokenSpawner.getItemNN(), 0, 1)); } } } } NNList<CapturedMob> souls = CapturedMob.getSouls(supportedSouls); final List<ItemStack> soulStacks = new ArrayList<ItemStack>(); final List<ItemStack> outputs = new ArrayList<ItemStack>(); for (CapturedMob soul : souls) { soulStacks.add(soul.toStack(itemSoulVial.getItemNN(), 1, 1)); outputs.add(recipe.getOutputStack(inputStack, soul)); } ingredients.setInputLists(ItemStack.class, new NNList<List<ItemStack>>(soulStacks, inputItemList)); ingredients.setOutputLists(ItemStack.class, new NNList<List<ItemStack>>(Collections.singletonList(new ItemStack(itemSoulVial.getItemNN())), outputs)); ingredients.setInput(EnergyIngredient.class, new EnergyIngredient(recipe.getEnergyRequired())); }
if (entity.isDead) { stack.shrink(1); secondaryResult = capturedMob.toStack(ItemSoulVial.this, 1, 1); break;
ItemStack capturedMobVessel = capturedMob.toStack(this, 1, 1);
final CapturedMob capturedMob = CapturedMob.create(entityName); if (capturedMob != null) { evt.getDrops().add(capturedMob.toStack(ModObject.itemBrokenSpawner.getItemNN(), 0, 1));
final CapturedMob capturedMob = CapturedMob.create(entityName); if (capturedMob != null) { ItemStack drop = capturedMob.toStack(ModObject.itemBrokenSpawner.getItemNN(), 0, 1); dropCache.put(evt.getPos().toImmutable(), drop);