aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/curseforge.yml8
-rw-r--r--.github/workflows/gradle.yml3
-rw-r--r--README.md2
-rwxr-xr-xbuild.gradle134
-rw-r--r--gradle.properties17
-rwxr-xr-xgradle/wrapper/gradle-wrapper.properties2
-rw-r--r--src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java34
-rw-r--r--src/main/java/me/shedaniel/rei/RoughlyEnoughItemsNetwork.java24
-rw-r--r--src/main/java/me/shedaniel/rei/RoughlyEnoughItemsState.java1
-rw-r--r--src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java34
-rw-r--r--src/main/java/me/shedaniel/rei/api/ClientHelper.java104
-rw-r--r--src/main/java/me/shedaniel/rei/api/LiveRecipeGenerator.java4
-rw-r--r--src/main/java/me/shedaniel/rei/api/REIHelper.java9
-rw-r--r--src/main/java/me/shedaniel/rei/api/RecipeHelper.java10
-rw-r--r--src/main/java/me/shedaniel/rei/api/TransferRecipeDisplay.java5
-rw-r--r--src/main/java/me/shedaniel/rei/gui/ConfigReloadingScreen.java2
-rw-r--r--src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java40
-rw-r--r--src/main/java/me/shedaniel/rei/gui/PreRecipeViewingScreen.java10
-rw-r--r--src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java24
-rw-r--r--src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java20
-rw-r--r--src/main/java/me/shedaniel/rei/gui/WarningAndErrorScreen.java8
-rw-r--r--src/main/java/me/shedaniel/rei/gui/credits/CreditsEntryListWidget.java2
-rw-r--r--src/main/java/me/shedaniel/rei/gui/credits/CreditsScreen.java10
-rw-r--r--src/main/java/me/shedaniel/rei/gui/modules/entries/GameModeMenuEntry.java2
-rw-r--r--src/main/java/me/shedaniel/rei/gui/modules/entries/SubSubsetsMenuEntry.java2
-rw-r--r--src/main/java/me/shedaniel/rei/gui/modules/entries/WeatherMenuEntry.java2
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/ClickableLabelWidget.java2
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/EntryListWidget.java4
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/EntryWidget.java3
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/LabelWidget.java4
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/RecipeChoosePageWidget.java4
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/TextFieldWidget.java4
-rw-r--r--src/main/java/me/shedaniel/rei/impl/ClientHelperImpl.java324
-rw-r--r--src/main/java/me/shedaniel/rei/impl/ConfigManagerImpl.java6
-rw-r--r--src/main/java/me/shedaniel/rei/impl/ConfigObjectImpl.java7
-rw-r--r--src/main/java/me/shedaniel/rei/impl/EntryRegistryImpl.java2
-rw-r--r--src/main/java/me/shedaniel/rei/impl/InternalWidgets.java10
-rw-r--r--src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java244
-rw-r--r--src/main/java/me/shedaniel/rei/impl/ScreenHelper.java22
-rw-r--r--src/main/java/me/shedaniel/rei/impl/widgets/ButtonWidget.java2
-rw-r--r--src/main/java/me/shedaniel/rei/impl/widgets/TexturedDrawableConsumer.java9
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java16
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultPotionEffectExclusionZones.java10
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultRecipeBookExclusionZones.java14
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultServerContainerPlugin.java12
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/autocrafting/DefaultCategoryHandler.java22
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/autocrafting/DefaultRecipeBookHandler.java26
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/containers/CraftingContainerInfoWrapper.java12
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingDisplay.java4
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCraftingCategory.java6
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCraftingDisplay.java4
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/information/DefaultInformationCategory.java2
-rw-r--r--src/main/java/me/shedaniel/rei/server/ContainerInfo.java6
-rw-r--r--src/main/java/me/shedaniel/rei/server/ContainerInfoHandler.java22
-rw-r--r--src/main/java/me/shedaniel/rei/server/InputSlotCrafter.java52
-rw-r--r--src/main/java/me/shedaniel/rei/tests/plugin/REITestPlugin.java2
-rwxr-xr-xsrc/main/resources/assets/roughlyenoughitems/lang/en_us.json1
-rw-r--r--src/main/resources/rei.aw12
58 files changed, 838 insertions, 545 deletions
diff --git a/.github/workflows/curseforge.yml b/.github/workflows/curseforge.yml
index c8721ec76..c7f110b6f 100644
--- a/.github/workflows/curseforge.yml
+++ b/.github/workflows/curseforge.yml
@@ -9,14 +9,20 @@ on:
jobs:
build:
runs-on: ubuntu-latest
+ if: "!contains(github.event.head_commit.message, 'ci skip')"
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
+ - name: Clean Gradle
+ run: ./gradlew clean --refresh-dependencies --stacktrace
+ env:
+ danielshe_curse_api_key: ${{ secrets.CF_API_KEY }}
+ BRANCH_NAME: ${{ github.ref }}
- name: Upload to CurseForge
- run: ./gradlew clean build releaseOnCf --refresh-dependencies --stacktrace
+ run: ./gradlew build releaseOnCf --stacktrace
env:
danielshe_curse_api_key: ${{ secrets.CF_API_KEY }}
BRANCH_NAME: ${{ github.ref }} \ No newline at end of file
diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml
index a75d4db4b..c0619b581 100644
--- a/.github/workflows/gradle.yml
+++ b/.github/workflows/gradle.yml
@@ -5,7 +5,6 @@ on: [push]
jobs:
build:
runs-on: ubuntu-latest
- if: "!contains(github.event.head_commit.message, 'ci skip')"
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
@@ -13,4 +12,4 @@ jobs:
with:
java-version: 1.8
- name: Build with Gradle
- run: ./gradlew clean build
+ run: ./gradlew clean build --refresh-dependencies --stacktrace
diff --git a/README.md b/README.md
index 94096fb40..c5fde6939 100644
--- a/README.md
+++ b/README.md
@@ -16,4 +16,4 @@ This mod is both client sided and server sided.
### License
Roughly Enough Items was a fork of Almost Enough Items by ZenDarva until v2.0 rewrite. This fork is permitted under the MIT license.
Roughly Enough Items is licensed under [MIT license](https://github.com/shedaniel/RoughlyEnoughItems/blob/3.x/LICENSE).
-Cloth, which is Roughly Enough Items's depenency, is licensed under [The Unlicense](https://github.com/shedaniel/Cloth/blob/master/LICENSE).
+Cloth, which is Roughly Enough Items's dependency, is licensed under [The Unlicense](https://github.com/shedaniel/Cloth/blob/master/LICENSE).
diff --git a/build.gradle b/build.gradle
index 1082bab5e..77a9f8968 100755
--- a/build.gradle
+++ b/build.gradle
@@ -1,41 +1,35 @@
+plugins {
+ id("fabric-loom") version "0.4.5"
+ id("maven-publish")
+ id("java")
+ id("java-library")
+ id("net.minecrell.licenser") version("0.4.1")
+ id("com.matthewprenger.cursegradle") version("1.4.0")
+ id("net.corda.plugins.jar-filter") version("5.0.8") apply false
+}
+
import net.fabricmc.loom.task.RemapJarTask
import java.text.SimpleDateFormat
-plugins {
- id 'fabric-loom' version '0.4.3'
- id 'maven-publish'
- id 'net.minecrell.licenser' version '0.4.1'
- id 'com.matthewprenger.cursegradle' version '1.4.0'
-}
-
sourceCompatibility = targetCompatibility = 1.8
archivesBaseName = "RoughlyEnoughItems"
group = "me.shedaniel"
-def forceVersion = ""
-
-version = forceVersion != "" ? forceVersion : project.mod_version
-
-def includeDep = true
+version = project.mod_version
minecraft {
accessWidener = file("src/main/resources/rei.aw")
}
-static def buildTime() {
- def df = new SimpleDateFormat("yyyyMMddHHmm")
- df.setTimeZone(TimeZone.getTimeZone("UTC"))
- return df.format(new Date())
-}
-
license {
header rootProject.file('HEADER')
include '**/*.java'
}
repositories {
+ maven { url "https://dl.bintray.com/shedaniel/legacy-yarn-updated" }
}
jar {
@@ -51,15 +45,17 @@ processResources {
dependencies {
minecraft("com.mojang:minecraft:${project.minecraft_version}")
- mappings("net.fabricmc:yarn:${project.yarn_version}:v2")
+ mappings("me.shedaniel:legacy-yarn:${project.yarn_version}:v2")
modApi("net.fabricmc:fabric-loader:${project.fabricloader_version}")
modApi("net.fabricmc.fabric-api:fabric-api:${project.fabric_api}") {
- exclude module: "fabric-biomes-v1"
+ exclude(module: "fabric-dimensions-v1")
+ exclude(module: "fabric-biomes-v1")
+ exclude(module: "fabric-events-interaction-v0")
}
modApi("me.shedaniel.cloth:cloth-events:${cloth_events_version}") {
transitive = false
}
- modImplementation("me.shedaniel.cloth:config-2:${cloth_config_version}") {
+ modApi("me.shedaniel.cloth:config-2:${cloth_config_version}") {
exclude module: "fabric-api"
}
modApi("me.sargunvohra.mcmods:autoconfig1u:${project.autoconfig1u}") {
@@ -72,44 +68,66 @@ dependencies {
modRuntime("io.github.prospector:modmenu:${modmenu_version}") {
transitive = false
}
- if (includeDep) {
- afterEvaluate {
- def listAdded = new ArrayList(Arrays.asList((api_exculde as String).split(',')))
- def eachDep = { dep ->
- for (apiIncludeDepStr in (api_include as String).split(',')) {
- def apiIncludeGroup = apiIncludeDepStr.split(':')[0]
- def apiIncludeDep = apiIncludeDepStr.split(':')[1]
- if (dep.module.id.group == apiIncludeGroup && dep.module.id.name.startsWith(apiIncludeDep)) {
- def version = dep.module.id.version.indexOf('@') >= 0 ? dep.module.id.version.substring(0, dep.module.id.version.indexOf('@')) : dep.module.id.version
- def mavenDep = "${dep.module.id.group}:${dep.module.id.name}:$version"
- if (!(mavenDep in listAdded)) {
- include(mavenDep) {
- transitive = false
- }
- listAdded.add(mavenDep)
+ afterEvaluate {
+ def listAdded = new ArrayList(Arrays.asList((api_exculde as String).split(',')))
+ def eachDep = { dep ->
+ for (apiIncludeDepStr in (api_include as String).split(',')) {
+ if (apiIncludeDepStr.isEmpty()) continue
+ def apiIncludeGroup = apiIncludeDepStr.split(':')[0]
+ def apiIncludeDep = apiIncludeDepStr.split(':')[1]
+ if (dep.module.id.group == apiIncludeGroup && dep.module.id.name.startsWith(apiIncludeDep)) {
+ def version = dep.module.id.version.indexOf('@') >= 0 ? dep.module.id.version.substring(0, dep.module.id.version.indexOf('@')) : dep.module.id.version
+ def mavenDep = "${dep.module.id.group}:${dep.module.id.name}:$version"
+ if (!(mavenDep in listAdded)) {
+ include(mavenDep) {
+ transitive = false
}
- break
+ listAdded.add(mavenDep)
}
+ break
}
}
- configurations.compile.resolvedConfiguration.firstLevelModuleDependencies.each eachDep
- configurations.runtimeClasspath.resolvedConfiguration.firstLevelModuleDependencies.each eachDep
}
+ configurations.compile.resolvedConfiguration.firstLevelModuleDependencies.each eachDep
+ configurations.runtimeClasspath.resolvedConfiguration.firstLevelModuleDependencies.each eachDep
+ }
+}
+
+tasks.withType(JavaCompile) {
+ options.encoding = "UTF-8"
+}
+
+task jarFilter(type: net.corda.gradle.jarfilter.JarFilterTask) {
+ jars remapJar
+ annotations {
+ forRemove = [
+ "org.jetbrains.annotations.NotNull",
+ "org.jetbrains.annotations.Nullable",
+ "org.jetbrains.annotations.ApiStatus\$Experimental",
+ "org.jetbrains.annotations.ApiStatus\$Internal",
+ "org.jetbrains.annotations.ApiStatus\$ScheduledForRemoval",
+ "org.jetbrains.annotations.ApiStatus\$AvailableSince",
+ "org.jetbrains.annotations.ApiStatus\$NonExtendable",
+ "org.jetbrains.annotations.ApiStatus\$OverrideOnly"
+ ]
}
}
+task copyJarFilter(type: Copy) {
+ from jarFilter
+ into "${project.buildDir}/filtered-libs/"
+ rename { "${project.archivesBaseName}-${project.version}.jar" }
+}
+
task sourcesJar(type: Jar, dependsOn: classes) {
- classifier = "sources"
+ classifier("sources")
from sourceSets.main.allSource
}
task remapMavenJar(type: RemapJarTask, dependsOn: jar) {
-// classifier = "maven"
afterEvaluate {
- //noinspection GroovyAccessibility
input = file("${project.buildDir}/libs/${archivesBaseName}-${version}-dev.jar")
archiveName = "${archivesBaseName}-${version}.jar"
- //noinspection GroovyAccessibility
addNestedDependencies = false
}
}
@@ -123,7 +141,7 @@ task releaseOnCf {
def branch
if (System.env.BRANCH_NAME) {
branch = System.env.BRANCH_NAME
- branch = branch.substring(branch.lastIndexOf("/")+1)
+ branch = branch.substring(branch.lastIndexOf("/") + 1)
} else {
branch = "git rev-parse --abbrev-ref HEAD".execute().in.text.trim()
}
@@ -133,11 +151,11 @@ task releaseOnCf {
def time = df.format(new Date())
def changes = new StringBuilder()
changes << "<h2>REI v$project.version for $project.supported_version</h2>Updated at <b>$time</b>.<br><a href=\"https://www.github.com/shedaniel/RoughlyEnoughItems/commits/$branch\">Click here for changelog</a>"
- def proc = "git log --max-count=200 --pretty=format:\"%s\"".execute()
+ def proc = "git log --max-count=200 --pretty=format:%s".execute()
proc.in.eachLine { line ->
def processedLine = line.toString()
if (!processedLine.contains("New translations") && !processedLine.contains("Merge") && !processedLine.contains("branch")) {
- changes << "<br>- $processedLine"
+ changes << "<br>- ${processedLine.capitalize()}"
}
}
proc.waitFor()
@@ -149,23 +167,27 @@ curseforge {
if (project.hasProperty('danielshe_curse_api_key') || System.getenv('danielshe_curse_api_key') != null) {
apiKey = project.hasProperty('danielshe_curse_api_key') ? project.property('danielshe_curse_api_key') : System.getenv('danielshe_curse_api_key')
project {
- id = '310111'
- releaseType = 'beta'
+ id = "310111"
+ releaseType = "beta"
changelogType = "html"
changelog = releaseChangelog
- addGameVersion '1.16-Snapshot'
- addGameVersion 'Java 8'
- addGameVersion 'Fabric'
+ addGameVersion "1.16-Snapshot"
+ addGameVersion "Java 8"
+ addGameVersion "Fabric"
relations {
- requiredDependency 'fabric-api'
- embeddedLibrary 'cloth'
- embeddedLibrary 'cloth-config'
+ requiredDependency "fabric-api"
+ embeddedLibrary "cloth"
+ embeddedLibrary "cloth-config"
+ embeddedLibrary "auto-config-updated-api"
}
- mainArtifact(file("${project.buildDir}/libs/${project.archivesBaseName}-${project.version}.jar")) {
+ mainArtifact(file("${project.buildDir}/filtered-libs/${project.archivesBaseName}-${project.version}.jar")) {
displayName = "[Fabric $project.supported_version] v$project.version"
}
+ addArtifact(file("${project.buildDir}/libs/${project.archivesBaseName}-${project.version}-sources.jar")) {
+ displayName = "[Fabric $project.supported_version] v$project.version Sources"
+ }
afterEvaluate {
- uploadTask.dependsOn("remapJar")
+ uploadTask.dependsOn("copyJarFilter")
}
}
}
diff --git a/gradle.properties b/gradle.properties
index 2552bbfca..10e838650 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,13 +1,14 @@
-mod_version=4.3.0-unstable
-supported_version=20w18a
-minecraft_version=20w18a
-yarn_version=20w18a+build.1
+org.gradle.jvmargs=-Xmx3G
+mod_version=4.3.9-unstable
+supported_version=20w20a
+minecraft_version=20w20a
+yarn_version=20w20a+build.1+legacy.20w09a+build.8
fabricloader_version=0.8.2+build.194
cloth_events_version=2.2.0-unstable
-cloth_config_version=4.0.5-unstable
-modmenu_version=1.11.2+build.6
-fabric_api=0.7.1+build.331-1.16
+cloth_config_version=4.3.0-unstable
+modmenu_version=1.11.4+build.9
+fabric_api=0.10.8+build.345-1.16
autoconfig1u=3.0.1-unstable
-api_include=me.shedaniel.cloth:cloth-events,me.shedaniel.cloth:config-2,me.sargunvohra.mcmods:autoconfig1u,org.jetbrains:annotations
+api_include=me.shedaniel.cloth:cloth-events,me.shedaniel.cloth:config-2,me.sargunvohra.mcmods:autoconfig1u
api_exculde=
#api_include=me.shedaniel.cloth:cloth-events,me.shedaniel.cloth:config-2,me.sargunvohra.mcmods:autoconfig1u,org.jetbrains:annotations,net.fabricmc.fabric-api:fabric- \ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 3098271c2..7ca6abcf2 100755
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
diff --git a/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java b/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java
index 0fd28b111..d8886e991 100644
--- a/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java
+++ b/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java
@@ -39,9 +39,9 @@ import net.fabricmc.loader.api.ModContainer;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.Element;
import net.minecraft.client.gui.screen.Screen;
-import net.minecraft.client.gui.screen.ingame.CraftingScreen;
+import net.minecraft.client.gui.screen.ingame.ContainerScreen;
+import net.minecraft.client.gui.screen.ingame.CraftingTableScreen;
import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen;
-import net.minecraft.client.gui.screen.ingame.HandledScreen;
import net.minecraft.client.gui.screen.ingame.InventoryScreen;
import net.minecraft.client.gui.screen.recipebook.RecipeBookGhostSlots;
import net.minecraft.client.gui.screen.recipebook.RecipeBookProvider;
@@ -49,11 +49,11 @@ import net.minecraft.client.gui.screen.recipebook.RecipeBookWidget;
import net.minecraft.client.gui.widget.TextFieldWidget;
import net.minecraft.client.gui.widget.TexturedButtonWidget;
import net.minecraft.client.resource.language.I18n;
+import net.minecraft.container.CraftingTableContainer;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.recipe.Ingredient;
import net.minecraft.recipe.RecipeManager;
-import net.minecraft.screen.CraftingScreenHandler;
import net.minecraft.screen.slot.Slot;
import net.minecraft.text.LiteralText;
import net.minecraft.util.ActionResult;
@@ -192,11 +192,11 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
ClientSidePacketRegistry.INSTANCE.register(RoughlyEnoughItemsNetwork.CREATE_ITEMS_MESSAGE_PACKET, (packetContext, packetByteBuf) -> {
ItemStack stack = packetByteBuf.readItemStack();
String player = packetByteBuf.readString(32767);
- packetContext.getPlayer().sendMessage(new LiteralText(I18n.translate("text.rei.cheat_items").replaceAll("\\{item_name}", SearchArgument.tryGetItemStackName(stack.copy())).replaceAll("\\{item_count}", stack.copy().getCount() + "").replaceAll("\\{player_name}", player)), false);
+ packetContext.getPlayer().addMessage(new LiteralText(I18n.translate("text.rei.cheat_items").replaceAll("\\{item_name}", SearchArgument.tryGetItemStackName(stack.copy())).replaceAll("\\{item_count}", stack.copy().getCount() + "").replaceAll("\\{player_name}", player)), false);
});
ClientSidePacketRegistry.INSTANCE.register(RoughlyEnoughItemsNetwork.NOT_ENOUGH_ITEMS_PACKET, (packetContext, packetByteBuf) -> {