aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2021-10-14 17:53:21 +0800
committershedaniel <daniel@shedaniel.me>2021-10-14 18:31:38 +0800
commit81f07b79c7560c4b0aba0d6dd3c1cac781fad68a (patch)
tree01a163dea539410c45a6dc53bf346d5832330e63 /runtime
parent423f31a81e7c0933c8e5571efb748b8a11f1774b (diff)
downloadRoughlyEnoughItems-81f07b79c7560c4b0aba0d6dd3c1cac781fad68a.tar.gz
RoughlyEnoughItems-81f07b79c7560c4b0aba0d6dd3c1cac781fad68a.tar.bz2
RoughlyEnoughItems-81f07b79c7560c4b0aba0d6dd3c1cac781fad68a.zip
Remove LBA compatibility, Add Fabric API compatibility
Update buildscripts and README Update buildscripts and README
Diffstat (limited to 'runtime')
-rw-r--r--runtime/build.gradle42
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/common/compat/LBASupportPlugin.java50
2 files changed, 24 insertions, 68 deletions
diff --git a/runtime/build.gradle b/runtime/build.gradle
index 44abf331b..76b4276b3 100644
--- a/runtime/build.gradle
+++ b/runtime/build.gradle
@@ -9,25 +9,26 @@ repositories {
}
loom {
- accessWidener = gradle.rootProject.project("fabric").file("src/main/resources/roughlyenoughitems.accessWidener")
+ accessWidenerPath = gradle.rootProject.project("fabric").file("src/main/resources/roughlyenoughitems.accessWidener")
}
dependencies {
modCompileOnly("net.fabricmc:fabric-loader:${project.fabricloader_version}")
- modCompileOnly("me.shedaniel.cloth:cloth-config:${cloth_config_version}")
- modCompileOnly("dev.architectury:architectury:${architectury_version}")
- compileOnly(project(path: ":api"))
- modCompileOnly("alexiil.mc.lib:libblockattributes-fluids:0.8.3-pre.3")
+ modApi("me.shedaniel.cloth:cloth-config:${cloth_config_version}")
+ modApi("dev.architectury:architectury:${architectury_version}")
+ compileClasspath(project(path: ":api", configuration: "dev"))
}
remapJar {
- afterEvaluate {
- remapAccessWidener.set(false)
- }
+ remapAccessWidener = false
+}
+
+configurations {
+ dev
}
-java {
- withSourcesJar()
+remapJar {
+ classifier "raw"
}
task fakeJar(type: Jar, dependsOn: remapJar) {
@@ -35,20 +36,25 @@ task fakeJar(type: Jar, dependsOn: remapJar) {
from(rootProject.file("fake/fabric.mod.json")) {
into ""
}
- archiveClassifier.set "fake"
+ classifier null
+}
+
+artifacts {
+ dev(jar)
+ apiElements(fakeJar)
+ runtimeElements(fakeJar)
+}
+
+afterEvaluate {
+ configurations.apiElements.artifacts.removeIf { it.buildDependencies.getDependencies(null).contains(tasks.remapJar) }
+ configurations.runtimeElements.artifacts.removeIf { it.buildDependencies.getDependencies(null).contains(tasks.remapJar) }
}
publishing {
publications {
mavenCommon(MavenPublication) {
artifactId = rootProject.name + "-" + project.name
- artifact(fakeJar) { classifier null }
- afterEvaluate {
- artifact(remapSourcesJar.output) {
- builtBy remapSourcesJar
- classifier "sources"
- }
- }
+ from components.java
}
}
}
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/common/compat/LBASupportPlugin.java b/runtime/src/main/java/me/shedaniel/rei/impl/common/compat/LBASupportPlugin.java
deleted file mode 100644
index fac34a62b..000000000
--- a/runtime/src/main/java/me/shedaniel/rei/impl/common/compat/LBASupportPlugin.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * This file is licensed under the MIT License, part of Roughly Enough Items.
- * Copyright (c) 2018, 2019, 2020, 2021 shedaniel
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.shedaniel.rei.impl.common.compat;
-
-import alexiil.mc.lib.attributes.fluid.FluidAttributes;
-import alexiil.mc.lib.attributes.fluid.GroupedFluidInvView;
-import alexiil.mc.lib.attributes.fluid.amount.FluidAmount;
-import dev.architectury.event.CompoundEventResult;
-import dev.architectury.hooks.fluid.FluidStackHooks;
-import me.shedaniel.rei.api.common.fluid.FluidSupportProvider;
-import me.shedaniel.rei.api.common.plugins.REIServerPlugin;
-import me.shedaniel.rei.api.common.util.EntryStacks;
-
-public class LBASupportPlugin implements REIServerPlugin {
- @Override
- public void registerFluidSupport(FluidSupportProvider support) {
- support.register(entry -> {
- GroupedFluidInvView view = FluidAttributes.GROUPED_INV_VIEW.get(entry.getValue());
- if (view.getStoredFluids().size() > 0)
- return CompoundEventResult.interruptTrue(view.getStoredFluids().stream()
- .filter(fluidKey -> !fluidKey.isEmpty() && fluidKey.getRawFluid() != null)
- .map(fluidKey -> {
- FluidAmount amount = view.getAmount_F(fluidKey);
- return EntryStacks.of(fluidKey.getRawFluid(), amount.mul(FluidStackHooks.bucketAmount()).asLong(1));
- }));
- return CompoundEventResult.pass();
- });
- }
-}