Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 6 additions & 93 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Worlds Colliding - Core Mod
[![](https://cf.way2muchnoise.eu/title/worlds-colliding-mod.svg?badge_style=for_the_badge)](https://www.curseforge.com/minecraft/mc-mods/worlds-colliding-mod)

Worlds Colliding is the core foundation of the modpack of the same name. This mod serves as the technical engine, adding specific mechanics essential to the modpack’s narrative and progression system.

<ins>__Key Features__</ins>:
Expand All @@ -20,97 +22,8 @@ https://github.com/GCJOJO/WorldsColliding/issues <br>
```./gradlew build```
3) Enjoy !

<ins>__How to use the dialogue system__</ins>: <br>
First create a resource pack using this folder structure
```
resourcepacks/
my_resourcepack/
assets/
lang/
en_us.json
any other language files...
dialogues.json
pack.mcmeta
```

Inside dialogues.json define the different speakers that may speak in your dialogues.

```jsonc
{
"speakers" : [
// The speaker with id 0 is named Speaker 1 and its display color is white, this speaker doesn't play any sound when talking
{ "id" : 0, "name": "Speaker 1", "color": "FFFFFFFF", "sounds" : [] },
// The speaker with id 1 is named Speaker 2 and its display color is red, this speaker plays the note block banjo sound when talking
{ "id" : 1, "name": "Speaker 2", "color": "FFFF0000", "sounds" : ["block.note_block.banjo"] },
// The speaker with id 2 is named Speaker 3 and randomly plays the sounds of the xylophone, the flute, the basedrum and the sound of falling on a mud block
{ "id" : 2, "name": "Speaker 3", "color": "FFFFFFFF", "sounds" : ["block.note_block.xylophone", "block.note_block.flute", "block.note_block.basedrum", "block.mud.fall"] },
//...
]
}
```

Here is how you define a dialogue, there are multiple actions that can be defined as follows:
```jsonc
{
"speakers" : [
//...
],
"dialogue_1" : [
{ "action" : "message", "speaker" : 0, "text" : "this action displays a message with speaker id 0"},

{ "action": "change_set", "set": "dialogue_2" },

{ "action": "choice", "option1": "Choose option 1 !", "action1": "action1_choosen", "save1": "option1", "option2": "Choose option 2 !", "action2": "action2_choosen", "save2": "option2" },

// this actions displays a fading animation that takes 20 ticks and fades the screen from being visible to a white screen
{ "action": "fade", "from": "00000000", "to": "FFFFFFFF", "time": 20 },

{ "action": "wait", "time": 20 },

// clears every actions,
{ "action": "clear" },
//you may specify which action type to clear
{ "action": "clear", "cleared_action": "fade" },

// displays an image on the screen, the width and height are the original size of the image, the image should be properly resized once shown to the player
{ "action": "image", "id": 0, "image": "my_resourcepack:textures/gui/my_cool_texture.png", "width": 64, "height": 64},

// This actions move the image with id 0 with a duration of 80 ticks.
// The image starts at a position of 10% of the screen and ends at 90% of the screen and blends from 0% transparency to 100%
{ "action": "move_image", "id": 0, "start_x": 10, "start_y": 10, "end_x": 90, "end_y": 90, "alpha_start": 0, "alpha_end": 255, "time": 80 }

// This actions executes a command as the player reading the dialogue.
// The <PLAYER> text will be replaced by the player's name.
{ "action": "command", "command": "say hello from <PLAYER> !" }

// The command is execute as if the player typed it without needing permisions, you don't need to do /execute positioned as ... for any positioned command
// You can simply do :
{ "action": "command", "command": "tp @s ~ ~10 ~" }
]
}
```
When defining text such as message or speaker names, you may use localized keys and translate them inside of `en_us.json` or any other language files.

You may display you dialogues using the following commands : <br>
``/dialogue set my_resourcepack:dialogue_1`` <br>
``/dialogue play``

<ins>__What are blocking and non-blocking actions ?__</ins><br>
Blocking actions are considered as actions that blocks the current dialogue, when they end, they wait for user input instead of directly going to the next action. <br>
There can be only one Blocking Action at any point.

Non-blocking actions do not wait user input before going to the next action. <br>
Non-blocking actions can be stacked on top of each others and stack on top of one Blocking Action and need to be cleared manually using the clear action.

Here is a table of Blocking and Non-Blocking Actions

| Blocking | Non-Blocking |
|:---------------------:|:---------------------:|
| MessageAction | FadeAction |
| ChoiceAction | ImageAction |
| WaitAction | NextAction |
| ExecuteCommandAction | CreditAction |
| | ClearAction |
| | MoveImageAction |

## Dialogue System
The dialogue system has been moved to its own library [BlablaLib](https://github.com/GCJOJO/BlablaLib).
<br><br><br>
-------------------------------------------------
_This project is currently in active development_
49 changes: 14 additions & 35 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ plugins {
id 'maven-publish'
id 'net.minecraftforge.gradle' version '[6.0,6.2)'
id 'org.spongepowered.mixin' version '0.7.+'
id 'architectury-plugin' version '3.4-SNAPSHOT'
}

architectury {
minecraft = project.minecraft_version
}

version = mod_version
Expand Down Expand Up @@ -115,17 +120,7 @@ sourceSets.main.resources { srcDir 'src/generated/resources' }
repositories {
// Put repositories for dependencies here
// ForgeGradle automatically adds the Forge maven and Maven Central for you

// If you have mod jar dependencies in ./libs, you can declare them as a repository like so.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html#sub:flat_dir_resolver
flatDir {
dir 'libs'
}
maven
{
url = uri("https://maven.bai.lol")
}

mavenLocal()

maven {
name = 'GeckoLib'
Expand All @@ -136,11 +131,7 @@ repositories {
}
}

dependencies {
implementation fg.deobf("software.bernie.geckolib:geckolib-forge-${minecraft_version}:${geckolib_version}")
implementation("com.eliotlash.mclib:mclib:20")
}

maven { url 'https://jitpack.io' }
}

dependencies {
Expand All @@ -151,16 +142,12 @@ dependencies {
// then special handling is done to allow a setup of a vanilla dependency without the use of an external repository.
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"

// Example mod dependency with JEI - using fg.deobf() ensures the dependency is remapped to your development mappings
// The JEI API is declared for compile time use, while the full JEI artifact is used at runtime
// compileOnly fg.deobf("mezz.jei:jei-${mc_version}-common-api:${jei_version}")
// compileOnly fg.deobf("mezz.jei:jei-${mc_version}-forge-api:${jei_version}")
// runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}-forge:${jei_version}")
implementation fg.deobf("software.bernie.geckolib:geckolib-forge-${minecraft_version}:${geckolib_version}")
implementation("com.eliotlash.mclib:mclib:20")

// Example mod dependency using a mod jar from ./libs with a flat dir repository
// This maps to ./libs/coolmod-${mc_version}-${coolmod_version}.jar
// The group id is ignored when searching -- in this case, it is "blank"
//implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}")
implementation fg.deobf("dev.architectury:architectury-forge:${architectury_api_version}")
implementation fg.deobf("com.github.GCJOJO.BlablaLib:blablalib-forge:${blablalib_version}")
//implementation fg.deobf("io.github.gcjojo.blablalib:blablalib-forge:${blablalib_version}")

// For more info:
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
Expand All @@ -178,6 +165,7 @@ tasks.named('processResources', ProcessResources).configure {
loader_version_range: loader_version_range,
mod_id: mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version,
mod_authors: mod_authors, mod_description: mod_description,
blablalib_version_range: blablalib_version_range
]
inputs.properties replaceProperties

Expand Down Expand Up @@ -211,16 +199,7 @@ tasks.named('jar', Jar).configure {

// Example configuration to allow publishing using the maven-publish plugin
publishing {
publications {
register('mavenJava', MavenPublication) {
artifact jar
}
}
repositories {
maven {
url "file://${project.projectDir}/mcmodsrepo"
}
}

}

tasks.withType(JavaCompile).configureEach {
Expand Down
9 changes: 7 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
org.gradle.jvmargs=-Xmx8G
org.gradle.daemon=false


## Environment Properties

# The Minecraft version must agree with the Forge version to get a valid artifact
Expand All @@ -18,6 +17,12 @@ forge_version=47.4.10
forge_version_range=[47,)
# The loader version range can only use the major version of Forge/FML as bounds
loader_version_range=[47,)

architectury_api_version=9.2.14
blablalib_version=1.0.4

blablalib_version_range=[1.0.4,)

# The mapping channel to use for mappings.
# The default set of supported mapping channels are ["official", "snapshot", "snapshot_nodoc", "stable", "stable_nodoc"].
# Additional mapping channels can be registered through the "channelProviders" extension in a Gradle plugin.
Expand Down Expand Up @@ -48,7 +53,7 @@ mod_name=World's Colliding
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=All Rights Reserved
# The mod version. See https://semver.org/
mod_version=1.1.6
mod_version=1.2.0
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ pluginManagement {
repositories {
gradlePluginPortal()
maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
maven { url "https://maven.architectury.dev/" }
maven {
name = 'MinecraftForge'
url = 'https://maven.minecraftforge.net/'
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/fr/gcjojo/worldscolliding/ModEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import fr.gcjojo.worldscolliding.entity.AwakenedScourgeEntity;
import fr.gcjojo.worldscolliding.entity.ModEntities;
import fr.gcjojo.worldscolliding.entity.ScourgeEntity;
import fr.gcjojo.worldscolliding.events.ModEvents;
import fr.gcjojo.worldscolliding.items.ModItems;
import fr.gcjojo.worldscolliding.network.ModNetwork;
import fr.gcjojo.worldscolliding.worldgen.dimension.ModDimensions;
Expand Down Expand Up @@ -62,6 +63,8 @@ public ModEntry(FMLJavaModLoadingContext context)
MinecraftForge.EVENT_BUS.register(this);

context.registerConfig(ModConfig.Type.COMMON, Config.SPEC);

ModEvents.registerBlablaLibEvents();
}

public static Logger getLogger() { return LOGGER; }
Expand Down
Loading
Loading