Skip to content

Commit

Permalink
Quite good
Browse files Browse the repository at this point in the history
  • Loading branch information
enjarai committed May 31, 2024
1 parent 3a27139 commit cf3f097
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 29 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
- Added a config option to disable the automatic removal of furnace extraction exceptions.
- This can be turned off to preserve vanilla hopper behaviour when pulling empty buckets from furnaces.
- Replaced the furnace extraction removal exceptions config option with a gamerule for easier configuring.
- Updated Cooldown Coordinator to fix a sizable bug.
- Removed CICADA as an included dependency, it must now be downloaded separately.
71 changes: 70 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'fabric-loom' version '1.6-SNAPSHOT'
id 'maven-publish'
id "me.modmuss50.mod-publish-plugin" version "0.4.4"
}

sourceCompatibility = JavaVersion.VERSION_21
Expand Down Expand Up @@ -39,7 +40,7 @@ dependencies {
// Include Cooldown Coordinator
include(modImplementation("net.gnomecraft:cooldown-coordinator:${project.cooldowncoordinator_version}"))

include modImplementation("nl.enjarai:cicada-lib:${project.cicada_version}") {
modImplementation("nl.enjarai:cicada-lib:${project.cicada_version}") {
exclude group: "net.fabricmc.fabric-api"
}
}
Expand Down Expand Up @@ -114,4 +115,72 @@ sourceSets {
]
}
}
}

publishMods {
file = remapJar.archiveFile
displayName = "${property('mod_version')} for ${property('minecraft_version')}"
version = project.version
changelog = getRootProject().file("CHANGELOG.md").text
type = STABLE
modLoaders.add("fabric")

def min = property('publish_target_min')
def max = property('publish_target_max')

if (providers.gradleProperty('enjaraiModrinthToken').present) {
modrinth {
projectId = property('mod_modrinth')
accessToken = providers.gradleProperty('enjaraiModrinthToken').get()

if (min == max) {
minecraftVersions.add(min)
} else {
minecraftVersionRange {
start = min
end = max
}
}

requires {
slug = "fabric-api"
}
requires {
slug = "cicada"
}
}
}

if (providers.gradleProperty('enjaraiCurseforgeToken').present) {
curseforge {
projectId = property('mod_curseforge')
accessToken = providers.gradleProperty('enjaraiCurseforgeToken').get()

if (min == max) {
minecraftVersions.add(min)
} else {
minecraftVersionRange {
start = min
end = max
}
}

requires {
slug = "fabric-api"
}
requires {
slug = "cicada"
}
}
}

if (providers.gradleProperty('enjaraiGithubToken').present) {
github {
repository = property('mod_github')
accessToken = providers.gradleProperty('enjaraiGithubToken').get()

commitish = property('git_branch')
tagName = project.version
}
}
}
20 changes: 13 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,27 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.20.5
yarn_mappings=1.20.5+build.1
loader_version=0.15.10
minecraft_version=1.20.6
yarn_mappings=1.20.6+build.3
loader_version=0.15.11

# Mod Properties
mod_version = 2.3.0
mod_version = 2.3.1
maven_group = nl.enjarai
archives_base_name = omnihopper
modid = omnihopper

publish_target_min=1.20.5
publish_target_max=1.20.6
mod_modrinth=i2u9r3li
mod_curseforge=610606
mod_github=enjarai/OmniHopper
git_branch=1.20.5/dev

# Dependencies
fabric_version=0.97.6+1.20.5
fabric_version=0.99.4+1.20.6
# https://github.com/gniftygnome/cooldown-coordinator/releases
# https://maven.enjarai.dev/#/mirrors/net/gnomecraft/cooldown-coordinator
cooldowncoordinator_version=0.7.1
cooldowncoordinator_version=0.7.2
# https://maven.enjarai.dev/#/releases/nl/enjarai/cicada-lib
cicada_version=0.6.0+1.20.2-plus
cicada_version=0.7.2+1.20.5-and-above
11 changes: 0 additions & 11 deletions src/main/java/nl/enjarai/omnihopper/ModConfig.java

This file was deleted.

12 changes: 9 additions & 3 deletions src/main/java/nl/enjarai/omnihopper/OmniHopper.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package nl.enjarai.omnihopper;

import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.gamerule.v1.GameRuleFactory;
import net.fabricmc.fabric.api.gamerule.v1.GameRuleRegistry;
import net.minecraft.util.Identifier;
import net.minecraft.world.GameRules;
import nl.enjarai.cicada.api.conversation.ConversationManager;
import nl.enjarai.cicada.api.util.CicadaEntrypoint;
import nl.enjarai.cicada.api.util.JsonSource;
Expand All @@ -15,17 +18,20 @@ public class OmniHopper implements ModInitializer, CicadaEntrypoint {
public static final String MODID = "omnihopper";
public static final Logger LOGGER = ProperLogger.getLogger(MODID);

public static final GameRules.Key<GameRules.BooleanRule> REMOVE_FURNACE_EXCEPTIONS = GameRuleRegistry.register(
MODID + ":removeFurnaceExtractionExceptions",
GameRules.Category.MISC, GameRuleFactory.createBooleanRule(true)
);

@Override
public void onInitialize() {
ModBlocks.register();
ModItems.register();
ModScreenHandlers.register();

var touch = ModConfig.INSTANCE;
}

public static Identifier id(String path) {
return new Identifier(MODID, path);
return Identifier.of(MODID, path);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import nl.enjarai.omnihopper.ModConfig;
import nl.enjarai.omnihopper.OmniHopper;
import nl.enjarai.omnihopper.util.FurnaceFuelBucketStorage;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.Mixin;
Expand Down Expand Up @@ -56,7 +56,7 @@ protected void setFuelStack(ItemStack fuelItem) {
)
)
private boolean removeExtractionExceptions(boolean original) {
if (ModConfig.INSTANCE.removeFurnaceExtractionExceptions) {
if (getWorld().getGameRules().getBoolean(OmniHopper.REMOVE_FURNACE_EXCEPTIONS)) {
return false;
}
return original;
Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/assets/omnihopper/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,7 @@
"container.fluid_omnihopper": "Omni-Flopper",
"container.fluid_hopper": "Flopper",
"container.wooden_omnihopper": "Omni-Whopper",
"container.wooden_hopper": "Whopper"
"container.wooden_hopper": "Whopper",

"gamerule.omnihopper:removeFurnaceExtractionExceptions": "[OmniHopper] Remove Furnace fuel slot extraction exceptions"
}
4 changes: 2 additions & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
"accessWidener" : "omnihopper.accesswidener",
"depends": {
"cooldown-coordinator": "^0.4.3",
"cicada": "*",
"cicada": ">=0.6.0 <1.0.0",
"fabric": "*",
"fabricloader": ">=0.15",
"minecraft": ">=1.20.5",
"minecraft": ">=1.20.5 <=1.20.6",
"java": ">=21"
},
"custom": {
Expand Down

0 comments on commit cf3f097

Please sign in to comment.