45 Commits
Author SHA1 Message Date
Raven Szewczyk 310b552c53 Remove internal packet size limit (#683) 2025-03-04 21:08:04 +01:00
Raven SzewczykandMartin Robertz e817c41edf Add an API for Sound P2P listing updated channels any time p2ps are connected/disconnected from that p2p's network (#543)
* Add an API for Sound P2P listing updated channels any time p2ps are connected/disconnected from that p2p's network

* Run onSoundP2PAttach() on block updates too, to allow GT meta tiles to work

---------

Co-authored-by: Martin Robertz <dream-master@gmx.net>
2024-08-04 02:01:55 +00:00
Raven Szewczyk 08827cca66 Store weak world references in dimensionalcoords to avoid leaking 2024-08-02 21:55:15 +01:00
Raven Szewczyk fb37226a0c Fix DimensionalCoord isEqual comparing World objects instead of numeric IDs 2024-08-02 21:55:15 +01:00
Raven Szewczyk 0b4d3954e2 Sound/Music P2P Tunnels 2024-08-02 21:55:15 +01:00
Raven Szewczyk 3b1c99866b Fix version pattern 2024-02-07 17:22:08 +00:00
Raven Szewczyk e1595ccc64 [ci skip] upgraded build system 2024-02-04 19:56:34 +00:00
Raven SzewczykandMartin Robertz 7ac8ff948e Fix incompatibility with rv2-api depending jars like IC2C (#450)
* Fix incompatibility with rv2-api depending jars like IC2C

* Update deps, add another needed change

---------

Co-authored-by: Martin Robertz <dream-master@gmx.net>
2024-01-09 22:59:50 +01:00
Raven Szewczyk cac33c6f76 [ci skip] upgraded build system 2024-01-08 21:23:39 +00:00
Raven Szewczyk 8bc4b1b60f Remove all-comment .java files 2024-01-08 17:19:44 +00:00
Raven Szewczyk e6ca9e36ef Lazily fill out the ItemList for network delta updates (#363)
* Lazily fill out the ItemList for network delta updates

* Implement a new api for looking up a single stored item to optimize network monitor updates

* Update buildscript

* Add Nonnull annotation to the argument
2023-08-03 18:08:21 +01:00
Raven Szewczyk c7c8fcd883 Crafting tree zoom and screenshot (#332)
* Add zooming to the crafting tree view

* Implement save-to-png for crafting trees

* Address review comments
2023-06-08 07:56:06 +02:00
076ccfafcc Add enough API to make NEE no longer require asming into ae2 (#326)
* Add enough API to make NEE no longer require asming into ae2

* spotlessApply (#327)

Co-authored-by: GitHub GTNH Actions <>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-05-25 20:34:02 +02:00
Raven Szewczyk cef07a8c2d Split crafting tree data packets into 1MB chunks and only limit max crafting steps on dedicated servers (#314)
* Split crafting tree data packets into 1MB chunks

* Only limit max crafting steps on dedicated servers

* Fix remaining debug code
2023-05-09 17:27:13 +02:00
Raven Szewczyk ac2c093108 Fullscreen crafting tree and tall crafting list (#313)
* Update buildscript and set gradle project name

* Implement fullscreen mode for the crafting tree view

* Tall crafting list view

* Default to tallMode = true
2023-05-07 13:19:40 +02:00
Raven Szewczyk 19676072b8 Enable generics injection & Jabel & code cleanup (#307)
* Enable Jabel and generic injection

* Use RoundingMode enum values

* Use enhanced for loops

* Use diamond operator where appropriate

* Deprecate ChainedIterator

* spotless

* Collapse identical catch blocks

* Use try with resources

* Use List.sort where possible

* Anonymous type->lambda

* Loop -> removeIf

* Simplifiable map operations

* Use enhanced instanceof

* Use enhanced switch

* Use bulk operations

* Use zero-sized arrays in toArray

* Add early exits

* Remove redundant addAll

* Fix missing reflection generic types

* More missed language migration aids

* Redundant type arguments

* Redundant type casts

* Fix compilation errors

* Use Arrays.fill

* Fix some missing generic types
2023-05-02 07:55:33 +02:00
Raven Szewczyk fe3f2756ec Fall back to the default icon provider if null is returned from ICraftingIconProvider, handle renamed interfaces in the crafting tree view (#306)
* Fall back to the default icon provider if null is returned from ICraftingIconProvider

* Handle renamed interfaces in the crafting tree view
2023-05-01 19:13:45 +02:00
Raven Szewczyk 1d74af6e2c Add a crafting tree view to requests for better insights (#283)
- Sets a configurable limit on the number of simulation steps and the size of the serialized tree to prevent DDOS
 - Culls invisible parts of the tree when rendering, tested to maintain high fps on requests with 200k+ individual steps
 - Displays the machines that are responsible for crafting via interfaces, with an API to override the displayed itemstack (for GT hatches to point to their multiblock when implemented)

More features, such as searching, filtering the tree etc. might come in future PRs.
2023-04-14 23:58:04 +02:00
Raven Szewczyk ce174089e6 Fix NPE when viewing the crafting status without any CPUs (#279) 2023-03-14 16:22:22 +01:00
Raven Szewczyk f6d9ae6d84 Trim arrays to size after mutations for memory savings (#277) 2023-03-12 16:51:56 +00:00
Raven Szewczyk 92378192cc Add complex pattern crafting logging to find slow recipes (#272) 2023-03-05 14:22:17 +01:00
Raven Szewczyk 790b9f95fd Remove unnecessary SideOnly CLIENT annotations for getting item names (#271)
* Remove unnecessary SideOnly CLIENT annotations for getting item names

* Split off the crafting context log message to avoid an additional concatenation
2023-03-05 09:16:13 +00:00
Raven Szewczyk d82bd39f96 Even more ccv2 fixes (#264)
* Make emitable match simulatemissing again, and add fulfilled amounts to the debug log

* Better craft debug logging

* Fix wrong actuallyNeeded calculation (the key holds all requested items, not per single craft)

* Add a test for the previously failing recipe

* Fix subtle bugs in partial refunds of crafting requests, the code is easier to read now too

* Test for the complex recipe chain from Discord

* Add readable names to itemstacks where possible in crafting logs

* Remove redundant line
2023-03-01 19:49:08 +00:00
Raven Szewczyk bfc24ef7b4 Unit test and fix duplicate missing items (#263)
* Unit test and fix duplicate missing items

Closes <https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/12724>

* Proper partial refund implementation for simulated missing items
2023-03-01 08:51:15 +00:00
Raven Szewczyk 535d24e71c Don't crash the server if a crafting simulation fails (e.g. due to arithmetic overflow) (#259) 2023-02-25 14:38:48 +00:00
Raven Szewczyk 091deaad17 Send a chat message about which ingredient causes craft not to start (#258) 2023-02-25 12:39:12 +00:00
Raven Szewczyk 7cd5c56882 More CCv2 fixes (mostly gt tool crafting) (#257)
* Update buildscript

* Add a simple gt5u tool crafting unittest

* Fix child requests going missing when duplicates of the same item are present in the pattern

* Fix typo causing complex patterns to never attempt simulation

* Add a heuristic to better avoid requesting duplicate gt tools

* Add more complex tool crafting tests for the scenarios in <https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/12685>

* Fix getContainerItem to match vanilla in max damage handling

* Use the shared ae2 getContainerItem instead of a custom copy
2023-02-24 18:21:35 +01:00
Raven Szewczyk efadbe5a8b Add crafting debug logging to the v2 calculator (#241)
* Update buildscript and clean up dependency warnings

* Add crafting debug logging to the v2 calculator
2023-02-08 00:17:34 +01:00
Raven Szewczyk 2fda15fb45 [ci skip] upgraded build system 2023-01-31 09:50:53 +00:00
Raven Szewczyk b634b5fb86 Fix the functionalTest sourceset config for RFG 2023-01-29 09:22:27 +00:00
Raven Szewczyk a412baad7f [ci skip] Add git-blame-ignore-revs for spotlessApply 2023-01-29 09:18:04 +00:00
Raven Szewczyk 385e163974 [ci skip] spotlessApply with the new settings 2023-01-29 09:18:04 +00:00
Raven Szewczyk c33bea414a [ci skip] Update buildscript to RetroFuturaGradle 2023-01-29 09:17:49 +00:00
Raven Szewczyk c86f91d4a9 More calculator fixes (#231)
* Fix infinite recursion when handling pattern cycles

* Add a test for not using renamed items in strict patterns

* Rename local variables in ContainerCraftConfirm to be readable

* Handle tool/bucket crafting table recipes correctly

* Don't show byproduct-extracted items in the plan, it's confusing
2023-01-23 17:30:01 +01:00
Raven Szewczyk 7b1ac385fe Fixes interfaces not pushing big stacks to ME chests (#224)
(and potentially other inventories that limit per-operation stack size).
Also because of the possibility of pushing that may need multiple ticks to complete, take that into account when requesting quicker ticking, otherwise pushing e.g. 512 wool to a ME chest takes a minute instead of seconds.
2023-01-16 15:19:02 +01:00
Raven Szewczyk ecbd198e21 Crafting calculator v2 unit tests, api for ae2fc and byproduct bug fixes (#223)
* Add a unittest mod that runs on server start in the dev environment

* Integrate JUnit 5 into functionalTests

* Byte cost adjustment api for ae2fc, fix byproduct refund handling

* Output an XML of the test run for debugging

* Add enough mock wrappers for a simple crafting test with no patterns

* Add processing pattern mocking support and a test for it

* Add mock item storage and tests for crafting with items stored

* Add a test for crafting chests from different log types

* Add a test for a mixed log chest crafting, change report format to more readable legacy xml

* Fix wrong generic argument in registerByteAmountAdjuster

* Add an explanation javadoc of byproduct separation
2023-01-15 15:54:05 +00:00
Raven Szewczyk da88fcb82c Fix NPE and overcounting bug in the v2 crafting calculator (#222)
* Fix NPE

* Fix derp, didn't update one of the arrays which caused things to never get cancelled in subsimulations

* No-op on nulls instead of throwing
2023-01-12 20:37:12 +01:00
Raven Szewczyk 406c256832 Crafting calculator v2 (#221)
* Update NEI

* Update buildscript

* Crafting Calculator V2 [WIP]

* Implement refunds

* Add a config option to switch crafting calculators, default to v2

* Initial AE2 glue code

* Fix scheduling as a Future

* The simplest of crafting now works

* Fix crafting cpu picking up the wrong pattern fuzzy matches

* Revert "use as substitute" changes in the old crafting calculator.
2023-01-12 19:25:42 +01:00
Raven Szewczyk e4a111388f Consistent, deterministic meteorite generation (#200)
* Update buildscript

* Make meteorite locations independent of chunk loading order by using a grid-based system for location randomization

* Refactor MeteoritePlacer and related worldgen to be fully deterministic.

Also move around some initialization code into constructors to make it easier to read.
2022-11-29 17:41:08 +01:00
Raven Szewczyk 8e52364e05 Allow "use substitutions" patterns to request crafting of substituted components (#195)
* Update buildscript

* Allow "use substitutions" patterns to request crafting of substituted components

Previously only existing substitution items would be used, but crafting new ones wouldn't be requested.
This may not be 100% reliable when multiple alternative patterns exist and only some are craftable, as not all possible crafting permutations are explored.

* Make patterns eligible for substitution crafting optional

* Add a gui button to toggle whether patterns can be used as crafting substitutions
2022-10-22 12:47:12 +02:00
Raven Szewczyk a40ee7424f Update buildscript, apply spotless (#175) 2022-09-01 13:27:40 +02:00
Raven Szewczyk 08d0ef617f Fix potential missed updates in the level emitter. (#173)
* Fix potential missed updates in the level emitter.

This makes the emitter tickable, but sleeping most of the time so the performance impact should be minimal.
If an update is ignored due to the configured delay, ticking is scheduled to make sure that the update happens if no further network updates happen until the next delay period.

* Attempt #2: Delay the first tick of the level emitter on load

* Revert "NetworkMonitor optimization - do not rebuild cache more than once per tick"

This reverts commit 09b253109c.

* spaces->tabs to match existing code
2022-09-01 12:58:42 +02:00
Raven Szewczyk 4e0d3c47ca Add APIs to allow reuse of GUI classes in the Wireless Crafting Terminal mod (#168) 2022-08-24 19:27:57 +02:00
Raven Szewczyk ef93068186 CPU table enhancements: cycling, show in crafting confirmation dialog (#167)
* Factor out the cpu table clientside widget

* Recursive GuiSync support

* Factor out container, add back cpu cycling via the big button

* Add busy cpu preference

* Use CPU table in craft confirmation dialog
2022-08-24 09:24:30 +02:00
Raven Szewczyk a803e9f84a Mark TE chunks as dirty on block updates (#148) 2022-06-23 11:28:26 +02:00