use of betterwithaddons.crafting.recipes.NetRecipe in project BetterWithAddons by DaedalusGame.
the class FireNet method add.
@ZenMethod
public static void add(IItemStack[] outputs, @NotNull IIngredient input) {
NetRecipe r = new NetRecipe(BlockNettedScreen.SifterType.FIRE, new IngredientCraftTweaker(input), 0, CraftTweakerMC.getItemStacks(outputs));
CraftTweaker.LATE_ACTIONS.add(new Add(r));
}
use of betterwithaddons.crafting.recipes.NetRecipe in project BetterWithAddons by DaedalusGame.
the class WaterNet method add.
@ZenMethod
public static void add(IItemStack[] outputs, @NotNull IIngredient input) {
NetRecipe r = new NetRecipe(BlockNettedScreen.SifterType.WATER, new IngredientCraftTweaker(input), 0, CraftTweakerMC.getItemStacks(outputs));
CraftTweaker.LATE_ACTIONS.add(new Add(r));
}
use of betterwithaddons.crafting.recipes.NetRecipe in project BetterWithAddons by DaedalusGame.
the class TileEntityNettedScreen method captureDroppedItems.
private boolean captureDroppedItems() {
List<EntityItem> items = this.getCaptureItems(world, pos);
if (items.size() > 0) {
for (EntityItem item : items) {
ItemStack stack = item.getItem();
if (stack.getItem() == Item.getItemFromBlock(Blocks.SAND))
handleSandCase(item);
}
CraftingManagerNet manager = getCraftingManager(getSifterType());
if (manager != null) {
NetRecipe recipe = manager.getMostValidRecipe(items, getSandCount());
if (recipe != null) {
List<ItemStack> ret = recipe.getOutput();
if (ret != null && ret.size() > 0) {
ItemUtil.consumeItem(items, recipe.input);
world.playSound(null, pos.getX(), pos.getY(), pos.getZ(), SoundEvents.ENTITY_ITEM_PICKUP, SoundCategory.PLAYERS, 0.2F, ((world.rand.nextFloat() - world.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
for (int i = 0; i < ret.size(); i++) {
ItemStack item = ret.get(i);
if (item.isEmpty())
continue;
EntityItem result = new EntityItem(world, pos.getX() + 0.5f, pos.getY() + (i % 2 == 0 ? 1.2f : -0.5f), pos.getZ() + 0.5f, item.copy());
result.setDefaultPickupDelay();
if (!world.isRemote) {
world.spawnEntity(result);
}
}
if (recipe.getSandRequired() > 0)
increaseSandCount(-recipe.getSandRequired());
return true;
}
}
}
}
return false;
}
use of betterwithaddons.crafting.recipes.NetRecipe in project BetterWithAddons by DaedalusGame.
the class SandNet method add.
@ZenMethod
public static void add(IItemStack[] outputs, @NotNull IIngredient input, int sand) {
NetRecipe r = new NetRecipe(BlockNettedScreen.SifterType.SAND, new IngredientCraftTweaker(input), sand, CraftTweakerMC.getItemStacks(outputs));
CraftTweaker.LATE_ACTIONS.add(new Add(r));
}
Aggregations