use of org.cubeengine.module.itemduct.data.DuctDataBuilder in project modules-extra by CubeEngine.
the class ItemDuctManager method setup.
public void setup(PluginContainer plugin, ItemductConfig config) {
if (!this.init) {
DataRegistration.<DuctData, ImmutableDuctData>builder().dataClass(DuctData.class).immutableClass(ImmutableDuctData.class).builder(new DuctDataBuilder()).manipulatorId("duct").dataName("CubeEngine ItemDuct Data").buildAndRegister(plugin);
DuctData.FILTERS.getQuery();
Ingredient hopper = Ingredient.of(ItemTypes.HOPPER);
activatorItem = ItemStack.of(ItemTypes.HOPPER, 1);
activatorItem.offer(Keys.ITEM_ENCHANTMENTS, singletonList(Enchantment.builder().type(EnchantmentTypes.LOOTING).level(1).build()));
activatorItem.offer(Keys.DISPLAY_NAME, Text.of(TextColors.GOLD, "ItemDuct Activator"));
activatorItem.offer(Keys.HIDE_ENCHANTMENTS, true);
activatorItem.offer(new DuctData(config.activatorUses));
activatorItem.offer(Keys.ITEM_LORE, Collections.singletonList(Text.of("Uses: ", config.activatorUses)));
this.recipe = CraftingRecipe.shapedBuilder().rows().row(hopper, hopper, hopper).row(hopper, Ingredient.of(ItemTypes.DIAMOND), hopper).row(hopper, hopper, hopper).result(activatorItem.copy()).build("ItemDuctActivator", plugin);
Sponge.getRegistry().getCraftingRecipeRegistry().register(this.recipe);
activatorItem.offer(new DuctData(config.superActivatorUses));
activatorItem.offer(Keys.ITEM_LORE, Collections.singletonList(Text.of("Uses: Infinite")));
activatorItem.offer(Keys.DISPLAY_NAME, Text.of(TextColors.GOLD, "ItemDuct Super Activator"));
this.superRecipe = CraftingRecipe.shapedBuilder().rows().row(hopper, hopper, hopper).row(hopper, Ingredient.of(ItemTypes.NETHER_STAR), hopper).row(hopper, hopper, hopper).result(activatorItem.copy()).build("ItemDuctSuperActivator", plugin);
Sponge.getRegistry().getCraftingRecipeRegistry().register(this.superRecipe);
}
this.reload(config);
this.init = true;
}
Aggregations