Skip to content

Commit

Permalink
Create mod metabolites
Browse files Browse the repository at this point in the history
  • Loading branch information
lilypuree committed Jan 27, 2024
1 parent 993c04e commit daac50b
Show file tree
Hide file tree
Showing 13 changed files with 112 additions and 66 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ env:
MOD_NAME: Metabolism
CURSEFORGE_ID: 953740
MODRINTH_ID: dd5hwRqg
forge: Forge
fabric: Fabric

on:
workflow_dispatch:

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## 1.20.1 Changelog

### 2.1.3
- Fabric mixin conflict fixed
- Added Create metabolites

### 2.1.2
- Fabric Configs mod menu screen fixed
- Removed doTemperature gamerule
Expand Down
6 changes: 6 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ subprojects {
name = 'BlameJared Maven (JEI / CraftTweaker / Bookshelf)'
url = 'https://maven.blamejared.com'
}
maven {
url "https://cursemaven.com"
content {
includeGroup "curse.maven"
}
}
}

tasks.withType(JavaCompile).configureEach {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"warmth": 6.0,
"food": 4.0,
"hydration": 2.0,
"modifier": {
"eat_when_full": true,
"fast_eating": true
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"warmth": 10.0,
"food": 8.0,
"hydration": 2.0,
"amplifier": 1,
"modifier": {
"eat_when_full": true,
"fast_eating": true
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"warmth": 12.0,
"food": 7.0,
"hydration": 7.0,
"amplifier": 1,
"modifier": {
"eat_when_full": true
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"warmth": 8.0,
"food": 5.0,
"hydration": 5.0,
"amplifier": 1,
"modifier": {
"eat_when_full": true
}
}
32 changes: 0 additions & 32 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ plugins {
id 'idea'
id 'maven-publish'
id 'fabric-loom' version '1.2-SNAPSHOT'
id "com.modrinth.minotaur" version "2.+"
id 'net.darkhax.curseforgegradle' version "1.+"
}
base {
archivesName = "${mod_name}-Fabric-${minecraft_version}"
Expand Down Expand Up @@ -85,33 +83,3 @@ publishing {
}
}
}

modrinth {
debugMode = true
token = System.getenv("MODRINTH_TOKEN")
projectId = "${mod_id}" // This can be the project ID or the slug. Either will work!
versionName = archivesBaseName + "-" + version
versionType = "release" // This is the default -- can also be `beta` or `alpha`
uploadFile = remapJar
changelog = rootProject.file('CHANGELOG.md').text
gameVersions = ["1.20.1"] // Must be an array, even with only one version
dependencies { // A special DSL for creating dependencies
required.project "fabric-api" // Creates a new required dependency on Fabric API
embedded.project "midnightlib" // Creates a new required dependency on Fabric API
}
}

task publishCurseForge(type: net.darkhax.curseforgegradle.TaskPublishCurseForge) {
debugMode = true

description = 'publishes the fabric build to CurseForge.'

apiToken = System.getenv("CURSEFORGE_TOKEN")

def mainFile = upload(953740, jar)
mainFile.changelog = rootProject.file('CHANGELOG.md')
mainFile.changelogType = "markdown"
mainFile.releaseType = "release"
mainFile.addRequirement("fabric-api")
mainFile.addEmbedded("midnightlib")
}
6 changes: 4 additions & 2 deletions fabric/src/main/java/lilypuree/metabolism/mixin/GuiMixin.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package lilypuree.metabolism.mixin;

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import com.llamalad7.mixinextras.sugar.Local;
import com.llamalad7.mixinextras.sugar.ref.LocalIntRef;
import lilypuree.metabolism.client.ClientHandler;
Expand Down Expand Up @@ -38,8 +40,8 @@ public abstract class GuiMixin {
@Shadow
private int screenHeight;

@Redirect(method = "renderPlayerHealth", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/Gui;getVehicleMaxHearts(Lnet/minecraft/world/entity/LivingEntity;)I"))
public int onGetVehicleHealth(Gui gui, LivingEntity entity) {
@WrapOperation(method = "renderPlayerHealth", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/Gui;getVehicleMaxHearts(Lnet/minecraft/world/entity/LivingEntity;)I"))
public int onGetVehicleHealth(Gui instance, LivingEntity vehicle, Operation<Integer> original) {
return 20;
}

Expand Down
31 changes: 2 additions & 29 deletions forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ plugins {
id 'net.minecraftforge.gradle' version '[6.0,6.2)'
id 'org.spongepowered.mixin' version '0.7-SNAPSHOT'
id 'org.parchmentmc.librarian.forgegradle' version '1.+'
id "com.modrinth.minotaur" version "2.+"
id 'net.darkhax.curseforgegradle' version '1.+'

}
base {
Expand Down Expand Up @@ -91,6 +89,8 @@ dependencies {
compileOnly project(":common")
compileOnly fg.deobf("squeek.appleskin:appleskin-forge:${appleskin_forge_version}:api")
annotationProcessor("org.spongepowered:mixin:0.8.5-SNAPSHOT:processor")

implementation fg.deobf("curse.maven:farmers-delight-398521:5051242")
}

tasks.withType(JavaCompile).configureEach {
Expand Down Expand Up @@ -123,30 +123,3 @@ publishing {
}
}
}

modrinth {
debugMode = true
token = System.getenv("MODRINTH_TOKEN")
projectId = "${mod_id}" // This can be the project ID or the slug. Either will work!
versionName = archivesBaseName + "-" + version
versionType = "release" // This is the default -- can also be `beta` or `alpha`
uploadFile = jar // With Loom, this MUST be set to `remapJar` instead of `jar`!
changelog = rootProject.file('CHANGELOG.md').text
gameVersions = ["1.20.1"] // Must be an array, even with only one version
dependencies { // A special DSL for creating dependencies

}
}

task publishCurseForge(type: net.darkhax.curseforgegradle.TaskPublishCurseForge) {
debugMode = true

description = 'publishes the forge build to CurseForge.'

apiToken = System.getenv("CURSEFORGE_TOKEN")

def mainFile = upload(953740, jar)
mainFile.changelog = rootProject.file('CHANGELOG.md')
mainFile.changelogType = "markdown"
mainFile.releaseType = "release"
}
25 changes: 25 additions & 0 deletions forge/src/main/java/lilypuree/metabolism/data/DataGenerators.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package lilypuree.metabolism.data;

import net.minecraft.core.HolderLookup;
import net.minecraft.data.DataGenerator;
import net.minecraft.data.PackOutput;
import net.minecraftforge.common.data.ExistingFileHelper;
import net.minecraftforge.data.event.GatherDataEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;

import java.util.concurrent.CompletableFuture;

@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
public class DataGenerators {

@SubscribeEvent
public static void gatherData(GatherDataEvent event) {
DataGenerator generator = event.getGenerator();
PackOutput packOutput = generator.getPackOutput();
CompletableFuture<HolderLookup.Provider> lookupProvider = event.getLookupProvider();
ExistingFileHelper existingFileHelper = event.getExistingFileHelper();


}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package lilypuree.metabolism.data;

import com.mojang.logging.LogUtils;
import net.minecraft.core.HolderLookup;
import net.minecraft.data.CachedOutput;
import net.minecraft.data.DataProvider;
import net.minecraft.data.PackOutput;
import net.minecraftforge.common.data.ExistingFileHelper;
import org.slf4j.Logger;

import java.util.concurrent.CompletableFuture;

public class MetabolitesProvider implements DataProvider {
private static final Logger LOGGER = LogUtils.getLogger();
protected final String modid;

public MetabolitesProvider(PackOutput packOutput, CompletableFuture<HolderLookup.Provider> lookupProvider, String modid, ExistingFileHelper existingFileHelper) {
this.modid = modid;
}

@Override
public String getName() {
return "Metabolites for mod " + modid;
}

@Override
public CompletableFuture<?> run(CachedOutput cachedOutput) {
return null;
}


}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false

# Project
version=2.1.2
version=2.1.3
group=lilypuree.metabolism

# Common
Expand Down

0 comments on commit daac50b

Please sign in to comment.