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

Sluuuurp #231

Merged
merged 236 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
236 commits
Select commit Hold shift + click to select a range
f79828a
Started working on new connection logic. Also renamed CellTileEntity …
empireu Jan 24, 2023
e4c9e1f
Started working on CellBlockEntity logic. Removed old connection code…
empireu Jan 24, 2023
7ea20bf
Implemented new removal logic.
empireu Jan 24, 2023
3c797b1
Removed unused class.
empireu Jan 24, 2023
17996ef
Removed more unused classes and refactored some more.
empireu Jan 24, 2023
f457f90
Updated the naming convention of the cell provider. Events now use th…
empireu Jan 24, 2023
0a66e15
Added up/down to PlacementRotation.
empireu Jan 24, 2023
4731975
Added Flywheel dependency.
empireu Jan 24, 2023
27430c6
Started defining some useful interfaces and created a scaffold entity…
empireu Jan 25, 2023
902cb83
Now using ICellContainer instead of scanning for CellBlockEntity in t…
empireu Jan 25, 2023
cb30419
Added part provider and registry
empireu Jan 25, 2023
bf63121
Moved the new classes to some more appropriate packages
empireu Jan 25, 2023
5a85e65
Vec3 operator overloads
empireu Jan 26, 2023
8a36c5f
BlockPos operator overloads
empireu Jan 26, 2023
347acf9
Basic MultipartBlockEntity placement working. Successfully detecting …
empireu Jan 26, 2023
0d5933b
Starting client synchronization and saving
empireu Jan 27, 2023
f06948a
Part picking, voxel shape, API for shapes, refactored some methods an…
empireu Jan 28, 2023
94c6019
Small cleanup (and modified some log messages)
empireu Jan 28, 2023
84d4a48
Part breaking and refactored some methods in MultipartBlock
empireu Jan 28, 2023
0f821a4
Merge pull request #1 from empireu/feature/flywheel
empireu Jan 28, 2023
964df02
Added flywheel initialization.
empireu Jan 28, 2023
9ce8213
Basic flywheel rendering API and fixed flywheel initialization order …
empireu Jan 28, 2023
25cdb34
Test renderer working!
empireu Jan 28, 2023
fd03a39
Fixed desync issue caused by not enqueueing cells received in the ini…
empireu Jan 28, 2023
17d139b
Models loading, and fixed relight queue not being processed when a pa…
empireu Jan 29, 2023
5691e97
Removed relight queue because it would not make sense for parts to ju…
empireu Jan 29, 2023
9930806
Moved placement info to a PartPlacementContext class instead of passi…
empireu Jan 29, 2023
52665e7
Added facing to parts
empireu Jan 29, 2023
bcf86ed
Added collisions
empireu Jan 29, 2023
fec5133
Made the renderer and provider generic
empireu Jan 29, 2023
fa4e9ae
Break parts when corresponding block is broken
empireu Jan 29, 2023
84ed991
Limited placement faces to blocks that are solid
empireu Jan 29, 2023
f205e8c
Added some utility classes for directions and implemented changed the…
empireu Jan 29, 2023
7295ce0
Started working on part-cell connections
empireu Jan 30, 2023
ff5c4d0
Relative rotation from forward up and fixed a space in Networking
empireu Jan 31, 2023
9638636
Unified part updates into a single queue
empireu Jan 31, 2023
ba16807
Unified server part updates
empireu Jan 31, 2023
6c7abf9
Fixed multipart not being removed when broken neighbor left it with 0…
empireu Jan 31, 2023
e5fe299
Changed cells to use CellPos (position + face) instead of BlockPos. R…
empireu Jan 31, 2023
bec779a
CellPart saving/loading
empireu Jan 31, 2023
3662b1d
CellPart server->client synchronization API
empireu Jan 31, 2023
b4a9e5c
Implemented wrapped connections
empireu Jan 31, 2023
a2b5d65
Connection recording
empireu Feb 1, 2023
a9fd77d
Fixed critical world loading issue caused by querying the level for t…
empireu Feb 2, 2023
990f4b0
Registered wire part and removed test part
empireu Feb 2, 2023
a66dca7
Rewritten part renderer and fixed part de-sync issue. Implemented a t…
empireu Feb 3, 2023
8c2185b
Fixed some scan logic, implemented the rest of the wire models, and a…
empireu Feb 4, 2023
17a6535
Minor clean-up and comments for most of the new APIs.
empireu Feb 4, 2023
1ed37f4
Made part items be consumed.
empireu Feb 4, 2023
a8a9089
Added connection mode (planar, inner, wrapped) to connection recording.
empireu Feb 4, 2023
b7879ab
Made break particles invisible and changed consume logic
empireu Feb 4, 2023
14c9de4
Added wire item model, removed multipart block from creative tabs, an…
empireu Feb 4, 2023
2ffa2cf
Changed part item consume result to SUCCESS, because CONSUME prevente…
empireu Feb 4, 2023
3c2e5a7
Various cleanups and refactorings
empireu Feb 4, 2023
3eba19d
Updated flywheel version and added some minor rendering logic
empireu Feb 4, 2023
9de85a7
Changed the connection logic to not rebuild the solver of cells in th…
empireu Feb 4, 2023
53b3723
Crude parallel dispatch for testing.
empireu Feb 4, 2023
ee5fa5f
Fixed time precision loss.
empireu Feb 4, 2023
fbcf2bf
Added part interactions.
empireu Feb 5, 2023
c9ca76c
Added basic part renderer and a Battery Part.
empireu Feb 5, 2023
ae6d203
Added part placement validation (based on collisions with other parts…
empireu Feb 5, 2023
6227b75
Added part tick API (unfortunately, access transformers were required…
empireu Feb 6, 2023
963ab81
Unified part updates and refactored some method names
empireu Feb 6, 2023
2e6a908
Re-built the Direction Mask API with performance in mind, added more …
empireu Feb 14, 2023
62e99d4
Reimplemented wire model selection using the DirectionMask API, and f…
empireu Feb 16, 2023
b2be322
Merge pull request #2 from empireu/feature/surface_placement
empireu Feb 16, 2023
c5a7671
Initial directory restructuring, renames
empireu Feb 16, 2023
dc56626
Moved to new packages and renamed some classes
empireu Feb 16, 2023
c41b5d9
IntelliJ cleanup
empireu Feb 16, 2023
7f0a39e
IntelliJ cleanup
empireu Feb 16, 2023
39357d4
Modernized registries (forge deprecated old usage)
empireu Feb 16, 2023
1d3031a
Various cleanups
empireu Feb 16, 2023
c16447c
Various cleanups
empireu Feb 16, 2023
1b0ebfd
Renamed and fixed some extensions
empireu Feb 16, 2023
1ac1c6a
Various cleanups
empireu Feb 16, 2023
8fd1d1e
Merge pull request #3 from empireu/feature/restructuring-cleanup
empireu Feb 16, 2023
869ec7b
Implemented basic wrapper that will be used by parts, cells, ... and …
empireu Feb 16, 2023
199fff3
Ported most of the old waila code to the new API.
empireu Feb 16, 2023
2327f4f
Cleaned up the new classes.
empireu Feb 16, 2023
710fd33
Implemented WAILA for cell blocks.
empireu Feb 16, 2023
d79bca0
Merge pull request #4 from empireu/feature/waila-api
empireu Feb 16, 2023
2e96a4d
Theoretical set/object
empireu Feb 16, 2023
9a5918a
Basic Object implementation. Unfortunately, a complete purge of conte…
empireu Feb 16, 2023
bf54844
Documentation for the new APIs
empireu Feb 17, 2023
a6008e6
Cleaned up the cell provider, now using the direction masks and a fun…
empireu Feb 17, 2023
570d003
Improved WAILA handling for cells and objects, and added extensions t…
empireu Feb 17, 2023
2691111
Various cleanups and fixed formatting
empireu Feb 17, 2023
781bab4
Added more documentation for the new APIs.
empireu Feb 17, 2023
afebe94
Added Design Document
empireu Feb 17, 2023
c86ddc8
Injected directions into the electrical objects and fixed connection …
empireu Feb 17, 2023
c81316e
Added voltage source and ground, and fixed pass order (build was happ…
empireu Feb 17, 2023
e19453d
Fixed bundle bug
empireu Feb 17, 2023
c9a0437
Added Event Manager for Object/Cell -> Game communications, and back.
empireu Feb 18, 2023
32f2609
Added Event Scheduler. We'll use this to schedule events from our sim…
empireu Feb 18, 2023
667db4f
Basic parallel updates.
empireu Feb 18, 2023
3023211
Added logs for update rate
empireu Feb 18, 2023
1c7111f
Added thread count to the config
empireu Feb 18, 2023
937aab2
Fixed onPlaced order
empireu Feb 18, 2023
9b5fe00
Added section about parallel simulations
empireu Feb 18, 2023
54cd254
Re-added wires, and changed the organisational scheme a little (all c…
empireu Feb 19, 2023
fc4c86a
Log simulation tick time
empireu Feb 19, 2023
02ffa84
Merge pull request #6 from empireu/feature/sim-objects-parallel
empireu Feb 20, 2023
6d854e0
Cleaned up some spacing
empireu Feb 20, 2023
c74fcb4
Added a lot of documentation, minor refactors and moved the Ground, V…
empireu Feb 20, 2023
4d72da6
Merge pull request #5 from empireu/feature/sim-objects
empireu Feb 20, 2023
7dc7a7f
Adds test furnace
empireu Feb 21, 2023
af99a86
Fixed planar scans not being validated
empireu Feb 21, 2023
ee173fb
Fixes subscribers not being re-added when the graph is changed
empireu Feb 21, 2023
9257b5e
Cleaned up furnace particle animation, changed furnace to use left-ri…
empireu Feb 21, 2023
e5ace65
Added Atomic Update utility class and added Heating Element classes f…
empireu Feb 21, 2023
bd694a3
Adds a crude thermal system for furnaces
empireu Feb 21, 2023
b450960
Fixed code mis-copy
empireu Feb 21, 2023
ed75187
Updated the animations and removed some unused classes
empireu Feb 21, 2023
bd46be6
Removes PID control and replaces it with on/off control
empireu Feb 21, 2023
48bd199
Adds new models (voltage source, ground, resistor) and deletes old an…
empireu Feb 21, 2023
2b38fdb
Made furnace faster
empireu Feb 21, 2023
5549608
Generator Object (untested) and ComponentHolder - a wrapping API. Als…
empireu Feb 21, 2023
1120802
Adds battery with energy, voltage, resistance and Vec3, NBT utilities
empireu Feb 22, 2023
b691143
Adds Polar components, fixes floating circuit issue using workaround,…
empireu Feb 22, 2023
10355c8
Fixes ticker deadlock and adds test ghost light block
empireu Feb 22, 2023
44ed41f
Fixes battery save not using the correct tag and formats charge perce…
empireu Feb 22, 2023
433fff1
Adds light (untested)
empireu Feb 22, 2023
a3a2525
Implements ghost refresh (bring back destroyed ghost) and adds Event …
empireu Feb 23, 2023
b777c41
Implements Part Brightness API and moves part renderer transform func…
empireu Feb 23, 2023
219b1e0
Adds Wall Mounted Light 3D Model
empireu Feb 23, 2023
68a0fb3
Adds basic Wire Model (resistance)
empireu Feb 23, 2023
a648cdc
Fixes simulation lingering after server stops, adds some custom shade…
empireu Feb 23, 2023
9ea3437
Optimizes performance by not sending too many resistor updates (updat…
empireu Feb 24, 2023
f0e0295
Implements battery model using interpolation and adds lifetime and th…
empireu Feb 25, 2023
bd36aab
Refactors battery functions using IBatteryView, adds cycles tracking
empireu Feb 25, 2023
7c0acea
Adds Prometheus
empireu Feb 25, 2023
0f4c189
Fixes a theoretical race condition in the synchronous work algorithm,…
empireu Feb 25, 2023
be204be
Adds SubscriberCollection
empireu Feb 26, 2023
002997c
Adds SubscriberCollection to CellGraph and re-implements current subs…
empireu Feb 26, 2023
6e428ee
Fixes battery capacity being displayed incorrectly and changes cycles…
empireu Feb 26, 2023
2438831
Adds Cell Behavior System
empireu Feb 26, 2023
0dd3c68
Implements test battery functions
empireu Feb 26, 2023
ac6576e
Pulls in libage:feature/thermal and fixes some quotes in build.gradle
empireu Mar 6, 2023
c59f59e
Integrates thermal simulation into the furnace. Currently unusable be…
empireu Mar 6, 2023
1242a1a
Fixes TooltipBuilder using grams instead of kg
empireu Mar 6, 2023
b40be22
Updates resistivity access and fixes saving issue caused by simulatio…
empireu Mar 7, 2023
708bf6f
Adds Grid interpolator and hermite spline using arbitrary ranges
empireu Mar 7, 2023
265c57a
Cleans up mathematics and implements thermal simulation, dataset loading
empireu Mar 7, 2023
581efbc
Implements thermal wire
empireu Mar 7, 2023
fd88871
Implements thermal wire tint and light
empireu Mar 7, 2023
60fcd95
Implements custom cell NBT
empireu Mar 7, 2023
5aec78b
Removes furnace data logging
empireu Mar 7, 2023
a6de376
Updates thermal wire light level calculation
empireu Mar 7, 2023
7207b13
Updates test battery models
empireu Mar 7, 2023
8780c15
Implements basic temperature based explosions and adds battery heating
empireu Mar 7, 2023
88d05e1
Implements new thermal API
empireu Mar 8, 2023
c763977
Updates Explosion API to be more generic (more research required) and…
empireu Mar 8, 2023
30b29f7
Adds minecraft temperature conversion
empireu Mar 8, 2023
04970f2
Switches to libage next branch
empireu Mar 8, 2023
a06dd78
Fixes DirectionMaskTests#testChecks
empireu Mar 8, 2023
eca7b26
Thermoelectric generator and fixed a simulation pause issue
empireu Mar 9, 2023
04e354c
Uses BiMap instead of two maps
empireu Mar 9, 2023
8a08a93
Adds thermal radiator
empireu Mar 9, 2023
a221abf
Fixes battery cell initialization and removes brightness logs
empireu Mar 9, 2023
346db42
Adds two parameter lead acid model and grid loaders
empireu Mar 10, 2023
5296dec
Adds documentation to some mathematics classes.
empireu Mar 11, 2023
d244680
Adds basic furnace GUI.
empireu Mar 11, 2023
1ae5795
Implements Segment Tree for faster splines
empireu Mar 11, 2023
ad8beb2
Adds furnace background texture and fixes furnace not invalidating da…
empireu Mar 11, 2023
07a1e96
Adds furnace GUI extra synchronization
empireu Mar 11, 2023
bff693a
Adds furnace GUI temperature and progress indicators
empireu Mar 11, 2023
2385a57
Implements furnace GUI quick move and lowers energy requirement
empireu Mar 12, 2023
30a98ea
Adds thermocouple 3D model and adds BasicCellPart to reduce boilerplate
empireu Mar 12, 2023
80c01ad
Improves thermocouple algorithm
empireu Mar 12, 2023
082360b
Adds test fuel burner machine
empireu Mar 12, 2023
3bfe760
Implements basic solar panel
empireu Mar 12, 2023
adadbe3
Version bump to 2.0.0 since Cell was a rewrite
jrddunbr Mar 18, 2023
aefa03f
Purges old assets
empireu Mar 20, 2023
3a5d3d9
Merge remote-tracking branch 'origin/feature/test-content' into featu…
empireu Mar 20, 2023
38e48b7
Fixes part item creative tab
empireu Mar 20, 2023
e40731d
Moves ElectricalObject and ThermalObject to different files
empireu Mar 20, 2023
c4226e1
Changes while loop to use condition instead of breaking out
empireu Mar 20, 2023
44a2c5e
Renames ComponentHolder to ElectricalComponentHolder
empireu Mar 20, 2023
3a52da7
Adds some documentation to the mathematical functions and classes
empireu Mar 21, 2023
4578f42
Adds some documentation to TooltipBuilder
empireu Mar 21, 2023
2484a9a
Adds some documentation to SegmentTree
empireu Mar 21, 2023
4c62f2a
Fixes creative part pickup
empireu Mar 21, 2023
e5a58e9
Adds Thermocouple thermal coloring (generic thermal bipole rendering)
empireu Mar 21, 2023
efb32b1
Fixes radiator model rotation and changes heat generator to use the f…
empireu Mar 21, 2023
7dedb9b
Implements part item saving and fixes some flywheel issues
empireu Mar 21, 2023
7d1663d
Disables prometheus
empireu Mar 22, 2023
184b47f
Merge pull request #7 from empireu/feature/test-content
empireu Apr 1, 2023
9fcdcc5
Adds more furnace documentation
empireu Apr 2, 2023
57f3687
Adds more documentation to Generator and fixes battery not conserving…
empireu Apr 2, 2023
edead15
Moves battery saving from parts to cells
empireu Apr 2, 2023
25162ca
Fixes heat generator getter
empireu Apr 2, 2023
ff677c8
Implements heat generator saving and GUI
empireu Apr 2, 2023
338de2a
Moves Functions.kt functions to the file, removes some unused functio…
empireu May 20, 2023
1952df1
Adds Dual and removes more unused functions
empireu May 20, 2023
25d4b48
Refactors some geometry operations
empireu May 20, 2023
be94a38
Implements meters using a data access tree
empireu May 20, 2023
43d67da
Moves extensions out of objects
empireu May 20, 2023
c8d633a
Merge pull request #8 from empireu/cleanup
empireu May 20, 2023
ff00b98
Implements a Locator data structure
empireu May 21, 2023
cce984b
Removes old connection and neighbor classes, replacing them with the …
empireu May 21, 2023
3eaddf2
Adds a replacement for RelativeRotationDirection connectivity and tes…
empireu May 21, 2023
9c39ff2
Replaces old location in generic containers and scanners
empireu May 21, 2023
97eca2d
Re-implements wire
empireu May 21, 2023
5439975
Brings back old content
empireu May 22, 2023
0d442db
Refactors class names and file structure
empireu May 22, 2023
6054c35
Refactors more class names
empireu May 22, 2023
759fb8a
Merge pull request #9 from empireu/feature/cell-backend-generic
empireu May 22, 2023
f3cc249
Implements furnace recipe caching
empireu May 22, 2023
bd75e71
Separates Battery from Generator and adds PowerVoltageSource and Powe…
empireu May 22, 2023
89cf703
Fixes unit test rangeScanRec
empireu May 23, 2023
8d2c25c
Implements basic geometry classes
empireu May 23, 2023
ad61648
Implements basic multiblock system
empireu May 25, 2023
99df940
Adjusts subscriber time step based on interval
empireu May 25, 2023
2378768
Updates thermocouple behavior, reverts libage hotfix, refactors names…
empireu May 27, 2023
92f29dd
Adds reflection-based object loading
empireu May 27, 2023
6533f37
Implements behavior reflection
empireu May 27, 2023
7e4dfe4
Adds heater textures and wire item textures
empireu May 28, 2023
12dbbdc
Implements bulk part messages for rendering and shorter behavior cont…
empireu May 28, 2023
76dc6bd
Implements dependency injection
empireu May 28, 2023
06102b6
Implements generic wire model
empireu May 28, 2023
19def11
Implements client side replication API and changes PartRenderer to be…
empireu May 29, 2023
1df9bce
Replaces wire sync with replicator technology
empireu May 29, 2023
0cc0b43
Implements minor upgrades to the mathematical framework (WIP)
empireu Jun 1, 2023
74a6201
Adds an experiment to test mesh generation using the actual framework
empireu Jun 1, 2023
dc29193
Adds more useless features to Geometry.kt and moves all extensions in…
empireu Jun 2, 2023
3514805
Implements basic grid demo with cable rendering (using a spline based…
empireu Jun 4, 2023
cf76563
Adds more useless features to Geometry.kt
empireu Jun 5, 2023
4450aee
Adds DRAGONS fluid simulation and implements various refactors
empireu Jun 7, 2023
5f5e715
Implements Nuclear Radiation and Chemistry
empireu Jun 17, 2023
b7ccc89
Implements basic latex collector
empireu Jun 19, 2023
ded0e54
Implements Minecraft 1.19.3 (and build system issues)
empireu Jun 20, 2023
21d7e5c
Implements game
empireu Jun 22, 2023
26464ca
Moves periodic table out of Chemistry.kt
empireu Jun 22, 2023
f889e28
Implements natural rubber demo
empireu Jul 1, 2023
cb0db76
Cleans up and removes some unused technologies
empireu Sep 19, 2023
575b19e
Merge pull request #10 from empireu/feature/content
empireu Sep 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
233 changes: 126 additions & 107 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,54 +1,49 @@
//file:noinspection GroovyAssignabilityCheck

buildscript {
ext.kotlin_version = '1.6.10'
repositories {
// These repositories are only for Gradle plugins, put any other repositories in the repository block further below
maven { url = 'https://maven.minecraftforge.net' }
maven { url = 'https://maven.parchmentmc.org' }
gradlePluginPortal()
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
classpath 'org.parchmentmc:librarian:1.+'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
classpath "gradle.plugin.com.github.johnrengelman:shadow:7.1.1"
classpath 'org.spongepowered:mixingradle:0.7.+'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.0"
}
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'org.parchmentmc.librarian.forgegradle'
apply plugin: 'kotlin'
apply plugin: 'kotlinx-serialization'
apply plugin: "com.github.johnrengelman.shadow"
apply from: 'https://raw.githubusercontent.com/thedarkcolour/KotlinForForge/site/thedarkcolour/kotlinforforge/gradle/kff-3.3.2.gradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'


plugins {
id 'net.minecraftforge.gradle' version '5.1.+'
id 'org.jetbrains.kotlin.jvm' version '1.8.0'
id 'org.jetbrains.kotlin.plugin.serialization' version '1.8.0'
id 'org.parchmentmc.librarian.forgegradle' version '1.+'
id 'com.github.johnrengelman.shadow' version '7.1.2'
}

version = '1.0.1'
version = '2.0.0'
group = 'org.eln2.mc'
archivesBaseName = 'eln2'

// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
java.toolchain.languageVersion = JavaLanguageVersion.of(17)

println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
tasks.build.dependsOn kotlinSourcesJar
tasks.build.dependsOn shadowJar

println(
'Grissess Status - Java: ' + System.getProperty('java.version') +
' JVM: ' + System.getProperty('java.vm.version') +
'(' + System.getProperty('java.vendor') + ') ' +
'Arch: ' + System.getProperty('os.arch')
)

minecraft {
mappings channel: 'parchment', version: "2022.05.22-1.18.2"
mappings channel: 'parchment', version: '2023.03.12-1.19.3'

accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')

runs {
client {
workingDirectory project.file('run')

// The markers can be added/remove as needed separated by commas.
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"

mods {
eln2 {
Expand All @@ -59,6 +54,7 @@ minecraft {

server {
workingDirectory project.file('run')

property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'

Expand All @@ -71,9 +67,10 @@ minecraft {

data {
workingDirectory project.file('run')

property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.

args '--mod', 'eln2', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')

mods {
Expand All @@ -90,108 +87,130 @@ configurations {
implementation.extendsFrom library
}

minecraft.runs.all {
lazyToken('minecraft_classpath') {
configurations.library.copyRecursive().resolve().collect { it.absolutePath }.join(File.pathSeparator)
reobf {
shadowJar {
// empty
}
}

test {
useJUnitPlatform()
}

// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }
sourceSets.main.resources {
srcDir 'src/generated/resources'
}

repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
maven { url "https://maven.bai.lol" }
// 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:
// flatDir {
// dir 'libs'
// }
maven {
name 'JitPack'
url 'https://jitpack.io'
}
maven {
name 'tterrag maven'
url 'https://maven.tterrag.com/'
}
maven {
name = 'Kotlin for Forge'
url = 'https://thedarkcolour.github.io/KotlinForForge/'
content {
includeGroup 'thedarkcolour'
}
}
maven {
url = 'https://maven2.bai.lol'
content {
includeGroup 'lol.bai'
includeGroup 'mcp.mobius.waila'
}
}
}

dependencies {
minecraft 'net.minecraftforge:forge:1.18.2-40.1.25'
compileOnly fg.deobf("mcp.mobius.waila:wthit-api:forge-4.7.2")
runtimeOnly fg.deobf("mcp.mobius.waila:wthit:forge-4.7.2")
library('com.github.age-series:libage:main-SNAPSHOT')
library("org.apache.commons:commons-math3:3.6.1")
library("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2")
library('com.charleskorn.kaml:kaml:0.40.0')

// Real mod deobf dependency examples - these get remapped to your current mappings
// compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency
// runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}") // Adds the full JEI mod as a runtime dependency
// implementation fg.deobf("com.tterrag.registrate:Registrate:MC${mc_version}-${registrate_version}") // Adds registrate as a dependency

// Examples using mod jars from ./libs
// implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}")
minecraft 'net.minecraftforge:forge:1.19.3-44.1.23'
library ("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0") {
exclude group: 'org.jetbrains', module: 'annotations'
}
library("org.jetbrains.kotlin:kotlin-reflect:1.8.0")
library("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0")

compileOnly fg.deobf('mcp.mobius.waila:wthit-api:forge-6.4.2')
runtimeOnly fg.deobf('mcp.mobius.waila:wthit:forge-6.4.2')
runtimeOnly fg.deobf('lol.bai:badpackets:forge-0.3.4')
implementation fg.deobf('com.jozufozu.flywheel:flywheel-forge-1.19.3:0.6.8.a-1')

library 'com.github.age-series:LibAge:8ed5950a0d'
library 'org.apache.commons:commons-math3:3.6.1'
library('com.charleskorn.kaml:kaml:0.50.0')

testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
Comment on lines +148 to +149
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read the tests and I think that we could improve them if we added mockito

}

shadowJar {
archiveClassifier.set("")
configurations = [project.configurations.library]

def rlTarget = "${project.group}.relocated"

relocate 'kotlin', "${rlTarget}.kotlin"
relocate 'com.charleskorn', "${rlTarget}.charleskorn"
relocate 'org.snakeyaml', "${rlTarget}.snakeyaml"
relocate 'org.apache.commons', "${rlTarget}.apache.commons"
relocate 'org.ageseries', "${rlTarget}.ageseries"
relocate 'org.intellij', "${rlTarget}.intellij"
relocate 'jetbrains', "${rlTarget}.jetbrains"

afterEvaluate {
finalizedBy reobfShadowJar
}
}

jar {
//noinspection GroovyAssignabilityCheck
archiveClassifier = 'slim'
manifest {
attributes([
"Specification-Title" : "eln2",
"Specification-Vendor" : "age-series-team",
"Specification-Version" : "1",
"Implementation-Title" : project.name,
"Implementation-Version" : project.jar.archiveVersion,
"Implementation-Vendor" : "age-series-team",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
"Specification-Title" : 'eln2',
"Specification-Vendor" : 'age-series-team',
"Specification-Version" : '2',
"Implementation-Title" : project.name,
"Implementation-Version" : project.jar.archiveVersion,
"Implementation-Vendor" : 'age-series-team',
"Implementation-Timestamp": new Date().format('yyyy-MM-dd\'T\'HH:mm:ssZ')
])
}
}

// Do shadow relocations
// (I can't figure out how to do this in an automatic, sensible way, so--for
// now--you will have to hunt down these dependencies manually and iteratively.
// Let ./gradlew dependencies be your guide, and/or the printlns below.
// Sorry! - Grissess)
def shaded = [
"com.charleskorn.kaml",
"org.snakeyaml",
"org.apache.commons",
"com.github.age-series"
].stream().collect()
final def classpathBlacklist = [
'annotations-23.0.0.jar'
]

shadowJar {
archiveClassifier = ''
dependencies {
exclude(dependency {
def res = !shaded.contains(it.moduleGroup)
if(!res) println("Include: $it")
else println("Exclude: $it")
res
})
}
shaded.forEach {
relocate it, "org.ageseries.shadow." + it
minecraft.runs.configureEach {
lazyToken('minecraft_classpath') {
configurations.library.copyRecursive()
.resolve()
.stream()
.filter {
!classpathBlacklist.any { final blacklisted ->
it.path.endsWith(blacklisted)
}
}
.collect { it.absolutePath }
.join(File.pathSeparator)
}

finalizedBy 'reobfShadowJar'
}

assemble.dependsOn shadowJar

reobf {
shadowJar { }
jar { classpath.from(sourceSets.main.compileClasspath) }
shadowJar {}
}

// This is the preferred method to reobfuscate your jar file
jar.finalizedBy('reobfJar')
compileKotlin {
kotlinOptions {
jvmTarget = "17"
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "17"
}
}
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
// publish.dependsOn('reobfJar')

jar.finalizedBy('reobfJar')

1 change: 0 additions & 1 deletion docs/CONTRIBUTING.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/CONTRIBUTORS

This file was deleted.

Loading