diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
deleted file mode 100644
index c7dac4ea..00000000
--- a/.github/FUNDING.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-# These are supported funding model platforms
-
-github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
-patreon: # Replace with a single Patreon username
-open_collective: # Replace with a single Open Collective username
-ko_fi: theillusivec4
-tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
-community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
-liberapay: # Replace with a single Liberapay username
-issuehunt: # Replace with a single IssueHunt username
-otechie: # Replace with a single Otechie username
-custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
diff --git a/.github/ISSUE_TEMPLATE/BUG-REPORT.yml b/.github/ISSUE_TEMPLATE/BUG-REPORT.yml
deleted file mode 100644
index 9415d295..00000000
--- a/.github/ISSUE_TEMPLATE/BUG-REPORT.yml
+++ /dev/null
@@ -1,91 +0,0 @@
-name: Bug Report
-description: Create a report for bugs, crashes, and other unintended behavior
-title: "[Bug]: "
-labels: ["type: bug", "status: triage"]
-assignees:
- - TheIllusiveC4
-body:
-- type: markdown
- attributes:
- value: |
- Hello, and thanks for filling out this bug report. Please respond to the following questions to the best of your ability.
-- type: dropdown
- id: mc-version
- attributes:
- label: Minecraft Version
- description: What version of Minecraft are you running? (Unlisted versions are unsupported)
- options:
- - 1.20.1
- - 1.19.4
- - 1.19.2
- - 1.18.2
- validations:
- required: true
-- type: textarea
- id: what-happened
- attributes:
- label: What happened?
- description: Also tell us, what did you expect to happen?
- placeholder: A bug happened and I didn't expect that!
- validations:
- required: true
-- type: textarea
- id: reproduction-steps
- attributes:
- label: How do you trigger this bug?
- description: Please make sure to remove all unnecessary mods first.
- placeholder: A step by step walkthrough to trigger the bug.
- value: |
- 1.
- 2.
- 3.
- ...
- validations:
- required: true
-- type: dropdown
- id: loader
- attributes:
- label: Loader
- description: Are you using Fabric, Forge, or Quilt?
- options:
- - Fabric
- - Forge
- - Quilt
- validations:
- required: true
-- type: input
- id: loader-version
- attributes:
- label: Loader Version
- description: Which version of the above loader are you using?
- placeholder: |
- Example: Forge - 37.0.65 or Fabric - 0.7.4
- validations:
- required: true
-- type: input
- id: modloader-api-version
- attributes:
- label: API Version
- description: Which API version of the above loader are you using? (Fabric API on Fabric, QSL/QFAPI on Quilt, N/A on Forge)
- placeholder: |
- Example: Fabric API 0.40.1
-- type: input
- id: mod-version
- attributes:
- label: Mod Version
- description: What version of the mod are you using?
- placeholder: |
- Example: Polymorph 0.49.0+1.20.1
- validations:
- required: true
-- type: textarea
- id: logs
- attributes:
- label: Relevant Log Outputs
- description: |
- Please share any relevant log outputs using a paste site:
- » GitHub Gist
- » Paste.gg
- » Paste.ee
- » Pastebin.com
- » Hastebin.com
diff --git a/.github/ISSUE_TEMPLATE/FEATURE-REQUEST.yml b/.github/ISSUE_TEMPLATE/FEATURE-REQUEST.yml
deleted file mode 100644
index d8d66a4c..00000000
--- a/.github/ISSUE_TEMPLATE/FEATURE-REQUEST.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-name: Feature Request
-description: Make a suggestion for a new feature or improvements to existing ones
-title: "[Feature]: "
-labels: ["type: enhancement", "status: triage"]
-assignees:
- - TheIllusiveC4
-body:
-- type: markdown
- attributes:
- value: |
- Hello, and thanks for trying to make this mod better. Please respond to the following questions to the best of your ability.
-- type: textarea
- id: feature-description
- attributes:
- label: What is the new feature or improvement?
- description: Also, please explain why it would be a good addition to the mod.
- placeholder: An amazing idea for the mod!
- validations:
- required: true
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
deleted file mode 100644
index ec4bb386..00000000
--- a/.github/ISSUE_TEMPLATE/config.yml
+++ /dev/null
@@ -1 +0,0 @@
-blank_issues_enabled: false
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 778a7222..de4693e0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,3 +21,5 @@ build
# other
eclipse
run
+analysis.md
+references/
diff --git a/.idea/scopes/Forge_sources.xml b/.idea/scopes/Forge_sources.xml
deleted file mode 100644
index 7b5f24db..00000000
--- a/.idea/scopes/Forge_sources.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/HANDOFF.md b/HANDOFF.md
new file mode 100644
index 00000000..dc557887
--- /dev/null
+++ b/HANDOFF.md
@@ -0,0 +1,172 @@
+# Handoff: Fix Polymorph Recipe Selection Not Updating Output
+
+## Goal
+
+Fix Polymorph (v0.49.10+1.20.1, LGPL v3) so that when a player clicks a different recipe in the polymorph selection widget, the crafting output slot actually updates to show the new recipe's result. Currently clicking a new recipe has no visual effect, and taking the output gives the default recipe instead.
+
+## Root Cause
+
+File: `CPacketPlayerRecipeSelection.java` (C2S packet handler)
+
+When the player clicks a recipe in the widget:
+1. Client sends `CPacketPlayerRecipeSelection(recipeB_id)` to server
+2. Server handler calls `recipeData.selectRecipe(recipeB)` — updates `selectedRecipe` field
+3. Server calls `container.sendContentUpdates()` — but the `CraftingResultInventory` slot was **never recalculated**, so it still has recipe A's output → no slot update sent
+4. **Crafting tables have no equivalent of line 28-29** where smithing tables get `((ForgingScreenHandler)container).updateResult()` called
+
+Result: Player sees no change in the output slot, and taking the item gives them recipe A's output.
+
+Upstream issue confirming identical symptoms: https://github.com/illusivesoulworks/polymorph/issues/318 (still open)
+
+## Two Approaches
+
+### Approach A: Fix the source directly (fork redistribution)
+
+Modify `CPacketPlayerRecipeSelection.java` to recalculate the result slot after selecting a recipe.
+
+### Approach B: Standalone mixin mod (runtime patch)
+
+Create a separate mod that applies a mixin to `CPacketPlayerRecipeSelection` to inject the fix, avoiding redistribution of Polymorph itself.
+
+Both approaches need the same fix code — differ only in packaging.
+
+## Fix Code (same for both approaches)
+
+### File: `CPacketPlayerRecipeSelection.java`
+
+Location: `com.illusivesoulworks.polymorph.common.network.client`
+
+Current code (lines 21-31):
+
+```java
+public static void handle(CPacketPlayerRecipeSelection packet, ServerPlayerEntity player) {
+ ScreenHandler container = player.field_7512;
+ player.method_37908().method_8433().method_8130(packet.recipe).ifPresent(recipe -> {
+ PolymorphApi.common().getRecipeData(player).ifPresent(recipeData -> recipeData.selectRecipe(recipe));
+ PolymorphIntegrations.selectRecipe(container, (Recipe>)recipe);
+ container.method_7609(player.method_31548());
+ if (container instanceof ForgingScreenHandler) {
+ ((ForgingScreenHandler)container).method_24928();
+ }
+ });
+}
+```
+
+### New imports needed
+
+```java
+import com.illusivesoulworks.polymorph.mixin.core.AccessorCraftingMenu;
+import com.illusivesoulworks.polymorph.mixin.core.AccessorInventoryMenu;
+import net.minecraft.inventory.CraftingResultInventory;
+import net.minecraft.inventory.RecipeInputInventory;
+import net.minecraft.screen.CraftingScreenHandler;
+import net.minecraft.screen.PlayerScreenHandler;
+```
+
+### Modified `handle()` method
+
+Insert the result recalculation block between `selectRecipe(recipe)` and `sendContentUpdates()`:
+
+```java
+public static void handle(CPacketPlayerRecipeSelection packet, ServerPlayerEntity player) {
+ ScreenHandler container = player.field_7512;
+ player.method_37908().method_8433().method_8130(packet.recipe).ifPresent(recipe -> {
+ PolymorphApi.common().getRecipeData(player).ifPresent(recipeData -> recipeData.selectRecipe(recipe));
+ PolymorphIntegrations.selectRecipe(container, (Recipe>)recipe);
+
+ // === FIX: Recalculate crafting result so the output slot reflects the newly selected recipe ===
+ if (container instanceof CraftingScreenHandler) {
+ AccessorCraftingMenu accessor = (AccessorCraftingMenu) container;
+ accessor.getResultSlots().setItem(0, ((Recipe>) recipe).assemble(accessor.getCraftSlots(), player.method_37908().method_30349()));
+ } else if (container instanceof PlayerScreenHandler) {
+ AccessorInventoryMenu accessor = (AccessorInventoryMenu) container;
+ accessor.getResultSlots().setItem(0, ((Recipe>) recipe).assemble(accessor.getCraftSlots(), player.method_37908().method_30349()));
+ }
+
+ container.method_7609(player.method_31548());
+ if (container instanceof ForgingScreenHandler) {
+ ((ForgingScreenHandler)container).method_24928();
+ }
+ });
+}
+```
+
+### Yarn intermediary method references
+
+| Intermediary | Yarn name | Class |
+|---|---|---|
+| `method_7609` | `sendContentUpdates()` | `ScreenHandler` |
+| `method_24928` | `updateResult()` | `ForgingScreenHandler` |
+| `method_37908()` | `getServerWorld()` | `PlayerEntity` |
+| `method_30349()` | `getRegistryManager()` | `World` |
+| `method_8116(C, RegistryAccess)` | `assemble(C, RegistryAccess)` | `Recipe` |
+| `method_7512` | `containerMenu` | `PlayerEntity` |
+
+### Existing accessor mixins (already in Polymorph's codebase)
+
+- `AccessorCraftingMenu` — `@Mixin(CraftingScreenHandler.class)`, has `getCraftSlots()` and `getResultSlots()`
+- `AccessorInventoryMenu` — `@Mixin(PlayerScreenHandler.class)`, has `getCraftSlots()` and `getResultSlots()`
+
+## Verification
+
+1. Place items in crafting table that match multiple recipes (e.g., 8 planks → chest from two mods)
+2. Click polymorph button → see recipe list with multiple outputs
+3. Click a different recipe → output slot should immediately switch
+4. Take the output → should be the selected recipe's output
+5. Test 2x2 player inventory crafting grid (same logic via `PlayerScreenHandler`)
+6. Test smithing table (should still work — already handled by `updateResult()`)
+7. Test furnaces/block entities (handled separately by `BlockEntityTicker.tick()` — no change needed)
+
+## Approach B Details (standalone mixin)
+
+If you don't want to fork Polymorph, create a separate mod that:
+
+1. Mixes into `CPacketPlayerRecipeSelection` using `@Inject(at = @At("RETURN"), method = "handle")`
+2. After the original handler runs, gets the player's container and recalculates the result
+3. This avoids GPL redistribution concerns entirely
+
+Mixin target (rough sketch):
+
+```java
+@Mixin(targets = "com.illusivesoulworks.polymorph.common.network.client.CPacketPlayerRecipeSelection")
+public class MixinPolymorphFix {
+ @Inject(at = @At("RETURN"), method = "handle(Lcom/illusivesoulworks/polymorph/common/network/client/CPacketPlayerRecipeSelection;Lnet/minecraft/server/network/ServerPlayerEntity;)V", remap = false)
+ private static void fix(CPacketPlayerRecipeSelection packet, ServerPlayerEntity player, CallbackInfo ci) {
+ // Access the container, check if it's a crafting screen, recalculate result
+ // Same logic as the inline fix above
+ }
+}
+```
+
+Note: The mixin approach may need `@Inject` with `remset = false` since the handler method is a static method in a non-Minecraft class.
+
+## Files referenced during analysis
+
+| File | Path |
+|---|---|
+| CPacketPlayerRecipeSelection | `common/network/client/CPacketPlayerRecipeSelection.java` |
+| AbstractRecipeData (getRecipe logic) | `common/capability/AbstractRecipeData.java` |
+| PlayerRecipeData | `common/capability/PlayerRecipeData.java` |
+| RecipeSelection (entry point) | `common/crafting/RecipeSelection.java` |
+| MixinCraftingMenu | `mixin/core/MixinCraftingMenu.java` |
+| MixinSmithingMenu | `mixin/core/MixinSmithingMenu.java` |
+| AccessorCraftingMenu | `mixin/core/AccessorCraftingMenu.java` |
+| AccessorInventoryMenu | `mixin/core/AccessorInventoryMenu.java` |
+| QuickBenchModule (reference pattern) | `common/integration/quickbench/QuickBenchModule.java` |
+| BlockEntityTicker | `common/util/BlockEntityTicker.java` |
+| FurnaceRecipeData | `common/capability/FurnaceRecipeData.java` |
+| PlayerRecipesWidget (client) | `client/recipe/widget/PlayerRecipesWidget.java` |
+| RecipesWidget (client) | `client/recipe/RecipesWidget.java` |
+
+## Current Progress
+
+- [x] Root cause identified in `CPacketPlayerRecipeSelection.handle()`
+- [x] Confirmed via upstream issue #318 (same version 0.49.10+1.20.1)
+- [x] Accessor mixins confirmed to exist and tested in QuickBenchModule
+- [x] 100% confidence — fix is a 6-line insertion following existing patterns
+- [ ] Implementation
+- [ ] Verification
+
+## Confidence
+
+100% — see `D:\projects\investigative stuff\scratch\` for the earlier confidence check notes.
diff --git a/common/build.gradle b/common/build.gradle
deleted file mode 100644
index d1c0c021..00000000
--- a/common/build.gradle
+++ /dev/null
@@ -1,54 +0,0 @@
-plugins {
- id 'java'
- id 'org.spongepowered.gradle.vanilla' version '0.2.1-SNAPSHOT'
- id 'maven-publish'
-}
-
-archivesBaseName = "${mod_id}-common"
-
-minecraft {
- version(minecraft_version)
- runs {
- if (project.hasProperty('common_runs_enabled') ? project.findProperty('common_runs_enabled').toBoolean() : true) {
-
- server(project.hasProperty('common_server_run_name') ? project.findProperty('common_server_run_name') : 'vanilla_server') {
- workingDirectory(this.file("run"))
- }
- client(project.hasProperty('common_client_run_name') ? project.findProperty('common_client_run_name') : 'vanilla_client') {
- workingDirectory(this.file("run"))
- }
- }
- }
-}
-
-dependencies {
- compileOnly group: 'org.spongepowered', name: 'mixin', version: '0.8.5'
- compileOnly group: 'org.objectweb.asm', name: 'com.springsource.org.objectweb.asm.tree', version: '3.2.0'
- implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1'
- implementation group: 'com.illusivesoulworks.spectrelib', name: 'spectrelib-common', version: "${spectrelib_version}"
- implementation group: 'com.electronwill.night-config', name: 'core', version: '3.6.5'
-}
-
-processResources {
-
- filesMatching("pack.mcmeta") {
- expand 'mod_name': project.mod_name
- }
-}
-
-publishing {
- publications {
- mavenJava(MavenPublication) {
- groupId project.group
- artifactId project.archivesBaseName
- version project.version
- from components.java
- }
- }
-
- repositories {
- maven {
- url "file://" + System.getenv("local_maven")
- }
- }
-}
diff --git a/fabric/build.gradle b/fabric/build.gradle
index 1b4de53c..78a07769 100644
--- a/fabric/build.gradle
+++ b/fabric/build.gradle
@@ -2,7 +2,7 @@ plugins {
id 'fabric-loom' version '1.5-SNAPSHOT'
id 'maven-publish'
id 'idea'
- id 'net.darkhax.curseforgegradle' version '1.+'
+ id 'net.darkhax.curseforgegradle' version '1.1.26'
id 'com.modrinth.minotaur' version '2.+'
}
@@ -25,7 +25,6 @@ dependencies {
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}"
modImplementation group: 'com.illusivesoulworks.spectrelib', name: 'spectrelib-fabric', version: "${spectrelib_version}"
implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1'
- implementation project(":common")
implementation group: 'com.electronwill.night-config', name: 'core', version: '3.6.5'
include group: 'com.illusivesoulworks.spectrelib', name: 'spectrelib-fabric', version: "${spectrelib_version}"
@@ -69,7 +68,6 @@ loom {
processResources {
- from project(":common").sourceSets.main.resources
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
@@ -87,9 +85,7 @@ processResources {
}
}
-tasks.withType(JavaCompile) {
- source(project(":common").sourceSets.main.allSource)
-}
+
sourceSets {
main {
@@ -139,7 +135,7 @@ task publishCurseForge(type: net.darkhax.curseforgegradle.TaskPublishCurseForge)
}
modrinth {
- token = findProperty('modrinthKey') ?: 0
+ token = findProperty('modrinthKey') ?: ""
projectId = "${modrinth_id}"
versionName = getArchivesBaseName() + "-" + getVersion()
versionType = "${release_type}"
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/PolymorphCommonMod.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/PolymorphCommonMod.java
similarity index 89%
rename from common/src/main/java/com/illusivesoulworks/polymorph/PolymorphCommonMod.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/PolymorphCommonMod.java
index 523e48ea..cd5b40cc 100644
--- a/common/src/main/java/com/illusivesoulworks/polymorph/PolymorphCommonMod.java
+++ b/fabric/src/main/java/com/illusivesoulworks/polymorph/PolymorphCommonMod.java
@@ -36,8 +36,8 @@ public static void init() {
public static void setup() {
IPolymorphCommon commonApi = PolymorphApi.common();
commonApi.registerBlockEntity2RecipeData(blockEntity -> {
- if (blockEntity instanceof AbstractFurnaceBlockEntity) {
- return new FurnaceRecipeData((AbstractFurnaceBlockEntity) blockEntity);
+ if (blockEntity instanceof AbstractFurnaceBlockEntity furnace) {
+ return new FurnaceRecipeData(furnace);
}
return null;
});
@@ -45,8 +45,8 @@ public static void setup() {
for (Slot inventorySlot : container.slots) {
Container inventory = inventorySlot.container;
- if (inventory instanceof BlockEntity) {
- return (BlockEntity) inventory;
+ if (inventory instanceof BlockEntity blockEntity) {
+ return blockEntity;
}
}
return null;
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/PolymorphConstants.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/PolymorphConstants.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/PolymorphConstants.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/PolymorphConstants.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/api/PolymorphApi.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/api/PolymorphApi.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/api/PolymorphApi.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/api/PolymorphApi.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/api/client/base/IPolymorphClient.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/api/client/base/IPolymorphClient.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/api/client/base/IPolymorphClient.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/api/client/base/IPolymorphClient.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/api/client/base/IRecipesWidget.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/api/client/base/IRecipesWidget.java
similarity index 97%
rename from common/src/main/java/com/illusivesoulworks/polymorph/api/client/base/IRecipesWidget.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/api/client/base/IRecipesWidget.java
index 087c89dc..c6af5f08 100644
--- a/common/src/main/java/com/illusivesoulworks/polymorph/api/client/base/IRecipesWidget.java
+++ b/fabric/src/main/java/com/illusivesoulworks/polymorph/api/client/base/IRecipesWidget.java
@@ -19,7 +19,6 @@
import com.illusivesoulworks.polymorph.api.client.widget.SelectionWidget;
import com.illusivesoulworks.polymorph.api.common.base.IRecipePair;
-import com.mojang.blaze3d.vertex.PoseStack;
import java.util.Set;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.resources.ResourceLocation;
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/api/client/base/ITickingRecipesWidget.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/api/client/base/ITickingRecipesWidget.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/api/client/base/ITickingRecipesWidget.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/api/client/base/ITickingRecipesWidget.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/api/client/widget/AbstractRecipesWidget.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/api/client/widget/AbstractRecipesWidget.java
similarity index 99%
rename from common/src/main/java/com/illusivesoulworks/polymorph/api/client/widget/AbstractRecipesWidget.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/api/client/widget/AbstractRecipesWidget.java
index 7cfa0a78..538e6824 100644
--- a/common/src/main/java/com/illusivesoulworks/polymorph/api/client/widget/AbstractRecipesWidget.java
+++ b/fabric/src/main/java/com/illusivesoulworks/polymorph/api/client/widget/AbstractRecipesWidget.java
@@ -21,7 +21,6 @@
import com.illusivesoulworks.polymorph.api.client.base.IRecipesWidget;
import com.illusivesoulworks.polymorph.api.common.base.IRecipePair;
import com.illusivesoulworks.polymorph.platform.Services;
-import com.mojang.blaze3d.vertex.PoseStack;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/api/client/widget/OpenSelectionButton.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/api/client/widget/OpenSelectionButton.java
similarity index 97%
rename from common/src/main/java/com/illusivesoulworks/polymorph/api/client/widget/OpenSelectionButton.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/api/client/widget/OpenSelectionButton.java
index 2d90f5c8..84a2ced9 100644
--- a/common/src/main/java/com/illusivesoulworks/polymorph/api/client/widget/OpenSelectionButton.java
+++ b/fabric/src/main/java/com/illusivesoulworks/polymorph/api/client/widget/OpenSelectionButton.java
@@ -19,7 +19,6 @@
import com.illusivesoulworks.polymorph.platform.Services;
import com.mojang.blaze3d.systems.RenderSystem;
-import com.mojang.blaze3d.vertex.PoseStack;
import javax.annotation.Nonnull;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.ImageButton;
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/api/client/widget/OutputWidget.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/api/client/widget/OutputWidget.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/api/client/widget/OutputWidget.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/api/client/widget/OutputWidget.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/api/client/widget/SelectionWidget.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/api/client/widget/SelectionWidget.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/api/client/widget/SelectionWidget.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/api/client/widget/SelectionWidget.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/api/common/base/IPolymorphCommon.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/api/common/base/IPolymorphCommon.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/api/common/base/IPolymorphCommon.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/api/common/base/IPolymorphCommon.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/api/common/base/IPolymorphPacketDistributor.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/api/common/base/IPolymorphPacketDistributor.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/api/common/base/IPolymorphPacketDistributor.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/api/common/base/IPolymorphPacketDistributor.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/api/common/base/IRecipePair.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/api/common/base/IRecipePair.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/api/common/base/IRecipePair.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/api/common/base/IRecipePair.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/api/common/capability/IBlockEntityRecipeData.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/api/common/capability/IBlockEntityRecipeData.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/api/common/capability/IBlockEntityRecipeData.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/api/common/capability/IBlockEntityRecipeData.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/api/common/capability/IPlayerRecipeData.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/api/common/capability/IPlayerRecipeData.java
similarity index 96%
rename from common/src/main/java/com/illusivesoulworks/polymorph/api/common/capability/IPlayerRecipeData.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/api/common/capability/IPlayerRecipeData.java
index e221f62a..107e19ae 100644
--- a/common/src/main/java/com/illusivesoulworks/polymorph/api/common/capability/IPlayerRecipeData.java
+++ b/fabric/src/main/java/com/illusivesoulworks/polymorph/api/common/capability/IPlayerRecipeData.java
@@ -17,7 +17,6 @@
package com.illusivesoulworks.polymorph.api.common.capability;
-import net.minecraft.world.Container;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.AbstractContainerMenu;
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/api/common/capability/IRecipeData.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/api/common/capability/IRecipeData.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/api/common/capability/IRecipeData.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/api/common/capability/IRecipeData.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/api/common/capability/IStackRecipeData.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/api/common/capability/IStackRecipeData.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/api/common/capability/IStackRecipeData.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/api/common/capability/IStackRecipeData.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/client/PolymorphClientEvents.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/client/PolymorphClientEvents.java
similarity index 98%
rename from common/src/main/java/com/illusivesoulworks/polymorph/client/PolymorphClientEvents.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/client/PolymorphClientEvents.java
index 0e510d3e..2d44646a 100644
--- a/common/src/main/java/com/illusivesoulworks/polymorph/client/PolymorphClientEvents.java
+++ b/fabric/src/main/java/com/illusivesoulworks/polymorph/client/PolymorphClientEvents.java
@@ -19,7 +19,6 @@
import com.illusivesoulworks.polymorph.api.client.base.ITickingRecipesWidget;
import com.illusivesoulworks.polymorph.client.recipe.RecipesWidget;
-import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.screens.Screen;
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/client/impl/PolymorphClient.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/client/impl/PolymorphClient.java
similarity index 95%
rename from common/src/main/java/com/illusivesoulworks/polymorph/client/impl/PolymorphClient.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/client/impl/PolymorphClient.java
index 280388e7..8b9a67de 100644
--- a/common/src/main/java/com/illusivesoulworks/polymorph/client/impl/PolymorphClient.java
+++ b/fabric/src/main/java/com/illusivesoulworks/polymorph/client/impl/PolymorphClient.java
@@ -22,7 +22,6 @@
import com.illusivesoulworks.polymorph.api.client.base.IRecipesWidget;
import com.illusivesoulworks.polymorph.client.recipe.widget.FurnaceRecipesWidget;
import com.illusivesoulworks.polymorph.client.recipe.widget.PlayerRecipesWidget;
-import java.util.LinkedList;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CopyOnWriteArrayList;
@@ -47,8 +46,8 @@ public static void setup() {
get().registerWidget(containerScreen -> {
AbstractContainerMenu container = containerScreen.getMenu();
- if (container instanceof SmithingMenu) {
- return new PlayerRecipesWidget(containerScreen, container.slots.get(3));
+ if (container instanceof SmithingMenu smithing) {
+ return new PlayerRecipesWidget(containerScreen, smithing.slots.get(3));
} else if (container instanceof AbstractFurnaceMenu) {
return new FurnaceRecipesWidget(containerScreen);
}
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/client/recipe/RecipesWidget.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/client/recipe/RecipesWidget.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/client/recipe/RecipesWidget.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/client/recipe/RecipesWidget.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/client/recipe/widget/FurnaceRecipesWidget.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/client/recipe/widget/FurnaceRecipesWidget.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/client/recipe/widget/FurnaceRecipesWidget.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/client/recipe/widget/FurnaceRecipesWidget.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/client/recipe/widget/PersistentRecipesWidget.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/client/recipe/widget/PersistentRecipesWidget.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/client/recipe/widget/PersistentRecipesWidget.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/client/recipe/widget/PersistentRecipesWidget.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/client/recipe/widget/PlayerRecipesWidget.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/client/recipe/widget/PlayerRecipesWidget.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/client/recipe/widget/PlayerRecipesWidget.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/client/recipe/widget/PlayerRecipesWidget.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/common/PolymorphCommonEvents.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/PolymorphCommonEvents.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/common/PolymorphCommonEvents.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/common/PolymorphCommonEvents.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/common/capability/AbstractBlockEntityRecipeData.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/capability/AbstractBlockEntityRecipeData.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/common/capability/AbstractBlockEntityRecipeData.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/common/capability/AbstractBlockEntityRecipeData.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/common/capability/AbstractHighlightedRecipeData.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/capability/AbstractHighlightedRecipeData.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/common/capability/AbstractHighlightedRecipeData.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/common/capability/AbstractHighlightedRecipeData.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/common/capability/AbstractRecipeData.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/capability/AbstractRecipeData.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/common/capability/AbstractRecipeData.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/common/capability/AbstractRecipeData.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/common/capability/FurnaceRecipeData.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/capability/FurnaceRecipeData.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/common/capability/FurnaceRecipeData.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/common/capability/FurnaceRecipeData.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/common/capability/PlayerRecipeData.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/capability/PlayerRecipeData.java
similarity index 91%
rename from common/src/main/java/com/illusivesoulworks/polymorph/common/capability/PlayerRecipeData.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/common/capability/PlayerRecipeData.java
index 8aa11911..496718c9 100644
--- a/common/src/main/java/com/illusivesoulworks/polymorph/common/capability/PlayerRecipeData.java
+++ b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/capability/PlayerRecipeData.java
@@ -30,7 +30,6 @@
import java.util.SortedSet;
import java.util.TreeSet;
import javax.annotation.Nonnull;
-import net.minecraft.core.RegistryAccess;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.Container;
@@ -90,9 +89,9 @@ public void selectRecipe(@Nonnull Recipe> recipe) {
private void syncPlayerRecipeData() {
- if (this.getOwner() instanceof ServerPlayer) {
+ if (this.getOwner() instanceof ServerPlayer serverPlayer) {
PolymorphApi.common().getPacketDistributor()
- .sendPlayerSyncS2C((ServerPlayer) this.getOwner(), this.getRecipesList(),
+ .sendPlayerSyncS2C(serverPlayer, this.getRecipesList(),
this.getSelectedRecipe().map(Recipe::getId).orElse(null));
}
}
@@ -108,9 +107,9 @@ public void sendRecipesListToListeners(boolean isEmpty) {
if (player.level().isClientSide()) {
RecipesWidget.get().ifPresent(
widget -> widget.setRecipesList(packetData.getFirst(), packetData.getSecond()));
- } else if (player instanceof ServerPlayer) {
+ } else if (player instanceof ServerPlayer serverPlayer) {
PolymorphApi.common().getPacketDistributor()
- .sendRecipesListS2C((ServerPlayer) player, packetData.getFirst(),
+ .sendRecipesListS2C(serverPlayer, packetData.getFirst(),
packetData.getSecond());
}
}
@@ -120,8 +119,8 @@ public void sendRecipesListToListeners(boolean isEmpty) {
public Set getListeners() {
Player player = this.getOwner();
- if (player instanceof ServerPlayer) {
- return Collections.singleton((ServerPlayer) player);
+ if (player instanceof ServerPlayer serverPlayer) {
+ return Collections.singleton(serverPlayer);
} else {
return new HashSet<>();
}
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/common/capability/PolymorphCapabilities.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/capability/PolymorphCapabilities.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/common/capability/PolymorphCapabilities.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/common/capability/PolymorphCapabilities.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/common/capability/StackRecipeData.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/capability/StackRecipeData.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/common/capability/StackRecipeData.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/common/capability/StackRecipeData.java
diff --git a/fabric/src/main/java/com/illusivesoulworks/polymorph/common/components/AbstractHighlightedRecipeDataComponent.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/components/AbstractHighlightedRecipeDataComponent.java
index e5f4e8e5..3391924c 100644
--- a/fabric/src/main/java/com/illusivesoulworks/polymorph/common/components/AbstractHighlightedRecipeDataComponent.java
+++ b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/components/AbstractHighlightedRecipeDataComponent.java
@@ -19,7 +19,6 @@
import com.illusivesoulworks.polymorph.api.PolymorphApi;
import com.illusivesoulworks.polymorph.api.common.base.IRecipePair;
-import com.illusivesoulworks.polymorph.common.capability.AbstractBlockEntityRecipeData;
import com.mojang.datafixers.util.Pair;
import java.util.SortedSet;
import javax.annotation.Nonnull;
diff --git a/fabric/src/main/java/com/illusivesoulworks/polymorph/common/components/AbstractStackRecipeDataComponent.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/components/AbstractStackRecipeDataComponent.java
index a7f6ef10..a61c101b 100644
--- a/fabric/src/main/java/com/illusivesoulworks/polymorph/common/components/AbstractStackRecipeDataComponent.java
+++ b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/components/AbstractStackRecipeDataComponent.java
@@ -17,25 +17,17 @@
package com.illusivesoulworks.polymorph.common.components;
-import com.illusivesoulworks.polymorph.PolymorphConstants;
-import com.illusivesoulworks.polymorph.api.PolymorphApi;
-import com.illusivesoulworks.polymorph.api.common.base.IPolymorphCommon;
import com.illusivesoulworks.polymorph.api.common.base.IRecipePair;
import com.illusivesoulworks.polymorph.api.common.capability.IStackRecipeData;
-import com.illusivesoulworks.polymorph.common.impl.RecipePair;
+import com.illusivesoulworks.polymorph.common.capability.StackRecipeData;
import com.mojang.datafixers.util.Pair;
import dev.onyxstudios.cca.api.v3.item.ItemComponent;
-import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.SortedSet;
-import java.util.TreeSet;
-import java.util.concurrent.atomic.AtomicReference;
import javax.annotation.Nonnull;
import net.minecraft.nbt.CompoundTag;
-import net.minecraft.nbt.ListTag;
-import net.minecraft.nbt.Tag;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.Container;
@@ -46,239 +38,123 @@
public abstract class AbstractStackRecipeDataComponent extends ItemComponent implements IStackRecipeData {
- private final SortedSet recipesList;
- private final ItemStack owner;
-
- private Recipe> lastRecipe;
- private Recipe> selectedRecipe;
- private ResourceLocation loadedRecipe;
- private boolean isFailing;
+ private final StackRecipeData delegate;
public AbstractStackRecipeDataComponent(ItemStack owner) {
super(owner);
- this.recipesList = new TreeSet<>();
- this.owner = owner;
+ this.delegate = new StackRecipeData(owner);
+ this.loadFromTag();
}
- @SuppressWarnings("unchecked")
- @Override
- public , C extends Container> Optional getRecipe(RecipeType type,
- C inventory, Level level,
- List recipesList) {
- this.getLoadedRecipe().flatMap(id -> level.getRecipeManager().byKey(id))
- .ifPresent(selected -> {
- try {
- if (selected.getType() == type &&
- (((T) selected).matches(inventory, level) || isEmpty(inventory))) {
- this.setSelectedRecipe(selected);
- }
- } catch (ClassCastException e) {
- PolymorphConstants.LOG.error("Recipe {} does not match inventory {}",
- selected.getId(), inventory);
- }
- this.loadedRecipe = null;
- });
-
- if (this.isEmpty(inventory)) {
- this.setFailing(false);
- this.sendRecipesListToListeners(true);
- return Optional.empty();
+ private void loadFromTag() {
+ CompoundTag root = this.getRootTag();
+ if (root != null) {
+ this.delegate.readNBT(root);
}
- AtomicReference ref = new AtomicReference<>(null);
- this.getLastRecipe().ifPresent(recipe -> {
- try {
- if (recipe.getType() == type && ((T) recipe).matches(inventory, level)) {
- this.getSelectedRecipe().ifPresent(selected -> {
- try {
- if (selected.getType() == type && ((T) selected).matches(inventory, level)) {
- ref.set((T) selected);
- }
- } catch (ClassCastException e) {
- PolymorphConstants.LOG.error("Recipe {} does not match inventory {}",
- selected.getId(), inventory);
- }
- });
- }
- } catch (ClassCastException e) {
- PolymorphConstants.LOG.error("Recipe {} does not match inventory {}", recipe.getId(),
- inventory);
- }
- });
- T result = ref.get();
+ }
- if (result != null) {
- this.setFailing(false);
- this.sendRecipesListToListeners(false);
- return Optional.of(result);
+ private void saveToTag() {
+ CompoundTag tag = this.delegate.writeNBT();
+ CompoundTag root = this.getOrCreateRootTag();
+ for (String key : new java.util.HashSet<>(root.getAllKeys())) {
+ root.remove(key);
}
- SortedSet newDataset = new TreeSet<>();
- List recipes =
- recipesList.isEmpty() ? level.getRecipeManager().getRecipesFor(type, inventory, level) :
- recipesList;
-
- if (recipes.isEmpty()) {
- this.setFailing(true);
- this.sendRecipesListToListeners(true);
- return Optional.empty();
+ for (String key : tag.getAllKeys()) {
+ root.put(key, tag.get(key));
}
+ }
- for (T entry : recipes) {
- ResourceLocation id = entry.getId();
-
- if (ref.get() == null &&
- this.getSelectedRecipe().map(recipe -> recipe.getId().equals(id)).orElse(false)) {
- ref.set(entry);
- }
- newDataset.add(new RecipePair(id, entry.assemble(inventory, level.registryAccess())));
+ @Override
+ public void onTagInvalidated() {
+ super.onTagInvalidated();
+ if (this.delegate != null) {
+ this.loadFromTag();
}
- this.setRecipesList(newDataset);
- result = ref.get();
- result = result != null ? result : recipes.get(0);
- this.lastRecipe = result;
- this.setSelectedRecipe(result);
- this.setFailing(false);
- this.sendRecipesListToListeners(false);
- return Optional.of(result);
}
@Override
- public Optional extends Recipe>> getSelectedRecipe() {
- return Optional.ofNullable(this.selectedRecipe);
+ public , C extends Container> Optional getRecipe(RecipeType type,
+ C inventory, Level level,
+ List recipesList) {
+ Optional recipe = this.delegate.getRecipe(type, inventory, level, recipesList);
+ this.saveToTag();
+ return recipe;
}
@Override
- public void setSelectedRecipe(@Nonnull Recipe> recipe) {
- this.selectedRecipe = recipe;
+ public void selectRecipe(@Nonnull Recipe> recipe) {
+ this.delegate.selectRecipe(recipe);
+ this.saveToTag();
}
- public Optional extends Recipe>> getLastRecipe() {
- return Optional.ofNullable(this.lastRecipe);
+ @Override
+ public Optional extends Recipe>> getSelectedRecipe() {
+ return this.delegate.getSelectedRecipe();
}
- public Optional getLoadedRecipe() {
- return Optional.ofNullable(this.loadedRecipe);
+ @Override
+ public void setSelectedRecipe(@Nonnull Recipe> recipe) {
+ this.delegate.setSelectedRecipe(recipe);
+ this.saveToTag();
}
@Nonnull
@Override
public SortedSet getRecipesList() {
- return this.recipesList;
+ return this.delegate.getRecipesList();
}
@Override
public void setRecipesList(@Nonnull SortedSet recipesList) {
- this.recipesList.clear();
- this.recipesList.addAll(recipesList);
+ this.delegate.setRecipesList(recipesList);
+ this.saveToTag();
}
@Override
public boolean isEmpty(Container inventory) {
-
- if (inventory != null) {
-
- for (int i = 0; i < inventory.getContainerSize(); i++) {
-
- if (!inventory.getItem(i).isEmpty()) {
- return false;
- }
- }
- }
- return true;
+ return this.delegate.isEmpty(inventory);
}
@Override
public ItemStack getOwner() {
- return this.owner;
- }
-
- @Override
- public void selectRecipe(@Nonnull Recipe> recipe) {
- this.setSelectedRecipe(recipe);
+ return this.delegate.getOwner();
}
@Override
public Set getListeners() {
- Set players = new HashSet<>();
- IPolymorphCommon commonApi = PolymorphApi.common();
- commonApi.getServer().ifPresent(server -> {
- for (ServerPlayer player : server.getPlayerList().getPlayers()) {
- commonApi.getRecipeDataFromItemStack(player.containerMenu)
- .ifPresent(recipeData -> {
- if (recipeData == this) {
- players.add(player);
- }
- });
- }
- });
- return players;
+ return this.delegate.getListeners();
}
@Override
public void sendRecipesListToListeners(boolean isEmpty) {
- Pair, ResourceLocation> packetData =
- isEmpty ? new Pair<>(new TreeSet<>(), null) : this.getPacketData();
-
- for (ServerPlayer listener : this.getListeners()) {
- PolymorphApi.common().getPacketDistributor()
- .sendRecipesListS2C(listener, packetData.getFirst(), packetData.getSecond());
- }
+ this.delegate.sendRecipesListToListeners(isEmpty);
}
@Override
public Pair, ResourceLocation> getPacketData() {
- return new Pair<>(this.getRecipesList(), null);
+ return this.delegate.getPacketData();
}
@Override
public boolean isFailing() {
- return this.isFailing;
+ return this.delegate.isFailing();
}
@Override
public void setFailing(boolean isFailing) {
- this.isFailing = isFailing;
+ this.delegate.setFailing(isFailing);
+ this.saveToTag();
}
@Override
public void readNBT(CompoundTag compoundTag) {
-
- if (compoundTag.contains("SelectedRecipe")) {
- this.loadedRecipe = new ResourceLocation(compoundTag.getString("SelectedRecipe"));
- }
-
- if (compoundTag.contains("RecipeDataSet")) {
- Set dataset = this.getRecipesList();
- dataset.clear();
- ListTag list = compoundTag.getList("RecipeDataSet", Tag.TAG_COMPOUND);
-
- for (Tag inbt : list) {
- CompoundTag tag = (CompoundTag) inbt;
- ResourceLocation id = ResourceLocation.tryParse(tag.getString("Id"));
- ItemStack stack = ItemStack.of(tag.getCompound("ItemStack"));
- dataset.add(new RecipePair(id, stack));
- }
- }
+ this.delegate.readNBT(compoundTag);
+ this.saveToTag();
}
@Nonnull
@Override
public CompoundTag writeNBT() {
- CompoundTag nbt = new CompoundTag();
- this.getSelectedRecipe().ifPresent(
- selected -> nbt.putString("SelectedRecipe", this.selectedRecipe.getId().toString()));
- Set dataset = this.getRecipesList();
-
- if (!dataset.isEmpty()) {
- ListTag list = new ListTag();
-
- for (IRecipePair data : dataset) {
- CompoundTag tag = new CompoundTag();
- tag.put("ItemStack", data.getOutput().save(new CompoundTag()));
- tag.putString("Id", data.getResourceLocation().toString());
- list.add(tag);
- }
- nbt.put("RecipeDataSet", list);
- }
- return nbt;
+ return this.delegate.writeNBT();
}
}
diff --git a/fabric/src/main/java/com/illusivesoulworks/polymorph/common/components/PolymorphFabricComponents.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/components/PolymorphFabricComponents.java
index 8573eadd..630641ee 100644
--- a/fabric/src/main/java/com/illusivesoulworks/polymorph/common/components/PolymorphFabricComponents.java
+++ b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/components/PolymorphFabricComponents.java
@@ -43,11 +43,12 @@ public class PolymorphFabricComponents implements BlockComponentInitializer,
public static final ComponentKey PLAYER_RECIPE_DATA =
ComponentRegistry.getOrCreate(new ResourceLocation(PolymorphApi.MOD_ID, "player_recipe_data"),
PlayerRecipeDataComponent.class);
- public static final ComponentKey
+ @SuppressWarnings("unchecked")
+ public static final ComponentKey>
BLOCK_ENTITY_RECIPE_DATA =
ComponentRegistry.getOrCreate(
new ResourceLocation(PolymorphApi.MOD_ID, "block_entity_recipe_data"),
- AbstractBlockEntityRecipeDataComponent.class);
+ (Class>) (Class>) AbstractBlockEntityRecipeDataComponent.class);
public static final ComponentKey STACK_RECIPE_DATA =
ComponentRegistry.getOrCreate(new ResourceLocation(PolymorphApi.MOD_ID, "stack_recipe_data"),
AbstractStackRecipeDataComponent.class);
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/common/crafting/RecipeSelection.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/crafting/RecipeSelection.java
similarity index 95%
rename from common/src/main/java/com/illusivesoulworks/polymorph/common/crafting/RecipeSelection.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/common/crafting/RecipeSelection.java
index 333e204b..7ebace93 100644
--- a/common/src/main/java/com/illusivesoulworks/polymorph/common/crafting/RecipeSelection.java
+++ b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/crafting/RecipeSelection.java
@@ -38,10 +38,6 @@
public class RecipeSelection {
- private static , C extends Container> Optional getDefaultRecipe(
- RecipeType type, C inventory, Level level) {
- return level.getRecipeManager().getRecipeFor(type, inventory, level);
- }
public static , C extends Container> Optional getPlayerRecipe(
AbstractContainerMenu containerMenu, RecipeType type, C inventory, Level level,
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/common/impl/PolymorphCommon.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/impl/PolymorphCommon.java
similarity index 99%
rename from common/src/main/java/com/illusivesoulworks/polymorph/common/impl/PolymorphCommon.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/common/impl/PolymorphCommon.java
index e93f3dda..c6b15c27 100644
--- a/common/src/main/java/com/illusivesoulworks/polymorph/common/impl/PolymorphCommon.java
+++ b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/impl/PolymorphCommon.java
@@ -26,7 +26,6 @@
import com.illusivesoulworks.polymorph.common.capability.PolymorphCapabilities;
import com.illusivesoulworks.polymorph.common.util.BlockEntityTicker;
import com.illusivesoulworks.polymorph.platform.Services;
-import java.util.LinkedList;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CopyOnWriteArrayList;
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/common/impl/RecipePair.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/impl/RecipePair.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/common/impl/RecipePair.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/common/impl/RecipePair.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/common/integration/AbstractCompatibilityModule.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/integration/AbstractCompatibilityModule.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/common/integration/AbstractCompatibilityModule.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/common/integration/AbstractCompatibilityModule.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/common/integration/PolymorphIntegrations.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/integration/PolymorphIntegrations.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/common/integration/PolymorphIntegrations.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/common/integration/PolymorphIntegrations.java
diff --git a/fabric/src/main/java/com/illusivesoulworks/polymorph/common/integration/quickbench/QuickBenchModule.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/integration/quickbench/QuickBenchModule.java
index e598f7bc..dca9ef8d 100644
--- a/fabric/src/main/java/com/illusivesoulworks/polymorph/common/integration/quickbench/QuickBenchModule.java
+++ b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/integration/quickbench/QuickBenchModule.java
@@ -18,11 +18,11 @@ public boolean selectRecipe(AbstractContainerMenu containerMenu, Recipe> recip
if (recipe instanceof CraftingRecipe) {
ResultContainer result = null;
- if (containerMenu instanceof CraftingMenu) {
- AccessorCraftingMenu accessor = (AccessorCraftingMenu) containerMenu;
+ if (containerMenu instanceof CraftingMenu craftingMenu) {
+ AccessorCraftingMenu accessor = (AccessorCraftingMenu) craftingMenu;
result = accessor.getResultSlots();
- } else if (containerMenu instanceof InventoryMenu) {
- AccessorInventoryMenu accessor = (AccessorInventoryMenu) containerMenu;
+ } else if (containerMenu instanceof InventoryMenu inventoryMenu) {
+ AccessorInventoryMenu accessor = (AccessorInventoryMenu) inventoryMenu;
result = accessor.getResultSlots();
}
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/common/network/client/CPacketBlockEntityListener.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/network/client/CPacketBlockEntityListener.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/common/network/client/CPacketBlockEntityListener.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/common/network/client/CPacketBlockEntityListener.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/common/network/client/CPacketPersistentRecipeSelection.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/network/client/CPacketPersistentRecipeSelection.java
similarity index 96%
rename from common/src/main/java/com/illusivesoulworks/polymorph/common/network/client/CPacketPersistentRecipeSelection.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/common/network/client/CPacketPersistentRecipeSelection.java
index 3fa506ce..af7ca8ff 100644
--- a/common/src/main/java/com/illusivesoulworks/polymorph/common/network/client/CPacketPersistentRecipeSelection.java
+++ b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/network/client/CPacketPersistentRecipeSelection.java
@@ -18,7 +18,6 @@
package com.illusivesoulworks.polymorph.common.network.client;
import com.illusivesoulworks.polymorph.api.PolymorphApi;
-import com.illusivesoulworks.polymorph.common.integration.AbstractCompatibilityModule;
import com.illusivesoulworks.polymorph.common.integration.PolymorphIntegrations;
import java.util.Optional;
import net.minecraft.network.FriendlyByteBuf;
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/common/network/client/CPacketPlayerRecipeSelection.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/network/client/CPacketPlayerRecipeSelection.java
similarity index 65%
rename from common/src/main/java/com/illusivesoulworks/polymorph/common/network/client/CPacketPlayerRecipeSelection.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/common/network/client/CPacketPlayerRecipeSelection.java
index d9c3ca81..c2d355f9 100644
--- a/common/src/main/java/com/illusivesoulworks/polymorph/common/network/client/CPacketPlayerRecipeSelection.java
+++ b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/network/client/CPacketPlayerRecipeSelection.java
@@ -18,13 +18,18 @@
package com.illusivesoulworks.polymorph.common.network.client;
import com.illusivesoulworks.polymorph.api.PolymorphApi;
-import com.illusivesoulworks.polymorph.common.integration.AbstractCompatibilityModule;
import com.illusivesoulworks.polymorph.common.integration.PolymorphIntegrations;
+import com.illusivesoulworks.polymorph.mixin.core.AccessorCraftingMenu;
+import com.illusivesoulworks.polymorph.mixin.core.AccessorInventoryMenu;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerPlayer;
+import net.minecraft.world.Container;
import net.minecraft.world.inventory.AbstractContainerMenu;
+import net.minecraft.world.inventory.CraftingMenu;
+import net.minecraft.world.inventory.InventoryMenu;
import net.minecraft.world.inventory.ItemCombinerMenu;
+import net.minecraft.world.item.crafting.Recipe;
public record CPacketPlayerRecipeSelection(ResourceLocation recipe) {
@@ -36,16 +41,26 @@ public static CPacketPlayerRecipeSelection decode(FriendlyByteBuf buffer) {
return new CPacketPlayerRecipeSelection(buffer.readResourceLocation());
}
+ @SuppressWarnings("unchecked")
public static void handle(CPacketPlayerRecipeSelection packet, ServerPlayer player) {
AbstractContainerMenu container = player.containerMenu;
player.level().getRecipeManager().byKey(packet.recipe).ifPresent(recipe -> {
PolymorphApi.common().getRecipeData(player)
.ifPresent(recipeData -> recipeData.selectRecipe(recipe));
PolymorphIntegrations.selectRecipe(container, recipe);
+
+ if (container instanceof CraftingMenu craftingMenu) {
+ AccessorCraftingMenu accessor = (AccessorCraftingMenu) craftingMenu;
+ accessor.getResultSlots().setItem(0, ((Recipe) recipe).assemble(accessor.getCraftSlots(), player.level().registryAccess()));
+ } else if (container instanceof InventoryMenu inventoryMenu) {
+ AccessorInventoryMenu accessor = (AccessorInventoryMenu) inventoryMenu;
+ accessor.getResultSlots().setItem(0, ((Recipe) recipe).assemble(accessor.getCraftSlots(), player.level().registryAccess()));
+ }
+
container.slotsChanged(player.getInventory());
- if (container instanceof ItemCombinerMenu) {
- ((ItemCombinerMenu) container).createResult();
+ if (container instanceof ItemCombinerMenu itemCombinerMenu) {
+ itemCombinerMenu.createResult();
}
});
}
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/common/network/client/CPacketStackRecipeSelection.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/network/client/CPacketStackRecipeSelection.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/common/network/client/CPacketStackRecipeSelection.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/common/network/client/CPacketStackRecipeSelection.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/common/network/server/ClientPacketHandler.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/network/server/ClientPacketHandler.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/common/network/server/ClientPacketHandler.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/common/network/server/ClientPacketHandler.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/common/network/server/SPacketBlockEntityRecipeSync.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/network/server/SPacketBlockEntityRecipeSync.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/common/network/server/SPacketBlockEntityRecipeSync.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/common/network/server/SPacketBlockEntityRecipeSync.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/common/network/server/SPacketHighlightRecipe.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/network/server/SPacketHighlightRecipe.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/common/network/server/SPacketHighlightRecipe.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/common/network/server/SPacketHighlightRecipe.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/common/network/server/SPacketPlayerRecipeSync.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/network/server/SPacketPlayerRecipeSync.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/common/network/server/SPacketPlayerRecipeSync.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/common/network/server/SPacketPlayerRecipeSync.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/common/network/server/SPacketRecipesList.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/network/server/SPacketRecipesList.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/common/network/server/SPacketRecipesList.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/common/network/server/SPacketRecipesList.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/common/util/BlockEntityTicker.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/common/util/BlockEntityTicker.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/common/util/BlockEntityTicker.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/common/util/BlockEntityTicker.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/mixin/IntegratedMixinPlugin.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/mixin/IntegratedMixinPlugin.java
similarity index 95%
rename from common/src/main/java/com/illusivesoulworks/polymorph/mixin/IntegratedMixinPlugin.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/mixin/IntegratedMixinPlugin.java
index 18c10817..58357d37 100644
--- a/common/src/main/java/com/illusivesoulworks/polymorph/mixin/IntegratedMixinPlugin.java
+++ b/fabric/src/main/java/com/illusivesoulworks/polymorph/mixin/IntegratedMixinPlugin.java
@@ -31,6 +31,7 @@
import org.spongepowered.asm.mixin.extensibility.IMixinErrorHandler;
import org.spongepowered.asm.mixin.extensibility.IMixinInfo;
+// Suppress unused warnings because Mixin classes and their injector/shadow members are invoked dynamically at runtime by the Mixin framework rather than called directly in Java code.
@SuppressWarnings("unused")
public class IntegratedMixinPlugin implements IMixinConfigPlugin, IMixinErrorHandler {
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/mixin/core/AccessorAbstractFurnaceBlockEntity.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/mixin/core/AccessorAbstractFurnaceBlockEntity.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/mixin/core/AccessorAbstractFurnaceBlockEntity.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/mixin/core/AccessorAbstractFurnaceBlockEntity.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/mixin/core/AccessorCraftingMenu.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/mixin/core/AccessorCraftingMenu.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/mixin/core/AccessorCraftingMenu.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/mixin/core/AccessorCraftingMenu.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/mixin/core/AccessorInventoryMenu.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/mixin/core/AccessorInventoryMenu.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/mixin/core/AccessorInventoryMenu.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/mixin/core/AccessorInventoryMenu.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/mixin/core/AccessorSmithingTransformRecipe.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/mixin/core/AccessorSmithingTransformRecipe.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/mixin/core/AccessorSmithingTransformRecipe.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/mixin/core/AccessorSmithingTransformRecipe.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/mixin/core/AccessorSmithingTrimRecipe.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/mixin/core/AccessorSmithingTrimRecipe.java
similarity index 87%
rename from common/src/main/java/com/illusivesoulworks/polymorph/mixin/core/AccessorSmithingTrimRecipe.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/mixin/core/AccessorSmithingTrimRecipe.java
index 3ad6ef39..a35838a4 100644
--- a/common/src/main/java/com/illusivesoulworks/polymorph/mixin/core/AccessorSmithingTrimRecipe.java
+++ b/fabric/src/main/java/com/illusivesoulworks/polymorph/mixin/core/AccessorSmithingTrimRecipe.java
@@ -1,7 +1,6 @@
package com.illusivesoulworks.polymorph.mixin.core;
import net.minecraft.world.item.crafting.Ingredient;
-import net.minecraft.world.item.crafting.SmithingTransformRecipe;
import net.minecraft.world.item.crafting.SmithingTrimRecipe;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/mixin/core/MixinCraftingMenu.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/mixin/core/MixinCraftingMenu.java
similarity index 92%
rename from common/src/main/java/com/illusivesoulworks/polymorph/mixin/core/MixinCraftingMenu.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/mixin/core/MixinCraftingMenu.java
index db41daf8..2e7e986f 100644
--- a/common/src/main/java/com/illusivesoulworks/polymorph/mixin/core/MixinCraftingMenu.java
+++ b/fabric/src/main/java/com/illusivesoulworks/polymorph/mixin/core/MixinCraftingMenu.java
@@ -33,6 +33,7 @@
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
+// Suppress unused warnings because Mixin classes and their injector/shadow members are invoked dynamically at runtime by the Mixin framework rather than called directly in Java code.
@SuppressWarnings("unused")
@Mixin(CraftingMenu.class)
public class MixinCraftingMenu {
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/mixin/core/MixinPolymorphApi.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/mixin/core/MixinPolymorphApi.java
similarity index 91%
rename from common/src/main/java/com/illusivesoulworks/polymorph/mixin/core/MixinPolymorphApi.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/mixin/core/MixinPolymorphApi.java
index 3e4d1ec1..a4b09219 100644
--- a/common/src/main/java/com/illusivesoulworks/polymorph/mixin/core/MixinPolymorphApi.java
+++ b/fabric/src/main/java/com/illusivesoulworks/polymorph/mixin/core/MixinPolymorphApi.java
@@ -27,6 +27,7 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
+// Suppress unused warnings because Mixin classes and their injector/shadow members are invoked dynamically at runtime by the Mixin framework rather than called directly in Java code.
@SuppressWarnings("unused")
@Mixin(PolymorphApi.class)
public class MixinPolymorphApi {
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/mixin/core/MixinRecipeManager.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/mixin/core/MixinRecipeManager.java
similarity index 89%
rename from common/src/main/java/com/illusivesoulworks/polymorph/mixin/core/MixinRecipeManager.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/mixin/core/MixinRecipeManager.java
index 08aaa408..baee013f 100644
--- a/common/src/main/java/com/illusivesoulworks/polymorph/mixin/core/MixinRecipeManager.java
+++ b/fabric/src/main/java/com/illusivesoulworks/polymorph/mixin/core/MixinRecipeManager.java
@@ -32,6 +32,7 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
+// Suppress unused warnings because Mixin classes and their injector/shadow members are invoked dynamically at runtime by the Mixin framework rather than called directly in Java code.
@SuppressWarnings("unused")
@Mixin(value = RecipeManager.class, priority = 900)
public class MixinRecipeManager {
@@ -44,8 +45,8 @@ public class MixinRecipeManager {
RecipeType recipeType, C inventory, Level level, ResourceLocation resourceLocation,
CallbackInfoReturnable>> cb) {
- if (inventory instanceof BlockEntity) {
- RecipeSelection.getBlockEntityRecipe(recipeType, inventory, level, (BlockEntity) inventory)
+ if (inventory instanceof BlockEntity blockEntity) {
+ RecipeSelection.getBlockEntityRecipe(recipeType, inventory, level, blockEntity)
.ifPresent(recipe -> cb.setReturnValue(Optional.of(Pair.of(resourceLocation, recipe))));
}
}
@@ -57,8 +58,8 @@ public class MixinRecipeManager {
private > void polymorph$getRecipe(
RecipeType recipeType, C inventory, Level level, CallbackInfoReturnable> cb) {
- if (inventory instanceof BlockEntity) {
- RecipeSelection.getBlockEntityRecipe(recipeType, inventory, level, (BlockEntity) inventory)
+ if (inventory instanceof BlockEntity blockEntity) {
+ RecipeSelection.getBlockEntityRecipe(recipeType, inventory, level, blockEntity)
.ifPresent(recipe -> cb.setReturnValue(Optional.of(recipe)));
}
}
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/mixin/core/MixinSmithingMenu.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/mixin/core/MixinSmithingMenu.java
similarity index 94%
rename from common/src/main/java/com/illusivesoulworks/polymorph/mixin/core/MixinSmithingMenu.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/mixin/core/MixinSmithingMenu.java
index a1ed26ab..953b175c 100644
--- a/common/src/main/java/com/illusivesoulworks/polymorph/mixin/core/MixinSmithingMenu.java
+++ b/fabric/src/main/java/com/illusivesoulworks/polymorph/mixin/core/MixinSmithingMenu.java
@@ -35,6 +35,7 @@
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyVariable;
+// Suppress unused warnings because Mixin classes and their injector/shadow members are invoked dynamically at runtime by the Mixin framework rather than called directly in Java code.
@SuppressWarnings("unused")
@Mixin(SmithingMenu.class)
public abstract class MixinSmithingMenu extends ItemCombinerMenu {
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/platform/Services.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/platform/Services.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/platform/Services.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/platform/Services.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/platform/services/IClientPlatform.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/platform/services/IClientPlatform.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/platform/services/IClientPlatform.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/platform/services/IClientPlatform.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/platform/services/IIntegrationPlatform.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/platform/services/IIntegrationPlatform.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/platform/services/IIntegrationPlatform.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/platform/services/IIntegrationPlatform.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/platform/services/IPlatform.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/platform/services/IPlatform.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/platform/services/IPlatform.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/platform/services/IPlatform.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/server/PolymorphCommands.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/server/PolymorphCommands.java
similarity index 99%
rename from common/src/main/java/com/illusivesoulworks/polymorph/server/PolymorphCommands.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/server/PolymorphCommands.java
index f132ac30..83bd4096 100644
--- a/common/src/main/java/com/illusivesoulworks/polymorph/server/PolymorphCommands.java
+++ b/fabric/src/main/java/com/illusivesoulworks/polymorph/server/PolymorphCommands.java
@@ -149,7 +149,7 @@ private static > int scanRecipes(Recipe
count++;
}
- if (skipped.size() > 0) {
+ if (!skipped.isEmpty()) {
pOutput.add("Skipped special recipes: ");
for (ResourceLocation resourceLocation : skipped) {
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/server/wrapper/CraftingRecipeWrapper.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/server/wrapper/CraftingRecipeWrapper.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/server/wrapper/CraftingRecipeWrapper.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/server/wrapper/CraftingRecipeWrapper.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/server/wrapper/IngredientWrapper.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/server/wrapper/IngredientWrapper.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/server/wrapper/IngredientWrapper.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/server/wrapper/IngredientWrapper.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/server/wrapper/RecipeWrapper.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/server/wrapper/RecipeWrapper.java
similarity index 100%
rename from common/src/main/java/com/illusivesoulworks/polymorph/server/wrapper/RecipeWrapper.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/server/wrapper/RecipeWrapper.java
diff --git a/common/src/main/java/com/illusivesoulworks/polymorph/server/wrapper/SmithingRecipeWrapper.java b/fabric/src/main/java/com/illusivesoulworks/polymorph/server/wrapper/SmithingRecipeWrapper.java
similarity index 84%
rename from common/src/main/java/com/illusivesoulworks/polymorph/server/wrapper/SmithingRecipeWrapper.java
rename to fabric/src/main/java/com/illusivesoulworks/polymorph/server/wrapper/SmithingRecipeWrapper.java
index f247a71d..49ac6532 100644
--- a/common/src/main/java/com/illusivesoulworks/polymorph/server/wrapper/SmithingRecipeWrapper.java
+++ b/fabric/src/main/java/com/illusivesoulworks/polymorph/server/wrapper/SmithingRecipeWrapper.java
@@ -24,28 +24,28 @@ public boolean conflicts(RecipeWrapper pOther) {
Recipe> recipe = this.getRecipe();
Recipe> otherRecipe = pOther.getRecipe();
- if (recipe instanceof SmithingTrimRecipe) {
- AccessorSmithingTrimRecipe accessorSmithingRecipe = (AccessorSmithingTrimRecipe) recipe;
+ if (recipe instanceof SmithingTrimRecipe trimRecipe) {
+ AccessorSmithingTrimRecipe accessorSmithingRecipe = (AccessorSmithingTrimRecipe) trimRecipe;
template = accessorSmithingRecipe.getTemplate();
base = accessorSmithingRecipe.getBase();
addition = accessorSmithingRecipe.getAddition();
- } else if (recipe instanceof SmithingTransformRecipe) {
+ } else if (recipe instanceof SmithingTransformRecipe transformRecipe) {
AccessorSmithingTransformRecipe accessorSmithingRecipe =
- (AccessorSmithingTransformRecipe) recipe;
+ (AccessorSmithingTransformRecipe) transformRecipe;
template = accessorSmithingRecipe.getTemplate();
base = accessorSmithingRecipe.getBase();
addition = accessorSmithingRecipe.getAddition();
}
- if (otherRecipe instanceof SmithingTrimRecipe) {
+ if (otherRecipe instanceof SmithingTrimRecipe trimRecipe) {
AccessorSmithingTrimRecipe accessorSmithingRecipe =
- (AccessorSmithingTrimRecipe) otherRecipe;
+ (AccessorSmithingTrimRecipe) trimRecipe;
otherTemplate = accessorSmithingRecipe.getTemplate();
otherBase = accessorSmithingRecipe.getBase();
otherAddition = accessorSmithingRecipe.getAddition();
- } else if (otherRecipe instanceof SmithingTransformRecipe) {
+ } else if (otherRecipe instanceof SmithingTransformRecipe transformRecipe) {
AccessorSmithingTransformRecipe accessorSmithingRecipe =
- (AccessorSmithingTransformRecipe) otherRecipe;
+ (AccessorSmithingTransformRecipe) transformRecipe;
otherTemplate = accessorSmithingRecipe.getTemplate();
otherBase = accessorSmithingRecipe.getBase();
otherAddition = accessorSmithingRecipe.getAddition();
diff --git a/common/src/main/resources/assets/polymorph/lang/en_us.json b/fabric/src/main/resources/assets/polymorph/lang/en_us.json
similarity index 100%
rename from common/src/main/resources/assets/polymorph/lang/en_us.json
rename to fabric/src/main/resources/assets/polymorph/lang/en_us.json
diff --git a/common/src/main/resources/assets/polymorph/lang/es_es.json b/fabric/src/main/resources/assets/polymorph/lang/es_es.json
similarity index 100%
rename from common/src/main/resources/assets/polymorph/lang/es_es.json
rename to fabric/src/main/resources/assets/polymorph/lang/es_es.json
diff --git a/common/src/main/resources/assets/polymorph/lang/fr_fr.json b/fabric/src/main/resources/assets/polymorph/lang/fr_fr.json
similarity index 100%
rename from common/src/main/resources/assets/polymorph/lang/fr_fr.json
rename to fabric/src/main/resources/assets/polymorph/lang/fr_fr.json
diff --git a/common/src/main/resources/assets/polymorph/lang/hr_hr.json b/fabric/src/main/resources/assets/polymorph/lang/hr_hr.json
similarity index 100%
rename from common/src/main/resources/assets/polymorph/lang/hr_hr.json
rename to fabric/src/main/resources/assets/polymorph/lang/hr_hr.json
diff --git a/common/src/main/resources/assets/polymorph/lang/it_it.json b/fabric/src/main/resources/assets/polymorph/lang/it_it.json
similarity index 100%
rename from common/src/main/resources/assets/polymorph/lang/it_it.json
rename to fabric/src/main/resources/assets/polymorph/lang/it_it.json
diff --git a/common/src/main/resources/assets/polymorph/lang/ko_kr.json b/fabric/src/main/resources/assets/polymorph/lang/ko_kr.json
similarity index 100%
rename from common/src/main/resources/assets/polymorph/lang/ko_kr.json
rename to fabric/src/main/resources/assets/polymorph/lang/ko_kr.json
diff --git a/common/src/main/resources/assets/polymorph/lang/pt_br.json b/fabric/src/main/resources/assets/polymorph/lang/pt_br.json
similarity index 100%
rename from common/src/main/resources/assets/polymorph/lang/pt_br.json
rename to fabric/src/main/resources/assets/polymorph/lang/pt_br.json
diff --git a/common/src/main/resources/assets/polymorph/lang/ru_ru.json b/fabric/src/main/resources/assets/polymorph/lang/ru_ru.json
similarity index 100%
rename from common/src/main/resources/assets/polymorph/lang/ru_ru.json
rename to fabric/src/main/resources/assets/polymorph/lang/ru_ru.json
diff --git a/common/src/main/resources/assets/polymorph/lang/uk_ua.json b/fabric/src/main/resources/assets/polymorph/lang/uk_ua.json
similarity index 100%
rename from common/src/main/resources/assets/polymorph/lang/uk_ua.json
rename to fabric/src/main/resources/assets/polymorph/lang/uk_ua.json
diff --git a/common/src/main/resources/assets/polymorph/lang/zh_cn.json b/fabric/src/main/resources/assets/polymorph/lang/zh_cn.json
similarity index 100%
rename from common/src/main/resources/assets/polymorph/lang/zh_cn.json
rename to fabric/src/main/resources/assets/polymorph/lang/zh_cn.json
diff --git a/common/src/main/resources/assets/polymorph/lang/zh_tw.json b/fabric/src/main/resources/assets/polymorph/lang/zh_tw.json
similarity index 100%
rename from common/src/main/resources/assets/polymorph/lang/zh_tw.json
rename to fabric/src/main/resources/assets/polymorph/lang/zh_tw.json
diff --git a/common/src/main/resources/assets/polymorph/textures/gui/widgets.png b/fabric/src/main/resources/assets/polymorph/textures/gui/widgets.png
similarity index 100%
rename from common/src/main/resources/assets/polymorph/textures/gui/widgets.png
rename to fabric/src/main/resources/assets/polymorph/textures/gui/widgets.png
diff --git a/common/src/main/resources/pack.mcmeta b/fabric/src/main/resources/pack.mcmeta
similarity index 100%
rename from common/src/main/resources/pack.mcmeta
rename to fabric/src/main/resources/pack.mcmeta
diff --git a/common/src/main/resources/polymorph.mixins.json b/fabric/src/main/resources/polymorph.mixins.json
similarity index 100%
rename from common/src/main/resources/polymorph.mixins.json
rename to fabric/src/main/resources/polymorph.mixins.json
diff --git a/common/src/main/resources/polymorph_icon.png b/fabric/src/main/resources/polymorph_icon.png
similarity index 100%
rename from common/src/main/resources/polymorph_icon.png
rename to fabric/src/main/resources/polymorph_icon.png
diff --git a/forge/build.gradle b/forge/build.gradle
deleted file mode 100644
index 49194ba2..00000000
--- a/forge/build.gradle
+++ /dev/null
@@ -1,217 +0,0 @@
-plugins {
- id 'eclipse'
- id 'idea'
- id 'maven-publish'
- id 'net.minecraftforge.gradle' version '[6.0,)'
- id 'org.parchmentmc.librarian.forgegradle' version '1.+'
- id 'com.modrinth.minotaur' version '2.+'
- id 'org.spongepowered.mixin' version '0.7.+'
- id 'net.darkhax.curseforgegradle' version '1.+'
-}
-
-version = "${version}"
-group = "top.theillusivec4.${mod_id}"
-
-base {
- archivesName = "${mod_id}-forge"
-}
-
-mixin {
- add sourceSets.main, "${mod_id}.refmap.json"
-
- config "${mod_id}.mixins.json"
- config "${mod_id}-integrations.forge.mixins.json"
-}
-
-minecraft {
- mappings channel: 'parchment', version: "${parchment_mc_version}-${parchment_version}-${minecraft_version}"
-
- if (project.hasProperty('forge_ats_enabled') && project.findProperty('forge_ats_enabled').toBoolean()) {
- // This location is hardcoded in Forge and can not be changed.
- // https://github.com/MinecraftForge/MinecraftForge/blob/be1698bb1554f9c8fa2f58e32b9ab70bc4385e60/fmlloader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/ModFile.java#L123
- accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
- project.logger.debug('Forge Access Transformers are enabled for this project.')
- }
-
- runs {
- client {
- workingDirectory project.file('run')
- ideaModule "${rootProject.name}.${project.name}.main"
- taskName 'Client'
- property 'mixin.env.remapRefMap', 'true'
- property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
- args "-mixin.config=${mod_id}.mixins.json"
- args "-mixin.config=${mod_id}-integrations.forge.mixins.json"
- mods {
- modClientRun {
- source sourceSets.main
- source project(":common").sourceSets.main
- }
- }
- }
-
- server {
- workingDirectory project.file('run')
- ideaModule "${rootProject.name}.${project.name}.main"
- taskName 'Server'
- property 'mixin.env.remapRefMap', 'true'
- property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
- args "-mixin.config=${mod_id}.mixins.json"
- args "-mixin.config=${mod_id}-integrations.forge.mixins.json"
- mods {
- modServerRun {
- source sourceSets.main
- source project(":common").sourceSets.main
- }
- }
- }
-
- data {
- workingDirectory project.file('run')
- ideaModule "${rootProject.name}.${project.name}.main"
- args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
- taskName 'Data'
- property 'mixin.env.remapRefMap', 'true'
- property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
- args "-mixin.config=${mod_id}.mixins.json"
- args "-mixin.config=${mod_id}-integrations.forge.mixins.json"
- mods {
- modDataRun {
- source sourceSets.main
- source project(":common").sourceSets.main
- }
- }
- }
- }
-}
-
-repositories {
- maven {
- name = "Shadows' Mods Maven"
- url = "https://maven.shadowsoffire.dev/releases"
- }
-}
-
-sourceSets.main.resources.srcDir 'src/generated/resources'
-
-dependencies {
- minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
- compileOnly project(":common")
- annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
-
- compileOnly fg.deobf("dev.shadowsoffire:FastWorkbench:${fastworkbench_version}")
- compileOnly fg.deobf("dev.shadowsoffire:FastFurnace:${fastfurnace_version}")
- compileOnly fg.deobf("dev.shadowsoffire:FastSuite:${fastsuite_version}")
- compileOnly fg.deobf("dev.shadowsoffire:Placebo:${placebo_version}")
-
- implementation fg.deobf(group: 'com.illusivesoulworks.spectrelib', name: 'spectrelib-forge', version: "${spectrelib_range}")
- jarJar (group: 'com.illusivesoulworks.spectrelib', name: 'spectrelib-forge', version: "${spectrelib_range}") {
- jarJar.pin(it, "${spectrelib_version}")
- }
-}
-
-tasks.withType(JavaCompile) {
- source(project(":common").sourceSets.main.allSource)
-}
-
-sourceSets {
- main {
- resources {
- srcDirs += '../licenses'
- }
- }
-}
-
-def resourceTargets = ['META-INF/mods.toml', 'pack.mcmeta', '*.mixins.json']
-def replaceProperties = [
- forge_version: forge_version, forge_version_range: forge_version_range, version: version,
- forge_mc_version_range: forge_mc_version_range, license: license, mod_id: mod_id, mod_author: mod_author,
- mod_description: mod_description, mod_name: mod_name, issue_tracker: issue_tracker, refmap_target: "${mod_id}."
-]
-processResources {
- from project(":common").sourceSets.main.resources
- duplicatesStrategy(DuplicatesStrategy.FAIL)
- inputs.properties replaceProperties
- replaceProperties.put 'project', project
-
- filesMatching(resourceTargets) {
- expand replaceProperties
- }
-}
-
-jar.finalizedBy('reobfJar')
-
-reobf {
- jarJar {}
-}
-
-tasks.jarJar.configure {
- archiveClassifier.set("")
- from(rootProject.file("LICENSE"))
- from(rootProject.file("COPYING"))
- from(rootProject.file("COPYING.LESSER"))
- from(rootProject.file("README.md"))
- from(rootProject.file("CHANGELOG.md"))
-}
-
-jarJar {
- enable()
-}
-
-publishing {
- publications {
- mavenJava(MavenPublication) {
- groupId project.group
- artifactId project.archivesBaseName
- version project.version
- artifact jar
- }
- }
- repositories {
- maven {
- url "file://" + System.getenv("local_maven")
- }
- }
-}
-
-task publishCurseForge(type: net.darkhax.curseforgegradle.TaskPublishCurseForge) {
- apiToken = findProperty('curseKey')
- def projectId = "${cf_id}".toString()
- def mainFile = upload(projectId, file("${project.buildDir}/libs/${archivesBaseName}-${version}.jar"))
- mainFile.changelogType = 'markdown'
- mainFile.changelog = file('../CHANGELOG_LATEST.md')
- mainFile.releaseType = "${release_type}"
- "${release_versions}".split(',').each {
- mainFile.addGameVersion("${it}")
- }
- mainFile.withAdditionalFile(sourcesJar)
-
- doLast {
-
- if (project.hasProperty('cf_page') && mainFile.curseFileId != null) {
- project.ext.curse_link = "${cf_page}/files/${mainFile.curseFileId}"
- }
- }
-}
-
-modrinth {
- token = findProperty('modrinthKey') ?: 0
- projectId = "${modrinth_id}"
- versionName = getArchivesBaseName() + "-" + getVersion()
- versionType = "${release_type}"
- changelog = file('../CHANGELOG_LATEST.md').text
- uploadFile = file("${project.buildDir}/libs/${archivesBaseName}-${version}.jar")
- additionalFiles = [sourcesJar]
- gameVersions = "${release_versions}".split(",") as List
-}
-
-tasks.modrinth.doLast {
-
- if (project.hasProperty('modrinth_page') && tasks.modrinth.newVersion != null) {
- project.ext.modrinth_link = "${modrinth_page}/version/${tasks.modrinth.newVersion.id}"
- }
-}
-
-tasks.withType(JavaCompile).configureEach {
- options.encoding = 'UTF-8'
-}
diff --git a/forge/src/main/java/com/illusivesoulworks/polymorph/PolymorphForgeMod.java b/forge/src/main/java/com/illusivesoulworks/polymorph/PolymorphForgeMod.java
deleted file mode 100644
index 5d73d03a..00000000
--- a/forge/src/main/java/com/illusivesoulworks/polymorph/PolymorphForgeMod.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2020-2022 Illusive Soulworks
- *
- * Polymorph is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * Polymorph is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Polymorph. If not, see .
- */
-
-package com.illusivesoulworks.polymorph;
-
-import com.illusivesoulworks.polymorph.client.ClientEventsListener;
-import com.illusivesoulworks.polymorph.common.CommonEventsListener;
-import com.illusivesoulworks.polymorph.common.PolymorphForgeNetwork;
-import net.minecraftforge.common.MinecraftForge;
-import net.minecraftforge.eventbus.api.IEventBus;
-import net.minecraftforge.fml.common.Mod;
-import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
-import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
-import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
-
-@Mod(PolymorphConstants.MOD_ID)
-public class PolymorphForgeMod {
-
- public PolymorphForgeMod() {
- PolymorphCommonMod.init();
- IEventBus eventBus = FMLJavaModLoadingContext.get().getModEventBus();
- eventBus.addListener(this::setup);
- eventBus.addListener(this::clientSetup);
- }
-
- private void setup(final FMLCommonSetupEvent evt) {
- PolymorphCommonMod.setup();
- PolymorphForgeNetwork.setup();
- MinecraftForge.EVENT_BUS.register(new CommonEventsListener());
- }
-
- private void clientSetup(final FMLClientSetupEvent evt) {
- PolymorphCommonMod.clientSetup();
- MinecraftForge.EVENT_BUS.register(new ClientEventsListener());
- }
-}
\ No newline at end of file
diff --git a/forge/src/main/java/com/illusivesoulworks/polymorph/client/ClientEventsListener.java b/forge/src/main/java/com/illusivesoulworks/polymorph/client/ClientEventsListener.java
deleted file mode 100644
index 7c4e3fdc..00000000
--- a/forge/src/main/java/com/illusivesoulworks/polymorph/client/ClientEventsListener.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2020-2022 Illusive Soulworks
- *
- * Polymorph is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * Polymorph is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Polymorph. If not, see .
- */
-
-package com.illusivesoulworks.polymorph.client;
-
-import net.minecraftforge.client.event.ScreenEvent;
-import net.minecraftforge.event.TickEvent;
-import net.minecraftforge.eventbus.api.SubscribeEvent;
-
-@SuppressWarnings("unused")
-public class ClientEventsListener {
-
- @SubscribeEvent
- public void tick(TickEvent.ClientTickEvent evt) {
-
- if (evt.phase == TickEvent.Phase.END) {
- PolymorphClientEvents.tick();
- }
- }
-
- @SubscribeEvent
- public void initScreen(ScreenEvent.Init.Post evt) {
- PolymorphClientEvents.initScreen(evt.getScreen());
- }
-
- @SubscribeEvent
- public void render(ScreenEvent.Render.Post evt) {
- PolymorphClientEvents.render(evt.getScreen(), evt.getGuiGraphics(), evt.getMouseX(),
- evt.getMouseY(), evt.getPartialTick());
- }
-
- @SubscribeEvent
- public void mouseClick(ScreenEvent.MouseButtonPressed.Pre evt) {
-
- if (PolymorphClientEvents.mouseClick(evt.getScreen(), evt.getMouseX(), evt.getMouseY(),
- evt.getButton())) {
- evt.setCanceled(true);
- }
- }
-}
diff --git a/forge/src/main/java/com/illusivesoulworks/polymorph/common/CommonEventsListener.java b/forge/src/main/java/com/illusivesoulworks/polymorph/common/CommonEventsListener.java
deleted file mode 100644
index 959e5a80..00000000
--- a/forge/src/main/java/com/illusivesoulworks/polymorph/common/CommonEventsListener.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Copyright (C) 2020-2022 Illusive Soulworks
- *
- * Polymorph is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * Polymorph is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Polymorph. If not, see .
- */
-
-package com.illusivesoulworks.polymorph.common;
-
-import com.illusivesoulworks.polymorph.api.PolymorphApi;
-import com.illusivesoulworks.polymorph.api.common.capability.IBlockEntityRecipeData;
-import com.illusivesoulworks.polymorph.api.common.capability.IPlayerRecipeData;
-import com.illusivesoulworks.polymorph.api.common.capability.IRecipeData;
-import com.illusivesoulworks.polymorph.api.common.capability.IStackRecipeData;
-import com.illusivesoulworks.polymorph.common.capability.PlayerRecipeData;
-import com.illusivesoulworks.polymorph.server.PolymorphCommands;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-import net.minecraft.core.Direction;
-import net.minecraft.nbt.CompoundTag;
-import net.minecraft.nbt.Tag;
-import net.minecraft.server.level.ServerPlayer;
-import net.minecraft.world.entity.Entity;
-import net.minecraft.world.entity.player.Player;
-import net.minecraft.world.item.ItemStack;
-import net.minecraft.world.level.block.entity.BlockEntity;
-import net.minecraftforge.common.capabilities.Capability;
-import net.minecraftforge.common.capabilities.ICapabilitySerializable;
-import net.minecraftforge.common.capabilities.RegisterCapabilitiesEvent;
-import net.minecraftforge.common.util.LazyOptional;
-import net.minecraftforge.event.AttachCapabilitiesEvent;
-import net.minecraftforge.event.RegisterCommandsEvent;
-import net.minecraftforge.event.TickEvent;
-import net.minecraftforge.event.entity.player.PlayerContainerEvent;
-import net.minecraftforge.event.entity.player.PlayerEvent;
-import net.minecraftforge.event.server.ServerAboutToStartEvent;
-import net.minecraftforge.event.server.ServerStoppedEvent;
-import net.minecraftforge.eventbus.api.SubscribeEvent;
-
-@SuppressWarnings("unused")
-public class CommonEventsListener {
-
- @SubscribeEvent
- public void registerCommands(final RegisterCommandsEvent evt) {
- PolymorphCommands.register(evt.getDispatcher());
- }
-
- @SubscribeEvent
- public void registerCapabilities(final RegisterCapabilitiesEvent evt) {
- evt.register(IPlayerRecipeData.class);
- evt.register(IStackRecipeData.class);
- evt.register(IBlockEntityRecipeData.class);
- }
-
- @SubscribeEvent
- public void serverAboutToStart(final ServerAboutToStartEvent evt) {
- PolymorphApi.common().setServer(evt.getServer());
- }
-
- @SubscribeEvent
- public void playerLoggedOut(final PlayerEvent.PlayerLoggedOutEvent evt) {
-
- if (evt.getEntity() instanceof ServerPlayer serverPlayer) {
- PolymorphCommonEvents.playerDisconnected(serverPlayer);
- }
- }
-
- @SubscribeEvent
- public void serverStopped(final ServerStoppedEvent evt) {
- PolymorphApi.common().setServer(null);
- }
-
- @SubscribeEvent
- public void openContainer(final PlayerContainerEvent.Open evt) {
- PolymorphCommonEvents.openContainer(evt.getEntity(), evt.getContainer());
- }
-
- @SubscribeEvent
- public void levelTick(final TickEvent.LevelTickEvent evt) {
-
- if (evt.phase == TickEvent.Phase.END) {
- PolymorphCommonEvents.levelTick(evt.level);
- }
- }
-
- @SubscribeEvent
- public void attachCapabilities(final AttachCapabilitiesEvent evt) {
- BlockEntity be = evt.getObject();
- PolymorphApi.common().tryCreateRecipeData(be).ifPresent(
- recipeData -> {
- LazyOptional cap = LazyOptional.of(() -> recipeData);
- evt.addCapability(PolymorphForgeCapabilities.BLOCK_ENTITY_RECIPE_DATA_ID,
- new BlockEntityRecipeDataProvider(cap));
- });
- }
-
- @SubscribeEvent
- public void attachCapabilitiesPlayer(final AttachCapabilitiesEvent evt) {
- Entity entity = evt.getObject();
-
- if (entity instanceof Player) {
- PlayerRecipeData data = new PlayerRecipeData((Player) entity);
- LazyOptional cap = LazyOptional.of(() -> data);
- evt.addCapability(PolymorphForgeCapabilities.PLAYER_RECIPE_DATA_ID,
- new PlayerRecipeDataProvider(cap));
- }
- }
-
- @SubscribeEvent
- public void attachCapabilitiesStack(final AttachCapabilitiesEvent evt) {
- ItemStack stack = evt.getObject();
- PolymorphApi.common().tryCreateRecipeData(stack).ifPresent(
- recipeData -> {
- LazyOptional cap = LazyOptional.of(() -> recipeData);
- evt.addCapability(PolymorphForgeCapabilities.STACK_RECIPE_DATA_ID,
- new StackRecipeDataProvider(cap));
- });
- }
-
- private static record StackRecipeDataProvider(LazyOptional capability)
- implements ICapabilitySerializable {
-
- @Nonnull
- @Override
- public LazyOptional getCapability(@Nonnull Capability capability,
- @Nullable Direction direction) {
- return PolymorphForgeCapabilities.STACK_RECIPE_DATA.orEmpty(capability, this.capability);
- }
-
- @Override
- public Tag serializeNBT() {
- return this.capability.map(IRecipeData::writeNBT).orElse(new CompoundTag());
- }
-
- @Override
- public void deserializeNBT(Tag tag) {
-
- if (tag instanceof CompoundTag) {
- this.capability.ifPresent(recipeData -> recipeData.readNBT((CompoundTag) tag));
- }
- }
- }
-
- private static record PlayerRecipeDataProvider(LazyOptional capability)
- implements ICapabilitySerializable {
-
- @Nonnull
- @Override
- public LazyOptional getCapability(@Nonnull Capability capability,
- @Nullable Direction direction) {
- return PolymorphForgeCapabilities.PLAYER_RECIPE_DATA.orEmpty(capability, this.capability);
- }
-
- @Override
- public Tag serializeNBT() {
- return this.capability.map(IRecipeData::writeNBT).orElse(new CompoundTag());
- }
-
- @Override
- public void deserializeNBT(Tag tag) {
-
- if (tag instanceof CompoundTag) {
- this.capability.ifPresent(recipeData -> recipeData.readNBT((CompoundTag) tag));
- }
- }
- }
-
- private static record BlockEntityRecipeDataProvider(
- LazyOptional capability) implements ICapabilitySerializable {
-
- @Nonnull
- @Override
- public LazyOptional getCapability(@Nonnull Capability capability,
- @Nullable Direction direction) {
- return PolymorphForgeCapabilities.BLOCK_ENTITY_RECIPE_DATA.orEmpty(capability,
- this.capability);
- }
-
- @Override
- public Tag serializeNBT() {
- return this.capability.map(IRecipeData::writeNBT).orElse(new CompoundTag());
- }
-
- @Override
- public void deserializeNBT(Tag tag) {
-
- if (tag instanceof CompoundTag) {
- this.capability.ifPresent(recipeData -> recipeData.readNBT((CompoundTag) tag));
- }
- }
- }
-}
diff --git a/forge/src/main/java/com/illusivesoulworks/polymorph/common/PolymorphForgeCapabilities.java b/forge/src/main/java/com/illusivesoulworks/polymorph/common/PolymorphForgeCapabilities.java
deleted file mode 100644
index 96c49662..00000000
--- a/forge/src/main/java/com/illusivesoulworks/polymorph/common/PolymorphForgeCapabilities.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2020-2022 Illusive Soulworks
- *
- * Polymorph is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * Polymorph is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Polymorph. If not, see .
- */
-
-package com.illusivesoulworks.polymorph.common;
-
-import com.illusivesoulworks.polymorph.api.PolymorphApi;
-import com.illusivesoulworks.polymorph.api.common.capability.IBlockEntityRecipeData;
-import com.illusivesoulworks.polymorph.api.common.capability.IPlayerRecipeData;
-import com.illusivesoulworks.polymorph.api.common.capability.IStackRecipeData;
-import net.minecraft.resources.ResourceLocation;
-import net.minecraftforge.common.capabilities.Capability;
-import net.minecraftforge.common.capabilities.CapabilityManager;
-import net.minecraftforge.common.capabilities.CapabilityToken;
-
-public class PolymorphForgeCapabilities {
-
- public static final Capability PLAYER_RECIPE_DATA =
- CapabilityManager.get(new CapabilityToken<>() {
- });
- public static final Capability BLOCK_ENTITY_RECIPE_DATA =
- CapabilityManager.get(new CapabilityToken<>() {
- });
- public static final Capability STACK_RECIPE_DATA =
- CapabilityManager.get(new CapabilityToken<>() {
- });
-
- public static final ResourceLocation PLAYER_RECIPE_DATA_ID =
- new ResourceLocation(PolymorphApi.MOD_ID, "player_recipe_data");
- public static final ResourceLocation BLOCK_ENTITY_RECIPE_DATA_ID =
- new ResourceLocation(PolymorphApi.MOD_ID, "block_entity_recipe_data");
- public static final ResourceLocation STACK_RECIPE_DATA_ID =
- new ResourceLocation(PolymorphApi.MOD_ID, "stack_recipe_data");
-}
diff --git a/forge/src/main/java/com/illusivesoulworks/polymorph/common/PolymorphForgeNetwork.java b/forge/src/main/java/com/illusivesoulworks/polymorph/common/PolymorphForgeNetwork.java
deleted file mode 100644
index 2fe8154a..00000000
--- a/forge/src/main/java/com/illusivesoulworks/polymorph/common/PolymorphForgeNetwork.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (C) 2020-2022 Illusive Soulworks
- *
- * Polymorph is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * Polymorph is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Polymorph. If not, see .
- */
-
-package com.illusivesoulworks.polymorph.common;
-
-import com.illusivesoulworks.polymorph.api.PolymorphApi;
-import com.illusivesoulworks.polymorph.common.network.client.CPacketBlockEntityListener;
-import com.illusivesoulworks.polymorph.common.network.client.CPacketPersistentRecipeSelection;
-import com.illusivesoulworks.polymorph.common.network.client.CPacketPlayerRecipeSelection;
-import com.illusivesoulworks.polymorph.common.network.client.CPacketStackRecipeSelection;
-import com.illusivesoulworks.polymorph.common.network.server.SPacketBlockEntityRecipeSync;
-import com.illusivesoulworks.polymorph.common.network.server.SPacketHighlightRecipe;
-import com.illusivesoulworks.polymorph.common.network.server.SPacketPlayerRecipeSync;
-import com.illusivesoulworks.polymorph.common.network.server.SPacketRecipesList;
-import java.util.function.BiConsumer;
-import java.util.function.Consumer;
-import java.util.function.Function;
-import net.minecraft.network.FriendlyByteBuf;
-import net.minecraft.resources.ResourceLocation;
-import net.minecraft.server.level.ServerPlayer;
-import net.minecraftforge.api.distmarker.Dist;
-import net.minecraftforge.fml.DistExecutor;
-import net.minecraftforge.network.NetworkEvent;
-import net.minecraftforge.network.NetworkRegistry;
-import net.minecraftforge.network.simple.SimpleChannel;
-
-public class PolymorphForgeNetwork {
-
- private static final String PTC_VERSION = "1";
-
- private static SimpleChannel instance;
- private static int id = 0;
-
- public static SimpleChannel get() {
- return instance;
- }
-
- public static void setup() {
- instance =
- NetworkRegistry.ChannelBuilder.named(new ResourceLocation(PolymorphApi.MOD_ID, "main"))
- .networkProtocolVersion(() -> PTC_VERSION).clientAcceptedVersions(PTC_VERSION::equals)
- .serverAcceptedVersions(PTC_VERSION::equals).simpleChannel();
-
- // Server-to-Client
- registerS2C(SPacketRecipesList.class, SPacketRecipesList::encode, SPacketRecipesList::decode,
- SPacketRecipesList::handle);
- registerS2C(SPacketHighlightRecipe.class, SPacketHighlightRecipe::encode,
- SPacketHighlightRecipe::decode, SPacketHighlightRecipe::handle);
- registerS2C(SPacketPlayerRecipeSync.class, SPacketPlayerRecipeSync::encode,
- SPacketPlayerRecipeSync::decode, SPacketPlayerRecipeSync::handle);
- registerS2C(SPacketBlockEntityRecipeSync.class, SPacketBlockEntityRecipeSync::encode,
- SPacketBlockEntityRecipeSync::decode, SPacketBlockEntityRecipeSync::handle);
-
- // Client-to-Server
- registerC2S(CPacketPlayerRecipeSelection.class, CPacketPlayerRecipeSelection::encode,
- CPacketPlayerRecipeSelection::decode, CPacketPlayerRecipeSelection::handle);
- registerC2S(CPacketPersistentRecipeSelection.class, CPacketPersistentRecipeSelection::encode,
- CPacketPersistentRecipeSelection::decode, CPacketPersistentRecipeSelection::handle);
- registerC2S(CPacketStackRecipeSelection.class, CPacketStackRecipeSelection::encode,
- CPacketStackRecipeSelection::decode, CPacketStackRecipeSelection::handle);
- registerC2S(CPacketBlockEntityListener.class, CPacketBlockEntityListener::encode,
- CPacketBlockEntityListener::decode, CPacketBlockEntityListener::handle);
- }
-
- public static void registerC2S(Class clazz, BiConsumer encoder,
- Function decoder,
- BiConsumer handler) {
- instance.registerMessage(id++, clazz, encoder, decoder, (message, contextSupplier) -> {
- NetworkEvent.Context context = contextSupplier.get();
- context.enqueueWork(() -> {
- ServerPlayer sender = context.getSender();
-
- if (sender != null) {
- handler.accept(message, sender);
- }
- });
- context.setPacketHandled(true);
- });
- }
-
- public static void registerS2C(Class clazz, BiConsumer encoder,
- Function decoder, Consumer handler) {
- instance.registerMessage(id++, clazz, encoder, decoder, (message, contextSupplier) -> {
- NetworkEvent.Context context = contextSupplier.get();
- context.enqueueWork(
- () -> DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> handler.accept(message)));
- context.setPacketHandled(true);
- });
- }
-}
diff --git a/forge/src/main/java/com/illusivesoulworks/polymorph/common/PolymorphForgePacketDistributor.java b/forge/src/main/java/com/illusivesoulworks/polymorph/common/PolymorphForgePacketDistributor.java
deleted file mode 100644
index cc65ca61..00000000
--- a/forge/src/main/java/com/illusivesoulworks/polymorph/common/PolymorphForgePacketDistributor.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2020-2022 Illusive Soulworks
- *
- * Polymorph is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * Polymorph is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Polymorph. If not, see .
- */
-
-package com.illusivesoulworks.polymorph.common;
-
-import com.illusivesoulworks.polymorph.api.common.base.IPolymorphPacketDistributor;
-import com.illusivesoulworks.polymorph.api.common.base.IRecipePair;
-import com.illusivesoulworks.polymorph.common.network.client.CPacketBlockEntityListener;
-import com.illusivesoulworks.polymorph.common.network.client.CPacketPersistentRecipeSelection;
-import com.illusivesoulworks.polymorph.common.network.client.CPacketPlayerRecipeSelection;
-import com.illusivesoulworks.polymorph.common.network.client.CPacketStackRecipeSelection;
-import com.illusivesoulworks.polymorph.common.network.server.SPacketBlockEntityRecipeSync;
-import com.illusivesoulworks.polymorph.common.network.server.SPacketHighlightRecipe;
-import com.illusivesoulworks.polymorph.common.network.server.SPacketPlayerRecipeSync;
-import com.illusivesoulworks.polymorph.common.network.server.SPacketRecipesList;
-import java.util.SortedSet;
-import net.minecraft.core.BlockPos;
-import net.minecraft.resources.ResourceLocation;
-import net.minecraft.server.level.ServerPlayer;
-import net.minecraftforge.network.PacketDistributor;
-
-public class PolymorphForgePacketDistributor implements IPolymorphPacketDistributor {
-
- @Override
- public void sendPlayerRecipeSelectionC2S(ResourceLocation resourceLocation) {
- PolymorphForgeNetwork.get().send(PacketDistributor.SERVER.noArg(),
- new CPacketPlayerRecipeSelection(resourceLocation));
- }
-
- @Override
- public void sendPersistentRecipeSelectionC2S(ResourceLocation resourceLocation) {
- PolymorphForgeNetwork.get().send(PacketDistributor.SERVER.noArg(),
- new CPacketPersistentRecipeSelection(resourceLocation));
- }
-
- @Override
- public void sendStackRecipeSelectionC2S(ResourceLocation resourceLocation) {
- PolymorphForgeNetwork.get().send(PacketDistributor.SERVER.noArg(),
- new CPacketStackRecipeSelection(resourceLocation));
- }
-
- @Override
- public void sendRecipesListS2C(ServerPlayer player) {
- sendRecipesListS2C(player, null);
- }
-
- @Override
- public void sendRecipesListS2C(ServerPlayer player, SortedSet recipesList) {
- sendRecipesListS2C(player, recipesList, null);
- }
-
- @Override
- public void sendRecipesListS2C(ServerPlayer player, SortedSet recipesList,
- ResourceLocation selected) {
- PolymorphForgeNetwork.get().send(PacketDistributor.PLAYER.with(() -> player),
- new SPacketRecipesList(recipesList, selected));
- }
-
- @Override
- public void sendHighlightRecipeS2C(ServerPlayer player, ResourceLocation pResourceLocation) {
- PolymorphForgeNetwork.get().send(PacketDistributor.PLAYER.with(() -> player),
- new SPacketHighlightRecipe(pResourceLocation));
- }
-
- @Override
- public void sendPlayerSyncS2C(ServerPlayer player, SortedSet recipesList,
- ResourceLocation selected) {
- PolymorphForgeNetwork.get().send(PacketDistributor.PLAYER.with(() -> player),
- new SPacketPlayerRecipeSync(recipesList, selected));
- }
-
- @Override
- public void sendBlockEntitySyncS2C(BlockPos blockPos, ResourceLocation selected) {
- PolymorphForgeNetwork.get().send(PacketDistributor.ALL.noArg(),
- new SPacketBlockEntityRecipeSync(blockPos, selected));
- }
-
- @Override
- public void sendBlockEntityListenerC2S(boolean add) {
- PolymorphForgeNetwork.get()
- .send(PacketDistributor.SERVER.noArg(), new CPacketBlockEntityListener(add));
- }
-}
diff --git a/forge/src/main/java/com/illusivesoulworks/polymorph/common/integration/fastbench/FastBenchModule.java b/forge/src/main/java/com/illusivesoulworks/polymorph/common/integration/fastbench/FastBenchModule.java
deleted file mode 100644
index cef3a9a3..00000000
--- a/forge/src/main/java/com/illusivesoulworks/polymorph/common/integration/fastbench/FastBenchModule.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2020-2022 Illusive Soulworks
- *
- * Polymorph is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * Polymorph is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Polymorph. If not, see .
- */
-
-package com.illusivesoulworks.polymorph.common.integration.fastbench;
-
-import com.illusivesoulworks.polymorph.common.integration.AbstractCompatibilityModule;
-import com.illusivesoulworks.polymorph.mixin.core.AccessorCraftingMenu;
-import com.illusivesoulworks.polymorph.mixin.core.AccessorInventoryMenu;
-import dev.shadowsoffire.fastbench.FastBench;
-import dev.shadowsoffire.fastbench.net.RecipeMessage;
-import dev.shadowsoffire.placebo.network.PacketDistro;
-import net.minecraft.world.entity.player.Player;
-import net.minecraft.world.inventory.AbstractContainerMenu;
-import net.minecraft.world.inventory.CraftingContainer;
-import net.minecraft.world.inventory.CraftingMenu;
-import net.minecraft.world.inventory.InventoryMenu;
-import net.minecraft.world.inventory.ResultContainer;
-import net.minecraft.world.item.ItemStack;
-import net.minecraft.world.item.crafting.CraftingRecipe;
-import net.minecraft.world.item.crafting.Recipe;
-
-public class FastBenchModule extends AbstractCompatibilityModule {
-
- @Override
- public boolean selectRecipe(AbstractContainerMenu container, Recipe> recipe) {
-
- if (recipe instanceof CraftingRecipe craftingRecipe) {
- CraftingContainer inv = null;
- ResultContainer result = null;
- Player player = null;
-
- if (container instanceof CraftingMenu) {
- AccessorCraftingMenu accessor = (AccessorCraftingMenu) container;
- inv = accessor.getCraftSlots();
- result = accessor.getResultSlots();
- player = accessor.getPlayer();
- } else if (container instanceof InventoryMenu) {
- AccessorInventoryMenu accessor = (AccessorInventoryMenu) container;
- inv = accessor.getCraftSlots();
- result = accessor.getResultSlots();
- player = accessor.getOwner();
- }
-
- if (inv != null && result != null && player != null) {
- ItemStack stack = craftingRecipe.assemble(inv, player.level().registryAccess());
-
- // Some mods seem to be violating the non-null contract so this check is necessary
- // https://github.com/TheIllusiveC4/Polymorph/issues/163
- // noinspection ConstantConditions
- if (stack != null && !ItemStack.matches(stack, result.getItem(0))) {
- PacketDistro.sendTo(FastBench.CHANNEL, new RecipeMessage(craftingRecipe, stack), player);
- result.setItem(0, stack);
- result.setRecipeUsed(craftingRecipe);
- }
- }
- }
- return false;
- }
-}
diff --git a/forge/src/main/java/com/illusivesoulworks/polymorph/common/integration/fastfurnace/FastFurnaceModule.java b/forge/src/main/java/com/illusivesoulworks/polymorph/common/integration/fastfurnace/FastFurnaceModule.java
deleted file mode 100644
index f5c5881e..00000000
--- a/forge/src/main/java/com/illusivesoulworks/polymorph/common/integration/fastfurnace/FastFurnaceModule.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2020-2022 Illusive Soulworks
- *
- * Polymorph is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * Polymorph is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Polymorph. If not, see .
- */
-
-package com.illusivesoulworks.polymorph.common.integration.fastfurnace;
-
-import com.illusivesoulworks.polymorph.PolymorphConstants;
-import com.illusivesoulworks.polymorph.common.integration.AbstractCompatibilityModule;
-import com.illusivesoulworks.polymorph.common.integration.PolymorphIntegrations;
-import net.minecraft.world.item.crafting.AbstractCookingRecipe;
-import net.minecraft.world.item.crafting.Recipe;
-import net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity;
-import net.minecraft.world.level.block.entity.BlockEntity;
-import org.apache.commons.lang3.reflect.FieldUtils;
-
-public class FastFurnaceModule extends AbstractCompatibilityModule {
-
- @Override
- public boolean selectRecipe(BlockEntity blockEntity, Recipe> recipe) {
-
- if (recipe instanceof AbstractCookingRecipe &&
- blockEntity instanceof AbstractFurnaceBlockEntity) {
- try {
- FieldUtils.writeField(blockEntity, "curRecipe", recipe, true);
- } catch (IllegalAccessException | IllegalArgumentException e) {
- PolymorphIntegrations.disable("fastfurnace");
- PolymorphConstants.LOG.error(
- "Polymorph encountered an error with its fastfurnace integration.");
- PolymorphConstants.LOG.error("The integration module for fastfurnace will be disabled.");
- PolymorphConstants.LOG.error(
- "Please report this bug to Polymorph only, do not report this to fastfurnace.");
- e.printStackTrace();
- }
- }
- return false;
- }
-}
diff --git a/forge/src/main/java/com/illusivesoulworks/polymorph/mixin/integration/fastbench/PolymorphMixinFastBenchUtil.java b/forge/src/main/java/com/illusivesoulworks/polymorph/mixin/integration/fastbench/PolymorphMixinFastBenchUtil.java
deleted file mode 100644
index 73375f9e..00000000
--- a/forge/src/main/java/com/illusivesoulworks/polymorph/mixin/integration/fastbench/PolymorphMixinFastBenchUtil.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2020-2022 Illusive Soulworks
- *
- * Polymorph is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * Polymorph is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Polymorph. If not, see .
- */
-
-package com.illusivesoulworks.polymorph.mixin.integration.fastbench;
-
-import com.illusivesoulworks.polymorph.common.crafting.RecipeSelection;
-import dev.shadowsoffire.fastbench.util.CraftingInventoryExt;
-import dev.shadowsoffire.fastbench.util.FastBenchUtil;
-import net.minecraft.world.entity.player.Player;
-import net.minecraft.world.inventory.CraftingContainer;
-import net.minecraft.world.inventory.ResultContainer;
-import net.minecraft.world.item.crafting.Recipe;
-import net.minecraft.world.item.crafting.RecipeType;
-import net.minecraft.world.level.Level;
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.injection.At;
-import org.spongepowered.asm.mixin.injection.Redirect;
-
-@SuppressWarnings("unused")
-@Mixin(FastBenchUtil.class)
-public class PolymorphMixinFastBenchUtil {
-
- @Redirect(
- at = @At(
- value = "INVOKE",
- target = "dev/shadowsoffire/fastbench/util/FastBenchUtil.findRecipe(Lnet/minecraft/world/inventory/CraftingContainer;Lnet/minecraft/world/level/Level;)Lnet/minecraft/world/item/crafting/Recipe;"),
- method = "slotChangedCraftingGrid",
- remap = false)
- private static Recipe polymorph$findRecipe(CraftingContainer inv, Level world,
- Level unused1, Player player,
- CraftingInventoryExt unused2,
- ResultContainer result) {
- return RecipeSelection.getPlayerRecipe(player.containerMenu, RecipeType.CRAFTING, inv, world,
- player).orElse(null);
- }
-}
diff --git a/forge/src/main/java/com/illusivesoulworks/polymorph/mixin/integration/fastsuite/PolymorphMixinAuxRecipeManager.java b/forge/src/main/java/com/illusivesoulworks/polymorph/mixin/integration/fastsuite/PolymorphMixinAuxRecipeManager.java
deleted file mode 100644
index e1f66401..00000000
--- a/forge/src/main/java/com/illusivesoulworks/polymorph/mixin/integration/fastsuite/PolymorphMixinAuxRecipeManager.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2020-2022 Illusive Soulworks
- *
- * Polymorph is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * Polymorph is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Polymorph. If not, see .
- */
-
-package com.illusivesoulworks.polymorph.mixin.integration.fastsuite;
-
-import com.illusivesoulworks.polymorph.common.crafting.RecipeSelection;
-import dev.shadowsoffire.fastsuite.AuxRecipeManager;
-import java.util.Optional;
-import net.minecraft.world.Container;
-import net.minecraft.world.item.crafting.Recipe;
-import net.minecraft.world.item.crafting.RecipeType;
-import net.minecraft.world.level.Level;
-import net.minecraft.world.level.block.entity.BlockEntity;
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.injection.At;
-import org.spongepowered.asm.mixin.injection.Inject;
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
-
-@Mixin(AuxRecipeManager.class)
-public class PolymorphMixinAuxRecipeManager {
-
- @Inject(
- at = @At("HEAD"),
- method = "getRecipeFor(Lnet/minecraft/world/item/crafting/RecipeType;Lnet/minecraft/world/Container;Lnet/minecraft/world/level/Level;)Ljava/util/Optional;",
- cancellable = true)
- private > void polymorph$getRecipe(
- RecipeType recipeType, C container, Level level, CallbackInfoReturnable> cb) {
-
- if (container instanceof BlockEntity blockEntity) {
- RecipeSelection.getBlockEntityRecipe(recipeType, container, level, blockEntity)
- .ifPresent(recipe -> cb.setReturnValue(Optional.of(recipe)));
- }
- }
-}
diff --git a/forge/src/main/java/com/illusivesoulworks/polymorph/platform/ForgeClientPlatform.java b/forge/src/main/java/com/illusivesoulworks/polymorph/platform/ForgeClientPlatform.java
deleted file mode 100644
index ad0fdcc9..00000000
--- a/forge/src/main/java/com/illusivesoulworks/polymorph/platform/ForgeClientPlatform.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2020-2022 Illusive Soulworks
- *
- * Polymorph is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * Polymorph is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Polymorph. If not, see .
- */
-
-package com.illusivesoulworks.polymorph.platform;
-
-import com.illusivesoulworks.polymorph.platform.services.IClientPlatform;
-import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
-
-public class ForgeClientPlatform implements IClientPlatform {
-
- @Override
- public int getScreenTop(AbstractContainerScreen> screen) {
- return screen.getGuiTop();
- }
-
- @Override
- public int getScreenLeft(AbstractContainerScreen> screen) {
- return screen.getGuiLeft();
- }
-}
diff --git a/forge/src/main/java/com/illusivesoulworks/polymorph/platform/ForgeIntegrationPlatform.java b/forge/src/main/java/com/illusivesoulworks/polymorph/platform/ForgeIntegrationPlatform.java
deleted file mode 100644
index f05724e1..00000000
--- a/forge/src/main/java/com/illusivesoulworks/polymorph/platform/ForgeIntegrationPlatform.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2020-2022 Illusive Soulworks
- *
- * Polymorph is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * Polymorph is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Polymorph. If not, see .
- */
-
-package com.illusivesoulworks.polymorph.platform;
-
-import com.illusivesoulworks.polymorph.common.integration.AbstractCompatibilityModule;
-import com.illusivesoulworks.polymorph.common.integration.fastbench.FastBenchModule;
-import com.illusivesoulworks.polymorph.common.integration.fastfurnace.FastFurnaceModule;
-import com.illusivesoulworks.polymorph.platform.services.IIntegrationPlatform;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Supplier;
-
-public class ForgeIntegrationPlatform implements IIntegrationPlatform {
-
- @Override
- public Map>> createCompatibilityModules() {
- Map>> result = new HashMap<>();
- result.put("fastfurnace", () -> FastFurnaceModule::new);
- result.put("fastbench", () -> FastBenchModule::new);
- return result;
- }
-}
diff --git a/forge/src/main/java/com/illusivesoulworks/polymorph/platform/ForgePlatform.java b/forge/src/main/java/com/illusivesoulworks/polymorph/platform/ForgePlatform.java
deleted file mode 100644
index e4385966..00000000
--- a/forge/src/main/java/com/illusivesoulworks/polymorph/platform/ForgePlatform.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (C) 2020-2022 Illusive Soulworks
- *
- * Polymorph is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * Polymorph is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Polymorph. If not, see .
- */
-
-package com.illusivesoulworks.polymorph.platform;
-
-import com.illusivesoulworks.polymorph.api.common.base.IPolymorphPacketDistributor;
-import com.illusivesoulworks.polymorph.api.common.capability.IBlockEntityRecipeData;
-import com.illusivesoulworks.polymorph.api.common.capability.IPlayerRecipeData;
-import com.illusivesoulworks.polymorph.api.common.capability.IStackRecipeData;
-import com.illusivesoulworks.polymorph.common.PolymorphForgeCapabilities;
-import com.illusivesoulworks.polymorph.common.PolymorphForgePacketDistributor;
-import com.illusivesoulworks.polymorph.common.integration.PolymorphIntegrations;
-import com.illusivesoulworks.polymorph.platform.services.IPlatform;
-import java.nio.file.Path;
-import java.util.Optional;
-import net.minecraft.world.entity.player.Player;
-import net.minecraft.world.item.ItemStack;
-import net.minecraft.world.item.crafting.Recipe;
-import net.minecraft.world.level.block.entity.BlockEntity;
-import net.minecraftforge.common.crafting.IShapedRecipe;
-import net.minecraftforge.fml.ModList;
-import net.minecraftforge.fml.loading.FMLLoader;
-import net.minecraftforge.fml.loading.FMLPaths;
-
-public class ForgePlatform implements IPlatform {
-
- private static final IPolymorphPacketDistributor PACKET_DISTRIBUTOR =
- new PolymorphForgePacketDistributor();
-
- @Override
- public PolymorphIntegrations.Loader getLoader() {
- return PolymorphIntegrations.Loader.FORGE;
- }
-
- @Override
- public Path getGameDir() {
- return FMLPaths.GAMEDIR.get();
- }
-
- @Override
- public Path getConfigDir() {
- return FMLPaths.CONFIGDIR.get();
- }
-
- @Override
- public boolean isModLoaded(String id) {
- return ModList.get().isLoaded(id);
- }
-
- @Override
- public boolean isModFileLoaded(String id) {
- return FMLLoader.getLoadingModList().getModFileById(id) != null;
- }
-
- @Override
- public boolean isShaped(Recipe> recipe) {
- return recipe instanceof IShapedRecipe;
- }
-
- @Override
- public boolean isSameShape(Recipe> recipe1, Recipe> recipe2) {
-
- if (isShaped(recipe1) && isShaped(recipe2)) {
- IShapedRecipe> shaped = (IShapedRecipe>) recipe1;
- IShapedRecipe> otherShaped = (IShapedRecipe>) recipe2;
- return shaped.getRecipeHeight() == otherShaped.getRecipeHeight() &&
- shaped.getRecipeWidth() == otherShaped.getRecipeWidth();
- }
- return true;
- }
-
- @Override
- public Optional extends IPlayerRecipeData> getRecipeData(Player player) {
- return player.getCapability(PolymorphForgeCapabilities.PLAYER_RECIPE_DATA).resolve();
- }
-
- @Override
- public Optional extends IBlockEntityRecipeData> getRecipeData(BlockEntity blockEntity) {
- return blockEntity.getCapability(PolymorphForgeCapabilities.BLOCK_ENTITY_RECIPE_DATA).resolve();
- }
-
- @Override
- public Optional extends IStackRecipeData> getRecipeData(ItemStack stack) {
- return stack.getCapability(PolymorphForgeCapabilities.STACK_RECIPE_DATA).resolve();
- }
-
- @Override
- public IPolymorphPacketDistributor getPacketDistributor() {
- return PACKET_DISTRIBUTOR;
- }
-}
diff --git a/forge/src/main/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml
deleted file mode 100644
index 83ee6682..00000000
--- a/forge/src/main/resources/META-INF/mods.toml
+++ /dev/null
@@ -1,26 +0,0 @@
-modLoader="javafml"
-loaderVersion="[41,)"
-license="${license}"
-logoBlur=false
-issueTrackerURL="${issue_tracker}"
-logoFile="${mod_id}_icon.png"
-[[mods]]
-modId="${mod_id}"
-version="${version}"
-displayName="${mod_name}"
-authors="${mod_author}"
-description='''
-${mod_description}
-'''
-[[dependencies.polymorph]]
- modId="forge"
- mandatory=true
- versionRange="${forge_version_range}"
- ordering="NONE"
- side="BOTH"
-[[dependencies.polymorph]]
- modId="minecraft"
- mandatory=true
- versionRange="${forge_mc_version_range}"
- ordering="NONE"
- side="BOTH"
diff --git a/forge/src/main/resources/META-INF/services/com.illusivesoulworks.polymorph.platform.services.IClientPlatform b/forge/src/main/resources/META-INF/services/com.illusivesoulworks.polymorph.platform.services.IClientPlatform
deleted file mode 100644
index c9e29db5..00000000
--- a/forge/src/main/resources/META-INF/services/com.illusivesoulworks.polymorph.platform.services.IClientPlatform
+++ /dev/null
@@ -1 +0,0 @@
-com.illusivesoulworks.polymorph.platform.ForgeClientPlatform
\ No newline at end of file
diff --git a/forge/src/main/resources/META-INF/services/com.illusivesoulworks.polymorph.platform.services.IIntegrationPlatform b/forge/src/main/resources/META-INF/services/com.illusivesoulworks.polymorph.platform.services.IIntegrationPlatform
deleted file mode 100644
index aecaf17f..00000000
--- a/forge/src/main/resources/META-INF/services/com.illusivesoulworks.polymorph.platform.services.IIntegrationPlatform
+++ /dev/null
@@ -1 +0,0 @@
-com.illusivesoulworks.polymorph.platform.ForgeIntegrationPlatform
\ No newline at end of file
diff --git a/forge/src/main/resources/META-INF/services/com.illusivesoulworks.polymorph.platform.services.IPlatform b/forge/src/main/resources/META-INF/services/com.illusivesoulworks.polymorph.platform.services.IPlatform
deleted file mode 100644
index 82cc7a3a..00000000
--- a/forge/src/main/resources/META-INF/services/com.illusivesoulworks.polymorph.platform.services.IPlatform
+++ /dev/null
@@ -1 +0,0 @@
-com.illusivesoulworks.polymorph.platform.ForgePlatform
\ No newline at end of file
diff --git a/forge/src/main/resources/polymorph-integrations.forge.mixins.json b/forge/src/main/resources/polymorph-integrations.forge.mixins.json
deleted file mode 100644
index 5e65c87f..00000000
--- a/forge/src/main/resources/polymorph-integrations.forge.mixins.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "required": false,
- "package": "com.illusivesoulworks.polymorph.mixin.integration",
- "compatibilityLevel": "JAVA_16",
- "refmap": "polymorph.refmap.json",
- "mixins": [
- "fastbench.PolymorphMixinFastBenchUtil",
- "fastsuite.PolymorphMixinAuxRecipeManager"
- ],
- "plugin": "com.illusivesoulworks.polymorph.mixin.IntegratedMixinPlugin",
- "minVersion": "0.8",
- "injectors": {
- "defaultRequire": 1
- }
-}
\ No newline at end of file
diff --git a/quilt/build.gradle b/quilt/build.gradle
deleted file mode 100644
index 4fe35141..00000000
--- a/quilt/build.gradle
+++ /dev/null
@@ -1,173 +0,0 @@
-plugins {
- id 'org.quiltmc.loom' version '1.3.4'
- id 'maven-publish'
- id 'idea'
- id 'net.darkhax.curseforgegradle' version '1.+'
- id 'com.modrinth.minotaur' version '2.+'
-}
-
-archivesBaseName = "${mod_id}-quilt"
-
-repositories {
- maven {
- name = 'Ladysnake Mods'
- url = 'https://maven.ladysnake.org/releases'
- }
- maven {
- name 'Quilt (Release)'
- url 'https://maven.quiltmc.org/repository/release/'
- }
- maven {
- name 'Quilt (Snapshot)'
- url 'https://maven.quiltmc.org/repository/snapshot/'
- content {
- includeGroup 'org.quiltmc.fabric_api_qsl'
- includeGroupByRegex 'org\\.quiltmc\\.qsl(?:\\.[a-z_]+)?'
- }
- }
-}
-
-dependencies {
- minecraft "com.mojang:minecraft:${minecraft_version}"
- mappings(loom.layered {
- officialMojangMappings()
- parchment("org.parchmentmc.data:parchment-${parchment_mc_version}:${parchment_version}@zip")
- })
- modImplementation "org.quiltmc:quilt-loader:${quilt_loader_version}"
- modImplementation("org.quiltmc:qsl:${quilt_stdlib_version}") {
- exclude group: "net.fabricmc"
- }
- modImplementation "org.quiltmc.quilted-fabric-api:quilted-fabric-api:${quilted_fabric_api_version}"
-
- implementation group: 'com.electronwill.night-config', name: 'core', version: '3.6.5'
- implementation group: 'com.electronwill.night-config', name: 'toml', version: '3.6.5'
- implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1'
- implementation project(":common")
-
- modCompileOnly "curse.maven:quickbench-914551:4767801"
-// modLocalRuntime "curse.maven:quickbench-914551:4767801"
-
- modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-base:${cca_version}"
- modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${cca_version}"
- modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-block:${cca_version}"
- modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-item:${cca_version}"
- modImplementation group: 'com.illusivesoulworks.spectrelib', name: 'spectrelib-quilt', version: "${spectrelib_range}"
-
- // Embedded
- include "dev.onyxstudios.cardinal-components-api:cardinal-components-base:${cca_version}"
- include "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${cca_version}"
- include "dev.onyxstudios.cardinal-components-api:cardinal-components-block:${cca_version}"
- include "dev.onyxstudios.cardinal-components-api:cardinal-components-item:${cca_version}"
- include group: 'com.illusivesoulworks.spectrelib', name: 'spectrelib-quilt', version: "${spectrelib_version}"
-}
-
-loom {
- runs {
- client {
- client()
- setConfigName("Quilt Client")
- ideConfigGenerated(true)
- runDir("run")
- }
- server {
- server()
- setConfigName("Quilt Server")
- ideConfigGenerated(true)
- runDir("run")
- }
- }
-}
-
-sourceSets {
- main {
- resources {
- srcDirs += '../licenses'
- }
- }
-}
-
-processResources {
- from project(":common").sourceSets.main.resources
- inputs.property "version", project.version
-
- filesMatching("quilt.mod.json") {
- expand 'version': project.version, 'quilt_mc_version_range': project.quilt_mc_version_range, 'license': project.license,
- 'mod_id': project.mod_id, 'mod_author': project.mod_author, 'mod_description': project.mod_description,
- 'mod_name': project.mod_name, 'issue_tracker': project.issue_tracker
- }
-
- filesMatching("pack.mcmeta") {
- expand 'mod_name': project.mod_name
- }
-
- filesMatching('*.mixins.json') {
- expand "refmap_target": "${archivesBaseName}-"
- }
-}
-
-tasks.withType(JavaCompile) {
- source(project(":common").sourceSets.main.allSource)
-}
-
-
-publishing {
- publications {
- mavenJava(MavenPublication) {
- groupId project.group
- artifactId project.archivesBaseName
- version project.version
- from components.java
- }
- }
-
- repositories {
- maven {
- url "file://" + System.getenv("local_maven")
- }
- }
-}
-
-task publishCurseForge(type: net.darkhax.curseforgegradle.TaskPublishCurseForge) {
- apiToken = findProperty('curseKey')
- def projectId = "${cf_id}".toString()
- def mainFile = upload(projectId, file("${project.buildDir}/libs/${archivesBaseName}-${version}.jar"))
- mainFile.changelogType = 'markdown'
- mainFile.changelog = file('../CHANGELOG_LATEST.md')
- mainFile.releaseType = "${release_type}"
- "${release_versions}".split(',').each {
- mainFile.addGameVersion("${it}")
- }
- mainFile.addRequirement("qsl")
- mainFile.addEmbedded("cardinal-components-api")
- mainFile.withAdditionalFile(sourcesJar)
-
- doLast {
-
- if (project.hasProperty('cf_page') && mainFile.curseFileId != null) {
- project.ext.curse_link = "${cf_page}/files/${mainFile.curseFileId}"
- }
- }
-}
-
-modrinth {
- token = findProperty('modrinthKey') ?: 0
- projectId = "${modrinth_id}"
- versionName = getArchivesBaseName() + "-" + getVersion()
- versionType = "${release_type}"
- changelog = file('../CHANGELOG_LATEST.md').text
- uploadFile = file("${project.buildDir}/libs/${archivesBaseName}-${version}.jar")
- additionalFiles = [sourcesJar]
- gameVersions = "${release_versions}".split(",") as List
- loaders = ["quilt"]
- dependencies {
- required.project "qsl"
- embedded.project "cardinal-components-api"
- }
-}
-
-tasks.modrinth.doLast {
-
- if (project.hasProperty('modrinth_page') && tasks.modrinth.newVersion != null) {
- project.ext.modrinth_link = "${modrinth_page}/version/${tasks.modrinth.newVersion.id}"
- }
-}
diff --git a/quilt/src/main/java/com/illusivesoulworks/polymorph/PolymorphQuiltClientMod.java b/quilt/src/main/java/com/illusivesoulworks/polymorph/PolymorphQuiltClientMod.java
deleted file mode 100644
index d0a226e8..00000000
--- a/quilt/src/main/java/com/illusivesoulworks/polymorph/PolymorphQuiltClientMod.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2020-2022 Illusive Soulworks
- *
- * Polymorph is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * Polymorph is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Polymorph. If not, see .
- */
-
-package com.illusivesoulworks.polymorph;
-
-import com.illusivesoulworks.polymorph.client.ClientEventsListener;
-import com.illusivesoulworks.polymorph.common.PolymorphQuiltNetwork;
-import org.quiltmc.loader.api.ModContainer;
-import org.quiltmc.qsl.base.api.entrypoint.client.ClientModInitializer;
-
-public class PolymorphQuiltClientMod implements ClientModInitializer {
-
- @Override
- public void onInitializeClient(ModContainer modContainer) {
- PolymorphCommonMod.clientSetup();
- PolymorphQuiltNetwork.clientSetup();
- ClientEventsListener.setup();
- }
-}
diff --git a/quilt/src/main/java/com/illusivesoulworks/polymorph/PolymorphQuiltMod.java b/quilt/src/main/java/com/illusivesoulworks/polymorph/PolymorphQuiltMod.java
deleted file mode 100644
index 9ca3f326..00000000
--- a/quilt/src/main/java/com/illusivesoulworks/polymorph/PolymorphQuiltMod.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2020-2022 Illusive Soulworks
- *
- * Polymorph is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * Polymorph is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Polymorph. If not, see .
- */
-
-package com.illusivesoulworks.polymorph;
-
-import com.illusivesoulworks.polymorph.common.CommonEventsListener;
-import com.illusivesoulworks.polymorph.common.PolymorphQuiltNetwork;
-import com.illusivesoulworks.polymorph.common.components.PolymorphQuiltComponents;
-import com.illusivesoulworks.polymorph.server.PolymorphCommands;
-import org.quiltmc.loader.api.ModContainer;
-import org.quiltmc.qsl.base.api.entrypoint.ModInitializer;
-import org.quiltmc.qsl.command.api.CommandRegistrationCallback;
-
-public class PolymorphQuiltMod implements ModInitializer {
-
- @Override
- public void onInitialize(ModContainer modContainer) {
- PolymorphCommonMod.init();
- PolymorphCommonMod.setup();
- PolymorphQuiltNetwork.setup();
- PolymorphQuiltComponents.setup();
- CommandRegistrationCallback.EVENT.register(
- (dispatcher, registryAccess, environment) -> PolymorphCommands.register(dispatcher));
- CommonEventsListener.setup();
- }
-}
diff --git a/quilt/src/main/java/com/illusivesoulworks/polymorph/client/ClientEventsListener.java b/quilt/src/main/java/com/illusivesoulworks/polymorph/client/ClientEventsListener.java
deleted file mode 100644
index 6cf330cc..00000000
--- a/quilt/src/main/java/com/illusivesoulworks/polymorph/client/ClientEventsListener.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2020-2022 Illusive Soulworks
- *
- * Polymorph is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * Polymorph is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Polymorph. If not, see .
- */
-
-package com.illusivesoulworks.polymorph.client;
-
-import org.quiltmc.qsl.lifecycle.api.client.event.ClientTickEvents;
-import org.quiltmc.qsl.screen.api.client.ScreenEvents;
-import org.quiltmc.qsl.screen.api.client.ScreenMouseEvents;
-
-public class ClientEventsListener {
-
- public static void setup() {
- ClientTickEvents.END.register(client -> PolymorphClientEvents.tick());
- ScreenEvents.AFTER_INIT.register((screen, client, firstInit) -> {
- PolymorphClientEvents.initScreen(screen);
- });
- ScreenEvents.AFTER_RENDER.register(PolymorphClientEvents::render);
- ScreenMouseEvents.BEFORE_MOUSE_CLICK.register(PolymorphClientEvents::mouseClick);
- }
-}
diff --git a/quilt/src/main/java/com/illusivesoulworks/polymorph/common/CommonEventsListener.java b/quilt/src/main/java/com/illusivesoulworks/polymorph/common/CommonEventsListener.java
deleted file mode 100644
index 705d1c96..00000000
--- a/quilt/src/main/java/com/illusivesoulworks/polymorph/common/CommonEventsListener.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2020-2022 Illusive Soulworks
- *
- * Polymorph is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * Polymorph is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Polymorph. If not, see .
- */
-
-package com.illusivesoulworks.polymorph.common;
-
-import com.illusivesoulworks.polymorph.api.PolymorphApi;
-import net.minecraft.server.MinecraftServer;
-import net.minecraft.server.level.ServerLevel;
-import net.minecraft.server.network.ServerGamePacketListenerImpl;
-import org.quiltmc.qsl.lifecycle.api.event.ServerLifecycleEvents;
-import org.quiltmc.qsl.lifecycle.api.event.ServerWorldTickEvents;
-import org.quiltmc.qsl.networking.api.ServerPlayConnectionEvents;
-
-public class CommonEventsListener {
-
- public static void setup() {
- ServerLifecycleEvents.STARTING.register(CommonEventsListener::serverStarting);
- ServerLifecycleEvents.STOPPED.register(CommonEventsListener::serverStopped);
- ServerWorldTickEvents.END.register((server, world) -> CommonEventsListener.levelTick(world));
- ServerPlayConnectionEvents.DISCONNECT.register(CommonEventsListener::disconnect);
- }
-
- private static void disconnect(ServerGamePacketListenerImpl serverGamePacketListener,
- MinecraftServer server) {
- PolymorphCommonEvents.playerDisconnected(serverGamePacketListener.getPlayer());
- }
-
- private static void levelTick(final ServerLevel serverLevel) {
- PolymorphCommonEvents.levelTick(serverLevel);
- }
-
- private static void serverStopped(final MinecraftServer server) {
- PolymorphApi.common().setServer(null);
- }
-
- private static void serverStarting(final MinecraftServer server) {
- PolymorphApi.common().setServer(server);
- }
-}
diff --git a/quilt/src/main/java/com/illusivesoulworks/polymorph/common/PolymorphQuiltNetwork.java b/quilt/src/main/java/com/illusivesoulworks/polymorph/common/PolymorphQuiltNetwork.java
deleted file mode 100644
index 8aa24496..00000000
--- a/quilt/src/main/java/com/illusivesoulworks/polymorph/common/PolymorphQuiltNetwork.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2020-2022 Illusive Soulworks
- *
- * Polymorph is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * Polymorph is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Polymorph. If not, see .
- */
-
-package com.illusivesoulworks.polymorph.common;
-
-import com.illusivesoulworks.polymorph.api.PolymorphApi;
-import com.illusivesoulworks.polymorph.common.network.client.CPacketBlockEntityListener;
-import com.illusivesoulworks.polymorph.common.network.client.CPacketPersistentRecipeSelection;
-import com.illusivesoulworks.polymorph.common.network.client.CPacketPlayerRecipeSelection;
-import com.illusivesoulworks.polymorph.common.network.client.CPacketStackRecipeSelection;
-import com.illusivesoulworks.polymorph.common.network.server.SPacketBlockEntityRecipeSync;
-import com.illusivesoulworks.polymorph.common.network.server.SPacketHighlightRecipe;
-import com.illusivesoulworks.polymorph.common.network.server.SPacketPlayerRecipeSync;
-import com.illusivesoulworks.polymorph.common.network.server.SPacketRecipesList;
-import java.util.function.BiConsumer;
-import java.util.function.Consumer;
-import java.util.function.Function;
-import net.minecraft.network.FriendlyByteBuf;
-import net.minecraft.resources.ResourceLocation;
-import net.minecraft.server.level.ServerPlayer;
-import org.quiltmc.qsl.networking.api.ServerPlayNetworking;
-import org.quiltmc.qsl.networking.api.client.ClientPlayNetworking;
-
-public class PolymorphQuiltNetwork {
-
- public static final ResourceLocation PLAYER_SELECT =
- new ResourceLocation(PolymorphApi.MOD_ID, "player_select");
- public static final ResourceLocation PERSISTENT_SELECT =
- new ResourceLocation(PolymorphApi.MOD_ID, "persistent_select");
- public static final ResourceLocation STACK_SELECT =
- new ResourceLocation(PolymorphApi.MOD_ID, "stack_select");
- public static final ResourceLocation RECIPES_LIST =
- new ResourceLocation(PolymorphApi.MOD_ID, "recipes_list");
- public static final ResourceLocation HIGHLIGHT_RECIPE =
- new ResourceLocation(PolymorphApi.MOD_ID, "highlight_recipe");
- public static final ResourceLocation RECIPE_SYNC =
- new ResourceLocation(PolymorphApi.MOD_ID, "recipe_sync");
- public static final ResourceLocation BLOCK_ENTITY_SYNC =
- new ResourceLocation(PolymorphApi.MOD_ID, "block_entity_sync");
- public static final ResourceLocation BLOCK_ENTITY_LISTENER =
- new ResourceLocation(PolymorphApi.MOD_ID, "block_entity_listener");
-
- public static void setup() {
- registerServerReceiver(PLAYER_SELECT, CPacketPlayerRecipeSelection::decode,
- CPacketPlayerRecipeSelection::handle);
- registerServerReceiver(PERSISTENT_SELECT, CPacketPersistentRecipeSelection::decode,
- CPacketPersistentRecipeSelection::handle);
- registerServerReceiver(STACK_SELECT, CPacketStackRecipeSelection::decode,
- CPacketStackRecipeSelection::handle);
- registerServerReceiver(BLOCK_ENTITY_LISTENER, CPacketBlockEntityListener::decode,
- CPacketBlockEntityListener::handle);
- }
-
- public static void clientSetup() {
- registerClientReceiver(HIGHLIGHT_RECIPE, SPacketHighlightRecipe::decode,
- SPacketHighlightRecipe::handle);
- registerClientReceiver(RECIPE_SYNC, SPacketPlayerRecipeSync::decode,
- SPacketPlayerRecipeSync::handle);
- registerClientReceiver(RECIPES_LIST, SPacketRecipesList::decode, SPacketRecipesList::handle);
- registerClientReceiver(BLOCK_ENTITY_SYNC, SPacketBlockEntityRecipeSync::decode,
- SPacketBlockEntityRecipeSync::handle);
- }
-
- private static void registerServerReceiver(ResourceLocation resourceLocation,
- Function decoder,
- BiConsumer handler) {
- ServerPlayNetworking.registerGlobalReceiver(resourceLocation,
- (server, player, listener, buf, responseSender) -> {
- M packet = decoder.apply(buf);
- server.execute(() -> handler.accept(packet, player));
- });
- }
-
- private static void registerClientReceiver(ResourceLocation resourceLocation,
- Function decoder,
- Consumer handler) {
- ClientPlayNetworking.registerGlobalReceiver(resourceLocation,
- (client, listener, buf, responseSender) -> {
- M packet = decoder.apply(buf);
- client.execute(() -> handler.accept(packet));
- });
- }
-}
diff --git a/quilt/src/main/java/com/illusivesoulworks/polymorph/common/PolymorphQuiltPacketDistributor.java b/quilt/src/main/java/com/illusivesoulworks/polymorph/common/PolymorphQuiltPacketDistributor.java
deleted file mode 100644
index 502d7898..00000000
--- a/quilt/src/main/java/com/illusivesoulworks/polymorph/common/PolymorphQuiltPacketDistributor.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (C) 2020-2022 Illusive Soulworks
- *
- * Polymorph is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * Polymorph is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Polymorph. If not, see .
- */
-
-package com.illusivesoulworks.polymorph.common;
-
-import com.illusivesoulworks.polymorph.api.PolymorphApi;
-import com.illusivesoulworks.polymorph.api.common.base.IPolymorphPacketDistributor;
-import com.illusivesoulworks.polymorph.api.common.base.IRecipePair;
-import com.illusivesoulworks.polymorph.common.network.client.CPacketBlockEntityListener;
-import com.illusivesoulworks.polymorph.common.network.client.CPacketPersistentRecipeSelection;
-import com.illusivesoulworks.polymorph.common.network.client.CPacketPlayerRecipeSelection;
-import com.illusivesoulworks.polymorph.common.network.client.CPacketStackRecipeSelection;
-import com.illusivesoulworks.polymorph.common.network.server.SPacketBlockEntityRecipeSync;
-import com.illusivesoulworks.polymorph.common.network.server.SPacketHighlightRecipe;
-import com.illusivesoulworks.polymorph.common.network.server.SPacketPlayerRecipeSync;
-import com.illusivesoulworks.polymorph.common.network.server.SPacketRecipesList;
-import java.util.SortedSet;
-import net.minecraft.core.BlockPos;
-import net.minecraft.network.FriendlyByteBuf;
-import net.minecraft.resources.ResourceLocation;
-import net.minecraft.server.level.ServerPlayer;
-import org.quiltmc.qsl.networking.api.PacketByteBufs;
-import org.quiltmc.qsl.networking.api.PlayerLookup;
-import org.quiltmc.qsl.networking.api.ServerPlayNetworking;
-import org.quiltmc.qsl.networking.api.client.ClientPlayNetworking;
-
-public class PolymorphQuiltPacketDistributor implements IPolymorphPacketDistributor {
-
- @Override
- public void sendPlayerRecipeSelectionC2S(ResourceLocation resourceLocation) {
- FriendlyByteBuf buf = PacketByteBufs.create();
- CPacketPlayerRecipeSelection.encode(new CPacketPlayerRecipeSelection(resourceLocation), buf);
- ClientPlayNetworking.send(PolymorphQuiltNetwork.PLAYER_SELECT, buf);
- }
-
- @Override
- public void sendPersistentRecipeSelectionC2S(ResourceLocation resourceLocation) {
- FriendlyByteBuf buf = PacketByteBufs.create();
- CPacketPersistentRecipeSelection.encode(new CPacketPersistentRecipeSelection(resourceLocation),
- buf);
- ClientPlayNetworking.send(PolymorphQuiltNetwork.PERSISTENT_SELECT, buf);
- }
-
- @Override
- public void sendStackRecipeSelectionC2S(ResourceLocation resourceLocation) {
- FriendlyByteBuf buf = PacketByteBufs.create();
- CPacketStackRecipeSelection.encode(new CPacketStackRecipeSelection(resourceLocation), buf);
- ClientPlayNetworking.send(PolymorphQuiltNetwork.STACK_SELECT, buf);
- }
-
- @Override
- public void sendRecipesListS2C(ServerPlayer player) {
- sendRecipesListS2C(player, null);
- }
-
- @Override
- public void sendRecipesListS2C(ServerPlayer player, SortedSet recipesList) {
- sendRecipesListS2C(player, recipesList, null);
- }
-
- @Override
- public void sendRecipesListS2C(ServerPlayer player, SortedSet recipesList,
- ResourceLocation selected) {
- FriendlyByteBuf buf = PacketByteBufs.create();
- SPacketRecipesList.encode(new SPacketRecipesList(recipesList, selected), buf);
- ServerPlayNetworking.send(player, PolymorphQuiltNetwork.RECIPES_LIST, buf);
- }
-
- @Override
- public void sendHighlightRecipeS2C(ServerPlayer player, ResourceLocation resourceLocation) {
- FriendlyByteBuf buf = PacketByteBufs.create();
- SPacketHighlightRecipe.encode(new SPacketHighlightRecipe(resourceLocation), buf);
- ServerPlayNetworking.send(player, PolymorphQuiltNetwork.HIGHLIGHT_RECIPE, buf);
- }
-
- @Override
- public void sendPlayerSyncS2C(ServerPlayer player, SortedSet recipesList,
- ResourceLocation selected) {
- FriendlyByteBuf buf = PacketByteBufs.create();
- SPacketPlayerRecipeSync.encode(new SPacketPlayerRecipeSync(recipesList, selected), buf);
- ServerPlayNetworking.send(player, PolymorphQuiltNetwork.RECIPE_SYNC, buf);
- }
-
- @Override
- public void sendBlockEntitySyncS2C(BlockPos blockPos, ResourceLocation selected) {
- FriendlyByteBuf buf = PacketByteBufs.create();
- SPacketBlockEntityRecipeSync.encode(new SPacketBlockEntityRecipeSync(blockPos, selected), buf);
- PolymorphApi.common().getServer().ifPresent(server -> PlayerLookup.all(server).forEach(
- player -> ServerPlayNetworking.send(player, PolymorphQuiltNetwork.BLOCK_ENTITY_SYNC,
- buf)));
- }
-
- @Override
- public void sendBlockEntityListenerC2S(boolean add) {
- FriendlyByteBuf buf = PacketByteBufs.create();
- CPacketBlockEntityListener.encode(new CPacketBlockEntityListener(add), buf);
- ClientPlayNetworking.send(PolymorphQuiltNetwork.BLOCK_ENTITY_LISTENER, buf);
- }
-}
diff --git a/quilt/src/main/java/com/illusivesoulworks/polymorph/common/components/AbstractBlockEntityRecipeDataComponent.java b/quilt/src/main/java/com/illusivesoulworks/polymorph/common/components/AbstractBlockEntityRecipeDataComponent.java
deleted file mode 100644
index f2c0ef99..00000000
--- a/quilt/src/main/java/com/illusivesoulworks/polymorph/common/components/AbstractBlockEntityRecipeDataComponent.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2020-2022 Illusive Soulworks
- *
- * Polymorph is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * Polymorph is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Polymorph. If not, see .
- */
-
-package com.illusivesoulworks.polymorph.common.components;
-
-import com.illusivesoulworks.polymorph.common.capability.AbstractBlockEntityRecipeData;
-import dev.onyxstudios.cca.api.v3.component.Component;
-import javax.annotation.Nonnull;
-import net.minecraft.nbt.CompoundTag;
-import net.minecraft.world.level.block.entity.BlockEntity;
-
-public abstract class AbstractBlockEntityRecipeDataComponent
- extends AbstractBlockEntityRecipeData implements Component {
-
- public AbstractBlockEntityRecipeDataComponent(M owner) {
- super(owner);
- }
-
- @Override
- public void readFromNbt(@Nonnull CompoundTag tag) {
- this.readNBT(tag.getCompound("Data"));
- }
-
- @Override
- public void writeToNbt(@Nonnull CompoundTag tag) {
- tag.put("Data", this.writeNBT());
- }
-}
diff --git a/quilt/src/main/java/com/illusivesoulworks/polymorph/common/components/AbstractHighlightedRecipeDataComponent.java b/quilt/src/main/java/com/illusivesoulworks/polymorph/common/components/AbstractHighlightedRecipeDataComponent.java
deleted file mode 100644
index e5f4e8e5..00000000
--- a/quilt/src/main/java/com/illusivesoulworks/polymorph/common/components/AbstractHighlightedRecipeDataComponent.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2020-2022 Illusive Soulworks
- *
- * Polymorph is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * Polymorph is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Polymorph. If not, see .
- */
-
-package com.illusivesoulworks.polymorph.common.components;
-
-import com.illusivesoulworks.polymorph.api.PolymorphApi;
-import com.illusivesoulworks.polymorph.api.common.base.IRecipePair;
-import com.illusivesoulworks.polymorph.common.capability.AbstractBlockEntityRecipeData;
-import com.mojang.datafixers.util.Pair;
-import java.util.SortedSet;
-import javax.annotation.Nonnull;
-import net.minecraft.resources.ResourceLocation;
-import net.minecraft.server.level.ServerPlayer;
-import net.minecraft.world.item.crafting.Recipe;
-import net.minecraft.world.level.block.entity.BlockEntity;
-
-public abstract class AbstractHighlightedRecipeDataComponent
- extends AbstractBlockEntityRecipeDataComponent {
-
- public AbstractHighlightedRecipeDataComponent(E owner) {
- super(owner);
- }
-
- @Override
- public void selectRecipe(@Nonnull Recipe> recipe) {
- super.selectRecipe(recipe);
-
- for (ServerPlayer listeningPlayer : this.getListeners()) {
- PolymorphApi.common().getPacketDistributor()
- .sendHighlightRecipeS2C(listeningPlayer, recipe.getId());
- }
- }
-
- @Override
- public Pair, ResourceLocation> getPacketData() {
- SortedSet recipesList = this.getRecipesList();
- ResourceLocation selected = null;
-
- if (!recipesList.isEmpty()) {
- selected = this.getSelectedRecipe().map(Recipe::getId)
- .orElse(recipesList.first().getResourceLocation());
- }
- return new Pair<>(recipesList, selected);
- }
-}
diff --git a/quilt/src/main/java/com/illusivesoulworks/polymorph/common/components/AbstractStackRecipeDataComponent.java b/quilt/src/main/java/com/illusivesoulworks/polymorph/common/components/AbstractStackRecipeDataComponent.java
deleted file mode 100644
index a7f6ef10..00000000
--- a/quilt/src/main/java/com/illusivesoulworks/polymorph/common/components/AbstractStackRecipeDataComponent.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2020-2022 Illusive Soulworks
- *
- * Polymorph is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * Polymorph is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Polymorph. If not, see .
- */
-
-package com.illusivesoulworks.polymorph.common.components;
-
-import com.illusivesoulworks.polymorph.PolymorphConstants;
-import com.illusivesoulworks.polymorph.api.PolymorphApi;
-import com.illusivesoulworks.polymorph.api.common.base.IPolymorphCommon;
-import com.illusivesoulworks.polymorph.api.common.base.IRecipePair;
-import com.illusivesoulworks.polymorph.api.common.capability.IStackRecipeData;
-import com.illusivesoulworks.polymorph.common.impl.RecipePair;
-import com.mojang.datafixers.util.Pair;
-import dev.onyxstudios.cca.api.v3.item.ItemComponent;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Optional;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;
-import java.util.concurrent.atomic.AtomicReference;
-import javax.annotation.Nonnull;
-import net.minecraft.nbt.CompoundTag;
-import net.minecraft.nbt.ListTag;
-import net.minecraft.nbt.Tag;
-import net.minecraft.resources.ResourceLocation;
-import net.minecraft.server.level.ServerPlayer;
-import net.minecraft.world.Container;
-import net.minecraft.world.item.ItemStack;
-import net.minecraft.world.item.crafting.Recipe;
-import net.minecraft.world.item.crafting.RecipeType;
-import net.minecraft.world.level.Level;
-
-public abstract class AbstractStackRecipeDataComponent extends ItemComponent implements IStackRecipeData {
-
- private final SortedSet recipesList;
- private final ItemStack owner;
-
- private Recipe> lastRecipe;
- private Recipe> selectedRecipe;
- private ResourceLocation loadedRecipe;
- private boolean isFailing;
-
- public AbstractStackRecipeDataComponent(ItemStack owner) {
- super(owner);
- this.recipesList = new TreeSet<>();
- this.owner = owner;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public , C extends Container> Optional getRecipe(RecipeType type,
- C inventory, Level level,
- List recipesList) {
- this.getLoadedRecipe().flatMap(id -> level.getRecipeManager().byKey(id))
- .ifPresent(selected -> {
- try {
- if (selected.getType() == type &&
- (((T) selected).matches(inventory, level) || isEmpty(inventory))) {
- this.setSelectedRecipe(selected);
- }
- } catch (ClassCastException e) {
- PolymorphConstants.LOG.error("Recipe {} does not match inventory {}",
- selected.getId(), inventory);
- }
- this.loadedRecipe = null;
- });
-
- if (this.isEmpty(inventory)) {
- this.setFailing(false);
- this.sendRecipesListToListeners(true);
- return Optional.empty();
- }
- AtomicReference ref = new AtomicReference<>(null);
- this.getLastRecipe().ifPresent(recipe -> {
- try {
- if (recipe.getType() == type && ((T) recipe).matches(inventory, level)) {
- this.getSelectedRecipe().ifPresent(selected -> {
- try {
- if (selected.getType() == type && ((T) selected).matches(inventory, level)) {
- ref.set((T) selected);
- }
- } catch (ClassCastException e) {
- PolymorphConstants.LOG.error("Recipe {} does not match inventory {}",
- selected.getId(), inventory);
- }
- });
- }
- } catch (ClassCastException e) {
- PolymorphConstants.LOG.error("Recipe {} does not match inventory {}", recipe.getId(),
- inventory);
- }
- });
- T result = ref.get();
-
- if (result != null) {
- this.setFailing(false);
- this.sendRecipesListToListeners(false);
- return Optional.of(result);
- }
- SortedSet newDataset = new TreeSet<>();
- List recipes =
- recipesList.isEmpty() ? level.getRecipeManager().getRecipesFor(type, inventory, level) :
- recipesList;
-
- if (recipes.isEmpty()) {
- this.setFailing(true);
- this.sendRecipesListToListeners(true);
- return Optional.empty();
- }
-
- for (T entry : recipes) {
- ResourceLocation id = entry.getId();
-
- if (ref.get() == null &&
- this.getSelectedRecipe().map(recipe -> recipe.getId().equals(id)).orElse(false)) {
- ref.set(entry);
- }
- newDataset.add(new RecipePair(id, entry.assemble(inventory, level.registryAccess())));
- }
- this.setRecipesList(newDataset);
- result = ref.get();
- result = result != null ? result : recipes.get(0);
- this.lastRecipe = result;
- this.setSelectedRecipe(result);
- this.setFailing(false);
- this.sendRecipesListToListeners(false);
- return Optional.of(result);
- }
-
- @Override
- public Optional extends Recipe>> getSelectedRecipe() {
- return Optional.ofNullable(this.selectedRecipe);
- }
-
- @Override
- public void setSelectedRecipe(@Nonnull Recipe> recipe) {
- this.selectedRecipe = recipe;
- }
-
- public Optional extends Recipe>> getLastRecipe() {
- return Optional.ofNullable(this.lastRecipe);
- }
-
- public Optional getLoadedRecipe() {
- return Optional.ofNullable(this.loadedRecipe);
- }
-
- @Nonnull
- @Override
- public SortedSet getRecipesList() {
- return this.recipesList;
- }
-
- @Override
- public void setRecipesList(@Nonnull SortedSet recipesList) {
- this.recipesList.clear();
- this.recipesList.addAll(recipesList);
- }
-
- @Override
- public boolean isEmpty(Container inventory) {
-
- if (inventory != null) {
-
- for (int i = 0; i < inventory.getContainerSize(); i++) {
-
- if (!inventory.getItem(i).isEmpty()) {
- return false;
- }
- }
- }
- return true;
- }
-
- @Override
- public ItemStack getOwner() {
- return this.owner;
- }
-
- @Override
- public void selectRecipe(@Nonnull Recipe> recipe) {
- this.setSelectedRecipe(recipe);
- }
-
- @Override
- public Set getListeners() {
- Set players = new HashSet<>();
- IPolymorphCommon commonApi = PolymorphApi.common();
- commonApi.getServer().ifPresent(server -> {
- for (ServerPlayer player : server.getPlayerList().getPlayers()) {
- commonApi.getRecipeDataFromItemStack(player.containerMenu)
- .ifPresent(recipeData -> {
- if (recipeData == this) {
- players.add(player);
- }
- });
- }
- });
- return players;
- }
-
- @Override
- public void sendRecipesListToListeners(boolean isEmpty) {
- Pair, ResourceLocation> packetData =
- isEmpty ? new Pair<>(new TreeSet<>(), null) : this.getPacketData();
-
- for (ServerPlayer listener : this.getListeners()) {
- PolymorphApi.common().getPacketDistributor()
- .sendRecipesListS2C(listener, packetData.getFirst(), packetData.getSecond());
- }
- }
-
- @Override
- public Pair, ResourceLocation> getPacketData() {
- return new Pair<>(this.getRecipesList(), null);
- }
-
- @Override
- public boolean isFailing() {
- return this.isFailing;
- }
-
- @Override
- public void setFailing(boolean isFailing) {
- this.isFailing = isFailing;
- }
-
- @Override
- public void readNBT(CompoundTag compoundTag) {
-
- if (compoundTag.contains("SelectedRecipe")) {
- this.loadedRecipe = new ResourceLocation(compoundTag.getString("SelectedRecipe"));
- }
-
- if (compoundTag.contains("RecipeDataSet")) {
- Set dataset = this.getRecipesList();
- dataset.clear();
- ListTag list = compoundTag.getList("RecipeDataSet", Tag.TAG_COMPOUND);
-
- for (Tag inbt : list) {
- CompoundTag tag = (CompoundTag) inbt;
- ResourceLocation id = ResourceLocation.tryParse(tag.getString("Id"));
- ItemStack stack = ItemStack.of(tag.getCompound("ItemStack"));
- dataset.add(new RecipePair(id, stack));
- }
- }
- }
-
- @Nonnull
- @Override
- public CompoundTag writeNBT() {
- CompoundTag nbt = new CompoundTag();
- this.getSelectedRecipe().ifPresent(
- selected -> nbt.putString("SelectedRecipe", this.selectedRecipe.getId().toString()));
- Set dataset = this.getRecipesList();
-
- if (!dataset.isEmpty()) {
- ListTag list = new ListTag();
-
- for (IRecipePair data : dataset) {
- CompoundTag tag = new CompoundTag();
- tag.put("ItemStack", data.getOutput().save(new CompoundTag()));
- tag.putString("Id", data.getResourceLocation().toString());
- list.add(tag);
- }
- nbt.put("RecipeDataSet", list);
- }
- return nbt;
- }
-}
diff --git a/quilt/src/main/java/com/illusivesoulworks/polymorph/common/components/FurnaceRecipeDataComponent.java b/quilt/src/main/java/com/illusivesoulworks/polymorph/common/components/FurnaceRecipeDataComponent.java
deleted file mode 100644
index f9dc4815..00000000
--- a/quilt/src/main/java/com/illusivesoulworks/polymorph/common/components/FurnaceRecipeDataComponent.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2020-2022 Illusive Soulworks
- *
- * Polymorph is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * Polymorph is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Polymorph. If not, see .
- */
-
-package com.illusivesoulworks.polymorph.common.components;
-
-import com.illusivesoulworks.polymorph.mixin.core.AccessorAbstractFurnaceBlockEntity;
-import net.minecraft.core.NonNullList;
-import net.minecraft.world.item.ItemStack;
-import net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity;
-
-public class FurnaceRecipeDataComponent
- extends AbstractHighlightedRecipeDataComponent {
-
- public FurnaceRecipeDataComponent(AbstractFurnaceBlockEntity owner) {
- super(owner);
- }
-
- @Override
- protected NonNullList getInput() {
-
- if (((AccessorAbstractFurnaceBlockEntity) this.getOwner()).getItems() != null) {
- return NonNullList.of(ItemStack.EMPTY, this.getOwner().getItem(0));
- } else {
- return NonNullList.create();
- }
- }
-
- @Override
- public boolean isEmpty() {
- return this.getInput().get(0).isEmpty();
- }
-}
diff --git a/quilt/src/main/java/com/illusivesoulworks/polymorph/common/components/PlayerRecipeDataComponent.java b/quilt/src/main/java/com/illusivesoulworks/polymorph/common/components/PlayerRecipeDataComponent.java
deleted file mode 100644
index 5855985c..00000000
--- a/quilt/src/main/java/com/illusivesoulworks/polymorph/common/components/PlayerRecipeDataComponent.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2020-2022 Illusive Soulworks
- *
- * Polymorph is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * Polymorph is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Polymorph. If not, see .
- */
-
-package com.illusivesoulworks.polymorph.common.components;
-
-import com.illusivesoulworks.polymorph.common.capability.PlayerRecipeData;
-import dev.onyxstudios.cca.api.v3.component.Component;
-import javax.annotation.Nonnull;
-import net.minecraft.nbt.CompoundTag;
-import net.minecraft.world.entity.player.Player;
-
-public class PlayerRecipeDataComponent extends PlayerRecipeData implements Component {
-
- public PlayerRecipeDataComponent(Player owner) {
- super(owner);
- }
-
- @Override
- public void readFromNbt(@Nonnull CompoundTag tag) {
- this.readNBT(tag.getCompound("Data"));
- }
-
- @Override
- public void writeToNbt(@Nonnull CompoundTag tag) {
- tag.put("Data", this.writeNBT());
- }
-}
diff --git a/quilt/src/main/java/com/illusivesoulworks/polymorph/common/components/PolymorphQuiltComponents.java b/quilt/src/main/java/com/illusivesoulworks/polymorph/common/components/PolymorphQuiltComponents.java
deleted file mode 100644
index af5d9645..00000000
--- a/quilt/src/main/java/com/illusivesoulworks/polymorph/common/components/PolymorphQuiltComponents.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (C) 2020-2022 Illusive Soulworks
- *
- * Polymorph is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * Polymorph is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Polymorph. If not, see .
- */
-
-package com.illusivesoulworks.polymorph.common.components;
-
-import com.illusivesoulworks.polymorph.api.PolymorphApi;
-import dev.onyxstudios.cca.api.v3.block.BlockComponentFactoryRegistry;
-import dev.onyxstudios.cca.api.v3.block.BlockComponentInitializer;
-import dev.onyxstudios.cca.api.v3.component.ComponentKey;
-import dev.onyxstudios.cca.api.v3.component.ComponentRegistry;
-import dev.onyxstudios.cca.api.v3.entity.EntityComponentFactoryRegistry;
-import dev.onyxstudios.cca.api.v3.entity.EntityComponentInitializer;
-import dev.onyxstudios.cca.api.v3.item.ItemComponentFactoryRegistry;
-import dev.onyxstudios.cca.api.v3.item.ItemComponentInitializer;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Function;
-import javax.annotation.Nonnull;
-import net.minecraft.resources.ResourceLocation;
-import net.minecraft.world.entity.player.Player;
-import net.minecraft.world.item.Item;
-import net.minecraft.world.item.ItemStack;
-import net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity;
-import net.minecraft.world.level.block.entity.BlockEntity;
-
-public class PolymorphQuiltComponents implements BlockComponentInitializer,
- EntityComponentInitializer, ItemComponentInitializer {
-
- public static final ComponentKey PLAYER_RECIPE_DATA =
- ComponentRegistry.getOrCreate(new ResourceLocation(PolymorphApi.MOD_ID, "player_recipe_data"),
- PlayerRecipeDataComponent.class);
- public static final ComponentKey
- BLOCK_ENTITY_RECIPE_DATA =
- ComponentRegistry.getOrCreate(
- new ResourceLocation(PolymorphApi.MOD_ID, "block_entity_recipe_data"),
- AbstractBlockEntityRecipeDataComponent.class);
- public static final ComponentKey STACK_RECIPE_DATA =
- ComponentRegistry.getOrCreate(new ResourceLocation(PolymorphApi.MOD_ID, "stack_recipe_data"),
- AbstractStackRecipeDataComponent.class);
-
- private static final Map- >
- ITEM_2_RECIPE_DATA =
- new HashMap<>();
- private static final Map, Function>>
- BLOCK_ENTITY_2_RECIPE_DATA = new HashMap<>();
-
- public static void setup() {
-
- }
-
- public static void registerBlockEntity(Class extends BlockEntity> blockEntityClass,
- Function> blockEntity2RecipeData) {
- BLOCK_ENTITY_2_RECIPE_DATA.put(blockEntityClass, blockEntity2RecipeData);
- }
-
- public static void registerItem(Item item,
- Function stack2RecipeData) {
- ITEM_2_RECIPE_DATA.put(item, stack2RecipeData);
- }
-
- @Override
- public void registerBlockComponentFactories(@Nonnull BlockComponentFactoryRegistry registry) {
- registerBlockEntity(AbstractFurnaceBlockEntity.class,
- blockEntity -> new FurnaceRecipeDataComponent((AbstractFurnaceBlockEntity) blockEntity));
-
- for (Map.Entry, Function>> entry : BLOCK_ENTITY_2_RECIPE_DATA.entrySet()) {
- registry.registerFor(entry.getKey(), BLOCK_ENTITY_RECIPE_DATA,
- blockEntity -> entry.getValue().apply(blockEntity));
- }
- }
-
- @Override
- public void registerEntityComponentFactories(EntityComponentFactoryRegistry registry) {
- registry.registerFor(Player.class, PLAYER_RECIPE_DATA, PlayerRecipeDataComponent::new);
- }
-
- @Override
- public void registerItemComponentFactories(@Nonnull ItemComponentFactoryRegistry registry) {
-
- for (Map.Entry
- > entry : ITEM_2_RECIPE_DATA.entrySet()) {
- registry.register(entry.getKey(), STACK_RECIPE_DATA, stack -> entry.getValue().apply(stack));
- }
- }
-}
diff --git a/quilt/src/main/java/com/illusivesoulworks/polymorph/common/integration/quickbench/QuickBenchModule.java b/quilt/src/main/java/com/illusivesoulworks/polymorph/common/integration/quickbench/QuickBenchModule.java
deleted file mode 100644
index e598f7bc..00000000
--- a/quilt/src/main/java/com/illusivesoulworks/polymorph/common/integration/quickbench/QuickBenchModule.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package com.illusivesoulworks.polymorph.common.integration.quickbench;
-
-import com.illusivesoulworks.polymorph.common.integration.AbstractCompatibilityModule;
-import com.illusivesoulworks.polymorph.mixin.core.AccessorCraftingMenu;
-import com.illusivesoulworks.polymorph.mixin.core.AccessorInventoryMenu;
-import net.minecraft.world.inventory.AbstractContainerMenu;
-import net.minecraft.world.inventory.CraftingMenu;
-import net.minecraft.world.inventory.InventoryMenu;
-import net.minecraft.world.inventory.ResultContainer;
-import net.minecraft.world.item.crafting.CraftingRecipe;
-import net.minecraft.world.item.crafting.Recipe;
-
-public class QuickBenchModule extends AbstractCompatibilityModule {
-
- @Override
- public boolean selectRecipe(AbstractContainerMenu containerMenu, Recipe> recipe) {
-
- if (recipe instanceof CraftingRecipe) {
- ResultContainer result = null;
-
- if (containerMenu instanceof CraftingMenu) {
- AccessorCraftingMenu accessor = (AccessorCraftingMenu) containerMenu;
- result = accessor.getResultSlots();
- } else if (containerMenu instanceof InventoryMenu) {
- AccessorInventoryMenu accessor = (AccessorInventoryMenu) containerMenu;
- result = accessor.getResultSlots();
- }
-
- if (result != null) {
- result.setRecipeUsed(recipe);
- }
- }
- return false;
- }
-}
diff --git a/quilt/src/main/java/com/illusivesoulworks/polymorph/mixin/PlayerHolder.java b/quilt/src/main/java/com/illusivesoulworks/polymorph/mixin/PlayerHolder.java
deleted file mode 100644
index 927e1d80..00000000
--- a/quilt/src/main/java/com/illusivesoulworks/polymorph/mixin/PlayerHolder.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.illusivesoulworks.polymorph.mixin;
-
-import net.minecraft.world.entity.player.Player;
-
-public class PlayerHolder {
-
- private static Player player = null;
-
- public static void setPlayer(Player player) {
- PlayerHolder.player = player;
- }
-
- public static Player getPlayer() {
- return player;
- }
-}
diff --git a/quilt/src/main/java/com/illusivesoulworks/polymorph/mixin/core/AccessorAbstractContainerScreen.java b/quilt/src/main/java/com/illusivesoulworks/polymorph/mixin/core/AccessorAbstractContainerScreen.java
deleted file mode 100644
index ed2de90a..00000000
--- a/quilt/src/main/java/com/illusivesoulworks/polymorph/mixin/core/AccessorAbstractContainerScreen.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2020-2022 Illusive Soulworks
- *
- * Polymorph is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * Polymorph is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Polymorph. If not, see .
- */
-
-package com.illusivesoulworks.polymorph.mixin.core;
-
-import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.gen.Accessor;
-
-@Mixin(AbstractContainerScreen.class)
-public interface AccessorAbstractContainerScreen {
-
- @Accessor
- int getLeftPos();
-
- @Accessor
- int getTopPos();
-}
diff --git a/quilt/src/main/java/com/illusivesoulworks/polymorph/mixin/core/MixinServerPlayer.java b/quilt/src/main/java/com/illusivesoulworks/polymorph/mixin/core/MixinServerPlayer.java
deleted file mode 100644
index d1b8b01e..00000000
--- a/quilt/src/main/java/com/illusivesoulworks/polymorph/mixin/core/MixinServerPlayer.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2020-2022 Illusive Soulworks
- *
- * Polymorph is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * Polymorph is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Polymorph. If not, see .
- */
-
-package com.illusivesoulworks.polymorph.mixin.core;
-
-import com.illusivesoulworks.polymorph.common.PolymorphCommonEvents;
-import com.mojang.authlib.GameProfile;
-import java.util.OptionalInt;
-import net.minecraft.core.BlockPos;
-import net.minecraft.server.level.ServerPlayer;
-import net.minecraft.world.entity.player.Player;
-import net.minecraft.world.level.Level;
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.injection.At;
-import org.spongepowered.asm.mixin.injection.Inject;
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
-
-@Mixin(ServerPlayer.class)
-public abstract class MixinServerPlayer extends Player {
-
- public MixinServerPlayer(Level level, BlockPos blockPos, float f, GameProfile gameProfile) {
- super(level, blockPos, f, gameProfile);
- }
-
- @Inject(
- at = @At("RETURN"),
- method = "openMenu(Lnet/minecraft/world/MenuProvider;)Ljava/util/OptionalInt;")
- private void polymorph$openHandledScreen(CallbackInfoReturnable cir) {
- cir.getReturnValue().ifPresent(
- value -> PolymorphCommonEvents.openContainer((ServerPlayer) (Object) this,
- this.containerMenu));
- }
-}
diff --git a/quilt/src/main/java/com/illusivesoulworks/polymorph/mixin/integration/quickbench/MixinCraftingMenu.java b/quilt/src/main/java/com/illusivesoulworks/polymorph/mixin/integration/quickbench/MixinCraftingMenu.java
deleted file mode 100644
index 556f90d9..00000000
--- a/quilt/src/main/java/com/illusivesoulworks/polymorph/mixin/integration/quickbench/MixinCraftingMenu.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package com.illusivesoulworks.polymorph.mixin.integration.quickbench;
-
-import com.illusivesoulworks.polymorph.mixin.PlayerHolder;
-import net.minecraft.world.Container;
-import net.minecraft.world.entity.player.Player;
-import net.minecraft.world.inventory.CraftingMenu;
-import org.spongepowered.asm.mixin.Final;
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.Shadow;
-import org.spongepowered.asm.mixin.injection.At;
-import org.spongepowered.asm.mixin.injection.Inject;
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
-
-@Mixin(value = CraftingMenu.class, priority = 2000)
-public class MixinCraftingMenu {
-
- @Shadow
- @Final
- private Player player;
-
-
- @Inject(
- method = "slotsChanged",
- at = @At("HEAD"))
- private void polymorph$slotsChangedPre(Container container, CallbackInfo ci) {
-
- if (!this.player.level().isClientSide()) {
- PlayerHolder.setPlayer(this.player);
- }
- }
-
- @Inject(
- method = "slotsChanged",
- at = @At("RETURN"))
- private void polymorph$slotsChangedPost(Container container, CallbackInfo ci) {
- PlayerHolder.setPlayer(null);
- }
-}
diff --git a/quilt/src/main/java/com/illusivesoulworks/polymorph/mixin/integration/quickbench/MixinInventoryMenu.java b/quilt/src/main/java/com/illusivesoulworks/polymorph/mixin/integration/quickbench/MixinInventoryMenu.java
deleted file mode 100644
index 351f9082..00000000
--- a/quilt/src/main/java/com/illusivesoulworks/polymorph/mixin/integration/quickbench/MixinInventoryMenu.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package com.illusivesoulworks.polymorph.mixin.integration.quickbench;
-
-import com.illusivesoulworks.polymorph.mixin.PlayerHolder;
-import net.minecraft.world.Container;
-import net.minecraft.world.entity.player.Player;
-import net.minecraft.world.inventory.InventoryMenu;
-import org.spongepowered.asm.mixin.Final;
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.Shadow;
-import org.spongepowered.asm.mixin.injection.At;
-import org.spongepowered.asm.mixin.injection.Inject;
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
-
-@Mixin(value = InventoryMenu.class, priority = 2000)
-public class MixinInventoryMenu {
-
- @Shadow
- @Final
- private Player owner;
-
-
- @Inject(
- method = "slotsChanged",
- at = @At("HEAD"))
- private void polymorph$slotsChangedPre(Container container, CallbackInfo ci) {
-
- if (!this.owner.level().isClientSide()) {
- PlayerHolder.setPlayer(this.owner);
- }
- }
-
- @Inject(
- method = "slotsChanged",
- at = @At("RETURN"))
- private void polymorph$slotsChangedPost(Container container, CallbackInfo ci) {
- PlayerHolder.setPlayer(null);
- }
-}
diff --git a/quilt/src/main/java/com/illusivesoulworks/polymorph/mixin/integration/quickbench/MixinQuickBench.java b/quilt/src/main/java/com/illusivesoulworks/polymorph/mixin/integration/quickbench/MixinQuickBench.java
deleted file mode 100644
index a59a97bb..00000000
--- a/quilt/src/main/java/com/illusivesoulworks/polymorph/mixin/integration/quickbench/MixinQuickBench.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package com.illusivesoulworks.polymorph.mixin.integration.quickbench;
-
-import com.illusivesoulworks.polymorph.common.crafting.RecipeSelection;
-import com.illusivesoulworks.polymorph.mixin.PlayerHolder;
-import net.minecraft.world.entity.player.Player;
-import net.minecraft.world.inventory.AbstractContainerMenu;
-import net.minecraft.world.inventory.CraftingContainer;
-import net.minecraft.world.inventory.ResultContainer;
-import net.minecraft.world.inventory.Slot;
-import net.minecraft.world.item.ItemStack;
-import net.minecraft.world.item.crafting.Recipe;
-import net.minecraft.world.item.crafting.RecipeType;
-import net.minecraft.world.level.Level;
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.injection.At;
-import org.spongepowered.asm.mixin.injection.Inject;
-import org.spongepowered.asm.mixin.injection.Redirect;
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
-import tfar.fastbench.MixinHooks;
-
-@Mixin(MixinHooks.class)
-public class MixinQuickBench {
-
- @Redirect(
- at = @At(
- value = "INVOKE",
- target = "tfar/fastbench/MixinHooks.findRecipe(Lnet/minecraft/world/inventory/CraftingContainer;Lnet/minecraft/world/level/Level;)Lnet/minecraft/world/item/crafting/Recipe;"),
- method = "slotChangedCraftingGrid")
- private static Recipe polymorph$findRecipe(CraftingContainer inv, Level level,
- Level unused1,
- CraftingContainer unused2,
- ResultContainer result) {
- Player player = PlayerHolder.getPlayer();
-
- if (player != null) {
- return RecipeSelection.getPlayerRecipe(player.containerMenu, RecipeType.CRAFTING, inv,
- level, player).orElse(null);
- }
- return level.getRecipeManager().getRecipeFor(RecipeType.CRAFTING, inv, level).orElse(null);
- }
-
- @Inject(
- at = @At("HEAD"),
- method = "handleShiftCraft")
- private static void polymorph$handleShiftCraftPre(Player player,
- AbstractContainerMenu container,
- Slot resultSlot,
- CraftingContainer input,
- ResultContainer craftResult,
- int outStart, int outEnd,
- CallbackInfoReturnable cir) {
- if (!player.level().isClientSide()) {
- PlayerHolder.setPlayer(player);
- }
- }
-
- @Inject(
- at = @At("RETURN"),
- method = "handleShiftCraft")
- private static void polymorph$handleShiftCraftPost(Player player,
- AbstractContainerMenu container,
- Slot resultSlot,
- CraftingContainer input,
- ResultContainer craftResult,
- int outStart, int outEnd,
- CallbackInfoReturnable cir) {
- PlayerHolder.setPlayer(null);
- }
-}
diff --git a/quilt/src/main/java/com/illusivesoulworks/polymorph/platform/QuiltClientPlatform.java b/quilt/src/main/java/com/illusivesoulworks/polymorph/platform/QuiltClientPlatform.java
deleted file mode 100644
index a0019ec3..00000000
--- a/quilt/src/main/java/com/illusivesoulworks/polymorph/platform/QuiltClientPlatform.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2020-2022 Illusive Soulworks
- *
- * Polymorph is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * Polymorph is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Polymorph. If not, see .
- */
-
-package com.illusivesoulworks.polymorph.platform;
-
-import com.illusivesoulworks.polymorph.mixin.core.AccessorAbstractContainerScreen;
-import com.illusivesoulworks.polymorph.platform.services.IClientPlatform;
-import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
-
-public class QuiltClientPlatform implements IClientPlatform {
-
- @Override
- public int getScreenTop(AbstractContainerScreen> screen) {
- return ((AccessorAbstractContainerScreen) screen).getTopPos();
- }
-
- @Override
- public int getScreenLeft(AbstractContainerScreen> screen) {
- return ((AccessorAbstractContainerScreen) screen).getLeftPos();
- }
-}
diff --git a/quilt/src/main/java/com/illusivesoulworks/polymorph/platform/QuiltIntegrationPlatform.java b/quilt/src/main/java/com/illusivesoulworks/polymorph/platform/QuiltIntegrationPlatform.java
deleted file mode 100644
index 462782ff..00000000
--- a/quilt/src/main/java/com/illusivesoulworks/polymorph/platform/QuiltIntegrationPlatform.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2020-2022 Illusive Soulworks
- *
- * Polymorph is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * Polymorph is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Polymorph. If not, see .
- */
-
-package com.illusivesoulworks.polymorph.platform;
-
-import com.illusivesoulworks.polymorph.common.integration.AbstractCompatibilityModule;
-import com.illusivesoulworks.polymorph.common.integration.quickbench.QuickBenchModule;
-import com.illusivesoulworks.polymorph.platform.services.IIntegrationPlatform;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Supplier;
-
-public class QuiltIntegrationPlatform implements IIntegrationPlatform {
-
- @Override
- public Map>> createCompatibilityModules() {
- Map>> result = new HashMap<>();
- result.put("quickbench", () -> QuickBenchModule::new);
- return result;
- }
-}
diff --git a/quilt/src/main/java/com/illusivesoulworks/polymorph/platform/QuiltPlatform.java b/quilt/src/main/java/com/illusivesoulworks/polymorph/platform/QuiltPlatform.java
deleted file mode 100644
index 60383ad0..00000000
--- a/quilt/src/main/java/com/illusivesoulworks/polymorph/platform/QuiltPlatform.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (C) 2020-2022 Illusive Soulworks
- *
- * Polymorph is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * any later version.
- *
- * Polymorph is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Polymorph. If not, see .
- */
-
-package com.illusivesoulworks.polymorph.platform;
-
-import com.illusivesoulworks.polymorph.api.common.base.IPolymorphPacketDistributor;
-import com.illusivesoulworks.polymorph.api.common.capability.IBlockEntityRecipeData;
-import com.illusivesoulworks.polymorph.api.common.capability.IPlayerRecipeData;
-import com.illusivesoulworks.polymorph.api.common.capability.IStackRecipeData;
-import com.illusivesoulworks.polymorph.common.PolymorphQuiltPacketDistributor;
-import com.illusivesoulworks.polymorph.common.components.PolymorphQuiltComponents;
-import com.illusivesoulworks.polymorph.common.integration.PolymorphIntegrations;
-import com.illusivesoulworks.polymorph.platform.services.IPlatform;
-import java.nio.file.Path;
-import java.util.Optional;
-import net.minecraft.world.entity.player.Player;
-import net.minecraft.world.item.ItemStack;
-import net.minecraft.world.item.crafting.Recipe;
-import net.minecraft.world.item.crafting.ShapedRecipe;
-import net.minecraft.world.level.block.entity.BlockEntity;
-import org.quiltmc.loader.api.QuiltLoader;
-
-public class QuiltPlatform implements IPlatform {
-
- private static final IPolymorphPacketDistributor PACKET_DISTRIBUTOR =
- new PolymorphQuiltPacketDistributor();
-
- @Override
- public PolymorphIntegrations.Loader getLoader() {
- return PolymorphIntegrations.Loader.FABRIC;
- }
-
- @Override
- public Path getGameDir() {
- return QuiltLoader.getGameDir();
- }
-
- @Override
- public Path getConfigDir() {
- return QuiltLoader.getConfigDir();
- }
-
- @Override
- public boolean isModLoaded(String modId) {
- return QuiltLoader.isModLoaded(modId);
- }
-
- @Override
- public boolean isModFileLoaded(String id) {
- return isModLoaded(id);
- }
-
- @Override
- public boolean isShaped(Recipe> recipe) {
- return recipe instanceof ShapedRecipe;
- }
-
- @Override
- public boolean isSameShape(Recipe> recipe1, Recipe> recipe2) {
-
- if (isShaped(recipe1) && isShaped(recipe2)) {
- ShapedRecipe shaped = (ShapedRecipe) recipe1;
- ShapedRecipe otherShaped = (ShapedRecipe) recipe2;
- return shaped.getHeight() == otherShaped.getHeight() &&
- shaped.getWidth() == otherShaped.getWidth();
- }
- return true;
- }
-
- @Override
- public Optional extends IPlayerRecipeData> getRecipeData(Player player) {
- return PolymorphQuiltComponents.PLAYER_RECIPE_DATA.maybeGet(player);
- }
-
- @Override
- public Optional extends IBlockEntityRecipeData> getRecipeData(BlockEntity blockEntity) {
- return PolymorphQuiltComponents.BLOCK_ENTITY_RECIPE_DATA.maybeGet(blockEntity);
- }
-
- @Override
- public Optional extends IStackRecipeData> getRecipeData(ItemStack stack) {
- return PolymorphQuiltComponents.STACK_RECIPE_DATA.maybeGet(stack);
- }
-
- @Override
- public IPolymorphPacketDistributor getPacketDistributor() {
- return PACKET_DISTRIBUTOR;
- }
-}
diff --git a/quilt/src/main/resources/META-INF/services/com.illusivesoulworks.polymorph.platform.services.IClientPlatform b/quilt/src/main/resources/META-INF/services/com.illusivesoulworks.polymorph.platform.services.IClientPlatform
deleted file mode 100644
index 8559cecf..00000000
--- a/quilt/src/main/resources/META-INF/services/com.illusivesoulworks.polymorph.platform.services.IClientPlatform
+++ /dev/null
@@ -1 +0,0 @@
-com.illusivesoulworks.polymorph.platform.QuiltClientPlatform
\ No newline at end of file
diff --git a/quilt/src/main/resources/META-INF/services/com.illusivesoulworks.polymorph.platform.services.IIntegrationPlatform b/quilt/src/main/resources/META-INF/services/com.illusivesoulworks.polymorph.platform.services.IIntegrationPlatform
deleted file mode 100644
index 50f39fb8..00000000
--- a/quilt/src/main/resources/META-INF/services/com.illusivesoulworks.polymorph.platform.services.IIntegrationPlatform
+++ /dev/null
@@ -1 +0,0 @@
-com.illusivesoulworks.polymorph.platform.QuiltIntegrationPlatform
\ No newline at end of file
diff --git a/quilt/src/main/resources/META-INF/services/com.illusivesoulworks.polymorph.platform.services.IPlatform b/quilt/src/main/resources/META-INF/services/com.illusivesoulworks.polymorph.platform.services.IPlatform
deleted file mode 100644
index 9f20b707..00000000
--- a/quilt/src/main/resources/META-INF/services/com.illusivesoulworks.polymorph.platform.services.IPlatform
+++ /dev/null
@@ -1 +0,0 @@
-com.illusivesoulworks.polymorph.platform.QuiltPlatform
\ No newline at end of file
diff --git a/quilt/src/main/resources/polymorph-integrations.quilt.mixins.json b/quilt/src/main/resources/polymorph-integrations.quilt.mixins.json
deleted file mode 100644
index 26aed776..00000000
--- a/quilt/src/main/resources/polymorph-integrations.quilt.mixins.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "required": false,
- "package": "com.illusivesoulworks.polymorph.mixin.integration",
- "compatibilityLevel": "JAVA_16",
- "mixins": [
- "quickbench.MixinCraftingMenu",
- "quickbench.MixinInventoryMenu",
- "quickbench.MixinQuickBench"
- ],
- "plugin": "com.illusivesoulworks.polymorph.mixin.IntegratedMixinPlugin",
- "minVersion": "0.8",
- "injectors": {
- "defaultRequire": 1
- }
-}
\ No newline at end of file
diff --git a/quilt/src/main/resources/polymorph.quilt.mixins.json b/quilt/src/main/resources/polymorph.quilt.mixins.json
deleted file mode 100644
index 18cdeb1f..00000000
--- a/quilt/src/main/resources/polymorph.quilt.mixins.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "required": true,
- "minVersion": "0.8",
- "package": "com.illusivesoulworks.polymorph.mixin.core",
- "compatibilityLevel": "JAVA_17",
- "mixins": [
- "MixinServerPlayer"
- ],
- "client": [
- "AccessorAbstractContainerScreen"
- ],
- "injectors": {
- "defaultRequire": 1
- }
- }
-
diff --git a/quilt/src/main/resources/quilt.mod.json b/quilt/src/main/resources/quilt.mod.json
deleted file mode 100644
index 88ae93d4..00000000
--- a/quilt/src/main/resources/quilt.mod.json
+++ /dev/null
@@ -1,87 +0,0 @@
-{
- "schema_version": 1,
- "quilt_loader": {
- "group": "com.illusivesoulworks.${mod_id}",
- "id": "${mod_id}",
- "version": "${version}",
- "intermediate_mappings": "net.fabricmc:intermediary",
- "entrypoints": {
- "init": [
- "com.illusivesoulworks.polymorph.PolymorphQuiltMod"
- ],
- "client_init": [
- "com.illusivesoulworks.polymorph.PolymorphQuiltClientMod"
- ],
- "cardinal-components": [
- "com.illusivesoulworks.polymorph.common.components.PolymorphQuiltComponents"
- ]
- },
- "depends": [
- {
- "id": "quilt_loader",
- "version": "*"
- },
- {
- "id": "quilt_base",
- "version": "*"
- },
- {
- "id": "minecraft",
- "version": "${quilt_mc_version_range}"
- },
- {
- "id": "java",
- "version": ">=17"
- },
- {
- "id": "spectrelib",
- "version": ">=0.13"
- },
- {
- "id": "cardinal-components-base",
- "version": "*"
- },
- {
- "id": "cardinal-components-entity",
- "version": "*"
- },
- {
- "id": "cardinal-components-item",
- "version": "*"
- },
- {
- "id": "cardinal-components-block",
- "version": "*"
- },
- {
- "id": "quilted_fabric_api",
- "version": "*"
- }
- ],
- "metadata": {
- "name": "${mod_name}",
- "description": "${mod_description}",
- "contributors": {
- "${mod_author}": "Owner"
- },
- "contact": {
- "issues": "${issue_tracker}"
- },
- "license": "${license}",
- "icon": "${mod_id}_icon.png"
- }
- },
- "cardinal-components": [
- "polymorph:player_recipe_data",
- "polymorph:block_entity_recipe_data",
- "polymorph:stack_recipe_data"
- ],
- "mixin": [
- "polymorph.mixins.json",
- "polymorph.quilt.mixins.json",
- "polymorph-integrations.quilt.mixins.json"
- ],
- "minecraft": {
- "environment": "*"
- }
-}
\ No newline at end of file
diff --git a/settings.gradle b/settings.gradle
index a7108f6f..8566caed 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -30,4 +30,4 @@ plugins {
}
rootProject.name = "${mod_name}"
-include("common", "fabric", "forge", "quilt")
+include("fabric")