Skip to content

Commit

Permalink
fix fuel tank KJS builder
Browse files Browse the repository at this point in the history
  • Loading branch information
screret committed Apr 12, 2024
1 parent 19c7c53 commit 877e54e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 22 deletions.
14 changes: 11 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,19 @@ dependencies {
}

processResources {
inputs.property "version", project.version
inputs.property "mod_id", project.mod_id
// set up properties for filling into metadata
var properties = [
"version": version,
"mod_id": project.mod_id,
"forge_version": forge.versions.forgeShortVersion.get().split("\\.")[0], // only specify major version of forge
"minecraft_version": libs.versions.minecraft.get(),
"gtceu_version": forge.versions.gtceu.get(),
"mod_name": mod_name,
]
inputs.properties(properties)

filesMatching("META-INF/mods.toml") {
expand "version": project.version
expand properties
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
package argent_matter.gcyr.integration.kjs.builders;

import argent_matter.gcyr.api.block.impl.SimpleFuelTankProperties;
import argent_matter.gcyr.api.block.impl.SimpleRocketMotorType;
import argent_matter.gcyr.common.block.FuelTankBlock;
import argent_matter.gcyr.common.block.RocketMotorBlock;
import argent_matter.gcyr.common.data.GCyRBlocks;
import dev.latvian.mods.kubejs.block.BlockBuilder;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.Block;

@Accessors(chain = true, fluent = true)
public class FuelTankBlockBuilder extends BlockBuilder {
@Getter
public transient int tier, maxCarryWeight, motorCount;
@Setter
public transient int tier;
@Setter
public transient long fuelStorage;
@Setter
public transient String typeId = "";

Expand All @@ -25,9 +24,9 @@ public FuelTankBlockBuilder(ResourceLocation i) {

@Override
public Block createObject() {
SimpleRocketMotorType fuelTankProperties = new SimpleRocketMotorType(this.typeId, tier, maxCarryWeight, motorCount);
RocketMotorBlock result = new RocketMotorBlock(this.createProperties(), fuelTankProperties);
GCyRBlocks.ALL_ROCKET_MOTORS.put(fuelTankProperties, () -> result);
SimpleFuelTankProperties fuelTankProperties = new SimpleFuelTankProperties(this.typeId, tier, fuelStorage);
FuelTankBlock result = new FuelTankBlock(this.createProperties(), fuelTankProperties);
GCyRBlocks.ALL_FUEL_TANKS.put(fuelTankProperties, () -> result);
return result;
}
}
22 changes: 11 additions & 11 deletions src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
modLoader="javafml" #mandatory
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
loaderVersion="[43,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
loaderVersion="${forge_version}" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
# The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties.
# Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here.
license="GNU GPL 3.0"
license="GNU LGPL 3.0"
# A URL to refer people to when problems occur with this mod
issueTrackerURL="https://github.com/argent-matter/gcyr/issues"
# A list of mods - how many allowed here is determined by the individual mod loader
[[mods]] #mandatory
# The modid of the mod
modId="gcyr" #mandatory
modId="${mod_id}" #mandatory
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
# ${version} will substitute the value of the Implementation-Version as read from the mod's JAR file metadata
# see the associated build.gradle script for how to populate this completely automatically during a build
version="${version}" #mandatory
# A display name for the mod
displayName="Gregicality Rocketry" #mandatory
displayName="${mod_name}" #mandatory
# A URL to query for updates for this mod. See the JSON update specification <here>
#updateJSONURL="http://myurl.me/" #optional
# A URL for the "homepage" for this mod, displayed in the mod UI
Expand All @@ -31,7 +31,7 @@ issueTrackerURL="https://github.com/argent-matter/gcyr/issues"
# A text field displayed in the mod UI
#credits="Thanks for this example mod goes to Java" #optional
# A text field displayed in the mod UI
authors="screret,NemEzanevem" #optional
authors="screret,NemEzanevem,voltaic" #optional
# Display Test controls the display for your mod in the server connection screen
# MATCH_VERSION means that your mod will cause a red X if the versions on client and server differ. This is the default behaviour and should be what you choose if you have server and client elements to your mod.
# IGNORE_SERVER_VERSION means that your mod will not cause a red X if it's present on the server but not on the client. This is what you should use if you're a server only mod.
Expand All @@ -45,7 +45,7 @@ issueTrackerURL="https://github.com/argent-matter/gcyr/issues"
A space addon for GregTechCEu
'''
# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional.
[[dependencies.gcyr]] #optional
[[dependencies.${mod_id}]] #optional
# the modid of the dependency
modId="forge" #mandatory
# Does this dependency have to exist - if not, ordering below must be specified
Expand All @@ -56,17 +56,17 @@ issueTrackerURL="https://github.com/argent-matter/gcyr/issues"
ordering="NONE"
# Side this dependency is applied on - BOTH, CLIENT or SERVER
side="BOTH"
# Here's another dependency
[[dependencies.gcyr]]
# Here's another dependency
[[dependencies.${mod_id}]]
modId="minecraft"
mandatory=true
# This version range declares a minimum of the current minecraft version up to but not including the next major version
versionRange="[1.20,1.21)"
versionRange="${minecraft_version}"
ordering="NONE"
side="BOTH"
[[dependencies.gcyr]]
[[dependencies.${mod_id}]]
modId="gtceu"
mandatory=true
versionRange="[1.0.14.a,)"
versionRange="[${gtceu_version},)"
ordering="AFTER"
side="BOTH"

0 comments on commit 877e54e

Please sign in to comment.