DefaultPlugin.java 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  1. /*
  2. * This file is licensed under the MIT License, part of Roughly Enough Items.
  3. * Copyright (c) 2018, 2019, 2020 shedaniel
  4. *
  5. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6. * of this software and associated documentation files (the "Software"), to deal
  7. * in the Software without restriction, including without limitation the rights
  8. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. * copies of the Software, and to permit persons to whom the Software is
  10. * furnished to do so, subject to the following conditions:
  11. *
  12. * The above copyright notice and this permission notice shall be included in all
  13. * copies or substantial portions of the Software.
  14. *
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  21. * SOFTWARE.
  22. */
  23. package me.shedaniel.rei.plugin;
  24. import com.google.common.collect.Lists;
  25. import com.google.common.collect.Maps;
  26. import it.unimi.dsi.fastutil.objects.Object2FloatMap;
  27. import me.shedaniel.math.Point;
  28. import me.shedaniel.math.Rectangle;
  29. import me.shedaniel.rei.RoughlyEnoughItemsCore;
  30. import me.shedaniel.rei.api.*;
  31. import me.shedaniel.rei.api.fluid.FluidSupportProvider;
  32. import me.shedaniel.rei.api.plugins.REIPluginV0;
  33. import me.shedaniel.rei.api.widgets.Panel;
  34. import me.shedaniel.rei.api.widgets.Tooltip;
  35. import me.shedaniel.rei.gui.RecipeViewingScreen;
  36. import me.shedaniel.rei.gui.VillagerRecipeViewingScreen;
  37. import me.shedaniel.rei.impl.ClientHelperImpl;
  38. import me.shedaniel.rei.impl.RenderingEntry;
  39. import me.shedaniel.rei.plugin.beacon.DefaultBeaconBaseCategory;
  40. import me.shedaniel.rei.plugin.beacon.DefaultBeaconBaseDisplay;
  41. import me.shedaniel.rei.plugin.blasting.DefaultBlastingDisplay;
  42. import me.shedaniel.rei.plugin.brewing.DefaultBrewingCategory;
  43. import me.shedaniel.rei.plugin.brewing.DefaultBrewingDisplay;
  44. import me.shedaniel.rei.plugin.campfire.DefaultCampfireCategory;
  45. import me.shedaniel.rei.plugin.campfire.DefaultCampfireDisplay;
  46. import me.shedaniel.rei.plugin.composting.DefaultCompostingCategory;
  47. import me.shedaniel.rei.plugin.composting.DefaultCompostingDisplay;
  48. import me.shedaniel.rei.plugin.cooking.DefaultCookingCategory;
  49. import me.shedaniel.rei.plugin.crafting.DefaultCraftingCategory;
  50. import me.shedaniel.rei.plugin.crafting.DefaultCustomDisplay;
  51. import me.shedaniel.rei.plugin.crafting.DefaultShapedDisplay;
  52. import me.shedaniel.rei.plugin.crafting.DefaultShapelessDisplay;
  53. import me.shedaniel.rei.plugin.fuel.DefaultFuelCategory;
  54. import me.shedaniel.rei.plugin.fuel.DefaultFuelDisplay;
  55. import me.shedaniel.rei.plugin.information.DefaultInformationCategory;
  56. import me.shedaniel.rei.plugin.information.DefaultInformationDisplay;
  57. import me.shedaniel.rei.plugin.smelting.DefaultSmeltingDisplay;
  58. import me.shedaniel.rei.plugin.smithing.DefaultSmithingCategory;
  59. import me.shedaniel.rei.plugin.smithing.DefaultSmithingDisplay;
  60. import me.shedaniel.rei.plugin.smoking.DefaultSmokingDisplay;
  61. import me.shedaniel.rei.plugin.stonecutting.DefaultStoneCuttingCategory;
  62. import me.shedaniel.rei.plugin.stonecutting.DefaultStoneCuttingDisplay;
  63. import me.shedaniel.rei.plugin.stripping.DefaultStrippingCategory;
  64. import me.shedaniel.rei.plugin.stripping.DefaultStrippingDisplay;
  65. import me.shedaniel.rei.plugin.stripping.DummyAxeItem;
  66. import me.shedaniel.rei.utils.CollectionUtils;
  67. import net.fabricmc.api.EnvType;
  68. import net.fabricmc.api.Environment;
  69. import net.minecraft.block.ComposterBlock;
  70. import net.minecraft.block.entity.AbstractFurnaceBlockEntity;
  71. import net.minecraft.client.MinecraftClient;
  72. import net.minecraft.client.gui.screen.ingame.*;
  73. import net.minecraft.client.gui.screen.recipebook.RecipeBookProvider;
  74. import net.minecraft.client.util.math.MatrixStack;
  75. import net.minecraft.enchantment.Enchantment;
  76. import net.minecraft.enchantment.EnchantmentHelper;
  77. import net.minecraft.fluid.Fluid;
  78. import net.minecraft.item.*;
  79. import net.minecraft.potion.PotionUtil;
  80. import net.minecraft.recipe.*;
  81. import net.minecraft.tag.BlockTags;
  82. import net.minecraft.tag.Tag;
  83. import net.minecraft.text.LiteralText;
  84. import net.minecraft.util.Identifier;
  85. import net.minecraft.util.math.MathHelper;
  86. import net.minecraft.util.registry.Registry;
  87. import org.jetbrains.annotations.NotNull;
  88. import org.jetbrains.annotations.Nullable;
  89. import java.util.*;
  90. @Environment(EnvType.CLIENT)
  91. public class DefaultPlugin implements REIPluginV0 {
  92. public static final Identifier CRAFTING = new Identifier("minecraft", "plugins/crafting");
  93. public static final Identifier SMELTING = new Identifier("minecraft", "plugins/smelting");
  94. public static final Identifier SMOKING = new Identifier("minecraft", "plugins/smoking");
  95. public static final Identifier BLASTING = new Identifier("minecraft", "plugins/blasting");
  96. public static final Identifier CAMPFIRE = new Identifier("minecraft", "plugins/campfire");
  97. public static final Identifier STONE_CUTTING = new Identifier("minecraft", "plugins/stone_cutting");
  98. public static final Identifier STRIPPING = new Identifier("minecraft", "plugins/stripping");
  99. public static final Identifier BREWING = new Identifier("minecraft", "plugins/brewing");
  100. public static final Identifier PLUGIN = new Identifier("roughlyenoughitems", "default_plugin");
  101. public static final Identifier COMPOSTING = new Identifier("minecraft", "plugins/composting");
  102. public static final Identifier FUEL = new Identifier("minecraft", "plugins/fuel");
  103. public static final Identifier SMITHING = new Identifier("minecraft", "plugins/smithing");
  104. public static final Identifier BEACON = new Identifier("minecraft", "plugins/beacon");
  105. public static final Identifier INFO = new Identifier("roughlyenoughitems", "plugins/information");
  106. private static final Identifier DISPLAY_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/display.png");
  107. private static final Identifier DISPLAY_TEXTURE_DARK = new Identifier("roughlyenoughitems", "textures/gui/display_dark.png");
  108. private static final List<DefaultBrewingDisplay> BREWING_DISPLAYS = Lists.newArrayList();
  109. private static final List<DefaultInformationDisplay> INFO_DISPLAYS = Lists.newArrayList();
  110. public static Identifier getDisplayTexture() {
  111. return REIHelper.getInstance().isDarkThemeEnabled() ? DISPLAY_TEXTURE_DARK : DISPLAY_TEXTURE;
  112. }
  113. public static void registerBrewingDisplay(DefaultBrewingDisplay display) {
  114. BREWING_DISPLAYS.add(display);
  115. }
  116. public static void registerInfoDisplay(DefaultInformationDisplay display) {
  117. INFO_DISPLAYS.add(display);
  118. }
  119. @Override
  120. public Identifier getPluginIdentifier() {
  121. return PLUGIN;
  122. }
  123. @Override
  124. public void preRegister() {
  125. INFO_DISPLAYS.clear();
  126. }
  127. @Override
  128. public void registerEntries(EntryRegistry entryRegistry) {
  129. if (!ConfigObject.getInstance().isLoadingDefaultPlugin()) {
  130. return;
  131. }
  132. for (Item item : Registry.ITEM) {
  133. List<ItemStack> stacks = null;
  134. try {
  135. stacks = entryRegistry.appendStacksForItem(item);
  136. } catch (Exception ignored) {
  137. }
  138. if (stacks != null) {
  139. for (ItemStack stack : entryRegistry.appendStacksForItem(item)) {
  140. entryRegistry.registerEntry(EntryStack.create(stack));
  141. }
  142. } else
  143. entryRegistry.registerEntry(EntryStack.create(item));
  144. }
  145. EntryStack stack = EntryStack.create(Items.ENCHANTED_BOOK);
  146. List<EntryStack> enchantments = new ArrayList<>();
  147. for (Enchantment enchantment : Registry.ENCHANTMENT) {
  148. for (int i = enchantment.getMinimumLevel(); i <= enchantment.getMaximumLevel(); i++) {
  149. Map<Enchantment, Integer> map = new HashMap<>();
  150. map.put(enchantment, i);
  151. ItemStack itemStack = new ItemStack(Items.ENCHANTED_BOOK);
  152. EnchantmentHelper.set(map, itemStack);
  153. enchantments.add(EntryStack.create(itemStack).setting(EntryStack.Settings.CHECK_TAGS, EntryStack.Settings.TRUE));
  154. }
  155. }
  156. entryRegistry.registerEntriesAfter(stack, enchantments);
  157. for (Fluid fluid : Registry.FLUID) {
  158. if (!fluid.getDefaultState().isEmpty() && fluid.getDefaultState().isStill())
  159. entryRegistry.registerEntry(EntryStack.create(fluid));
  160. }
  161. entryRegistry.registerEntry(new RenderingEntry() {
  162. private Identifier id = new Identifier("roughlyenoughitems", "textures/gui/kirb.png");
  163. @Override
  164. public void render(MatrixStack matrices, Rectangle bounds, int mouseX, int mouseY, float delta) {
  165. MinecraftClient.getInstance().getTextureManager().bindTexture(id);
  166. drawTexturedQuad(matrices.peek().getModel(), bounds.x, bounds.getMaxX(), bounds.y, bounds.getMaxY(), getZOffset(), 0, 1, 0, 1);
  167. }
  168. @Override
  169. public boolean isEmpty() {
  170. return !((ClientHelperImpl) ClientHelper.getInstance()).isAprilFools.get();
  171. }
  172. @Override
  173. public @Nullable Tooltip getTooltip(Point point) {
  174. return Tooltip.create(new LiteralText("Kibby"));
  175. }
  176. });
  177. }
  178. @Override
  179. public void registerPluginCategories(RecipeHelper recipeHelper) {
  180. if (!ConfigObject.getInstance().isLoadingDefaultPlugin()) {
  181. return;
  182. }
  183. recipeHelper.registerCategory(new DefaultCraftingCategory());
  184. recipeHelper.registerCategory(new DefaultCookingCategory(SMELTING, EntryStack.create(Items.FURNACE), "category.rei.smelting"));
  185. recipeHelper.registerCategory(new DefaultCookingCategory(SMOKING, EntryStack.create(Items.SMOKER), "category.rei.smoking"));
  186. recipeHelper.registerCategory(new DefaultCookingCategory(BLASTING, EntryStack.create(Items.BLAST_FURNACE), "category.rei.blasting"));
  187. recipeHelper.registerCategory(new DefaultCampfireCategory());
  188. recipeHelper.registerCategory(new DefaultStoneCuttingCategory());
  189. recipeHelper.registerCategory(new DefaultFuelCategory());
  190. recipeHelper.registerCategory(new DefaultBrewingCategory());
  191. recipeHelper.registerCategory(new DefaultCompostingCategory());
  192. recipeHelper.registerCategory(new DefaultStrippingCategory());
  193. recipeHelper.registerCategory(new DefaultSmithingCategory());
  194. recipeHelper.registerCategory(new DefaultBeaconBaseCategory());
  195. recipeHelper.registerCategory(new DefaultInformationCategory());
  196. }
  197. @Override
  198. public void registerRecipeDisplays(RecipeHelper recipeHelper) {
  199. if (!ConfigObject.getInstance().isLoadingDefaultPlugin()) {
  200. return;
  201. }
  202. recipeHelper.registerRecipes(CRAFTING, ShapelessRecipe.class, DefaultShapelessDisplay::new);
  203. recipeHelper.registerRecipes(CRAFTING, ShapedRecipe.class, DefaultShapedDisplay::new);
  204. recipeHelper.registerRecipes(SMELTING, SmeltingRecipe.class, DefaultSmeltingDisplay::new);
  205. recipeHelper.registerRecipes(SMOKING, SmokingRecipe.class, DefaultSmokingDisplay::new);
  206. recipeHelper.registerRecipes(BLASTING, BlastingRecipe.class, DefaultBlastingDisplay::new);
  207. recipeHelper.registerRecipes(CAMPFIRE, CampfireCookingRecipe.class, DefaultCampfireDisplay::new);
  208. recipeHelper.registerRecipes(STONE_CUTTING, StonecuttingRecipe.class, DefaultStoneCuttingDisplay::new);
  209. recipeHelper.registerRecipes(SMITHING, SmithingRecipe.class, DefaultSmithingDisplay::new);
  210. for (DefaultBrewingDisplay display : BREWING_DISPLAYS) {
  211. recipeHelper.registerDisplay(display);
  212. }
  213. for (Map.Entry<Item, Integer> entry : AbstractFurnaceBlockEntity.createFuelTimeMap().entrySet()) {
  214. recipeHelper.registerDisplay(new DefaultFuelDisplay(EntryStack.create(entry.getKey()), entry.getValue()));
  215. }
  216. List<EntryStack> arrowStack = Collections.singletonList(EntryStack.create(Items.ARROW));
  217. EntryRegistry.getInstance().getEntryStacks().filter(entry -> entry.getItem() == Items.LINGERING_POTION).forEach(entry -> {
  218. List<List<EntryStack>> input = new ArrayList<>();
  219. for (int i = 0; i < 4; i++)
  220. input.add(arrowStack);
  221. input.add(Collections.singletonList(EntryStack.create(entry.getItemStack())));
  222. for (int i = 0; i < 4; i++)
  223. input.add(arrowStack);
  224. ItemStack outputStack = new ItemStack(Items.TIPPED_ARROW, 8);
  225. PotionUtil.setPotion(outputStack, PotionUtil.getPotion(entry.getItemStack()));
  226. PotionUtil.setCustomPotionEffects(outputStack, PotionUtil.getCustomPotionEffects(entry.getItemStack()));
  227. List<EntryStack> output = Collections.singletonList(EntryStack.create(outputStack).addSetting(EntryStack.Settings.CHECK_TAGS, EntryStack.Settings.TRUE));
  228. recipeHelper.registerDisplay(new DefaultCustomDisplay(null, input, output));
  229. });
  230. Map<ItemConvertible, Float> map = Maps.newLinkedHashMap();
  231. if (ComposterBlock.ITEM_TO_LEVEL_INCREASE_CHANCE.isEmpty())
  232. ComposterBlock.registerDefaultCompostableItems();
  233. for (Object2FloatMap.Entry<ItemConvertible> entry : ComposterBlock.ITEM_TO_LEVEL_INCREASE_CHANCE.object2FloatEntrySet()) {
  234. if (entry.getFloatValue() > 0)
  235. map.put(entry.getKey(), entry.getFloatValue());
  236. }
  237. List<ItemConvertible> stacks = new LinkedList<>(map.keySet());
  238. stacks.sort(Comparator.comparing(map::get));
  239. for (int i = 0; i < stacks.size(); i += MathHelper.clamp(48, 1, stacks.size() - i)) {
  240. List<ItemConvertible> thisStacks = Lists.newArrayList();
  241. for (int j = i; j < i + 48; j++)
  242. if (j < stacks.size())
  243. thisStacks.add(stacks.get(j));
  244. recipeHelper.registerDisplay(new DefaultCompostingDisplay(MathHelper.floor(i / 48f), thisStacks, map, Lists.newArrayList(map.keySet()), new ItemStack[]{new ItemStack(Items.BONE_MEAL)}));
  245. }
  246. DummyAxeItem.getStrippedBlocksMap().entrySet().stream().sorted(Comparator.comparing(b -> Registry.BLOCK.getId(b.getKey()))).forEach(set -> {
  247. recipeHelper.registerDisplay(new DefaultStrippingDisplay(EntryStack.create(set.getKey()), EntryStack.create(set.getValue())));
  248. });
  249. recipeHelper.registerDisplay(new DefaultBeaconBaseDisplay(CollectionUtils.map(Lists.newArrayList(BlockTags.BEACON_BASE_BLOCKS.values()), ItemStack::new)));
  250. }
  251. @Override
  252. public void postRegister() {
  253. for (DefaultInformationDisplay display : INFO_DISPLAYS)
  254. RecipeHelper.getInstance().registerDisplay(display);
  255. // TODO Turn this into an API
  256. // Sit tight! This will be a fast journey!
  257. long time = System.currentTimeMillis();
  258. EntryRegistry.getInstance().getEntryStacks().forEach(this::applyPotionTransformer);
  259. for (List<RecipeDisplay> displays : RecipeHelper.getInstance().getAllRecipesNoHandlers().values()) {
  260. for (RecipeDisplay display : displays) {
  261. for (List<EntryStack> entries : display.getInputEntries())
  262. for (EntryStack stack : entries)
  263. applyPotionTransformer(stack);
  264. for (EntryStack stack : display.getOutputEntries())
  265. applyPotionTransformer(stack);
  266. }
  267. }
  268. time = System.currentTimeMillis() - time;
  269. RoughlyEnoughItemsCore.LOGGER.info("Applied Check Tags for potion in %dms.", time);
  270. }
  271. private void applyPotionTransformer(EntryStack stack) {
  272. if (stack.getItem() instanceof PotionItem)
  273. stack.addSetting(EntryStack.Settings.CHECK_TAGS, EntryStack.Settings.TRUE);
  274. }
  275. @Override
  276. public void registerBounds(DisplayHelper displayHelper) {
  277. if (!ConfigObject.getInstance().isLoadingDefaultPlugin()) {
  278. return;
  279. }
  280. BaseBoundsHandler baseBoundsHandler = BaseBoundsHandler.getInstance();
  281. baseBoundsHandler.registerExclusionZones(AbstractInventoryScreen.class, new DefaultPotionEffectExclusionZones());
  282. baseBoundsHandler.registerExclusionZones(RecipeBookProvider.class, new DefaultRecipeBookExclusionZones());
  283. baseBoundsHandler.registerExclusionZones(RecipeViewingScreen.class, () -> {
  284. Panel widget = ((RecipeViewingScreen) MinecraftClient.getInstance().currentScreen).getWorkingStationsBaseWidget();
  285. if (widget == null)
  286. return Collections.emptyList();
  287. return Collections.singletonList(widget.getBounds().clone());
  288. });
  289. displayHelper.registerProvider(new DisplayHelper.DisplayBoundsProvider<ContainerScreen<?>>() {
  290. @Override
  291. public Rectangle getScreenBounds(ContainerScreen<?> screen) {
  292. return new Rectangle(screen.x, screen.y, screen.containerWidth, screen.containerHeight);
  293. }
  294. @Override
  295. public Class<?> getBaseSupportedClass() {
  296. return ContainerScreen.class;
  297. }
  298. });
  299. displayHelper.registerProvider(new DisplayHelper.DisplayBoundsProvider<RecipeViewingScreen>() {
  300. @Override
  301. public Rectangle getScreenBounds(RecipeViewingScreen screen) {
  302. return screen.getBounds();
  303. }
  304. @Override
  305. public Class<?> getBaseSupportedClass() {
  306. return RecipeViewingScreen.class;
  307. }
  308. });
  309. displayHelper.registerProvider(new DisplayHelper.DisplayBoundsProvider<VillagerRecipeViewingScreen>() {
  310. @Override
  311. public Rectangle getScreenBounds(VillagerRecipeViewingScreen screen) {
  312. return screen.bounds;
  313. }
  314. @Override
  315. public Class<?> getBaseSupportedClass() {
  316. return VillagerRecipeViewingScreen.class;
  317. }
  318. });
  319. }
  320. @Override
  321. public void registerOthers(RecipeHelper recipeHelper) {
  322. if (!ConfigObject.getInstance().isLoadingDefaultPlugin()) {
  323. return;
  324. }
  325. recipeHelper.registerWorkingStations(CRAFTING, EntryStack.create(Items.CRAFTING_TABLE));
  326. recipeHelper.registerWorkingStations(SMELTING, EntryStack.create(Items.FURNACE));
  327. recipeHelper.registerWorkingStations(SMOKING, EntryStack.create(Items.SMOKER));
  328. recipeHelper.registerWorkingStations(BLASTING, EntryStack.create(Items.BLAST_FURNACE));
  329. recipeHelper.registerWorkingStations(CAMPFIRE, EntryStack.create(Items.CAMPFIRE));
  330. recipeHelper.registerWorkingStations(FUEL, EntryStack.create(Items.FURNACE), EntryStack.create(Items.SMOKER), EntryStack.create(Items.BLAST_FURNACE));
  331. recipeHelper.registerWorkingStations(BREWING, EntryStack.create(Items.BREWING_STAND));
  332. recipeHelper.registerWorkingStations(STONE_CUTTING, EntryStack.create(Items.STONECUTTER));
  333. recipeHelper.registerWorkingStations(COMPOSTING, EntryStack.create(Items.COMPOSTER));
  334. recipeHelper.registerWorkingStations(SMITHING, EntryStack.create(Items.SMITHING_TABLE));
  335. recipeHelper.registerWorkingStations(BEACON, EntryStack.create(Items.BEACON));
  336. Tag<Item> axes = MinecraftClient.getInstance().getNetworkHandler().getTagManager().items().get(new Identifier("fabric", "axes"));
  337. if (axes != null) {
  338. for (Item item : axes.values()) {
  339. recipeHelper.registerWorkingStations(STRIPPING, EntryStack.create(item));
  340. }
  341. }
  342. recipeHelper.removeAutoCraftButton(FUEL);
  343. recipeHelper.removeAutoCraftButton(COMPOSTING);
  344. recipeHelper.removeAutoCraftButton(BEACON);
  345. recipeHelper.removeAutoCraftButton(INFO);
  346. recipeHelper.registerScreenClickArea(new Rectangle(88, 32, 28, 23), CraftingTableScreen.class, CRAFTING);
  347. recipeHelper.registerScreenClickArea(new Rectangle(137, 29, 10, 13), InventoryScreen.class, CRAFTING);
  348. recipeHelper.registerScreenClickArea(new Rectangle(97, 16, 14, 30), BrewingStandScreen.class, BREWING);
  349. recipeHelper.registerScreenClickArea(new Rectangle(78, 32, 28, 23), FurnaceScreen.class, SMELTING);
  350. recipeHelper.registerScreenClickArea(new Rectangle(78, 32, 28, 23), SmokerScreen.class, SMOKING);
  351. recipeHelper.registerScreenClickArea(new Rectangle(78, 32, 28, 23), BlastFurnaceScreen.class, BLASTING);
  352. FluidSupportProvider.INSTANCE.registerFluidProvider(new FluidSupportProvider.FluidProvider() {
  353. @Override
  354. public @NotNull EntryStack itemToFluid(@NotNull EntryStack itemStack) {
  355. Item item = itemStack.getItem();
  356. if (item instanceof BucketItem)
  357. return EntryStack.create(((BucketItem) item).fluid, 1000);
  358. return EntryStack.empty();
  359. }
  360. });
  361. // SubsetsRegistry subsetsRegistry = SubsetsRegistry.INSTANCE;
  362. // subsetsRegistry.registerPathEntry("roughlyenoughitems:food", EntryStack.create(Items.MILK_BUCKET));
  363. // subsetsRegistry.registerPathEntry("roughlyenoughitems:food/roughlyenoughitems:cookies", EntryStack.create(Items.COOKIE));
  364. }
  365. @Override
  366. public int getPriority() {
  367. return -1;
  368. }
  369. }