diff options
| author | shedaniel <daniel@shedaniel.me> | 2021-02-28 02:07:47 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2021-02-28 02:07:47 +0800 |
| commit | 69d386214f5d3471a3ef1e5533037cdc32648c57 (patch) | |
| tree | a78d97ca416909ce68c3e5c11e1a1412e6fc174e /default-plugin | |
| parent | 542eb5154ebce387312ca3691f743b89e4aef99e (diff) | |
| download | RoughlyEnoughItems-69d386214f5d3471a3ef1e5533037cdc32648c57.tar.gz RoughlyEnoughItems-69d386214f5d3471a3ef1e5533037cdc32648c57.tar.bz2 RoughlyEnoughItems-69d386214f5d3471a3ef1e5533037cdc32648c57.zip | |
Port to Architectury Multiloader
Signed-off-by: shedaniel <daniel@shedaniel.me>
Diffstat (limited to 'default-plugin')
| -rw-r--r-- | default-plugin/build.gradle | 19 | ||||
| -rw-r--r-- | default-plugin/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java | 53 | ||||
| -rw-r--r-- | default-plugin/src/main/resources/fabric.mod.json | 29 | ||||
| -rw-r--r-- | default-plugin/src/main/resources/icon.png | bin | 27270 -> 0 bytes | |||
| -rw-r--r-- | default-plugin/src/main/resources/roughlyenoughitems-default-plugin.accessWidener | 21 |
5 files changed, 44 insertions, 78 deletions
diff --git a/default-plugin/build.gradle b/default-plugin/build.gradle index 159cda85d..4f7fbee58 100644 --- a/default-plugin/build.gradle +++ b/default-plugin/build.gradle @@ -1,9 +1,22 @@ archivesBaseName = "default-plugin" loom { - accessWidener = file("src/main/resources/roughlyenoughitems-default-plugin.accessWidener") + accessWidener = gradle.rootProject.project("fabric").file("src/main/resources/roughlyenoughitems.accessWidener") } dependencies { - compile project(path: ":api", configuration: "dev") -}
\ No newline at end of file + modCompileOnly("net.fabricmc:fabric-loader:${project.fabricloader_version}") + modCompileOnly("me.shedaniel.cloth:cloth-config:${cloth_config_version}") + modCompileOnly("me.shedaniel:architectury:${architectury_version}") + compileOnly(project(path: ":api")) +} + +architectury { + common() +} + +remapJar { + afterEvaluate { + remapAccessWidener.set(false) + } +} diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java index edd91e2ba..289ba480b 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java @@ -30,6 +30,7 @@ import it.unimi.dsi.fastutil.objects.Object2FloatMap; import it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet; import it.unimi.dsi.fastutil.objects.ReferenceSet; import me.shedaniel.architectury.hooks.FluidStackHooks; +import me.shedaniel.architectury.platform.Platform; import me.shedaniel.math.Rectangle; import me.shedaniel.rei.api.*; import me.shedaniel.rei.api.ingredient.EntryIngredient; @@ -344,32 +345,34 @@ public class DefaultPlugin implements REIPlugin, BuiltinPlugin { }); registry.registerDisplay(new DefaultBeaconBaseDisplay(CollectionUtils.map(Lists.newArrayList(BlockTags.BEACON_BASE_BLOCKS.getValues()), ItemStack::new))); registry.registerDisplay(new DefaultBeaconPaymentDisplay(CollectionUtils.map(Lists.newArrayList(ItemTags.BEACON_PAYMENT_ITEMS.getValues()), ItemStack::new))); - Set<Potion> potions = Sets.newLinkedHashSet(); - for (Ingredient container : PotionBrewing.ALLOWED_CONTAINERS) { - for (PotionBrewing.Mix<Potion> mix : PotionBrewing.POTION_MIXES) { - Potion from = mix.from; - Ingredient ingredient = mix.ingredient; - Potion to = mix.to; - Ingredient base = Ingredient.of(Arrays.stream(container.getItems()) - .map(ItemStack::copy) - .map(stack -> PotionUtils.setPotion(stack, from))); - ItemStack output = Arrays.stream(container.getItems()) - .map(ItemStack::copy) - .map(stack -> PotionUtils.setPotion(stack, to)) - .findFirst().orElse(ItemStack.EMPTY); - registerBrewingRecipe(base, ingredient, output); - potions.add(from); - potions.add(to); + if (Platform.isFabric()) { + Set<Potion> potions = Sets.newLinkedHashSet(); + for (Ingredient container : PotionBrewing.ALLOWED_CONTAINERS) { + for (PotionBrewing.Mix<Potion> mix : PotionBrewing.POTION_MIXES) { + Potion from = mix.from; + Ingredient ingredient = mix.ingredient; + Potion to = mix.to; + Ingredient base = Ingredient.of(Arrays.stream(container.getItems()) + .map(ItemStack::copy) + .map(stack -> PotionUtils.setPotion(stack, from))); + ItemStack output = Arrays.stream(container.getItems()) + .map(ItemStack::copy) + .map(stack -> PotionUtils.setPotion(stack, to)) + .findFirst().orElse(ItemStack.EMPTY); + registerBrewingRecipe(base, ingredient, output); + potions.add(from); + potions.add(to); + } } - } - for (Potion potion : potions) { - for (PotionBrewing.Mix<Item> mix : PotionBrewing.CONTAINER_MIXES) { - Item from = mix.from; - Ingredient ingredient = mix.ingredient; - Item to = mix.to; - Ingredient base = Ingredient.of(PotionUtils.setPotion(new ItemStack(from), potion)); - ItemStack output = PotionUtils.setPotion(new ItemStack(to), potion); - registerBrewingRecipe(base, ingredient, output); + for (Potion potion : potions) { + for (PotionBrewing.Mix<Item> mix : PotionBrewing.CONTAINER_MIXES) { + Item from = mix.from; + Ingredient ingredient = mix.ingredient; + Item to = mix.to; + Ingredient base = Ingredient.of(PotionUtils.setPotion(new ItemStack(from), potion)); + ItemStack output = PotionUtils.setPotion(new ItemStack(to), potion); + registerBrewingRecipe(base, ingredient, output); + } } } } diff --git a/default-plugin/src/main/resources/fabric.mod.json b/default-plugin/src/main/resources/fabric.mod.json deleted file mode 100644 index c6b67960d..000000000 --- a/default-plugin/src/main/resources/fabric.mod.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "schemaVersion": 1, - "id": "roughlyenoughitems-default-plugin", - "name": "REI (Default Plugin)", - "description": "The default implementation of handling vanilla features.", - "version": "${version}", - "authors": [ - "shedaniel" - ], - "contact": { - "homepage": "https://www.curseforge.com/minecraft/mc-mods/roughly-enough-items", - "sources": "https://github.com/shedaniel/RoughlyEnoughItems", - "issues": "https://github.com/shedaniel/RoughlyEnoughItems/issues" - }, - "license": "MIT", - "icon": "icon.png", - "entrypoints": { - "rei_plugins": [ - "me.shedaniel.rei.plugin.DefaultPlugin" - ], - "rei_containers": [ - "me.shedaniel.rei.plugin.DefaultServerContainerPlugin" - ] - }, - "accessWidener": "roughlyenoughitems-default-plugin.accessWidener", - "custom": { - "modmenu:parent": "roughlyenoughitems" - } -} diff --git a/default-plugin/src/main/resources/icon.png b/default-plugin/src/main/resources/icon.png Binary files differdeleted file mode 100644 index b7a48aef0..000000000 --- a/default-plugin/src/main/resources/icon.png +++ /dev/null diff --git a/default-plugin/src/main/resources/roughlyenoughitems-default-plugin.accessWidener b/default-plugin/src/main/resources/roughlyenoughitems-default-plugin.accessWidener deleted file mode 100644 index 7a3f5ba99..000000000 --- a/default-plugin/src/main/resources/roughlyenoughitems-default-plugin.accessWidener +++ /dev/null @@ -1,21 +0,0 @@ -accessWidener v1 named -accessible field net/minecraft/world/item/BucketItem content Lnet/minecraft/world/level/material/Fluid; -accessible field net/minecraft/client/gui/screens/inventory/EffectRenderingInventoryScreen doRenderEffects Z -accessible field net/minecraft/client/gui/screens/recipebook/RecipeBookComponent ghostRecipe Lnet/minecraft/client/gui/screens/recipebook/GhostRecipe; -accessible field net/minecraft/client/gui/screens/recipebook/RecipeBookComponent searchBox Lnet/minecraft/client/gui/components/EditBox; -accessible field net/minecraft/client/gui/screens/recipebook/RecipeBookComponent tabButtons Ljava/util/List; -accessible field net/minecraft/client/gui/screens/inventory/AbstractContainerScreen leftPos I -accessible field net/minecraft/client/gui/screens/inventory/AbstractContainerScreen topPos I -accessible field net/minecraft/client/gui/screens/inventory/AbstractContainerScreen imageWidth I -accessible field net/minecraft/client/gui/screens/inventory/AbstractContainerScreen imageHeight I -accessible field net/minecraft/client/gui/screens/inventory/AbstractContainerScreen hoveredSlot Lnet/minecraft/world/inventory/Slot; -accessible method net/minecraft/client/gui/GuiComponent innerBlit (Lcom/mojang/math/Matrix4f;IIIIIFFFF)V -accessible field net/minecraft/world/item/crafting/UpgradeRecipe base Lnet/minecraft/world/item/crafting/Ingredient; -accessible field net/minecraft/world/item/crafting/UpgradeRecipe addition Lnet/minecraft/world/item/crafting/Ingredient; -accessible field net/minecraft/world/item/alchemy/PotionBrewing ALLOWED_CONTAINERS Ljava/util/List; -accessible field net/minecraft/world/item/alchemy/PotionBrewing POTION_MIXES Ljava/util/List; -accessible field net/minecraft/world/item/alchemy/PotionBrewing CONTAINER_MIXES Ljava/util/List; -accessible class net/minecraft/world/item/alchemy/PotionBrewing$Mix -accessible field net/minecraft/world/item/alchemy/PotionBrewing$Mix from Ljava/lang/Object; -accessible field net/minecraft/world/item/alchemy/PotionBrewing$Mix to Ljava/lang/Object; -accessible field net/minecraft/world/item/alchemy/PotionBrewing$Mix ingredient Lnet/minecraft/world/item/crafting/Ingredient; |
