From ba446965dad004cb38679f0f0e1a526151d84213 Mon Sep 17 00:00:00 2001 From: shedaniel Date: Wed, 29 Jul 2020 12:25:47 +0800 Subject: 5.x - 20w30a Signed-off-by: shedaniel --- .../me/shedaniel/rei/REIModMenuEntryPoint.java | 35 - .../me/shedaniel/rei/RoughlyEnoughItemsCore.java | 413 ----------- .../shedaniel/rei/RoughlyEnoughItemsNetwork.java | 158 ---- .../me/shedaniel/rei/RoughlyEnoughItemsState.java | 111 --- .../me/shedaniel/rei/api/AutoTransferHandler.java | 304 -------- .../me/shedaniel/rei/api/BaseBoundsHandler.java | 64 -- .../me/shedaniel/rei/api/ButtonAreaSupplier.java | 50 -- .../java/me/shedaniel/rei/api/ClientHelper.java | 258 ------- .../java/me/shedaniel/rei/api/ConfigManager.java | 78 -- .../java/me/shedaniel/rei/api/ConfigObject.java | 169 ----- .../java/me/shedaniel/rei/api/DisplayHelper.java | 218 ------ .../rei/api/DisplayVisibilityHandler.java | 51 -- .../me/shedaniel/rei/api/DrawableConsumer.java | 35 - .../java/me/shedaniel/rei/api/EntryRegistry.java | 158 ---- src/main/java/me/shedaniel/rei/api/EntryStack.java | 358 --------- .../me/shedaniel/rei/api/FocusedStackProvider.java | 40 -- .../java/me/shedaniel/rei/api/ItemStackHook.java | 31 - .../me/shedaniel/rei/api/LiveRecipeGenerator.java | 50 -- .../me/shedaniel/rei/api/OptimalEntryStack.java | 53 -- .../java/me/shedaniel/rei/api/OverlayDecider.java | 69 -- src/main/java/me/shedaniel/rei/api/REIHelper.java | 67 -- src/main/java/me/shedaniel/rei/api/REIOverlay.java | 31 - .../java/me/shedaniel/rei/api/REIPluginEntry.java | 58 -- .../java/me/shedaniel/rei/api/RecipeCategory.java | 123 ---- .../java/me/shedaniel/rei/api/RecipeDisplay.java | 69 -- .../java/me/shedaniel/rei/api/RecipeHelper.java | 274 ------- .../me/shedaniel/rei/api/TextRepresentable.java | 51 -- src/main/java/me/shedaniel/rei/api/TextTest.java | 39 - .../shedaniel/rei/api/TransferRecipeCategory.java | 37 - .../shedaniel/rei/api/TransferRecipeDisplay.java | 44 -- .../rei/api/fluid/FluidSupportProvider.java | 63 -- .../me/shedaniel/rei/api/plugins/REIPluginV0.java | 88 --- .../shedaniel/rei/api/subsets/SubsetsRegistry.java | 63 -- .../java/me/shedaniel/rei/api/widgets/Arrow.java | 88 --- .../me/shedaniel/rei/api/widgets/BaseWidget.java | 53 -- .../me/shedaniel/rei/api/widgets/BurningFire.java | 88 --- .../java/me/shedaniel/rei/api/widgets/Button.java | 186 ----- .../java/me/shedaniel/rei/api/widgets/Label.java | 306 -------- .../java/me/shedaniel/rei/api/widgets/Panel.java | 102 --- .../java/me/shedaniel/rei/api/widgets/Slot.java | 159 ---- .../java/me/shedaniel/rei/api/widgets/Tooltip.java | 69 -- .../java/me/shedaniel/rei/api/widgets/Widgets.java | 212 ------ .../shedaniel/rei/gui/ConfigReloadingScreen.java | 71 -- .../shedaniel/rei/gui/ContainerScreenOverlay.java | 800 --------------------- .../me/shedaniel/rei/gui/OverlaySearchField.java | 179 ----- .../shedaniel/rei/gui/PreRecipeViewingScreen.java | 215 ------ .../shedaniel/rei/gui/RecipeDisplayExporter.java | 131 ---- .../java/me/shedaniel/rei/gui/RecipeScreen.java | 43 -- .../me/shedaniel/rei/gui/RecipeViewingScreen.java | 599 --------------- .../rei/gui/VillagerRecipeViewingScreen.java | 443 ------------ .../shedaniel/rei/gui/WarningAndErrorScreen.java | 303 -------- .../shedaniel/rei/gui/config/AppearanceTheme.java | 40 -- .../rei/gui/config/ConfigButtonPosition.java | 40 -- .../rei/gui/config/DisplayPanelLocation.java | 48 -- .../rei/gui/config/EntryPanelOrdering.java | 45 -- .../rei/gui/config/EntryPanelOrderingConfig.java | 63 -- .../shedaniel/rei/gui/config/ItemCheatingMode.java | 40 -- .../rei/gui/config/ItemCheatingStyle.java | 43 -- .../shedaniel/rei/gui/config/RecipeBorderType.java | 59 -- .../shedaniel/rei/gui/config/RecipeScreenType.java | 41 -- .../rei/gui/config/SearchFieldLocation.java | 41 -- .../gui/config/entry/FilteringAddRuleScreen.java | 194 ----- .../rei/gui/config/entry/FilteringEntry.java | 109 --- .../config/entry/FilteringRuleOptionsScreen.java | 239 ------ .../rei/gui/config/entry/FilteringRulesScreen.java | 246 ------- .../rei/gui/config/entry/FilteringScreen.java | 523 -------------- .../rei/gui/config/entry/NoFilteringEntry.java | 90 --- .../gui/config/entry/RecipeScreenTypeEntry.java | 112 --- .../rei/gui/config/entry/ReloadPluginsEntry.java | 95 --- .../rei/gui/credits/CreditsEntryListWidget.java | 142 ---- .../shedaniel/rei/gui/credits/CreditsScreen.java | 140 ---- .../me/shedaniel/rei/gui/entries/RecipeEntry.java | 36 - .../rei/gui/entries/SimpleRecipeEntry.java | 150 ---- .../java/me/shedaniel/rei/gui/modules/Menu.java | 277 ------- .../me/shedaniel/rei/gui/modules/MenuEntry.java | 44 -- .../entries/EntryStackSubsetsMenuEntry.java | 139 ---- .../rei/gui/modules/entries/GameModeMenuEntry.java | 108 --- .../gui/modules/entries/SubSubsetsMenuEntry.java | 233 ------ .../rei/gui/modules/entries/WeatherMenuEntry.java | 109 --- .../rei/gui/toast/CopyRecipeIdentifierToast.java | 76 -- .../rei/gui/toast/ExportRecipeIdentifierToast.java | 76 -- .../me/shedaniel/rei/gui/widget/ButtonWidget.java | 221 ------ .../rei/gui/widget/CategoryBaseWidget.java | 50 -- .../rei/gui/widget/ClickableLabelWidget.java | 137 ---- .../shedaniel/rei/gui/widget/DraggableWidget.java | 104 --- .../rei/gui/widget/EntryListEntryWidget.java | 98 --- .../shedaniel/rei/gui/widget/EntryListWidget.java | 549 -------------- .../me/shedaniel/rei/gui/widget/EntryWidget.java | 418 ----------- .../rei/gui/widget/FavoritesListWidget.java | 311 -------- .../me/shedaniel/rei/gui/widget/LabelWidget.java | 194 ----- .../shedaniel/rei/gui/widget/LateRenderable.java | 30 - .../me/shedaniel/rei/gui/widget/PanelWidget.java | 140 ---- .../me/shedaniel/rei/gui/widget/QueuedTooltip.java | 103 --- .../rei/gui/widget/RecipeArrowWidget.java | 86 --- .../shedaniel/rei/gui/widget/RecipeBaseWidget.java | 60 -- .../rei/gui/widget/RecipeChoosePageWidget.java | 205 ------ .../shedaniel/rei/gui/widget/SlotBaseWidget.java | 67 -- .../me/shedaniel/rei/gui/widget/TabWidget.java | 134 ---- .../shedaniel/rei/gui/widget/TextFieldWidget.java | 634 ---------------- .../java/me/shedaniel/rei/gui/widget/Widget.java | 75 -- .../shedaniel/rei/gui/widget/WidgetWithBounds.java | 39 - .../me/shedaniel/rei/impl/AbstractEntryStack.java | 111 --- .../rei/impl/AmountIgnoredEntryStackWrapper.java | 61 -- .../shedaniel/rei/impl/BaseBoundsHandlerImpl.java | 116 --- .../me/shedaniel/rei/impl/ClientHelperImpl.java | 442 ------------ .../me/shedaniel/rei/impl/ConfigManagerImpl.java | 237 ------ .../me/shedaniel/rei/impl/ConfigObjectImpl.java | 477 ------------ .../me/shedaniel/rei/impl/DisplayHelperImpl.java | 170 ----- .../me/shedaniel/rei/impl/EmptyEntryStack.java | 154 ---- .../me/shedaniel/rei/impl/EntryRegistryImpl.java | 187 ----- .../me/shedaniel/rei/impl/FluidEntryStack.java | 247 ------- .../rei/impl/FluidSupportProviderImpl.java | 60 -- .../me/shedaniel/rei/impl/InternalWidgets.java | 348 --------- .../java/me/shedaniel/rei/impl/ItemEntryStack.java | 405 ----------- .../me/shedaniel/rei/impl/RecipeHelperImpl.java | 653 ----------------- .../java/me/shedaniel/rei/impl/RenderingEntry.java | 139 ---- .../java/me/shedaniel/rei/impl/ScreenHelper.java | 254 ------- .../java/me/shedaniel/rei/impl/SearchArgument.java | 161 ----- .../me/shedaniel/rei/impl/SimpleFluidRenderer.java | 85 --- src/main/java/me/shedaniel/rei/impl/Weather.java | 61 -- .../rei/impl/filtering/AbstractFilteringRule.java | 40 -- .../rei/impl/filtering/FilteringContext.java | 48 -- .../rei/impl/filtering/FilteringContextImpl.java | 104 --- .../rei/impl/filtering/FilteringContextType.java | 34 - .../rei/impl/filtering/FilteringResult.java | 93 --- .../rei/impl/filtering/FilteringResultImpl.java | 55 -- .../rei/impl/filtering/FilteringRule.java | 92 --- .../impl/filtering/rules/ManualFilteringRule.java | 80 --- .../impl/filtering/rules/SearchFilteringRule.java | 171 ----- .../rei/impl/search/AlwaysMatchingArgument.java | 50 -- .../me/shedaniel/rei/impl/search/Argument.java | 64 -- .../rei/impl/search/ArgumentsRegistry.java | 51 -- .../me/shedaniel/rei/impl/search/MatchStatus.java | 86 --- .../me/shedaniel/rei/impl/search/MatchType.java | 41 -- .../me/shedaniel/rei/impl/search/ModArgument.java | 66 -- .../shedaniel/rei/impl/search/RegexArgument.java | 79 -- .../me/shedaniel/rei/impl/search/TagArgument.java | 74 -- .../me/shedaniel/rei/impl/search/TextArgument.java | 56 -- .../shedaniel/rei/impl/search/TooltipArgument.java | 58 -- .../rei/impl/subsets/SubsetsRegistryImpl.java | 106 --- .../me/shedaniel/rei/impl/widgets/ArrowWidget.java | 80 --- .../rei/impl/widgets/BurningFireWidget.java | 80 --- .../shedaniel/rei/impl/widgets/ButtonWidget.java | 312 -------- .../shedaniel/rei/impl/widgets/DrawableWidget.java | 52 -- .../widgets/FillRectangleDrawableConsumer.java | 70 -- .../me/shedaniel/rei/impl/widgets/LabelWidget.java | 275 ------- .../me/shedaniel/rei/impl/widgets/PanelWidget.java | 167 ----- .../rei/impl/widgets/TexturedDrawableConsumer.java | 82 --- .../shedaniel/rei/impl/widgets/package-info.java | 27 - .../rei/mixin/MixinBrewingRecipeRegistry.java | 84 --- .../me/shedaniel/rei/mixin/MixinItemStack.java | 48 -- .../rei/plugin/DefaultAutoCraftingPlugin.java | 53 -- .../me/shedaniel/rei/plugin/DefaultPlugin.java | 395 ---------- .../plugin/DefaultPotionEffectExclusionZones.java | 64 -- .../plugin/DefaultRecipeBookExclusionZones.java | 56 -- .../rei/plugin/DefaultServerContainerPlugin.java | 40 -- .../autocrafting/DefaultCategoryHandler.java | 140 ---- .../autocrafting/DefaultRecipeBookHandler.java | 102 --- .../plugin/beacon/DefaultBeaconBaseCategory.java | 182 ----- .../plugin/beacon/DefaultBeaconBaseDisplay.java | 64 -- .../plugin/blasting/DefaultBlastingDisplay.java | 44 -- .../rei/plugin/brewing/BrewingRecipe.java | 41 -- .../rei/plugin/brewing/DefaultBrewingCategory.java | 80 --- .../rei/plugin/brewing/DefaultBrewingDisplay.java | 88 --- .../plugin/campfire/DefaultCampfireCategory.java | 80 --- .../plugin/campfire/DefaultCampfireDisplay.java | 92 --- .../composting/DefaultCompostingCategory.java | 115 --- .../composting/DefaultCompostingDisplay.java | 81 --- .../containers/CraftingContainerInfoWrapper.java | 77 -- .../rei/plugin/cooking/DefaultCookingCategory.java | 109 --- .../rei/plugin/cooking/DefaultCookingDisplay.java | 119 --- .../plugin/crafting/DefaultCraftingCategory.java | 113 --- .../plugin/crafting/DefaultCraftingDisplay.java | 73 -- .../rei/plugin/crafting/DefaultCustomDisplay.java | 111 --- .../rei/plugin/crafting/DefaultShapedDisplay.java | 88 --- .../plugin/crafting/DefaultShapelessDisplay.java | 89 --- .../rei/plugin/fuel/DefaultFuelCategory.java | 112 --- .../rei/plugin/fuel/DefaultFuelDisplay.java | 64 -- .../information/DefaultInformationCategory.java | 220 ------ .../information/DefaultInformationDisplay.java | 101 --- .../plugin/smelting/DefaultSmeltingDisplay.java | 44 -- .../plugin/smithing/DefaultSmithingCategory.java | 73 -- .../plugin/smithing/DefaultSmithingDisplay.java | 92 --- .../rei/plugin/smoking/DefaultSmokingDisplay.java | 41 -- .../stonecutting/DefaultStoneCuttingCategory.java | 74 -- .../stonecutting/DefaultStoneCuttingDisplay.java | 83 --- .../plugin/stripping/DefaultStrippingCategory.java | 74 -- .../plugin/stripping/DefaultStrippingDisplay.java | 78 -- .../rei/plugin/stripping/DummyAxeItem.java | 40 -- .../me/shedaniel/rei/server/ContainerInfo.java | 40 -- .../shedaniel/rei/server/ContainerInfoHandler.java | 66 -- .../me/shedaniel/rei/server/InputSlotCrafter.java | 252 ------- .../java/me/shedaniel/rei/server/RecipeFinder.java | 347 --------- .../me/shedaniel/rei/server/RecipeGridAligner.java | 78 -- .../shedaniel/rei/tests/plugin/REITestPlugin.java | 79 -- .../me/shedaniel/rei/utils/CollectionUtils.java | 285 -------- 196 files changed, 26842 deletions(-) delete mode 100644 src/main/java/me/shedaniel/rei/REIModMenuEntryPoint.java delete mode 100644 src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java delete mode 100644 src/main/java/me/shedaniel/rei/RoughlyEnoughItemsNetwork.java delete mode 100644 src/main/java/me/shedaniel/rei/RoughlyEnoughItemsState.java delete mode 100644 src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java delete mode 100644 src/main/java/me/shedaniel/rei/api/BaseBoundsHandler.java delete mode 100644 src/main/java/me/shedaniel/rei/api/ButtonAreaSupplier.java delete mode 100644 src/main/java/me/shedaniel/rei/api/ClientHelper.java delete mode 100644 src/main/java/me/shedaniel/rei/api/ConfigManager.java delete mode 100644 src/main/java/me/shedaniel/rei/api/ConfigObject.java delete mode 100644 src/main/java/me/shedaniel/rei/api/DisplayHelper.java delete mode 100644 src/main/java/me/shedaniel/rei/api/DisplayVisibilityHandler.java delete mode 100644 src/main/java/me/shedaniel/rei/api/DrawableConsumer.java delete mode 100644 src/main/java/me/shedaniel/rei/api/EntryRegistry.java delete mode 100644 src/main/java/me/shedaniel/rei/api/EntryStack.java delete mode 100644 src/main/java/me/shedaniel/rei/api/FocusedStackProvider.java delete mode 100644 src/main/java/me/shedaniel/rei/api/ItemStackHook.java delete mode 100644 src/main/java/me/shedaniel/rei/api/LiveRecipeGenerator.java delete mode 100644 src/main/java/me/shedaniel/rei/api/OptimalEntryStack.java delete mode 100644 src/main/java/me/shedaniel/rei/api/OverlayDecider.java delete mode 100644 src/main/java/me/shedaniel/rei/api/REIHelper.java delete mode 100644 src/main/java/me/shedaniel/rei/api/REIOverlay.java delete mode 100644 src/main/java/me/shedaniel/rei/api/REIPluginEntry.java delete mode 100644 src/main/java/me/shedaniel/rei/api/RecipeCategory.java delete mode 100644 src/main/java/me/shedaniel/rei/api/RecipeDisplay.java delete mode 100644 src/main/java/me/shedaniel/rei/api/RecipeHelper.java delete mode 100644 src/main/java/me/shedaniel/rei/api/TextRepresentable.java delete mode 100644 src/main/java/me/shedaniel/rei/api/TextTest.java delete mode 100644 src/main/java/me/shedaniel/rei/api/TransferRecipeCategory.java delete mode 100644 src/main/java/me/shedaniel/rei/api/TransferRecipeDisplay.java delete mode 100644 src/main/java/me/shedaniel/rei/api/fluid/FluidSupportProvider.java delete mode 100644 src/main/java/me/shedaniel/rei/api/plugins/REIPluginV0.java delete mode 100644 src/main/java/me/shedaniel/rei/api/subsets/SubsetsRegistry.java delete mode 100644 src/main/java/me/shedaniel/rei/api/widgets/Arrow.java delete mode 100644 src/main/java/me/shedaniel/rei/api/widgets/BaseWidget.java delete mode 100644 src/main/java/me/shedaniel/rei/api/widgets/BurningFire.java delete mode 100644 src/main/java/me/shedaniel/rei/api/widgets/Button.java delete mode 100644 src/main/java/me/shedaniel/rei/api/widgets/Label.java delete mode 100644 src/main/java/me/shedaniel/rei/api/widgets/Panel.java delete mode 100644 src/main/java/me/shedaniel/rei/api/widgets/Slot.java delete mode 100644 src/main/java/me/shedaniel/rei/api/widgets/Tooltip.java delete mode 100644 src/main/java/me/shedaniel/rei/api/widgets/Widgets.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/ConfigReloadingScreen.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/OverlaySearchField.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/PreRecipeViewingScreen.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/RecipeDisplayExporter.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/RecipeScreen.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/WarningAndErrorScreen.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/config/AppearanceTheme.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/config/ConfigButtonPosition.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/config/DisplayPanelLocation.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/config/EntryPanelOrdering.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/config/EntryPanelOrderingConfig.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/config/ItemCheatingMode.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/config/ItemCheatingStyle.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/config/RecipeBorderType.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/config/RecipeScreenType.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/config/SearchFieldLocation.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/config/entry/FilteringAddRuleScreen.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/config/entry/FilteringEntry.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/config/entry/FilteringRuleOptionsScreen.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/config/entry/FilteringRulesScreen.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/config/entry/FilteringScreen.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/config/entry/NoFilteringEntry.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/config/entry/RecipeScreenTypeEntry.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/config/entry/ReloadPluginsEntry.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/credits/CreditsEntryListWidget.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/credits/CreditsScreen.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/entries/RecipeEntry.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/entries/SimpleRecipeEntry.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/modules/Menu.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/modules/MenuEntry.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/modules/entries/EntryStackSubsetsMenuEntry.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/modules/entries/GameModeMenuEntry.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/modules/entries/SubSubsetsMenuEntry.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/modules/entries/WeatherMenuEntry.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/toast/CopyRecipeIdentifierToast.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/toast/ExportRecipeIdentifierToast.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/widget/CategoryBaseWidget.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/widget/ClickableLabelWidget.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/widget/DraggableWidget.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/widget/EntryListEntryWidget.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/widget/EntryListWidget.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/widget/EntryWidget.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/widget/FavoritesListWidget.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/widget/LabelWidget.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/widget/LateRenderable.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/widget/PanelWidget.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/widget/QueuedTooltip.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/widget/RecipeArrowWidget.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/widget/RecipeBaseWidget.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/widget/RecipeChoosePageWidget.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/widget/SlotBaseWidget.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/widget/TabWidget.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/widget/TextFieldWidget.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/widget/Widget.java delete mode 100644 src/main/java/me/shedaniel/rei/gui/widget/WidgetWithBounds.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/AbstractEntryStack.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/AmountIgnoredEntryStackWrapper.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/BaseBoundsHandlerImpl.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/ClientHelperImpl.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/ConfigManagerImpl.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/ConfigObjectImpl.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/DisplayHelperImpl.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/EmptyEntryStack.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/EntryRegistryImpl.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/FluidEntryStack.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/FluidSupportProviderImpl.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/InternalWidgets.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/ItemEntryStack.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/RenderingEntry.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/ScreenHelper.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/SearchArgument.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/SimpleFluidRenderer.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/Weather.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/filtering/AbstractFilteringRule.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/filtering/FilteringContext.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/filtering/FilteringContextImpl.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/filtering/FilteringContextType.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/filtering/FilteringResult.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/filtering/FilteringResultImpl.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/filtering/FilteringRule.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/filtering/rules/ManualFilteringRule.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/filtering/rules/SearchFilteringRule.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/search/AlwaysMatchingArgument.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/search/Argument.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/search/ArgumentsRegistry.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/search/MatchStatus.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/search/MatchType.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/search/ModArgument.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/search/RegexArgument.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/search/TagArgument.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/search/TextArgument.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/search/TooltipArgument.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/subsets/SubsetsRegistryImpl.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/widgets/ArrowWidget.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/widgets/BurningFireWidget.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/widgets/ButtonWidget.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/widgets/DrawableWidget.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/widgets/FillRectangleDrawableConsumer.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/widgets/LabelWidget.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/widgets/PanelWidget.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/widgets/TexturedDrawableConsumer.java delete mode 100644 src/main/java/me/shedaniel/rei/impl/widgets/package-info.java delete mode 100644 src/main/java/me/shedaniel/rei/mixin/MixinBrewingRecipeRegistry.java delete mode 100644 src/main/java/me/shedaniel/rei/mixin/MixinItemStack.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/DefaultAutoCraftingPlugin.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/DefaultPotionEffectExclusionZones.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/DefaultRecipeBookExclusionZones.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/DefaultServerContainerPlugin.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/autocrafting/DefaultCategoryHandler.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/autocrafting/DefaultRecipeBookHandler.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/beacon/DefaultBeaconBaseCategory.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/beacon/DefaultBeaconBaseDisplay.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/blasting/DefaultBlastingDisplay.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/brewing/BrewingRecipe.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingCategory.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingDisplay.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/campfire/DefaultCampfireCategory.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/campfire/DefaultCampfireDisplay.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/composting/DefaultCompostingCategory.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/composting/DefaultCompostingDisplay.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/containers/CraftingContainerInfoWrapper.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingCategory.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingDisplay.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCraftingCategory.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCraftingDisplay.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCustomDisplay.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/crafting/DefaultShapedDisplay.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/crafting/DefaultShapelessDisplay.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/fuel/DefaultFuelCategory.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/fuel/DefaultFuelDisplay.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/information/DefaultInformationCategory.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/information/DefaultInformationDisplay.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/smelting/DefaultSmeltingDisplay.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/smithing/DefaultSmithingCategory.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/smithing/DefaultSmithingDisplay.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/smoking/DefaultSmokingDisplay.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/stonecutting/DefaultStoneCuttingCategory.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/stonecutting/DefaultStoneCuttingDisplay.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/stripping/DefaultStrippingCategory.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/stripping/DefaultStrippingDisplay.java delete mode 100644 src/main/java/me/shedaniel/rei/plugin/stripping/DummyAxeItem.java delete mode 100644 src/main/java/me/shedaniel/rei/server/ContainerInfo.java delete mode 100644 src/main/java/me/shedaniel/rei/server/ContainerInfoHandler.java delete mode 100644 src/main/java/me/shedaniel/rei/server/InputSlotCrafter.java delete mode 100644 src/main/java/me/shedaniel/rei/server/RecipeFinder.java delete mode 100644 src/main/java/me/shedaniel/rei/server/RecipeGridAligner.java delete mode 100644 src/main/java/me/shedaniel/rei/tests/plugin/REITestPlugin.java delete mode 100644 src/main/java/me/shedaniel/rei/utils/CollectionUtils.java (limited to 'src/main/java/me') diff --git a/src/main/java/me/shedaniel/rei/REIModMenuEntryPoint.java b/src/main/java/me/shedaniel/rei/REIModMenuEntryPoint.java deleted file mode 100644 index 203ee28e7..000000000 --- a/src/main/java/me/shedaniel/rei/REIModMenuEntryPoint.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * This file is licensed under the MIT License, part of Roughly Enough Items. - * Copyright (c) 2018, 2019, 2020 shedaniel - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package me.shedaniel.rei; - -import io.github.prospector.modmenu.api.ConfigScreenFactory; -import io.github.prospector.modmenu.api.ModMenuApi; -import me.shedaniel.rei.api.ConfigManager; - -public class REIModMenuEntryPoint implements ModMenuApi { - @Override - public ConfigScreenFactory getModConfigScreenFactory() { - return parent -> ConfigManager.getInstance().getConfigScreen(parent); - } -} diff --git a/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java b/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java deleted file mode 100644 index 950b6f331..000000000 --- a/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java +++ /dev/null @@ -1,413 +0,0 @@ -/* - * This file is licensed under the MIT License, part of Roughly Enough Items. - * Copyright (c) 2018, 2019, 2020 shedaniel - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package me.shedaniel.rei; - -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; -import me.shedaniel.cloth.api.client.events.v0.ClothClientHooks; -import me.shedaniel.math.api.Executor; -import me.shedaniel.rei.api.*; -import me.shedaniel.rei.api.plugins.REIPluginV0; -import me.shedaniel.rei.gui.ContainerScreenOverlay; -import me.shedaniel.rei.impl.*; -import me.shedaniel.rei.tests.plugin.REITestPlugin; -import net.fabricmc.api.ClientModInitializer; -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; -import net.fabricmc.fabric.api.network.ClientSidePacketRegistry; -import net.fabricmc.loader.api.FabricLoader; -import net.fabricmc.loader.api.ModContainer; -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.gui.Element; -import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.gui.screen.ingame.ContainerScreen; -import net.minecraft.client.gui.screen.ingame.CraftingTableScreen; -import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen; -import net.minecraft.client.gui.screen.ingame.InventoryScreen; -import net.minecraft.client.gui.screen.recipebook.RecipeBookGhostSlots; -import net.minecraft.client.gui.screen.recipebook.RecipeBookProvider; -import net.minecraft.client.gui.screen.recipebook.RecipeBookWidget; -import net.minecraft.client.gui.widget.TextFieldWidget; -import net.minecraft.client.gui.widget.TexturedButtonWidget; -import net.minecraft.client.resource.language.I18n; -import net.minecraft.container.CraftingTableContainer; -import net.minecraft.item.ItemStack; -import net.minecraft.item.Items; -import net.minecraft.recipe.Ingredient; -import net.minecraft.recipe.RecipeManager; -import net.minecraft.screen.slot.Slot; -import net.minecraft.text.LiteralText; -import net.minecraft.util.ActionResult; -import net.minecraft.util.Identifier; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.jetbrains.annotations.ApiStatus; - -import java.io.File; -import java.io.IOException; -import java.lang.reflect.Field; -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - -@ApiStatus.Internal -@Environment(EnvType.CLIENT) -public class RoughlyEnoughItemsCore implements ClientModInitializer { - - @ApiStatus.Internal public static final Logger LOGGER = LogManager.getFormatterLogger("REI"); - private static final RecipeHelper RECIPE_HELPER = new RecipeHelperImpl(); - private static final EntryRegistry ENTRY_REGISTRY = new EntryRegistryImpl(); - private static final DisplayHelper DISPLAY_HELPER = new DisplayHelperImpl(); - private static final Map plugins = Maps.newHashMap(); - private static final ExecutorService SYNC_RECIPES = Executors.newSingleThreadScheduledExecutor(r -> new Thread(r, "REI-SyncRecipes")); - private static ConfigManager configManager; - @ApiStatus.Experimental - public static boolean isLeftModePressed = false; - - @ApiStatus.Internal - public static RecipeHelper getRecipeHelper() { - return RECIPE_HELPER; - } - - @ApiStatus.Internal - public static ConfigManager getConfigManager() { - return configManager; - } - - @ApiStatus.Internal - public static EntryRegistry getEntryRegistry() { - return ENTRY_REGISTRY; - } - - @ApiStatus.Internal - public static DisplayHelper getDisplayHelper() { - return DISPLAY_HELPER; - } - - /** - * Registers a REI plugin - * - * @param plugin the plugin instance - * @return the plugin itself - */ - @ApiStatus.Internal - public static REIPluginEntry registerPlugin(REIPluginEntry plugin) { - plugins.put(plugin.getPluginIdentifier(), plugin); - RoughlyEnoughItemsCore.LOGGER.debug("Registered plugin %s from %s", plugin.getPluginIdentifier().toString(), plugin.getClass().getSimpleName()); - return plugin; - } - - public static List getPlugins() { - return new LinkedList<>(plugins.values()); - } - - public static Optional getPluginIdentifier(REIPluginEntry plugin) { - for (Identifier identifier : plugins.keySet()) - if (identifier != null && plugins.get(identifier).equals(plugin)) - return Optional.of(identifier); - return Optional.empty(); - } - - public static boolean hasPermissionToUsePackets() { - try { - MinecraftClient.getInstance().getNetworkHandler().getCommandSource().hasPermissionLevel(0); - return hasOperatorPermission() && canUsePackets(); - } catch (NullPointerException e) { - return true; - } - } - - public static boolean hasOperatorPermission() { - try { - return MinecraftClient.getInstance().getNetworkHandler().getCommandSource().hasPermissionLevel(1); - } catch (NullPointerException e) { - return true; - } - } - - public static boolean canUsePackets() { - return ClientSidePacketRegistry.INSTANCE.canServerReceive(RoughlyEnoughItemsNetwork.CREATE_ITEMS_PACKET) && ClientSidePacketRegistry.INSTANCE.canServerReceive(RoughlyEnoughItemsNetwork.CREATE_ITEMS_GRAB_PACKET) && ClientSidePacketRegistry.INSTANCE.canServerReceive(RoughlyEnoughItemsNetwork.DELETE_ITEMS_PACKET); - } - - @ApiStatus.Internal - public static void syncRecipes(long[] lastSync) { - if (lastSync != null) { - if (lastSync[0] > 0 && System.currentTimeMillis() - lastSync[0] <= 5000) { - RoughlyEnoughItemsCore.LOGGER.warn("Suppressing Sync Recipes!"); - return; - } - lastSync[0] = System.currentTimeMillis(); - } - RecipeManager recipeManager = MinecraftClient.getInstance().getNetworkHandler().getRecipeManager(); - if (ConfigObject.getInstance().doesRegisterRecipesInAnotherThread()) { - CompletableFuture.runAsync(() -> ((RecipeHelperImpl) RecipeHelper.getInstance()).recipesLoaded(recipeManager), SYNC_RECIPES); - } else { - ((RecipeHelperImpl) RecipeHelper.getInstance()).recipesLoaded(recipeManager); - } - } - - @ApiStatus.Internal - public static boolean isDebugModeEnabled() { - return System.getProperty("rei.test", "false").equals("true"); - } - - public static boolean canDeleteItems() { - return hasPermissionToUsePackets() || MinecraftClient.getInstance().interactionManager.hasCreativeInventory(); - } - - @SuppressWarnings("deprecation") - @Override - public void onInitializeClient() { - configManager = new ConfigManagerImpl(); - - detectFabricLoader(); - registerClothEvents(); - discoverPluginEntries(); - for (ModContainer modContainer : FabricLoader.getInstance().getAllMods()) { - if (modContainer.getMetadata().containsCustomElement("roughlyenoughitems:plugins")) - RoughlyEnoughItemsCore.LOGGER.error("REI plugin from " + modContainer.getMetadata().getId() + " is not loaded because it is too old!"); - } - - boolean networkingLoaded = FabricLoader.getInstance().isModLoaded("fabric-networking-v0"); - if (!networkingLoaded) { - RoughlyEnoughItemsState.error("Fabric API is not installed!", "https://www.curseforge.com/minecraft/mc-mods/fabric-api/files/all"); - return; - } - Executor.run(() -> () -> { - ClientSidePacketRegistry.INSTANCE.register(RoughlyEnoughItemsNetwork.CREATE_ITEMS_MESSAGE_PACKET, (packetContext, packetByteBuf) -> { - ItemStack stack = packetByteBuf.readItemStack(); - String player = packetByteBuf.readString(32767); - packetContext.getPlayer().addMessage(new LiteralText(I18n.translate("text.rei.cheat_items").replaceAll("\\{item_name}", EntryStack.create(stack.copy()).asFormattedText().getString()).replaceAll("\\{item_count}", stack.copy().getCount() + "").replaceAll("\\{player_name}", player)), false); - }); - ClientSidePacketRegistry.INSTANCE.register(RoughlyEnoughItemsNetwork.NOT_ENOUGH_ITEMS_PACKET, (packetContext, packetByteBuf) -> { - Screen currentScreen = MinecraftClient.getInstance().currentScreen; - if (currentScreen instanceof CraftingTableScreen) { - RecipeBookWidget recipeBookGui = ((RecipeBookProvider) currentScreen).getRecipeBookWidget(); - RecipeBookGhostSlots ghostSlots = recipeBookGui.ghostSlots; - ghostSlots.reset(); - - List> input = Lists.newArrayList(); - int mapSize = packetByteBuf.readInt(); - for (int i = 0; i < mapSize; i++) { - List list = Lists.newArrayList(); - int count = packetByteBuf.readInt(); - for (int j = 0; j < count; j++) { - list.add(packetByteBuf.readItemStack()); - } - input.add(list); - } - - ghostSlots.addSlot(Ingredient.ofItems(Items.STONE), 381203812, 12738291); - CraftingTableContainer container = ((CraftingTableScreen) currentScreen).getContainer(); - for (int i = 0; i < input.size(); i++) { - List stacks = input.get(i); - if (!stacks.isEmpty()) { - Slot slot = container.getSlot(i + container.getCraftingResultSlotIndex() + 1); - ghostSlots.addSlot(Ingredient.ofStacks(stacks.toArray(new ItemStack[0])), slot.xPosition, slot.yPosition); - } - } - } - }); - }); - } - - private void detectFabricLoader() { - Executor.run(() -> () -> { - try { - FabricLoader instance = FabricLoader.getInstance(); - for (Field field : instance.getClass().getDeclaredFields()) { - if (Logger.class.isAssignableFrom(field.getType())) { - field.setAccessible(true); - Logger logger = (Logger) field.get(instance); - if (logger.getName().toLowerCase(Locale.ROOT).contains("subsystem")) { - File reiConfigFolder = new File(instance.getConfigDirectory(), "roughlyenoughitems"); - File ignoreFile = new File(reiConfigFolder, ".ignoresubsystem"); - if (!ignoreFile.exists()) { - RoughlyEnoughItemsState.warn("Subsystem is detected (probably though Aristois), please contact support from them if anything happens."); - RoughlyEnoughItemsState.onContinue(() -> { - try { - reiConfigFolder.mkdirs(); - ignoreFile.createNewFile(); - } catch (IOException e) { - e.printStackTrace(); - } - }); - } - } - } - } - } catch (Throwable ignored) { - } - }); - } - - private void discoverPluginEntries() { - for (REIPluginEntry reiPlugin : FabricLoader.getInstance().getEntrypoints("rei_plugins", REIPluginEntry.class)) { - try { - if (!REIPluginV0.class.isAssignableFrom(reiPlugin.getClass())) - throw new IllegalArgumentException("REI plugin is too old!"); - registerPlugin(reiPlugin); - } catch (Exception e) { - e.printStackTrace(); - RoughlyEnoughItemsCore.LOGGER.error("Can't load REI plugins from %s: %s", reiPlugin.getClass(), e.getLocalizedMessage()); - } - } - for (REIPluginV0 reiPlugin : FabricLoader.getInstance().getEntrypoints("rei_plugins_v0", REIPluginV0.class)) { - try { - registerPlugin(reiPlugin); - } catch (Exception e) { - e.printStackTrace(); - RoughlyEnoughItemsCore.LOGGER.error("Can't load REI plugins from %s: %s", reiPlugin.getClass(), e.getLocalizedMessage()); - } - } - - // Test Only - loadTestPlugins(); - } - - private void loadTestPlugins() { - if (isDebugModeEnabled()) { - registerPlugin(new REITestPlugin()); - } - } - - private boolean shouldReturn(Screen screen) { - if (screen == null) return true; - return shouldReturn(screen.getClass()); - } - - private boolean shouldReturn(Class screen) { - try { - for (OverlayDecider decider : DisplayHelper.getInstance().getAllOverlayDeciders()) { - if (!decider.isHandingScreen(screen)) - continue; - ActionResult result = decider.shouldScreenBeOverlayed(screen); - if (result != ActionResult.PASS) - return result == ActionResult.FAIL || REIHelper.getInstance().getPreviousContainerScreen() == null; - } - } catch (ConcurrentModificationException ignored) { - } - return true; - } - - private void registerClothEvents() { - final Identifier recipeButtonTex = new Identifier("textures/gui/recipe_button.png"); - long[] lastSync = {-1}; - ClothClientHooks.SYNC_RECIPES.register((minecraftClient, recipeManager, synchronizeRecipesS2CPacket) -> syncRecipes(lastSync)); - ClothClientHooks.SCREEN_ADD_BUTTON.register((minecraftClient, screen, abstractButtonWidget) -> { - if (ConfigObject.getInstance().doesDisableRecipeBook() && screen instanceof ContainerScreen && abstractButtonWidget instanceof TexturedButtonWidget) - if (((TexturedButtonWidget) abstractButtonWidget).texture.equals(recipeButtonTex)) - return ActionResult.FAIL; - return ActionResult.PASS; - }); - ClothClientHooks.SCREEN_INIT_POST.register((minecraftClient, screen, screenHooks) -> { - if (shouldReturn(screen)) - return; - if (screen instanceof InventoryScreen && minecraftClient.interactionManager.hasCreativeInventory()) - return; - if (screen instanceof ContainerScreen) - ScreenHelper.setPreviousContainerScreen((ContainerScreen) screen); - boolean alreadyAdded = false; - for (Element element : Lists.newArrayList(screenHooks.cloth$getChildren())) - if (ContainerScreenOverlay.class.isAssignableFrom(element.getClass())) - if (alreadyAdded) - screenHooks.cloth$getChildren().remove(element); - else - alreadyAdded = true; - if (!alreadyAdded) - screenHooks.cloth$getChildren().add(ScreenHelper.getLastOverlay(true, false)); - }); - ClothClientHooks.SCREEN_RENDER_POST.register((matrices, minecraftClient, screen, i, i1, v) -> { - if (shouldReturn(screen)) - return; - ScreenHelper.getLastOverlay().render(matrices, i, i1, v); - }); - ClothClientHooks.SCREEN_MOUSE_DRAGGED.register((minecraftClient, screen, v, v1, i, v2, v3) -> { - if (shouldReturn(screen)) - return ActionResult.PASS; - if (ScreenHelper.isOverlayVisible() && ScreenHelper.getLastOverlay().mouseDragged(v, v1, i, v2, v3)) - return ActionResult.SUCCESS; - return ActionResult.PASS; - }); - ClothClientHooks.SCREEN_MOUSE_CLICKED.register((minecraftClient, screen, v, v1, i) -> { - isLeftModePressed = true; - if (ScreenHelper.getOptionalOverlay().isPresent()) - if (screen instanceof CreativeInventoryScreen) - if (ScreenHelper.isOverlayVisible() && ScreenHelper.getLastOverlay().mouseClicked(v, v1, i)) { - screen.setFocused(ScreenHelper.getLastOverlay()); - if (i == 0) - screen.setDragging(true); - return ActionResult.SUCCESS; - } - return ActionResult.PASS; - }); - ClothClientHooks.SCREEN_MOUSE_RELEASED.register((minecraftClient, screen, v, v1, i) -> { - isLeftModePressed = false; - if (shouldReturn(screen)) - return ActionResult.PASS; - if (ScreenHelper.getOptionalOverlay().isPresent()) - if (ScreenHelper.isOverlayVisible() && ScreenHelper.getLastOverlay().mouseReleased(v, v1, i)) { - return ActionResult.SUCCESS; - } - return ActionResult.PASS; - }); - ClothClientHooks.SCREEN_MOUSE_SCROLLED.register((minecraftClient, screen, v, v1, v2) -> { - if (shouldReturn(screen)) - return ActionResult.PASS; - if (ScreenHelper.isOverlayVisible() && ScreenHelper.getLastOverlay().mouseScrolled(v, v1, v2)) - return ActionResult.SUCCESS; - return ActionResult.PASS; - }); - ClothClientHooks.SCREEN_CHAR_TYPED.register((minecraftClient, screen, character, keyCode) -> { - if (shouldReturn(screen)) - return ActionResult.PASS; - if (ScreenHelper.getLastOverlay().charTyped(character, keyCode)) - return ActionResult.SUCCESS; - return ActionResult.PASS; - }); - ClothClientHooks.SCREEN_LATE_RENDER.register((matrices, minecraftClient, screen, i, i1, v) -> { - if (shouldReturn(screen)) - return; - if (!ScreenHelper.isOverlayVisible()) - return; - ScreenHelper.getLastOverlay().lateRender(matrices, i, i1, v); - }); - ClothClientHooks.SCREEN_KEY_PRESSED.register((minecraftClient, screen, i, i1, i2) -> { - if (shouldReturn(screen)) - return ActionResult.PASS; - if (screen instanceof ContainerScreen && ConfigObject.getInstance().doesDisableRecipeBook() && ConfigObject.getInstance().doesFixTabCloseContainer()) - if (i == 258 && minecraftClient.options.keyInventory.matchesKey(i, i1)) { - minecraftClient.player.closeContainer(); - return ActionResult.SUCCESS; - } - if (screen.getFocused() != null && screen.getFocused() instanceof TextFieldWidget || (screen.getFocused() instanceof RecipeBookWidget && ((RecipeBookWidget) screen.getFocused()).searchField != null && ((RecipeBookWidget) screen.getFocused()).searchField.isFocused())) - return ActionResult.PASS; - if (ScreenHelper.getLastOverlay().keyPressed(i, i1, i2)) - return ActionResult.SUCCESS; - return ActionResult.PASS; - }); - } - -} diff --git a/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsNetwork.java b/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsNetwork.java deleted file mode 100644 index 044b2ae4a..000000000 --- a/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsNetwork.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * This file is licensed under the MIT License, part of Roughly Enough Items. - * Copyright (c) 2018, 2019, 2020 shedaniel - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package me.shedaniel.rei; - -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; -import io.netty.buffer.Unpooled; -import me.shedaniel.math.api.Executor; -import me.shedaniel.rei.server.InputSlotCrafter; -import net.fabricmc.api.ModInitializer; -import net.fabricmc.fabric.api.network.ServerSidePacketRegistry; -import net.fabricmc.loader.api.FabricLoader; -import net.minecraft.container.Container; -import net.minecraft.container.CraftingContainer; -import net.minecraft.container.PlayerContainer; -import net.minecraft.entity.player.PlayerInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.network.PacketByteBuf; -import net.minecraft.server.network.ServerPlayerEntity; -import net.minecraft.text.TranslatableText; -import net.minecraft.util.Formatting; -import net.minecraft.util.Identifier; -import net.minecraft.util.Util; -import net.minecraft.util.math.MathHelper; - -import java.util.Comparator; -import java.util.List; -import java.util.Map; - -public class RoughlyEnoughItemsNetwork implements ModInitializer { - - public static final Identifier DELETE_ITEMS_PACKET = new Identifier("roughlyenoughitems", "delete_item"); - public static final Identifier CREATE_ITEMS_PACKET = new Identifier("roughlyenoughitems", "create_item"); - public static final Identifier CREATE_ITEMS_GRAB_PACKET = new Identifier("roughlyenoughitems", "create_item_grab"); - public static final Identifier CREATE_ITEMS_MESSAGE_PACKET = new Identifier("roughlyenoughitems", "ci_msg"); - public static final Identifier MOVE_ITEMS_PACKET = new Identifier("roughlyenoughitems", "move_items"); - public static final Identifier NOT_ENOUGH_ITEMS_PACKET = new Identifier("roughlyenoughitems", "og_not_enough"); - - @Override - public void onInitialize() { - boolean loaded = FabricLoader.getInstance().isModLoaded("fabric-networking-v0"); - if (!loaded) { - RoughlyEnoughItemsState.error("Fabric API is not installed!", "https://www.curseforge.com/minecraft/mc-mods/fabric-api/files/all"); - return; - } - Executor.run(() -> () -> { - FabricLoader.getInstance().getEntrypoints("rei_containers", Runnable.class).forEach(Runnable::run); - ServerSidePacketRegistry.INSTANCE.register(DELETE_ITEMS_PACKET, (packetContext, packetByteBuf) -> { - ServerPlayerEntity player = (ServerPlayerEntity) packetContext.getPlayer(); - if (player.getServer().getPermissionLevel(player.getGameProfile()) < player.getServer().getOpPermissionLevel()) { - player.addMessage(new TranslatableText("text.rei.no_permission_cheat").formatted(Formatting.RED), false); - return; - } - if (!player.inventory.getCursorStack().isEmpty()) { - player.inventory.setCursorStack(ItemStack.EMPTY); - player.updateCursorStack(); - } - }); - ServerSidePacketRegistry.INSTANCE.register(CREATE_ITEMS_PACKET, (packetContext, packetByteBuf) -> { - ServerPlayerEntity player = (ServerPlayerEntity) packetContext.getPlayer(); - if (player.getServer().getPermissionLevel(player.getGameProfile()) < player.getServer().getOpPermissionLevel()) { - player.addMessage(new TranslatableText("text.rei.no_permission_cheat").formatted(Formatting.RED), false); - return; - } - ItemStack stack = packetByteBuf.readItemStack(); - if (player.inventory.insertStack(stack.copy())) { - ServerSidePacketRegistry.INSTANCE.sendToPlayer(player, RoughlyEnoughItemsNetwork.CREATE_ITEMS_MESSAGE_PACKET, new PacketByteBuf(Unpooled.buffer()).writeItemStack(stack.copy()).writeString(player.getEntityName(), 32767)); - } else - player.addMessage(new TranslatableText("text.rei.failed_cheat_items"), false); - }); - ServerSidePacketRegistry.INSTANCE.register(CREATE_ITEMS_GRAB_PACKET, (packetContext, packetByteBuf) -> { - ServerPlayerEntity player = (ServerPlayerEntity) packetContext.getPlayer(); - if (player.getServer().getPermissionLevel(player.getGameProfile()) < player.getServer().getOpPermissionLevel()) { - player.addMessage(new TranslatableText("text.rei.no_permission_cheat").formatted(Formatting.RED), false); - return; - } - - PlayerInventory inventory = player.inventory; - ItemStack itemStack = packetByteBuf.readItemStack(); - ItemStack stack = itemStack.copy(); - if (!inventory.getCursorStack().isEmpty() && ItemStack.areItemsEqual(inventory.getCursorStack(), stack) && ItemStack.areTagsEqual(inventory.getCursorStack(), stack)) { - stack.setCount(MathHelper.clamp(stack.getCount() + inventory.getCursorStack().getCount(), 1, stack.getMaxCount())); - } else if (!inventory.getCursorStack().isEmpty()) { - return; - } - inventory.setCursorStack(stack.copy()); - player.updateCursorStack(); - ServerSidePacketRegistry.INSTANCE.sendToPlayer(player, RoughlyEnoughItemsNetwork.CREATE_ITEMS_MESSAGE_PACKET, new PacketByteBuf(Unpooled.buffer()).writeItemStack(itemStack.copy()).writeString(player.getEntityName(), 32767)); - }); - ServerSidePacketRegistry.INSTANCE.register(MOVE_ITEMS_PACKET, (packetContext, packetByteBuf) -> { - Identifier category = packetByteBuf.readIdentifier(); - ServerPlayerEntity player = (ServerPlayerEntity) packetContext.getPlayer(); - Container container = player.container; - PlayerContainer playerContainer = player.playerContainer; - try { - boolean shift = packetByteBuf.readBoolean(); - Map> input = Maps.newHashMap(); - int mapSize = packetByteBuf.readInt(); - for (int i = 0; i < mapSize; i++) { - List list = Lists.newArrayList(); - int count = packetByteBuf.readInt(); - for (int j = 0; j < count; j++) { - list.add(packetByteBuf.readItemStack()); - } - input.put(i, list); - } - try { - InputSlotCrafter.start(category, container, player, input, shift); - } catch (InputSlotCrafter.NotEnoughMaterialsException e) { - if (!(container instanceof CraftingContainer)) - return; - PacketByteBuf buf = new PacketByteBuf(Unpooled.buffer()); - buf.writeInt(input.size()); - input.entrySet().stream().sorted(Comparator.comparingInt(Map.Entry::getKey)).forEach(entry -> { - List stacks = entry.getValue(); - buf.writeInt(stacks.size()); - for (ItemStack stack : stacks) { - buf.writeItemStack(stack); - } - }); - if (ServerSidePacketRegistry.INSTANCE.canPlayerReceive(player, NOT_ENOUGH_ITEMS_PACKET)) { - ServerSidePacketRegistry.INSTANCE.sendToPlayer(player, NOT_ENOUGH_ITEMS_PACKET, buf); - } - } catch (IllegalStateException e) { - player.sendMessage(new TranslatableText(e.getMessage()).formatted(Formatting.RED), Util.NIL_UUID); - } catch (Exception e) { - player.sendMessage(new TranslatableText("error.rei.internal.error", e.getMessage()).formatted(Formatting.RED), Util.NIL_UUID); - e.printStackTrace(); - } - } catch (Exception e) { - e.printStackTrace(); - } - }); - }); - } - -} diff --git a/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsState.java b/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsState.java deleted file mode 100644 index 2f5240d09..000000000 --- a/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsState.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * This file is licensed under the MIT License, part of Roughly Enough Items. - * Copyright (c) 2018, 2019, 2020 shedaniel - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package me.shedaniel.rei; - -import net.fabricmc.api.EnvType; -import net.fabricmc.loader.api.FabricLoader; -import net.minecraft.util.Pair; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.jetbrains.annotations.ApiStatus; - -import java.util.ArrayList; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; - -@ApiStatus.Internal -public class RoughlyEnoughItemsState { - private RoughlyEnoughItemsState() {} - - public static final Logger LOGGER = LogManager.getFormatterLogger("REI"); - - private static List> errors = new ArrayList<>(); - private static List> warnings = new ArrayList<>(); - private static Set errorSet = new LinkedHashSet<>(); - private static Set warningSet = new LinkedHashSet<>(); - private static List continueCallbacks = new ArrayList<>(); - - public static void error(String reason) { - if (FabricLoader.getInstance().getEnvironmentType() == EnvType.SERVER || FabricLoader.getInstance().isDevelopmentEnvironment()) - throw new RuntimeException(reason); - if (RoughlyEnoughItemsState.errorSet.add(reason + " " + null)) { - RoughlyEnoughItemsState.errors.add(new Pair<>(reason, null)); - LOGGER.error(reason); - } - } - - public static void error(String reason, String link) { - if (FabricLoader.getInstance().getEnvironmentType() == EnvType.SERVER || FabricLoader.getInstance().isDevelopmentEnvironment()) - throw new RuntimeException(reason + " " + link); -