Skip to content

Commit

Permalink
Now you can make you cold with an IceCreamBucket
Browse files Browse the repository at this point in the history
  • Loading branch information
Garkatron committed Jan 10, 2025
1 parent 4d3a086 commit 471dc18
Show file tree
Hide file tree
Showing 22 changed files with 396 additions and 168 deletions.
124 changes: 90 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,94 @@
#### Better than adventure
This mod uses a modified version of Fabric (Babric) and is designed only for Better than Adventure, a heavily modified version of Minecraft b1.7.3! For more information, join the discord server provided on this projects

## StanleyLib updated to 1.2.0-7.2pre2
*A temperature mod and lib*

### What's this mod?
This mod introduces a library of functions aimed at managing player body temperature, enhancing gameplay through realistic environmental challenges and efficient resource management of thermal clothing and heat sources.

### Main features:
* Accessible functions for managing player temperature
* New damage types
* Fully configurable
* Classes and methods to monitor player temperature changes
* And more!

**Gameplay features can be deactivated.**
To deactivate:
##### stanleylib.cfg
```cfg
stanley.activate.temperature_management=false
```
**You can use only library features.**
# RPG System Documentation

## Import
##### build.gradle
```gradle
repositories {
maven { url = "https://jitpack.io" }
}
dependencies {
modImplementation "com.github.Garkatron:StanleyLib:${project.stanleylib_version}"
## Skills System

The **Skills System** is managed by an instance of `SkillTree.java`. Below is a guide to understanding and using the system effectively.

---

### **Creating and Managing Skills**

Skills can be implemented by extending `FunctionalSkill.java` or implementing the `IFunctionalSkill` interface. These classes provide templates for creating custom skills.

For example, if you want to create a skill like **Super Strength**, you can extend `FunctionalSkill` and write the logic to enhance the player's strength.

#### **Timed Skills**
You can use templates like `TimedFunctionalSkill` if your skill requires pre-written cooldown logic.

---

### **Skill Implementation Example**

Here is a simple implementation of a custom skill:

```java
public class MySkill extends FunctionalSkill {
public MySkill() {
// Initialization logic (if needed)
}

@Override
public boolean activate() {
// Logic to activate the skill
return false;
}

@Override
public boolean deactivate() {
// Logic to deactivate the skill
return false;
}

@Override
public boolean canActivate() {
// Conditions for activation
return false;
}

@Override
public boolean canDeactivate() {
// Conditions for deactivation
return false;
}

/*
* Optional methods:
* - boolean canComplete();
* - boolean complete();
* - boolean cancel();
*/
}
```
##### gradle.properties
```gradle
mod_version = release_tag_name
### Creating Skills and Adding Them to a Skill Tree
Here is an example of how to create instances of Skill and manage them using a SkillTree:

```java
// Define skills with dependencies
Skill skill1 = new Skill("Super Strength", 0, "Increases player strength", false, 0, 0, 0, new int[]{}, new MySkill());
Skill skill2 = new Skill("Advanced Strength", 1, "Further increases player strength", false, 0, 0, 0, new int[]{0}, new MySkill());

// Create a SkillTree instance
SkillTree skillTree = new SkillTree(
skill1,
skill2
// Add more skills as needed
);

// Unlocking skills
skillTree.unlockSkill(1); // Fails because Skill 1 depends on Skill 0
skillTree.unlockSkill(0); // Unlocks Skill 0
skillTree.unlockSkill(1); // Succeeds because Skill 0 is now unlocked

// Using skills
skillTree.getSkillById(0).getFunctionalSkill().activate();
skillTree.getSkillById(0).getFunctionalSkill().deactivate();

```
#### Key Concepts
Skill Dependencies: Skills can have dependencies. In the example above, Skill 1 depends on Skill 0 being unlocked first.
Functional Skills: These encapsulate the logic for what happens when a skill is activated, deactivated, completed, etc.
Skill Tree: A container for managing and unlocking skills, enforcing dependency rules.

#### Use FunctionalSkill for general-purpose skills and extend it for custom behavior.
Leverage TimedFunctionalSkill if your skill needs cooldown or duration logic.
Ensure skill dependencies are correctly defined using the integer array parameter in the Skill constructor.
87 changes: 55 additions & 32 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
plugins {
id 'babric-loom' version '1.4.+'
id 'fabric-loom' version '1.7.bta'
id 'java'
}

import org.gradle.internal.os.OperatingSystem

project.ext.lwjglVersion = "3.3.4"

switch (OperatingSystem.current()) {
case OperatingSystem.LINUX:
project.ext.lwjglNatives = "natives-linux"
break
case OperatingSystem.WINDOWS:
project.ext.lwjglNatives = "natives-windows"
break
case OperatingSystem.MAC_OS:
project.ext.lwjglNatives = "natives-macos"
}

group = project.mod_group
archivesBaseName = project.mod_name
version = project.mod_version

loom {
gluedMinecraftJar()
noIntermediateMappings()
customMinecraftManifest.set("https://github.com/Turnip-Labs/bta-manifest-repo/releases/download/v${project.bta_version}/${project.bta_version}.json")
customMinecraftMetadata.set("https://github.com/Turnip-Labs/bta-manifest-repo/releases/download/v${project.bta_version}/${project.bta_version}.json")
}

repositories {
Expand All @@ -25,12 +39,12 @@ repositories {
url = 'https://maven.fabricmc.net/'
}
maven {
name = 'signalumMavenReleases'
url = 'https://maven.thesignalumproject.net/releases'
name = 'SignalumMavenInfrastructure'
url = 'https://maven.thesignalumproject.net/infrastructure'
}
maven {
name = 'signalumMavenInfrastructure'
url = 'https://maven.thesignalumproject.net/infrastructure'
name = 'SignalumMavenReleases'
url = 'https://maven.thesignalumproject.net/releases'
}
ivy {
url = "https://github.com/Better-than-Adventure"
Expand All @@ -41,25 +55,17 @@ repositories {
metadataSources { artifact() }
}
ivy {
url = "https://github.com/Turnip-Labs"
patternLayout {
artifact "[organisation]/releases/download/v[revision]/[module]-[revision].jar"
m2compatible = true
}
metadataSources { artifact() }
}
ivy {
url = "https://github.com/Turnip-Labs"
url = "https://downloads.betterthanadventure.net/bta-client/${project.bta_channel}/"
patternLayout {
artifact "[organisation]/releases/download/[revision]/[module]-[revision].jar"
artifact "/v[revision]/client.jar"
m2compatible = true
}
metadataSources { artifact() }
}
ivy {
url = "https://github.com/Turnip-Labs"
url = "https://downloads.betterthanadventure.net/bta-server/${project.bta_channel}/"
patternLayout {
artifact "[organisation]/releases/download/[revision]/[module]-bta-[revision].jar"
artifact "/v[revision]/server.jar"
m2compatible = true
}
metadataSources { artifact() }
Expand All @@ -72,28 +78,21 @@ repositories {
}
metadataSources { artifact() }
}
ivy {
url = "https://github.com/MartinSVK12"
patternLayout {
artifact "[organisation]/releases/download/[revision]/[module]-[revision].jar"
m2compatible = true
}
metadataSources { artifact() }
}

}

dependencies {
minecraft "bta-download-repo:bta:${project.bta_version}"
minecraft "::${project.bta_version}"
mappings loom.layered() {}

modRuntimeOnly "objects:client:43db9b498cb67058d2e12d394e6507722e71bb45" // https://piston-data.mojang.com/v1/objects/43db9b498cb67058d2e12d394e6507722e71bb45/client.jar
modImplementation "fabric-loader:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

// Helper library
// If you do not need Halplibe you can comment this line out or delete this line
modImplementation "turniplabs:halplibe:${project.halplibe_version}"
implementation("turniplabs:halplibe:${project.halplibe_version}")

modImplementation "ModMenu:ModMenu:${project.mod_menu_version}"
modImplementation("turniplabs:modmenu-bta:${project.mod_menu_version}")

implementation "org.slf4j:slf4j-api:1.8.0-beta4"
implementation "org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0"
Expand All @@ -104,15 +103,34 @@ dependencies {
implementation("org.apache.logging.log4j:log4j-core:${log4jVersion}")
implementation("org.apache.logging.log4j:log4j-api:${log4jVersion}")
implementation("org.apache.logging.log4j:log4j-1.2-api:${log4jVersion}")

include(implementation("org.apache.commons:commons-lang3:3.12.0"))

modImplementation("com.github.zarzelcow:legacy-lwjgl3:1.0.4")
implementation platform("org.lwjgl:lwjgl-bom:$lwjglVersion")

runtimeOnly "org.lwjgl:lwjgl::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-assimp::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-glfw::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-openal::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-opengl::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-stb::$lwjglNatives"
implementation "org.lwjgl:lwjgl:$lwjglVersion"
implementation "org.lwjgl:lwjgl-assimp:$lwjglVersion"
implementation "org.lwjgl:lwjgl-glfw:$lwjglVersion"
implementation "org.lwjgl:lwjgl-openal:$lwjglVersion"
implementation "org.lwjgl:lwjgl-opengl:$lwjglVersion"
implementation "org.lwjgl:lwjgl-stb:$lwjglVersion"
}

java {
sourceCompatibility = JavaVersion.VERSION_16
targetCompatibility = JavaVersion.VERSION_16
withSourcesJar()
}

tasks.withType(JavaCompile).configureEach {
options.release.set 8
options.release.set 16
}

jar {
Expand All @@ -121,6 +139,11 @@ jar {
}
}

configurations.configureEach {
// Removes LWJGL2 dependencies
exclude group: "org.lwjgl.lwjgl"
}

processResources {
inputs.property "version", version

Expand Down
20 changes: 9 additions & 11 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
org.gradle.jvmargs=-Xmx2G

# BTA
bta_version=7.2_01
bta_version=7.3-pre3
bta_channel=prerelease

# Loader & Mod Menu
# Check the newest version at https://github.com/Turnip-Labs/fabric-loader/releases
loader_version=0.15.6-babric.6-bta
# Check the newest version at https://github.com/Turnip-Labs/ModMenu/releases/
mod_menu_version=2.0.6
# Loader
loader_version=0.15.6-bta.7

# HalpLibe
# Check the newest version at https://github.com/Turnip-Labs/bta-halplibe/releases/
halplibe_version=4.1.3
# Other Mods
mod_menu_version=3.0.0
halplibe_version=5.0.0

# Mod
mod_version=1.3.3-7.2_01
mod_version=1.0.0
mod_group=deus
mod_name=stanleytemperature
mod_name=rpgstuff
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 0 additions & 2 deletions jitpack.yml

This file was deleted.

9 changes: 5 additions & 4 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
pluginManagement {
repositories {
gradlePluginPortal()
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
gradlePluginPortal()
maven {
name = 'Jitpack'
url = 'https://jitpack.io'
Expand All @@ -13,8 +13,9 @@ pluginManagement {
name = 'Babric'
url = 'https://maven.glass-launcher.net/babric'
}
maven {
name = 'SignalumMavenInfrastructure'
url = 'https://maven.thesignalumproject.net/infrastructure'
}
}
}
plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0'
}
10 changes: 5 additions & 5 deletions src/main/java/deus/stanleytemperature/StanleyTemperature.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
import net.fabricmc.api.ModInitializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import turniplabs.halplibe.util.ClientStartEntrypoint;
import turniplabs.halplibe.util.GameStartEntrypoint;
import turniplabs.halplibe.util.RecipeEntrypoint;


public class StanleyTemperature implements ModInitializer, GameStartEntrypoint, RecipeEntrypoint {
public class StanleyTemperature implements ModInitializer, RecipeEntrypoint, ClientStartEntrypoint {

public static final String MOD_ID = "stanleytemperature";
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
Expand Down Expand Up @@ -40,16 +41,15 @@ public void onInitialize() {

}


@Override
public void beforeGameStart() {
public void beforeClientStart() {

}

@Override
public void afterGameStart() {
public void afterClientStart() {
HudManager.init();


}

@Override
Expand Down
Loading

0 comments on commit 471dc18

Please sign in to comment.