Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to 1.19.2 #19

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft
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
26 changes: 15 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
# gradle

# Gradle
.gradle/
build/
out/
classes/

# idea
# Loom
remappedSrc/
run/

# Eclipse
*.launch

# IntelliJ Idea
.idea/
*.iml
*.ipr
*.iws

# vscode
# Fleet
.fleet/

# Visual Studio Code
.settings/
.vscode/
bin/
.classpath
.project

# fabric

run/


# apple >.>
# Eclipse JDT LS
workspace/

.DS_Store
# macOS
*.DS_Store
52 changes: 30 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,45 @@
# Allium Peripherals ![Modrinth Downloads](https://img.shields.io/modrinth/dt/allium-peripherals?color=00AF5C&label=modrinth&style=flat&logo=modrinth)

For CC:T for Fabric & Minecraft 1.16.5
For CC:T for Fabric & Minecraft 1.19.2

Allium offers a couple peripherals - and more planned as ideas are proposed. The two currently provided are the survival and creative chat modem. These modems function identically to the
chat module from [SquidDev's Plethora](https://github.com/SquidDev-CC/Plethora) peripherals mod.
Allium offers a couple peripherals - and more planned as ideas are proposed. The two currently provided are the survival and creative chat modem. These modems function identically to the chat module from [SquidDev's Plethora](https://github.com/SquidDev-CC/Plethora) peripherals mod.
This mod depends on [ComputerCraft: Restitched](https://www.curseforge.com/minecraft/mc-mods/cc-restitched).

## Items
The current list of items in the game, along with a bit of documentation on their methods.

### Survival Chat Modem
To start, right click on one to bind yourself, right click to unbind. Nobody else can unbind you from a chat modem
you've bound yourself to (apart from breaking and replacing it). Once bound you have access to all the methods:
- `capture`: add a pattern to queue an event every time you send a message that matches. Once a message gets captured,
it does not get sent to anyone else.
- `uncapture`: removes a single given pattern or all patterns if none are supplied
- `getCaptures`: returns a table of all captures
- `getBoundPlayer`: returns two strings, the username of the bound player, and the UUID of the bound player
- `say`: sends a message to the bound player.
To start, right-click a Survival Chat Modem to bind yourself; right-click it again to unbind. Nobody else can unbind you from a chat modem you've bound yourself to (apart from breaking and replacing it).
Once bound, you have access to the following:

Methods:
- `capture`: Adds the given pattern to a queue that fires an event every time the bound player sends a message that matches the pattern. Once a message is captured, it will not be visible to other players.
**NOTE: This is currently broken on >=1.19.1; chat messages will still be visible to other players!**
- `uncapture`: Removes the given pattern from the queue, or all patterns if not specified.
- `getCaptures`: Returns a table of all queued patterns.
- `getBoundPlayer`: Returns both the username and UUID of the bound player as strings.
- `say`: Sends a message to the bound player.

Events:
- `chat_message -> (username, message, uuid)`
- Fired when a chat message is sent by the bound player.
- `string`: The player's username
- `string`: The player's chat message
- `string`: The player's UUID
- `chat_capture -> (username, message, uuid, pattern)`
- Fired when a chat message is sent by the bound player that matches a pattern defined via `capture`.
- `string`: The player's username
- `string`: The player's chat message
- `string`: The player's UUID
- `string`: The matching pattern


### Creative Chat Modem

The creative chat modem is similar to a survival modem, with the exception that it applies captures globally. Since it
lacks the need for a player, the methods `getBoundPlayer` and `say` do not apply to the creative chat modem, all others
from the survival modem are identical.
The Creative Chat Modem is similar to the Survival Chat Modem, with the exception that it applies captures globally. Since it lacks the need for a player, the methods `getBoundPlayer` and `say` do not apply. All other methods and events are identical to the Survival Chat Modem.

## Rationale & Credits

So basically I was really bored, and tired of waiting for Plethora to update (insert obligatory SquidDev comment "PRs
Welcome!"), so I went and made what I needed. I used Fabric because open source ethics, love for the community, and love
of framework.
So basically I was really bored, and tired of waiting for Plethora to update (insert obligatory SquidDev comment "PRs Welcome!"), so I went and made what I needed. I used Fabric because open source ethics, love for the community, and love of framework.

I would like to give a huge(blank) thanks for all the users on the fabric community discord for helping me make this mod
a reality, from shouting at me to refresh gradle, to dealing with my ineptitude while trying to implement block
entities. I'd also like to thank [SquidDev](https://github.com/SquidDev) in particular for assisting me when I came
across issues with the CC end of the mod.
I would like to give a huge(blank) thanks for all the users on the fabric community discord for helping me make this mod a reality, from shouting at me to refresh gradle, to dealing with my ineptitude while trying to implement block entities. I'd also like to thank [SquidDev](https://github.com/SquidDev) in particular for assisting me when I came across issues with the CC end of the mod.
83 changes: 29 additions & 54 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,53 +1,36 @@
plugins {
id 'fabric-loom' version '0.11-SNAPSHOT'
id 'fabric-loom' version '1.3-SNAPSHOT'
id 'io.github.juuxel.loom-vineflower' version '1.11.0'
id 'maven-publish'
}

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

archivesBaseName = project.archives_base_name
version = project.mod_version + '+' + project.minecraft_version
version = "${project.mod_version}+${project.minecraft_version}"
group = project.maven_group

base {
archivesName = project.archives_base_name
}

repositories {
mavenLocal()
mavenCentral()
maven {
name "SquidDev"
url "https://squiddev.cc/maven"
}
maven { url 'https://jitpack.io' }
maven { url "https://jitpack.io" }
maven { url "https://maven.shedaniel.me/" }
maven { url "https://maven.terraformersmc.com/releases" }

maven { url "https://squiddev.cc/maven" }
}

dependencies {
//to change the versions see the gradle.properties file
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

compileOnly 'com.google.code.findbugs:jsr305:3.0.2'

// Fabric API. This is technically optional, but you probably want it anyway.
// Fabric API
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

implementation 'javax.vecmath:vecmath:1.5.2'

// CC: Restitched
modApi 'com.electronwill.night-config:core:3.6.3'
modApi 'com.electronwill.night-config:toml:3.6.3'

modApi "com.github.cc-tweaked:cc-restitched:${project.cc_version}"

modApi("me.shedaniel.cloth:cloth-config-fabric:7.0.72") {
exclude(group: "net.fabricmc.fabric-api")
}

// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
// You may need to force-disable transitiveness on them.
compileOnly "com.google.code.findbugs:jsr305:${project.jsr305_version}"
}

processResources {
Expand All @@ -58,45 +41,37 @@ processResources {
}
}

// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
def targetVersion = 17
if (JavaVersion.current().isJava9Compatible()) {
it.options.release = targetVersion
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
it.options.release = 17
}

java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

withSourcesJar()
}

jar {
from "LICENSE"
from("LICENSE") {
rename { "${it}_${project.base.archivesName.get()}"}
}
}

// configure the maven publication
// Configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
// add all the jars that should be included when publishing to maven
artifact(remapJar) {
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
from components.java
}
}

// select the repositories you want to publish to
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// uncomment to publish to the local maven
mavenLocal()
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}
}
21 changes: 12 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx3G
org.gradle.jvmargs=-Xmx1G
org.gradle.parallel=true

minecraft_version=1.19
yarn_mappings=1.19+build.4
loader_version=0.14.8

#Fabric api
fabric_version=0.57.0+1.19
# Fabric Properties
# Check these on https://fabricmc.net/develop
minecraft_version=1.19.2
yarn_mappings=1.19.2+build.28
loader_version=0.14.22

# Mod Properties
mod_version = 0.3.4
mod_version = 0.4.0
maven_group = dev.hugeblank
archives_base_name = allium_peripherals

cc_version=v1.19-1.101.0-ccr
# Dependencies
fabric_version=0.76.1+1.19.2
cc_version=v1.19.1-1.101.2-ccr
jsr305_version=3.0.2
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 4 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Sun Oct 13 17:25:24 PDT 2019
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading