Skip to content

Commit

Permalink
Initial commit - carry over from libcd
Browse files Browse the repository at this point in the history
  • Loading branch information
LemmaEOF committed Aug 18, 2020
0 parents commit 8536820
Show file tree
Hide file tree
Showing 76 changed files with 6,162 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
30 changes: 30 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Compiled nonsense that does not belong in *source* control
/build
/bin
/.gradle
/minecraft
/out
/run
/classes

# IDE nonsense that could go in source control but really shouldn't
.classpath
.project
.metadata
.settings
*.launch
*.iml
.idea
*.ipr
*.iws

# Sekrit files
private.properties
private.gradle

# Files from bad operating systems :^)
Thumbs.db
.DS_Store
local.properties
.directory
*.log
14 changes: 14 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Copyright 2020 B0undarybreaker (Meredith Espinosa)

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<img src="icon.png" align="right" width="180px"/>

# Lib Data Potential


[>> Downloads <<](https://github.com/CottonMC/LibDP/releases)

*Let's play!*

**This mod is open source and under a permissive license.** As such, it can be included in any modpack on any platform
without prior permission. We appreciate hearing about people using our mods, but you do not need to ask to use them.
See the [LICENSE file](LICENSE) for more details.

Lib Data Potential, or LibDP, opens up new avenues of advanced customization of data-driven systems.

NOTE: This repo is under construction, documentation is not yet available beyond javadocs

## Diskettes
Diskettes are scripts written by an end user in a [Parchment](https://github.com/CottonMC/Parchment) supported language
to manipulate data-driven constructs in a way not possible with JSON or other libraries. Diskettes are capable of
turing-complete conditional checks on the craftability of a recipe, including the state of the player and the world.

## On Scope
LibCD used to have a system called Tweakers which performed a similar function to diskettes. However, they had a much
wider scope, and allowed adding standard versions of any of the common vanilla recipe types. This resulted in the
project being massively bloated, and it was practically impossible for me to document everything satisfactorily. LibDP
is contracting on its scope, and is only going to have built-in support for things you can't do with other libs.

## Alternatives
Since LibDP has a very limited scope, here are some situations that LibDP is not designed for and are better done with
alternatives:
#### - I want to add a couple recipes to my world!
Vanilla JSON recipes are perfect for simple recipe alterations, as that's the purpose they're designed for. The
[crafting recipe builder](https://crafting.thedestruc7i0n.ca) by thedestruc7i0n is a great help for making JSON recipes.
#### - I want to add a lot of recipes to my modpack, or edit a lot of similar recipes!
[KubeJS](https://www.curseforge.com/minecraft/mc-mods/kubejs-fabric) is set up in a much better position for editing
existing recipes, and it has very good tools to add recipes in bulk as well. It has a lot of documentation and support
for other things such as adding your own blocks and items as well.
#### - I want to add recipes with custom NBT outputs!
[NBT Crafting](https://www.curseforge.com/minecraft/mc-mods/nbt-crafting) adds support for NBT on JSON recipe inputs and
outputs. Its dollar system also allows output NBT to depend on input NBT. If you want to do fancy things with recipes
without having to learn how to do full-on programming, this is your best bet.

## Legacy
The `legacy` folder in this repo contains the contents of the legacy loot and recipe drivers, updated from LibCD names
to LibDP ones. You are free to use them to create a legacy driver system for using the features removed from LibDP.
Please keep in mind the packages on each of the files.

# What happened to LibCD?

Long story short, drama happened. Tweakers caused a lot of drama, and when someone who had been causing me grief for a
while said that libcd was obsolete due to their new mod, I agreed. LibCD is now primary geared towards developers, and
pared down massively in scale. It become actively damaging to my health to continue maintaining it in the state it was
in. There will be a successor to tweakers, but it will be pared back as well. I have plans for what I'd like to see out
of its new iteration.
132 changes: 132 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
plugins {
id "java"
id "eclipse"
id "idea"
id "fabric-loom" version "0.4-SNAPSHOT"
id "maven-publish"
id "com.jfrog.artifactory" version "4.9.0"
}

sourceCompatibility = 1.8
targetCompatibility = 1.8

if(rootProject.file("private.gradle").exists()) { //Publishing details
apply from: "private.gradle"
}

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

minecraft {
accessWidener = file("src/main/resources/libdp.accesswidener")
}

repositories {
mavenCentral()
maven { url "https://server.bbkr.space/artifactory/libs-release" }
maven { url "https://www.jitpack.io" }
}

dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.minecraft_version}+build.${project.yarn_build}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
compileOnly "com.google.code.findbugs:jsr305:3.0.2"

modImplementation "io.github.cottonmc:Parchment:${project.parchment_version}"
modImplementation "io.github.cottonmc:LibCD:${project.libcd_version}"
include "io.github.cottonmc:Parchment:${project.parchment_version}"
include "io.github.cottonmc:LibCD:${project.libcd_version}"

modCompileOnly ("com.github.Siphalor:nbt-crafting:1.16-2.0-SNAPSHOT") { transitive = false }
// modRuntime ("com.github.Siphalor:nbt-crafting:1.16-2.0-SNAPSHOT") { transitive = false } //only for testing
}

processResources {
inputs.property "version", project.version
from(sourceSets.main.resources.srcDirs) {
include "fabric.mod.json"
expand version: project.version
}
from(sourceSets.main.resources.srcDirs) {
exclude "fabric.mod.json"
}
}

// 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"
}

// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this task, sources will not be generated.
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources"
from sourceSets.main.allSource
}

jar {
from "LICENSE"
}

// configure the maven publication
publishing {
publications {
maven(MavenPublication) {
// add all the jars that should be included when publishing to maven
//artifact(jar) {
// builtBy remapJar
//}
artifact ("${project.buildDir.absolutePath}/libs/${archivesBaseName}-${project.version}.jar") { //release jar - file location not provided anywhere in loom
classifier null
builtBy remapJar
}

artifact ("${project.buildDir.absolutePath}/libs/${archivesBaseName}-${project.version}-dev.jar") { //release jar - file location not provided anywhere in loom
classifier "dev"
builtBy remapJar
}

artifact(sourcesJar) {
builtBy remapSourcesJar
}
}
}

// select the repositories you want to publish to
repositories {
// uncomment to publish to the local maven
// mavenLocal()
}
}

artifactory {
if (project.hasProperty("artifactoryUsername")) {
contextUrl = "https://server.bbkr.space/artifactory/"
publish {
repository {
if (version.contains("SNAPSHOT")) {
repoKey = "libs-snapshot"
} else {
repoKey = "libs-release"
}

username = artifactoryUsername
password = artifactoryPassword
}
defaults {
publications("maven")

publishArtifacts = true
publishPom = true
}
}
} else {
println "Cannot configure artifactory; please define ext.artifactoryUsername and ext.artifactoryPassword before running artifactoryPublish"
}
}
19 changes: 19 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.16.2
yarn_build=19
loader_version=0.9.1+build.205

# Mod Properties
mod_version = 1.0.0
maven_group = io.github.cottonmc
archives_base_name = libdp

# Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_version=0.17.2+build.396-1.16
parchment_version=1.1.0+1.16.2
libcd_version=3.0.1+1.16.2
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Mon Aug 22 17:36:22 EDT 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
Loading

0 comments on commit 8536820

Please sign in to comment.