Compare commits

...

1760 Commits
1.20 ... 1.21

Author SHA1 Message Date
ad71619b72
Efficient "nullable" on Enum codec 2025-04-11 08:15:55 +07:00
e9a0983ab2
Add relative side and direction nullable codecs 2025-04-11 06:54:52 +07:00
77443ee801
To avoid name conflicts, move dynamic synchable group map implementation to asMap property 2025-04-10 22:29:52 +07:00
1cfa2be1dd
Make DynamicSynchableGroup implement Int2ReferenceMap
what am i doing
2025-04-10 22:17:47 +07:00
389d0648b1
Allow allocating indices sparsingly in IDAllocator 2025-04-10 10:12:01 +07:00
bb501e2c7e
Mark "is mod loaded" as internal property, so it don't bleed into other namespaces 2025-04-10 08:31:26 +07:00
8fbf7d4c2c
Merge branch 'ironchests' into 1.21 2025-04-09 18:11:33 +03:00
5f64f5708b
давайте короче скопируем метод из ваниллы не особо разбираясь зачем он нам нужен, ПОХУЙ ЧТО АЙРОНЧЕСТЫ НИКОГДА НЕ БЫВАЮТ СДВОЕННЫЕ. 2025-04-09 18:10:43 +03:00
1fc5c76224
ничего не забыл? 2025-04-09 17:11:49 +03:00
cc372ed871
iron shulker boxes 2025-04-09 03:57:42 +03:00
85950c6a90
ты как меня назвал 2025-04-09 03:48:10 +03:00
16515ecc92
iron chests 2025-04-09 00:36:49 +03:00
2922af8715
How this went unnoticed i have no idea 2025-04-05 21:23:52 +07:00
822ab97066
Merge remote-tracking branch 'origin/1.21' into 1.21 2025-04-05 09:59:29 +07:00
43c02b37a8
Use memorizing suppliers to considerably improve get() performance of CapabilityCache 2025-04-05 09:58:50 +07:00
8f9103ca48
Store cable side directly, and not relative side, to further improve cable transfer performance 2025-04-05 09:47:30 +07:00
9a6cc53189
Actually fix matter bottler bottling when transferring very little amount of matter 2025-04-05 09:45:44 +07:00
2453c60d76
maybe fix matter bottler getting stuck? 2025-04-05 09:45:43 +07:00
a54382b74e
Use LinkedHashMap in DynamicSynchableGroup so iteration order is preserved 2025-04-05 09:45:43 +07:00
d35da8c7f4
Allow DynamicSynchableGroup to accept non-ISynchables 2025-04-05 09:45:42 +07:00
afb6cd5907
Add global direction and relative side codecs, so less data is duplicated when something need these codecs 2025-04-05 09:45:42 +07:00
578d86410b
Add shuffle variant for object array 2025-04-05 09:45:37 +07:00
9e1ae327ea
Add RelativeSide#defaultOf 2025-04-05 09:45:33 +07:00
cc7fe1ea2f
matter dust in creative tab 2025-04-05 00:43:44 +03:00
3e59eb5595
GearShocky — Вчера, в 15:24
ну давай ещё полоску на батарейках влепи
(она сверху)
2025-04-05 00:19:56 +03:00
4faef9d7c9
ЩАС БУДЕТ ТЕБЕ ТОЧНОСТЬ ЧИСЛА. 2025-04-04 22:09:35 +03:00
55856e6aec
matter capacitor gauge 2025-04-04 15:07:42 +03:00
167ea42ec8
idea refactor moment 2025-03-31 20:56:33 +07:00
a956d9a34f
Move feature to world subpackage 2025-03-31 09:32:32 +07:00
9b1c192f09
Provide "enhanced" (count unlimited) item stack codecs 2025-03-31 09:12:12 +07:00
2b589410f5
Move triggers and worldgen to server subpackage 2025-03-31 08:57:04 +07:00
12241ead12
Remove outdated code 2025-03-31 08:12:09 +07:00
a4b54f052c
Bump kommons 2025-03-30 23:56:43 +07:00
4b38528fe0
Switch more code to use kommons 2025-03-30 23:56:05 +07:00
c5c7e1bac4
Remove operator modifier on blockstate#set alias 2025-03-30 18:51:25 +07:00
339cacc545
Remove toImmutableList 2025-03-30 18:47:18 +07:00
844323ead6
Move streams exts from Utils to FriendlyStreams 2025-03-30 18:46:36 +07:00
ca95da8c6f
Move level extensions to separate file 2025-03-30 18:45:45 +07:00
3cbcd9e280
Use immutableMap provided by kommons 2025-03-30 18:42:42 +07:00
118f5e1b5c
Use immutableSet provided by kommons 2025-03-30 18:18:59 +07:00
1241d2368e
a? 2025-03-30 18:17:59 +07:00
4b5602404d
wtfffff 2025-03-30 18:17:28 +07:00
e0aa5ebbae
Compile against kommons immutable* factory functions and mapped comparator 2025-03-30 18:16:43 +07:00
88d47ef4d5
Remove enum.next/prev 2025-03-30 16:39:08 +07:00
46eebd236a
Rename file to Utils 2025-03-30 16:37:02 +07:00
4207be5078
Remove byte supplier and short supplier 2025-03-30 16:35:19 +07:00
2f03d6730a
Fix IDAllocator not being utilized properly in dynamic synchable group 2025-03-30 16:34:18 +07:00
30fb67f63a
Remove NotNullVar
lateinit should be used instead, really
2025-03-30 16:32:04 +07:00
6f12295245
Move nbt extensions to util subpackage 2025-03-30 16:27:40 +07:00
a2c5b84e77
Move observed config list to config subpackage 2025-03-30 16:24:06 +07:00
1a94ab6634
Split core into util package
for no reason of course
2025-03-30 16:23:46 +07:00
078b3dba9a
Move Multiblock subpackage to root 2025-03-30 15:32:32 +07:00
4c41128b37
Remove RandomSource2Generator 2025-03-30 15:28:44 +07:00
a49754e5cc
Move random utils to util subpackage 2025-03-30 15:24:29 +07:00
929049f24c
YuRaNnNzZZ — 21:17
даблклик теперь не собирает все итемы
в экзопаке
2025-03-29 21:19:37 +07:00
20c58c578d
okey 2025-03-29 21:08:54 +07:00
e3f9b8dc64
i'm with stupid 2025-03-29 20:44:56 +07:00
e85bc72ef2
Handle recursive lively nodes removal gracefully 2025-03-29 20:42:14 +07:00
03dfef00c4
??? 2025-03-29 20:30:38 +07:00
69e4747363
Try to prevent recursive energy transfer on cables 2025-03-29 20:22:44 +07:00
3e5f47c9a3
Fix matter reconstructor being a downgrade regarding energy values compared to replicator 2025-03-29 17:12:49 +07:00
f57ccafcfa
Fix player not getting advancements for items picked up into exopack inventory 2025-03-29 17:06:01 +07:00
f82c7977fa
Fix being unable to drain sub 1-xp point liquid xp 2025-03-29 14:11:17 +07:00
640aeabb07
Invalidate recipe caches on resources reload 2025-03-29 14:06:38 +07:00
c98a1573aa
ooprs!!1 2025-03-29 13:47:39 +07:00
072d2187f8
Specify default cache size to 16384 entries, and bump cache size for matter entangler 2025-03-29 13:39:56 +07:00
2d1c9184f4
Fix platform declaration clash 2025-03-29 13:37:27 +07:00
c93fa7bb7a
Weaken type argument in AutomationFilters 2025-03-29 13:37:14 +07:00
4db52b83c4
Since /reload reloads everything, we can cache isIncomplete 2025-03-29 13:34:43 +07:00
571c7bc339
Passing Int.MAX_VALUE to simple container slot factory will make its slots ignore max stack size completely 2025-03-29 13:33:07 +07:00
f5e21f5582
Fix filter deserialization 2025-03-29 12:41:55 +07:00
8454db6785
Some fixes for item filters 2025-03-29 12:07:32 +07:00
78fad5d3cc
Initial implementation for improved item filters 2025-03-29 10:55:32 +07:00
3e593748f7
Remove dummy filtered slot implementation since it is no longer required 2025-03-27 07:17:28 +07:00
3fab525345
Merge branch '1.21' into new-container-api 2025-03-26 23:00:26 +07:00
af24f391df
Fix blocks without menu still behaving like being interacted with clientside 2025-03-26 23:00:18 +07:00
10421570be
forgor about gauge updates when container contents changes in matter capacitor bank 2025-03-26 22:51:42 +07:00
4d51ed5210
Optimize battery bank 2025-03-26 22:50:13 +07:00
39a996f79f
Fix matter capacitor bank not marking chunks as dirty 2025-03-26 22:40:44 +07:00
a26840f670
sumOfDecimal 2025-03-26 22:38:27 +07:00
5281a5aeee
Remove jvm overloads from matter capacitor bank menu 2025-03-26 22:38:18 +07:00
750f941525
Optimize matter capacitor bank 2025-03-26 22:38:02 +07:00
7405989b97
Merge branch '1.21' into new-container-api 2025-03-26 22:21:11 +07:00
140bdab59c
Fix swapped out condition checks in nextDecimal 2025-03-26 22:21:02 +07:00
c2f20a76f6
Merge branch '1.21' into new-container-api 2025-03-26 22:14:39 +07:00
a3ed886900
Fix wrong matter recycler receive values 2025-03-26 22:11:37 +07:00
1087e755ff
And now, proper random decimals implementation 2025-03-26 22:09:40 +07:00
c965bcdc82
Move decimal sampling to random utils 2025-03-26 19:36:52 +07:00
5663b262eb
Move random extensions to RandomUtils file 2025-03-26 19:34:22 +07:00
e93c766edb
Move stuff from "Decimal" to appropriate places 2025-03-26 19:16:30 +07:00
85dde24e59
Update energy counter menu code 2025-03-26 19:06:39 +07:00
4fc646a13a
Energy counter "pull" mode 2025-03-26 18:52:26 +07:00
ddcfe11780
Caused by: java.lang.NoClassDefFoundError: ru/dbotthepony/mc/otm/android/feature/LimbOverclockingFeature 2025-03-24 23:33:52 +07:00
6226621b95
god damn it 2025-03-24 18:15:53 +07:00
1bb612b07c
Fixes for last commit 2025-03-24 18:14:47 +07:00
588b9c1b7c
Put all otm registries in one place 2025-03-24 13:55:36 +07:00
fdfc406ca6
Make exopack slot upgrades be consumed in stacks, to make bulk use way less annoying 2025-03-23 01:48:33 +07:00
9f8e7693a8
Add IEnhancedContainer specific optimization 2025-03-23 01:28:06 +07:00
65bbc56014
Merge branch '1.21' into new-container-api 2025-03-23 01:25:48 +07:00
16f91343d8
Allow to specify loot table rounds through nbt 2025-03-23 01:23:52 +07:00
3902e60424
BlockLootTableHolder#fill 2025-03-23 01:17:26 +07:00
c778f192b2
Proof-of-concept "Small capsule" loot block 2025-03-22 23:33:28 +07:00
22ebdbb1eb
Rename beforeDroppingItems to dropItems, and change logic 2025-03-22 19:59:48 +07:00
524c36aade
oops 2025-03-22 19:09:59 +07:00
faba736bd7
Considerably improve upgrade container performance 2025-03-22 17:10:26 +07:00
17dfa953db
damn 2025-03-22 15:28:11 +07:00
d17e64f335
Fix slotted container has empty bitmap after deserialization 2025-03-22 15:10:17 +07:00
eed3b04555
Make matter bottler actually consume energy 2025-03-22 15:07:05 +07:00
6cf218a184
Considerably buff matter bottler 2025-03-22 15:06:56 +07:00
0a9e90bec6
Make matter recycler receive random amount of matter on tick instead of determining total matter received upon job start 2025-03-22 00:49:42 +07:00
45181c9e55
Merge branch '1.21' into new-container-api 2025-03-22 00:31:35 +07:00
0126d4d976
Don't override nextGaussian, because JVM implementation should be generally faster 2025-03-22 00:30:03 +07:00
01d3cbf7b2
Add "Smart exchange" button to quickstack controls 2025-03-21 21:58:56 +07:00
be2011cf96
Merge branch '1.21' into new-container-api 2025-03-21 21:24:26 +07:00
ab2cc33b7a
"Smart storage exchange icon" 2025-03-21 21:24:16 +07:00
9413ae5f2b
Shrink effect list panel so it no longer overlaps "quick stack" controls 2025-03-21 21:17:50 +07:00
dc73ac7b55
Merge branch '1.21' into new-container-api 2025-03-21 21:11:30 +07:00
bfb8f0380a
Panel debug rendering 2025-03-21 21:10:46 +07:00
a6361f10f2
Final improvements to quick stack controls 2025-03-21 18:35:25 +07:00
f16b003cdf
Merge branch '1.21' into new-container-api 2025-03-21 18:18:18 +07:00
06f109575d
Fix children not getting re-sorted upon visibility changes 2025-03-21 18:18:07 +07:00
a2d9f43a2e
Fix grid panel layouts, introduce column major order 2025-03-21 18:17:50 +07:00
07e0c73479
Fixes for quick stack controls 2025-03-21 15:19:07 +07:00
2547478914
Merge branch '1.21' into new-container-api 2025-03-21 15:11:17 +07:00
7c028b1fa6
Im with stupid 2025-03-21 15:11:09 +07:00
dcff861e71
More quickstack controls 2025-03-21 14:31:59 +07:00
9be8596a5f
Merge branch '1.21' into new-container-api 2025-03-21 14:05:50 +07:00
57c6bbb795
Update cases where wrong random being used 2025-03-21 14:00:19 +07:00
29c51617b9
Merge branch '1.21' into new-container-api 2025-03-21 13:52:56 +07:00
3e92c5272d
Move panels additional types to separate file 2025-03-21 13:52:00 +07:00
f9821aa552
Use GJRAND64 in menus 2025-03-21 13:36:46 +07:00
b921658eb2
Remove randomGenerator from editable panel 2025-03-21 13:34:53 +07:00
9b27ed7fb6
Add netFloat and nextDouble helper methods to RandomSource 2025-03-21 13:33:53 +07:00
269227f6cf
Add helper methods for fast DockProperty creation 2025-03-21 12:58:13 +07:00
27834cc595
Fix wrong layout final iteration value 2025-03-21 12:23:08 +07:00
70ed0cfcba
Merge branch '1.21' into new-container-api 2025-03-21 10:46:03 +07:00
c343de6031
Parenting callbacks in panels 2025-03-21 10:45:07 +07:00
65bf4dc9d0
Merge branch '1.21' into new-container-api 2025-03-21 08:07:52 +07:00
e6c9708652
Add layout modes to grid panel 2025-03-21 08:07:43 +07:00
a48aaf52ae
Add DockProperty#all variant 2025-03-21 07:19:03 +07:00
9b384f2213
Implement sizeToContents() for GridPanel 2025-03-21 07:18:42 +07:00
5b1ae12f85
Prioritize slots with filter or items across all chests 2025-03-19 16:50:43 +07:00
85c4aa4dc4
Prioritize non-filtered slots when taking items first 2025-03-19 11:29:47 +07:00
bd4622fc0d
Ignore slot filters when taking from chests 2025-03-19 10:58:50 +07:00
36f6a12395
Fix quick move to nearby chests treating every chest equally
and possibly creating situation where items of one type of one of chests go into empty slots of different (unrelated) chest(s)
2025-03-18 22:55:17 +07:00
06a621d370
Prioritize chests closer to player first 2025-03-18 22:47:26 +07:00
d6f53946d9
"Quick stack to nearby chests" prototype 2025-03-18 22:37:44 +07:00
091ffc8c9f
Merge branch '1.21' into new-container-api 2025-03-18 18:59:00 +07:00
10f250b822
Provide convenient unit packet registration 2025-03-18 18:58:51 +07:00
7f299a6dec
Provide Unit (singleton) codecs 2025-03-18 18:58:49 +07:00
f7a4623830
Provide convenient unit packet registration 2025-03-18 18:56:23 +07:00
c9dca76870
Provide Unit (singleton) codecs 2025-03-18 18:55:55 +07:00
ef2602895b
Declare VanillaMenuTypes#register as internal 2025-03-18 18:41:09 +07:00
0a0b0e3819
Merge branch '1.21' into new-container-api 2025-03-18 18:40:39 +07:00
442a7b7496
Declare event listener functions as internal 2025-03-18 18:40:07 +07:00
2f016a76a6
Declare registerNetworkPackets as internal 2025-03-18 18:27:54 +07:00
71186b7c30
Ignore /.kotlin 2025-03-18 18:27:29 +07:00
8f40717ff6
Change quickmove slot priority to consider hotbar slots last, to match vanilla behavior 2025-03-17 23:15:54 +07:00
d48dbf3ec9
Merge branch '1.21' into new-container-api 2025-03-17 23:02:13 +07:00
7f362a95a2
Rearrange icons in quickmove 2025-03-17 23:01:58 +07:00
a84df28cf8
Rearrange icons in quickmove 2025-03-17 22:28:02 +07:00
03c64425a9
Add take all, restock, full restock buttons 2025-03-17 21:08:10 +07:00
d41d331e0f
Merge branch '1.21' into new-container-api 2025-03-17 11:24:15 +07:00
5b68a6c7ba
Add "quick move" to/from storage graphics 2025-03-17 11:23:51 +07:00
d89d5b9672
Add "quick move" to/from storage graphics 2025-03-17 11:23:34 +07:00
ee4b12e687
Improved "quick move" code in menus 2025-03-16 23:41:33 +07:00
9a5614de65
Don't drop experience capsules when keepInventory is enabled 2025-03-16 17:29:13 +07:00
95f19bc18f
Merge branch '1.21' into new-container-api 2025-03-16 00:31:14 +07:00
df5c8dc6aa
Make Matter Decomposer throttle for 1 tick when buffer can't fit all matter produced 2025-03-16 00:31:05 +07:00
d5a9632c97
Move SortInput to upper level 2025-03-15 22:26:47 +07:00
cf32fd9d2a
Extract moveItemStackToSlots static context 2025-03-15 17:43:41 +07:00
427b5f9179
Merge branch '1.21' into new-container-api 2025-03-15 13:23:43 +07:00
f599f1c2b9
Fix saturation going negative 2025-03-15 13:23:34 +07:00
fd9960bd86
Remove HandlerFilter 2025-03-15 11:38:26 +07:00
962ecb1996
Use nextDouble() because PRNG provides 64 bit numbers 2025-03-15 10:42:45 +07:00
7c6d58b782
Merge branch '1.21' into new-container-api 2025-03-15 10:15:31 +07:00
42386e1fbe
Update commentary on otmRandom 2025-03-15 10:08:02 +07:00
5d15425fa4
Merge branch '1.21' into new-container-api 2025-03-15 10:06:27 +07:00
b7b2b8095c
Revert "Remove otmRandom"
This reverts commit 5a016bef

The way OTM uses random generator in its code will quickly cause LCG used in Minecraft to show its bias
because LCG in minecraft samples its highest 48 bits, which gives us at best 2^16 period in the lowest bit returned by LCG.
Which it doesn't sound bad, it quickly causes RNG become biased the quicker/more it is sampled on each tick, especially considering
some may use `level.random.nextInt(chance) == 0` to determine chance of something happening,
which will get extremely biased on heavy RNG congested environment
If we avoid sampling Level's generator this much, we won't suffer from bias in our own code, as well as avoid biasing other mods this much.

The "2^16 period" problem is also might be the reason why Entities get their own instance of RandomSource, and Mob Goals use random exactly the way described above (`nextInt(chance)`), which can and will suffer from bias the moment mob exists in world for more than 2^16 ticks (but actual bias will happen sooner because RNG is not sampled only once per tick, obviously)
2025-03-15 10:04:16 +07:00
0efc520782
Implement faster lookup methods for Slotted Container as well 2025-03-15 00:18:02 +07:00
8b38504a26
Derive hasEmptySlots, isEmpty, countItem from other methods 2025-03-14 23:10:25 +07:00
69d9aaab50
Fast implementation of some methods in EnhancedContainer 2025-03-14 22:15:58 +07:00
448041fe2e
More specialized versions of iterators in IEnhancedContainer 2025-03-14 22:09:32 +07:00
54012cf136
Bump kommons 2025-03-14 21:06:23 +07:00
bc5ad7f37b
кипяточек 2025-03-14 19:47:13 +07:00
70c5382e9d
Always use slotted addItem implementation in containers 2025-03-14 19:45:28 +07:00
01215d647c
Cache hasFilterableSlots in CombinedContainer 2025-03-14 19:40:01 +07:00
3a5f37bd76
Specify argument names explicitly 2025-03-14 19:32:17 +07:00
4ab667b37e
Ooprs!!1 2025-03-14 19:32:04 +07:00
2943026dd5
Add generic param to CombinedContainer 2025-03-14 19:06:49 +07:00
90a22a093d
Don't create filter syncher for IPlayerInventorySlot 2025-03-14 18:57:14 +07:00
c43be6eb62
Remove IContainer 2025-03-14 18:40:10 +07:00
59eab74b44
Remove IMatteryContainer 2025-03-14 18:38:28 +07:00
bdeb740df0
Remove ShadowContainer and MatteryContainer 2025-03-14 18:35:22 +07:00
621661c9fe
Remove MatteryCraftingContainer usage 2025-03-14 18:34:19 +07:00
d0904da1db
Remove remaining MatteryContainer usages 2025-03-14 18:32:28 +07:00
05bdff6a37
Remove unused class 2025-03-14 18:31:01 +07:00
b076d29560
Declare IEnhancedContainer as having generic parameter Slot 2025-03-14 18:29:51 +07:00
a2263c5725
Update MatteryPlayer to use Enhanced containers instead of Mattery containers 2025-03-14 18:11:39 +07:00
d57371ca13
Merge branch '1.21' into new-container-api 2025-03-14 17:47:09 +07:00
579445fbbe
Nerf food for androids further 2025-03-14 17:44:26 +07:00
80ff50b937
Nullify excess hunger when eating as android 2025-03-14 17:40:16 +07:00
ca37b4959f
Bring back old behavior where exhaustion is immediately nullified by energy buffer on Androids 2025-03-14 17:36:55 +07:00
305ddbd0d4
Merge branch 'player-improvements' into new-container-api 2025-03-14 12:14:36 +07:00
b42a503096
Merge branch '1.21' into new-container-api 2025-03-14 12:14:06 +07:00
5d8f2d5a4a
Add REGENERATE_ENERGY_EFFICIENCY_FOOD and REGENERATE_ENERGY_EFFICIENCY_SATURATION 2025-03-14 12:04:16 +07:00
e06928a4b5
Update mixin signature 2025-03-14 11:24:58 +07:00
d10b1b4ee1
Aeugh 2025-03-14 11:21:08 +07:00
922f94b9de
e 2025-03-14 11:02:08 +07:00
b23bda2f6a
Move android package to player package 2025-03-14 10:54:08 +07:00
c4d5ffefa5
Move all logic regarding food / regeneration to MatteryFoodData 2025-03-14 10:37:54 +07:00
a34b485e68
Base replacement for FoodData 2025-03-14 08:52:36 +07:00
c3b2681e89
Rename AndroidConfig to PlayerConfig 2025-03-12 20:57:57 +07:00
cfd6b101d8
Fix addEatEffect hook 2025-03-12 20:31:59 +07:00
0424dd1944
Rename mattery player reference in coremod 2025-03-12 19:34:26 +07:00
05a081d9cb
Move MatteryPlayer to player subpackage 2025-03-12 19:33:20 +07:00
b68b1d724a
Move IMatteryPlayer as well as shortcuts to player subpackage 2025-03-12 19:28:54 +07:00
ade2c0499d
Move Item Monitor to new container API 2025-03-12 18:42:04 +07:00
e699147f9f
Merge ChargeMenuSlot into BatteryMenuSlot 2025-03-12 16:49:19 +07:00
4dad60dfbb
Move Matter Hatch to Slotted Container 2025-03-12 16:47:45 +07:00
55c3c16172
Update Energy Interface to use SlottedContainer 2025-03-11 21:10:19 +07:00
1455e12da3
Fix TooltipList not using proper container class 2025-03-11 21:08:31 +07:00
566538f8a7
Update Drive Viewer to use EnhancedContainer 2025-03-11 20:59:11 +07:00
c08ea8a43d
Update Driver Rack to use SlottedContainer 2025-03-11 20:50:59 +07:00
4df51ce126
Add better random to recommended mods 2025-03-11 17:53:18 +07:00
a6ba428518
Remove custom random generators except for gjrand64 which is used for worldgen 2025-03-11 16:56:51 +07:00
5a016bef1b
Remove otmRandom 2025-03-11 16:55:55 +07:00
1f8cd2cfe3
Update Plate press to use SlottedContainer 2025-03-11 16:50:48 +07:00
a2b2acd3f0
Merge branch '1.21' into new-container-api 2025-03-11 11:39:30 +07:00
0159931930
Faster otmRandom 2025-03-11 11:39:22 +07:00
8d58dfff14
Merge branch '1.21' into new-container-api 2025-03-11 11:09:04 +07:00
6c0265582a
Don't create own random provider if Better Random is present 2025-03-10 20:33:28 +07:00
5e1ae7e77d
Handle negative experience stored in essence capsules 2025-03-10 15:30:50 +07:00
17e4856b10
Use SlottedContainer in Essense Storage 2025-03-10 15:29:50 +07:00
847ec81928
Use moveEnergy in Energy Servo 2025-03-10 09:58:42 +07:00
5e23300ddf
Merge branch '1.21' into new-container-api 2025-03-09 22:37:57 +07:00
08ae897c6f
Make Medical Pill provide only Regeneration III for 8 seconds
Because it completely overshadows Enchanted Golden Apples with current state of things
2025-03-09 22:36:55 +07:00
6d14e6a396
Merge branch '1.21' into new-container-api 2025-03-09 22:01:13 +07:00
755d15fc0b
Replace PCG32 with GJRAND64 2025-03-09 21:52:21 +07:00
9ffee79687
Provide "no seed" initialization for GJRAND64 2025-03-09 21:49:49 +07:00
3a08552345
private the internal state of positional random 2025-03-09 21:29:43 +07:00
32fe6e754c
Provide GJRAND64RandomSource 2025-03-09 21:26:44 +07:00
436606abf4
Now Bread monster can spawn when thrown as item
And when killed, inert version is dropped
2025-03-09 21:11:42 +07:00
29edf383cd
Use thread local non-cryptographic random for Quantum Battery UUIDs
since they dont need to be cryptographically secure
2025-03-09 20:07:06 +07:00
9b6fa89850
Add matter value to imperfect bread so it can be replicated 2025-03-09 19:55:35 +07:00
1a30f4d203
Gold Disk, for spawning in dungeons, add Imperfect Bread to dungeons as Gold Disk 2025-03-09 19:54:03 +07:00
3f677ad353
Update bread item 2025-03-09 18:35:55 +07:00
f1c87ed5ad
Specify effect source as attacker in Wither Steel Sword 2025-03-09 16:22:11 +07:00
df7465a59f
Wither skeleton sword and helmet server config 2025-03-09 16:20:58 +07:00
6f2adfd6d3
Withered Steel Sword fixes 2025-03-09 16:17:27 +07:00
e97967903b
Update WitheredSkeletonSpawnHandler implementation 2025-03-09 16:12:24 +07:00
67ea3b977b
Further improve performance of UpgradeContainer 2025-03-09 16:00:51 +07:00
85aecaf79b
Cache toInt() and toLong() results in Decimal$Regular 2025-03-08 19:23:11 +07:00
bb77ecddb0
Merge branch '1.21' into new-container-api 2025-03-08 17:45:16 +07:00
65d076f634
Bump Kommons 2025-03-08 17:45:09 +07:00
00830c2986
Merge branch '1.21' into new-container-api 2025-03-08 17:41:20 +07:00
7251760800
Try PCG as otm provided random 2025-03-08 17:32:42 +07:00
3bcfd55154
Bump kommons 2025-03-08 17:30:25 +07:00
1ca2348adf
Provide PCG32 wrapper of RandomSource 2025-03-08 17:18:45 +07:00
430bc70c7e
Move PRNG implementation to Kommons
Yurie — Сегодня, в 15:09
вопрос
почему все эти рандомы не в kommons
2025-03-08 16:45:38 +07:00
322d89f2a2
Micro optimization 2025-03-08 14:12:32 +07:00
ebdff6811d
Don't scramble xoshiro on fork since seed is already enough random 2025-03-08 14:11:50 +07:00
b4eb0f7056
Merge branch '1.21' into new-container-api 2025-03-07 21:01:13 +07:00
f866f2a401
Add "Charge androids" and "Charge exopacks" buttons 2025-03-07 21:00:01 +07:00
101bf52113
Update Energy servo to use SlottedContainer, as well as make it behave better with automation 2025-03-07 19:53:09 +07:00
54c2964deb
Update Energy servo to use SlottedContainer, merge EnergyContainerInputMenuSlot into BatteryMenuSlot 2025-03-07 19:17:34 +07:00
762926d2cc
Update Cobblestone generator to use SlottedContainer 2025-03-07 18:48:52 +07:00
4107ec2313
Update Chemical generator to use SlottedContainer 2025-03-07 18:37:43 +07:00
af4123990f
Merge branch '1.21' into new-container-api 2025-03-07 17:32:10 +07:00
4861513797
Delay redstone signal level lookup update by 4 ticks 2025-03-07 17:30:20 +07:00
d19de3facf
Delay cable blockstate update by 4 ticks 2025-03-07 17:29:32 +07:00
9107f63d9d
"Accept wireless charging" button in exopack 2025-03-07 17:26:35 +07:00
f4ade757c3
Revert "Unfinished labs"
This reverts commit 2d87301ecb.
2025-03-07 16:20:59 +07:00
97dcabacd5
Color storage controls as solid white to improve visual clarity 2025-03-07 14:39:29 +07:00
45651d81b5
Merge branch '1.21' into new-container-api 2025-03-07 11:46:21 +07:00
ebc49b03c4
Replace shulker box gui 2025-03-07 11:45:35 +07:00
b8e76a0fd4
Make energy cable graph track node + side in lively nodes list, considerably improving performance 2025-03-07 10:45:18 +07:00
b4977ea6ae
Move Battery bank to slotted container 2025-03-07 10:26:09 +07:00
51be2c89f4
Make battery slot be filterable 2025-03-07 10:24:50 +07:00
d88da8f244
Automation-forbidden slots are now prohibited to be extracted from 2025-03-07 10:15:53 +07:00
bbf4e752e7
Fix (dis)chargeable handler filters not allowing to extract invalid items 2025-03-07 10:14:06 +07:00
f011c1a912
Allow bottler slots to be filtered 2025-03-07 09:38:22 +07:00
e3a11b3b9e
Update menus to use UserFilteredSlot 2025-03-07 09:34:05 +07:00
784930e396
Update AbstractProcessingMachineScreen to properly account for UserFilteredMenuSlot 2025-03-07 09:26:54 +07:00
3e086dcacf
Switch Powered furnaces to SlottedContainer, make them reject items which are not used in any recipe (in automation) 2025-03-07 09:23:26 +07:00
d5e05a2439 loader anim speed 2025-03-07 05:09:51 +05:00
8cd0c23f21 Merge remote-tracking branch 'origin/1.21' into 1.21 2025-03-07 04:51:04 +05:00
2d87301ecb Unfinished labs 2025-03-07 04:50:55 +05:00
fbd34f3414
SimpleCache helper function 2025-03-06 22:36:55 +07:00
67fc8f99f6
ooprs!! 2025-03-06 22:30:42 +07:00
06f8d8838a
More efficient pattern storage patternCapacity and storedPatterns implementations 2025-03-06 22:02:09 +07:00
d1a9825ea8
Update Pattern storage to use SlottedContainer 2025-03-06 22:00:41 +07:00
caa8d1bb90
Remove conflicting methods from mattery container 2025-03-06 21:58:50 +07:00
6c42af9f30
Provide stream() method in enhanced container 2025-03-06 21:58:08 +07:00
16d492073b
Merge branch '1.21' into new-container-api 2025-03-06 21:48:48 +07:00
9038003f2f
Fix error in loop logic in Matter scanner 2025-03-06 21:48:38 +07:00
cfd64fac07
Update Matter scanner to use SlottedContainer 2025-03-06 21:48:05 +07:00
8967d3aafa
Make CombinedItemHandler aware that SlottedContainer does not need to be rechecked 2025-03-06 20:41:58 +07:00
e0e1ba864d
Update Matter replicator to use Slotted Container 2025-03-06 20:41:39 +07:00
e8ba5916b1
Update Matter recycler to use Slotted Container 2025-03-06 20:31:28 +07:00
f8e9a67994
Update Matter Reconstructor to use slotted container 2025-03-06 20:00:26 +07:00
bc2cfccffe
Provide direct set operator 2025-03-06 18:22:04 +07:00
a73ad5484d
Merge branch '1.21' into new-container-api 2025-03-06 18:20:40 +07:00
1dd57065c9
Allow to "initialize" xoshiro with zero seed, and provide "raw" initialization 2025-03-06 18:20:26 +07:00
84d4ed78ea
Don't scramble xoshiro on fork since seed is already enough random 2025-03-06 16:49:10 +07:00
7a4ce4f394
Use EnhancedContainer in makeUpgradeSlots 2025-03-06 16:38:20 +07:00
c31549792e
More specific methods in enhanced container interface 2025-03-06 16:37:30 +07:00
5422f0fec8
Merge branch '1.21' into new-container-api 2025-03-06 16:14:41 +07:00
c40f9a2c57
Make lootTable decoding not throw an exception when meeting unexpected data 2025-03-06 16:13:24 +07:00
c376a99da0
Make Upgrade container inherit EnhancedContainer instead 2025-03-06 16:11:37 +07:00
9806e1ec52
Revert "Update Upgrade Container to use SlottedContainer"
This reverts commit 861b94a30a.
2025-03-06 16:06:21 +07:00
de79019f56
Implement EnhancedContainer 2025-03-06 16:06:04 +07:00
bc109e8020 frogs 2025-03-05 17:46:30 +05:00
efbc93e16a
Make IAutomatedContainer implement IItemHandlerModifiable 2025-03-05 19:01:24 +07:00
7efb792353
frigate cargo crate loot fix 2025-03-05 13:10:41 +03:00
861b94a30a
Update Upgrade Container to use SlottedContainer 2025-03-05 16:22:39 +07:00
83d11d531d
Cache recipes in Matter Entangler 2025-03-05 15:23:27 +07:00
45a32dce3c
Merge branch '1.21' into new-container-api 2025-03-05 13:20:27 +07:00
e45e35f0c3
Couldn't handle mushrom that day 2025-03-05 13:20:16 +07:00
3910e38add
Move Matter Entangler to Slotted container 2025-03-05 13:17:57 +07:00
5942ab2126
Implement IEnhancedCraftingContainer 2025-03-05 13:07:39 +07:00
8696d268ad
Make IEnhancedContainer implement StackedContentsCompatible 2025-03-05 13:03:42 +07:00
8aae573110
Merge branch '1.21' into new-container-api 2025-03-05 10:51:52 +07:00
b9cdfd9d91
Add Caffeine Cache dependency 2025-03-05 10:51:30 +07:00
f78336657d Merge remote-tracking branch 'origin/1.21' into 1.21 2025-03-05 07:55:04 +05:00
d9680181b1 a 2025-03-05 07:52:57 +05:00
892beddfc6
Merge branch '1.21' into new-container-api 2025-03-05 09:49:31 +07:00
828c80dfd4
Merge branch 'prng' into 1.21 2025-03-05 09:46:13 +07:00
e6365f3bb7
Merge remote-tracking branch 'origin/1.21' into 1.21 2025-03-05 09:46:07 +07:00
991314c07b
Use Xoshiro256SSRandom instead of CMWC for OTM provided level random 2025-03-05 09:44:02 +07:00
95f1a304c9
Provide docs for random number generators 2025-03-05 09:43:24 +07:00
b8291c7e1c
Proper Xoshiro256 initialization with 256 bit seed 2025-03-05 09:34:29 +07:00
1a52864c4e
Throw an exception when xoshiro seed is completely zero 2025-03-05 09:31:28 +07:00
f19804dd4a
Provide better random seeds for random number generators 2025-03-05 09:10:23 +07:00
6b7f1fb949 andr oid 2025-03-05 07:08:49 +05:00
49f76c7bdd
Provide Xoshiro256StarStar random 2025-03-05 09:07:01 +07:00
6c087a278d
Don't store seed since it is of no use 2025-03-05 08:38:07 +07:00
e03d9b1a74
Provide LCG64 implementation as separate class 2025-03-05 08:37:43 +07:00
d326e45b32
Initialize carry using lcg instead of modulo divide seed 2025-03-05 08:20:39 +07:00
ffee09ec0f Merge remote-tracking branch 'origin/1.21' into 1.21 2025-03-05 05:59:20 +05:00
5956b5d76f a 2025-03-05 05:59:10 +05:00
f5036e6220
unempty 2025-03-05 00:36:54 +03:00
d31922e331
вы мне не доверяете, А Я ВАМ 2025-03-05 00:33:51 +03:00
4187e7818e
тогда уж и типы правильные давайте 2025-03-04 23:57:19 +03:00
43d2abe7e3
а давайте лут таблицы будут работать в ящиках. согласны? 2025-03-04 23:52:57 +03:00
825cbb6731 Merge remote-tracking branch 'origin/1.21' into 1.21 2025-03-05 01:36:11 +05:00
94289b9d2c Adjustments 2025-03-05 01:35:59 +05:00
e8222216e0
и масштаб тоже нормально считать надо 2025-03-04 22:41:58 +03:00
18b89b4031
НЕТ НУ ЕСЛИ ТЕПЕРЬ У НАС ЕСТЬ ТАКОЙ ШРИФТ ТО Я БУДУ ЕГО АБУЗИТЬ
и вы мне ничего не сделаете
понятно?
2025-03-04 22:31:24 +03:00
a00225e859
очередная корректировка 2025-03-04 22:19:47 +03:00
ee0a113702
бесконечность не пердел 2025-03-04 21:57:17 +03:00
3a010048ee
да 2025-03-04 21:37:17 +03:00
9417d6ffdc
Use more robust 64-bit LCG for seeding CMWC internal state 2025-03-05 01:03:00 +07:00
1ddeff7a29
Merge remote-tracking branch 'origin/1.21' into 1.21 2025-03-05 00:48:39 +07:00
44a1ae3263
Николай Bsky — Сегодня, в 20:10
а можно другой цвет фонта энергии 💀
ибо на полоске энергия чуть более оранжево-желтая
а на фонте зеленовато желтый
2025-03-04 20:14:30 +03:00
fbef1f6f84
маленький шрифт для худа 2025-03-04 20:09:41 +03:00
4eb7971717
Further reduce internal state of CMWC (from 1024 octets / 8192 bits to just 128 octets / 1024 bits) because we don't need these insane periods 2025-03-04 21:06:22 +07:00
257c5edacb
рецепт конфигуратора 2025-03-04 15:20:01 +03:00
93fea6394f
компонент экран + корректировка рецептов
GearShocky — Сегодня, в 14:35
сканер сингулярностей
его кстати переделать нужно
2025-03-04 15:00:12 +03:00
5ea0b64982
конфигуратор для копирования настроек #341 2025-03-04 14:15:04 +03:00
440b7fff2b Falling sun 2025-03-04 06:18:01 +05:00
f03081f0f2 Merge remote-tracking branch 'origin/1.21' into 1.21 2025-03-04 00:13:41 +05:00
b38ebfaa3b I want this 2025-03-04 00:13:32 +05:00
14e6ee4916
Merge branch '1.21' into new-container-api 2025-03-03 22:29:17 +07:00
5df477feab
Fix grill not marking chunk as dirty when it ticks progress/fuel 2025-03-03 22:29:00 +07:00
b83c9edf13
Delegate List.shuffle extension impl to Minecraft util 2025-03-03 22:22:04 +07:00
fcec612718
Lock CMWC state size to 256 WORDs, improving performance of nextInt() 2025-03-03 22:19:57 +07:00
38923d7978
Fix flywheel battery not marking chunk dirty when energy level changes 2025-03-03 22:17:20 +07:00
d2f119a112
теги структур и карты для картографа 2025-03-03 17:34:39 +03:00
d558252db9
Update Matter Decomposer to use SlottedContainer 2025-03-03 20:14:20 +07:00
7f9af78734
Update MatteryPoweredBlockEntity battery container to use SlottedContainer 2025-03-03 19:55:52 +07:00
d76f2fe015
lol 2025-03-03 19:54:22 +07:00
70bfa114c8
Use IEnhancedContainer in setChanged 2025-03-03 19:47:45 +07:00
a5b96fa4c4
Update bottler to use slotted container 2025-03-03 18:33:24 +07:00
cff5988767
Merge branch '1.21' into new-container-api 2025-03-03 18:03:28 +07:00
362c3bd931
Shuffle entities in vicinity of android charger, so all players around it will get charged more or less equally 2025-03-03 18:01:03 +07:00
866776dc74
YuRaNnNzZZ — Сегодня, в 17:57
но он продолжает меня заряжать
2025-03-03 17:59:50 +07:00
6e7b90a8e8
Move Matter capacitor bank to slotted container 2025-03-03 15:00:30 +07:00
edb3aa657d
Merge branch '1.21' into new-container-api 2025-03-03 14:44:54 +07:00
56cce749f7
Make HFB be correct tool for plants and cobwebs 2025-03-03 13:40:33 +07:00
c96614c7c0
Replace usages of Level#random with OTM provided random (CMWC) 2025-03-03 13:23:06 +07:00
bc2c531e1f
Attach CMWC random to Level class, as alternative random to be used in OTM 2025-03-03 12:20:29 +07:00
32ef2911fa
Implement Complementary Multiply-With-Curry Random 2025-03-03 12:02:42 +07:00
4e653b6544 lang 2025-03-03 05:59:06 +05:00
b585187ae0 Merge remote-tracking branch 'origin/1.21' into 1.21 2025-03-03 03:21:08 +05:00
2ee6c7e923 Loader 2025-03-03 03:20:55 +05:00
42b86778cb
Веасол 2025-03-02 05:44:11 +03:00
36a16ac9d2
Trollium 2025-03-01 21:59:10 +03:00
e6bab75bc7
YuRaNnNzZZ — Сегодня, в 20:44
Изображение
а обратно?
2025-03-01 20:58:00 +03:00
80128a01e5 forgot 2025-03-01 19:22:48 +05:00
e1decb67ec Imperfect bread 2025-03-01 19:16:18 +05:00
9d12044db4 Merge remote-tracking branch 'origin/1.21' into 1.21 2025-03-01 17:54:34 +05:00
271f594389 yes 2025-03-01 17:54:26 +05:00
9ce2fbf497 withered steel block 2025-03-01 17:53:53 +05:00
6e5e64baeb
Merge branch '1.21' into new-container-api 2025-03-01 19:17:29 +07:00
f655405d4b
[19:15:16] [Worker-Main-10/ERROR] [minecraft/ModelManager]: Failed to load model overdrive_that_matters:models/block/matter_entangler_error.json
com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated object at line 3 column 4 path $.parent
2025-03-01 19:17:12 +07:00
3ed935001b
Move Painter to SlottedContainer 2025-03-01 19:16:40 +07:00
49ee0a6a5f eh? 2025-03-01 16:47:42 +05:00
4292713874
Oopsie 2025-03-01 13:26:34 +07:00
1b5476de40
Mark chunk dirty when grill fuel ticks 2025-03-01 12:22:24 +07:00
bf7c9277ee
Update getMaxStackSize in MatteryMenuSlot to use IEnhancedContainer 2025-03-01 12:19:06 +07:00
a6891362d9
Remove no longer needed operator 2025-03-01 12:15:33 +07:00
2b2f78e528
Fix Grill not properly saving cook progress when being deserialized from disk 2025-03-01 12:15:19 +07:00
454783a99a
KOptional codec 2025-03-01 12:11:53 +07:00
d2ff43946e
Update grill to use SlottedContainer 2025-03-01 12:00:33 +07:00
abf74e4a2b
Merge branch '1.21' into new-container-api 2025-03-01 11:28:16 +07:00
8ffb2ce3b1
Merge remote-tracking branch 'origin/1.21' into 1.21 2025-03-01 11:13:52 +07:00
0f2c6f0e1e
Fix allowSpectators not being used by filter 2025-03-01 11:13:33 +07:00
d76ddfcd2b Merge remote-tracking branch 'origin/1.21' into 1.21 2025-03-01 03:08:42 +05:00
272cf0f776 I'm schizo 2025-03-01 03:08:10 +05:00
ffdb7f6f8f
Also set furnaceMenuOpenState to false 2025-03-01 00:37:47 +07:00
162a3757e4
Add DeviceControls#dockOnLeft 2025-03-01 00:25:24 +07:00
66a4adecf9
Move Fluid tank to SlottedContainer, and make it accept slot filters 2025-03-01 00:06:07 +07:00
1702f95370
Rename "MatteryMenu" to "MatteryMenuSlot", along with all other slot classes to include "menu" in their name 2025-02-28 22:11:11 +07:00
1d11b9b626
Also unset "ender chest open" state on client 2025-02-28 22:05:47 +07:00
f9b2cef513
⚙ SHOCKY — Сегодня, в 22:00
а можно
эндер сундук
в инвентаре
⚙ SHOCKY — Сегодня, в 22:00
вырубить запоминание вкладки
что-бы предметы не испарялись
в бездну (эндер сундук)
⚙ SHOCKY — Сегодня, в 22:01
это что десинк клиента выходит
или как
что сервер думает что открыт сундук
и шифт клик перекидывает предмет в эндер сундук
а не в хотбар
2025-02-28 22:03:44 +07:00
f79b49d422
Move CargoCrate to SlottedContainer
implement necessary changes to MatteryMenu, MatterySlot and panels
to reflect networking slot filters as part of container state, and not as part of menu slot
2025-02-28 21:57:28 +07:00
b1930bc93d add iron sandwiches to creative menu 2025-02-28 19:20:42 +05:00
30263bf30e
Make CombinedContainer temporarily implement old IMatteryContainer so it no longer crashes 2025-02-28 20:29:20 +07:00
ffdd44357d
Make it compile again so migration can be done incrementally 2025-02-28 20:16:23 +07:00
18252cf800 bread 2025-02-28 17:03:05 +05:00
5e8ab76f49
Update MatteryContainer to fix compilation error 2025-02-28 15:38:37 +07:00
9f6b9ad85b
Some helper functions, split "Filtered" into own subclass with own "Simple" factory 2025-02-28 15:23:08 +07:00
ab1446b682
Move SlottedContainer to subpackage 2025-02-28 09:10:03 +07:00
6764af0dcc
Misc improvements for CombinedContainer 2025-02-28 08:38:09 +07:00
eddb7a1445
КУДА 2025-02-27 22:04:07 +03:00
7ba2e020b7
bread monster entity wip 2025-02-27 22:01:35 +03:00
6747d5f471
Further split ISlottedContainer into IAutomatedContainer 2025-02-27 23:40:29 +07:00
124a1b3db6
Get rid of "slot" and "container" in IContainerSlot since they were bad design choices 2025-02-27 21:55:03 +07:00
a0b04fc1f4
Extracting 'lost' items from SlottedContainer 2025-02-27 21:17:28 +07:00
8a4abb90bd
Forgot to switch IntSortedSet to IntSet 2025-02-27 21:08:00 +07:00
fc1d9d6448
Make SlottedContainerBuilder be embedded inside SlottedContainer 2025-02-27 20:41:56 +07:00
b39c82e79a
Merge branch '1.21' into new-container-api 2025-02-27 19:41:42 +07:00
d362c135d7
Implement clearSlotFilters in wrappedInventory 2025-02-27 19:34:39 +07:00
b1b6843400
Merge branch '1.21' into new-container-api 2025-02-27 19:24:54 +07:00
858e95e7bf
Merge branch '1.21' of https://git.dbotthepony.ru/DBot/overdrive_that_matters into 1.21 2025-02-27 19:19:51 +07:00
ca6ff30414
Initial code for new containers 2025-02-27 19:19:33 +07:00
8f2f4f1062 What about this 2025-02-27 16:52:27 +05:00
6b68e74b76 m 2025-02-27 16:49:59 +05:00
5e24fe2c85 Iron 2025-02-27 16:44:03 +05:00
6689bdfd19 texture consistency 2025-02-27 16:06:09 +05:00
b5e2b24dd5 Good morning 2025-02-27 15:53:59 +05:00
0b635aab7e attempt 2025-02-27 06:32:15 +05:00
cba52d8a66 смодулируй мне это 2025-02-27 04:38:29 +05:00
1c7f116502 g 2025-02-27 00:03:55 +05:00
5e3520de55 shapegen 2025-02-26 23:58:22 +05:00
aa0a1ed53f Matter entangler model 2025-02-26 23:27:44 +05:00
ba2048849b reduce empty space on bread monster texture 2025-02-26 15:45:14 +05:00
3fd06889da regen essence storage colored textures 2025-02-26 15:41:57 +05:00
e3efc88d83 Hull 2025-02-26 05:08:14 +05:00
74546e46d3 I don't know if this is relevant, the modded entity does not contain animation data and this one might be specific to blockbench 2025-02-26 01:33:39 +05:00
f57b171bc9 forsenbread (2) 2025-02-26 01:29:12 +05:00
dfc35f393f
Add clearSlotFilters to IMatteryContainer 2025-02-25 22:13:36 +07:00
cdaae2f9fa
Remove unused class 2025-02-25 21:54:18 +07:00
736da72ca7
Invalidate remotes on chart being deserialized 2025-02-25 19:56:58 +07:00
4ab69d6d82
Move IContainerSlot to regular container subpackage 2025-02-25 16:31:27 +07:00
25e25b0f86
Remove structural synchronization inside SynchableGroup
Also fixed memory leak when removing remotes
2025-02-25 16:09:32 +07:00
05913674b1
Improve performance of MatteryMenu#addSlot 2025-02-25 13:49:08 +07:00
2bcc1965ce
Add alt power view with shift pressed in flywheel battery screen 2025-02-25 12:06:32 +07:00
ab68f8d36d
Make DynamicLabel update text before resizing 2025-02-25 12:04:39 +07:00
06e2a97cfc
Make FramePanel take into account title width 2025-02-25 12:02:00 +07:00
59200b2baa
Improve performance of multiblock scanning by postponing blockentity lookup until it is actually needed 2025-02-25 11:56:36 +07:00
304b6a65c8
Multiblock formed/invalid/unloaded states; greatly improve multiblock scanning performance 2025-02-25 11:20:44 +07:00
6ce84804d7
Add 4 pixel margin to "multiblock formed" label 2025-02-25 11:06:04 +07:00
3ad085c1ae
Forgot to increase width and height in "BackgroundPanel#block" 2025-02-24 22:41:41 +07:00
4a711783f5
Flywheel battery status GUI 2025-02-24 22:40:03 +07:00
2c741b45c3 Merge remote-tracking branch 'origin/1.21' into 1.21 2025-02-24 17:33:57 +05:00
f257686742 forsenbread 2025-02-24 17:33:49 +05:00
4ff0b14b6d replicate this 2025-02-24 16:56:04 +05:00
d4636038cc
:skull_rotate: 2025-02-24 18:08:02 +07:00
d0ee1fb0e3
Properly delegate setChanged in combined container slot 2025-02-24 16:37:39 +07:00
96d902bc98
Type specific setChanged override in MatterySlot 2025-02-24 16:29:11 +07:00
13c9e93d31
Move black hole spawn chance to placedfeature 2025-02-24 15:15:25 +07:00
b12b25c68f
Changed my mind, 0.4% 2025-02-23 19:18:14 +07:00
469f7d072d
ZPM was supposed to have 0.1% chance to appear, not 1% 2025-02-23 18:10:14 +07:00
921778b9e6
Merge remote-tracking branch 'origin/1.21' into 1.21 2025-02-22 23:54:26 +07:00
dd003264f2
Allow spectators to see blackhole stats too 2025-02-22 23:54:11 +07:00
0f30cd6756 поскучал 2025-02-22 21:44:46 +05:00
00870576fd не скучайте 2025-02-22 20:58:12 +05:00
35d222d15a
Profiled matter capacitor storage 2025-02-22 18:56:45 +07:00
69c93d4b16
Painted tritanium anvil 2025-02-22 17:13:02 +07:00
28c7459b82
Use MatteryContainer instead of Mojang's SimpleContainer in matter entangler quantum linking 2025-02-22 13:27:04 +07:00
a93d754a68
Update tritanium door colored textures 2025-02-22 13:27:04 +07:00
ad729221f3
Update computer terminal colored textures 2025-02-22 13:27:04 +07:00
980f09471a
New texture recolor script 2025-02-22 13:27:04 +07:00
ec68b7ee9c
Shortcut to "isEmpty" in UpgradeContainer to account for most common case 2025-02-22 13:27:04 +07:00
b4fc02b14e
Revert "генерируем перекрашенные текстуры в рантайме"
This reverts commit 13d76df9fa.
2025-02-22 13:27:03 +07:00
4712cf4b35
Revert "генерация colomposed текстур и автотрек текстур для датагена"
This reverts commit cc8a149c25.
2025-02-22 13:27:03 +07:00
f9159f61ec
Revert "двери с люками тоже. и некрашенные блоки с полоской"
This reverts commit 12d63e962f.
2025-02-22 13:27:03 +07:00
bde57e69cf
Revert "да и остальное тритановое тоже"
This reverts commit e7ae4977d3.
2025-02-22 13:27:03 +07:00
47364de172
Revert "если вы ещё не поняли что я ненормальный"
This reverts commit 5dd4c027a9.
2025-02-22 13:27:02 +07:00
1be974006f
output = output 2025-02-22 09:03:07 +03:00
ba012cf9d0
black hole generator multiblock parts loottable/tags 2025-02-22 08:44:33 +03:00
9fcbd19385 Move singularity ring to block 2025-02-22 01:50:59 +05:00
767a3b45bd b 2025-02-22 01:50:26 +05:00
84505f1fbb I mixed it up 2025-02-22 01:50:13 +05:00
1965720053
Fix energy counter for android being rendered incorrectly 2025-02-21 21:15:29 +07:00
fb8a28d423
Animate gauges slower in matter entangler recipe category 2025-02-21 21:11:29 +07:00
63383c22eb
Fix power gauge in matter entangler recipe category rendering wrong 2025-02-21 21:10:15 +07:00
ba5d3a4043
Someplace i don't fucking know 2025-02-21 19:38:26 +07:00
60f5876280
если это не работает я сдаюсь. оно генерирует нормальный байткод который должен корректно вырезаться
YuRaNnNzZZ — Сегодня, в 14:50
Изображение
Изображение
и как это обходить блять
котлин говна
2025-02-21 15:01:50 +03:00
7432cac581
ЗВУК КЛИЕНТСКИЙ. ОН НЕ ДОЛЖЕН ПРОИГРЫВАТЬСЯ НА СЕРВЕРЕ. 2025-02-21 14:41:55 +03:00
e57dbe5814
How? 2025-02-21 18:24:58 +07:00
0b5ff224f8
Allow interacting with essence storage as fluid tank 2025-02-21 18:21:56 +07:00
e53676a91f Merge branch '1.21' of https://git.dbotthepony.ru/DBot/overdrive_that_matters into 1.21 2025-02-21 16:04:30 +05:00
bf63bc0e1e less shitty 2025-02-21 16:04:21 +05:00
624588318d
квантовый аккумулятор
10к/т
квантовый аккумулятор накопитель (capacitor)
200к/т
может он это того
не накопитель?
2025-02-21 13:24:31 +03:00
652e7d5238
попытка в амбиент звук для чёрной дыры.
не факт что правильная и не факт что будет работать нормально.
2025-02-20 23:46:15 +03:00
d5d4637fff hatch textures 2025-02-20 15:58:41 +05:00
8f81d8fd6f :trolley: 2025-02-20 04:15:42 +05:00
b108b2c495
Fix rare cable crash related to two neighbour cables being mined at same tick 2025-02-19 21:35:55 +07:00
9947c94414
Fix matter entangler not working 2025-02-19 14:40:44 +07:00
5166bf20ad
Fixed observed item stacks are not properly synched 2025-02-19 12:16:14 +07:00
74afafd904
parchment [skip ci] 2025-02-19 01:50:10 +03:00
cd40b66dab
Fix matter entangler not removing itself from matter graph when it is removed 2025-02-18 15:13:58 +07:00
d2fd075116
Add nickel plates to plate press 2025-02-18 10:27:05 +07:00
6b37ec8683
YuRaNnNzZZ: а ещё в табличках наверное надо текст приблизить
YuRaNnNzZZ: :wires:
2025-02-18 03:42:27 +03:00
39f72adb9e
holo sigh hitbox 2025-02-18 03:40:52 +03:00
2779c33d10 grill models (actual models now, i fucked up) 2025-02-18 02:30:39 +05:00
680cb3cab2 grill models 2025-02-18 02:30:06 +05:00
76c0540d57
Make explosive hammer less annoying in creative 2025-02-17 20:05:49 +07:00
7be3607da8
Star chair recipe 2025-02-17 19:52:58 +07:00
1f9719ceab
Don't decide whenever widen device controls panel before parent properly determines its dimensions 2025-02-17 19:47:54 +07:00
6105328e85
Add ignoreWhenSizingToContents 2025-02-17 19:38:12 +07:00
aa2e053c26
Don't add "chargeFlag" when player has no exopack 2025-02-17 19:31:54 +07:00
956531e08b
Don't touch filtered slots with non-stackable items in it 2025-02-17 19:26:00 +07:00
3129db667d
Reduce passive energy loss in flywheel battery 2025-02-17 19:09:57 +07:00
97e22459c5
Ah yes 2025-02-17 10:37:25 +07:00
995a57e631
Actually fix essence storage screen 2025-02-17 10:35:54 +07:00
2c0e0b3b8d
try onceClient for exopack scrollbar (for guis like integrated terminals) 2025-02-17 01:07:33 +03:00
4489951e4e
Fix previous commit 2025-02-17 01:01:44 +07:00
01c8fa1ec0
Fix essence storage screen bar visually displaying wrong xp required 2025-02-16 18:51:20 +07:00
0aa3e413b9
Mark otm armors as armor in general in tags 2025-02-16 18:37:01 +07:00
4d8a097b64
Merge remote-tracking branch 'origin/1.21' into 1.21 2025-02-16 12:31:18 +07:00
78ae793ade
Add missing "enchantments" upgrade ops to energy sword 2025-02-16 12:31:04 +07:00
18e7d9bbb3
ну а так? 2025-02-16 00:46:34 +03:00
b1915248a9
infinite water source missing tooltip 2025-02-16 00:34:39 +03:00
e747143512
simple check for durability in item reconstructor 2025-02-16 00:34:01 +03:00
533cb16dbf oops 2025-02-15 17:28:21 +05:00
2f13ef6984 p 2025-02-15 17:27:56 +05:00
0a22a54a9b Update the pattern drive gui texture 2025-02-15 16:02:06 +05:00
d8e52f11a9 ..Wait 2025-02-15 14:07:38 +05:00
a455e54087 Color 2025-02-15 14:04:53 +05:00
ceb8f866b9 Remove the weird gap at the base of essence storage 2025-02-15 14:00:53 +05:00
7c1893268d Merge remote-tracking branch 'origin/1.21' into 1.21 2025-02-15 13:37:36 +05:00
704eea379f Pale yellow 2025-02-15 13:37:05 +05:00
058580ae10
Inverting recipes for reinforced redstone lamp? 2025-02-15 15:36:40 +07:00
b8e57fb130
Flywheel config values 2025-02-14 21:36:25 +07:00
3eec0f4419
Fix chemical generator skipping one tick under certain conditions 2025-02-14 21:31:28 +07:00
3e56730191
Select random slots when distributing energy in battery bank 2025-02-14 21:27:47 +07:00
1363efecd8
Add "enchantable" tag to tritanium armor 2025-02-14 18:33:43 +07:00
3bdff50f4d
More robust "is hovered" logic 2025-02-13 20:56:53 +07:00
dd3a08f47d
Fix sizeToContents not working properly when childrens are not docked 2025-02-13 20:56:18 +07:00
89c7295abb
Change frequency of large veins again 2025-02-13 13:13:26 +07:00
b5269db492
Nerf tritanium large vein further 2025-02-12 21:56:30 +07:00
124af53131
If game suffers "Wayland" illness, don't crash, but instead just disable functionality 2025-02-12 19:07:18 +07:00
d1a2f24d5a
Add missing "mineable" tags for flywheel parts 2025-02-12 17:59:41 +07:00
f214682074
Bump matter registry limit to 64 MiB 2025-02-12 15:53:06 +07:00
6acee0de08
Swap redstone for dilithium gems in advanced upgrade recipes 2025-02-12 11:23:35 +07:00
4c04c6c114 Merge remote-tracking branch 'origin/1.21' into 1.21 2025-02-11 19:47:18 +05:00
1afe1859e5 teehee 2025-02-11 19:46:53 +05:00
3cb604bd98
Changed my mind about wind up inefficiency of netherite 2025-02-11 21:36:47 +07:00
46d5a87582
Display two digits in flywheel material tooltip 2025-02-11 21:35:24 +07:00
43eb2b7ac8
Bump default cable throughput once again 2025-02-11 21:23:15 +07:00
537620ba6c
Add netherite as flywheel material 2025-02-11 21:18:43 +07:00
bbf0283219 Merge remote-tracking branch 'origin/1.21' into 1.21 2025-02-11 16:47:20 +05:00
5813a3ad65
Make "powered" cable display handle more edge cases 2025-02-11 18:13:19 +07:00
c1bdc28bef Another attempt at eliminating the "furry test" from dilithium ore item 2025-02-11 15:41:38 +05:00
f9bd671e88
Misc fixes regarding cable network node removals 2025-02-11 15:55:30 +07:00
fcc8fe157e
Fix cables getting stuck on "powered" blockstate when segments get split 2025-02-11 14:37:51 +07:00
be9641fc03
Try to search for better path when cabling changes even if current path set is sufficient 2025-02-11 13:54:23 +07:00
486060c8a4
Don't subscribe block entity to chunk if syncher has no entries 2025-02-11 13:49:48 +07:00
483c27d919
Further refine cable path search performance 2025-02-11 12:58:12 +07:00
89ca0fbce8
Improve cable path search performance when there are a lot of paths existing already 2025-02-11 11:12:11 +07:00
590f420c07
egg 2025-02-11 11:08:24 +07:00
18949d65c4
a 2025-02-11 11:05:44 +07:00
fdc9944c17
Don't oversearch paths when target block won't accept all energy sent 2025-02-11 10:51:52 +07:00
8544368ab2
Update cable heuristics 2025-02-11 10:48:25 +07:00
3f87459f35 version deez 2025-02-11 07:14:21 +05:00
c5c5b04c3f Merge remote-tracking branch 'origin/1.21' into 1.21 2025-02-11 07:13:47 +05:00
2948d58e94 Mr. President, the condor has hit the second fuel base! 2025-02-11 07:13:32 +05:00
d0d9b6ae79
Merge remote-tracking branch 'origin/1.21' into 1.21 2025-02-11 01:25:34 +07:00
e708d3e6b2
There is no need for "greedy" strategy when searching for extra cable paths 2025-02-11 01:25:30 +07:00
e68f3a7996
Improve performance on cable addition and removal from cable network 2025-02-11 01:12:58 +07:00
614ba26da6
Improve extra path search performance 2025-02-11 00:17:04 +07:00
bb9d5d9ae0
Throttle cable path searches 2025-02-11 00:09:18 +07:00
a2c9234501
давайте исходить из того, что железных палок у нас в моде нет, так что и рецепты показывать НЕ НУЖНО 2025-02-10 18:38:28 +03:00
1b865d8c5f
светло-серым мангал-дипломат
Окрашено в светло-серый
2025-02-10 18:06:20 +03:00
702ac7cebb PH frigate loot table 2025-02-10 14:01:45 +05:00
1f669ba2b2
Reduce count of ore in tritanium cloud 2025-02-10 15:50:02 +07:00
b116ae7f91
Flywheel material tooltips 2025-02-10 15:46:03 +07:00
e55b1da9cb
Proper flywheel data values 2025-02-10 15:03:52 +07:00
c18fa330a6
Update "unlocked by" of pattern drive 2025-02-10 14:54:03 +07:00
1e4769873d
Improve ambiguous wording in energy counter description 2025-02-10 14:46:09 +07:00
c87ec56307
Proper pattern drive recipes 2025-02-10 14:44:45 +07:00
5e6b8bb725
Replace ender pearls with dilithium gems in matter transform matrix recipe 2025-02-10 14:44:27 +07:00
acc182eb26
Greatly improve performance of clusterization by hinting that min/max should be performed with implied zero value 2025-02-10 14:19:25 +07:00
b1783343bc
Greatly improve upgrade recipes 2025-02-10 13:53:36 +07:00
356ca59f9b h 2025-02-10 06:50:05 +05:00
61343b416f
Properly disable clientside "Cancel all tasks" button in pattern screen when player is in creative 2025-02-09 13:51:07 +07:00
691fe66797
Yurie — Сегодня, в 13:42
да
я знаю
i don't care
2025-02-09 13:44:31 +07:00
996d6e8ed1
Add antimatter transform matrix to the end cities 2025-02-09 13:36:40 +07:00
cdc9e7b40b
Matter entangler recipe 2025-02-09 13:34:55 +07:00
57d67b2945
Multiblock parts recipes, mechanical parts item 2025-02-09 13:30:58 +07:00
5687b15426
Add missing cargo crates item tag contents 2025-02-09 12:45:40 +07:00
22b0e44634 Issued a new fleet of frigates 2025-02-09 06:42:47 +05:00
cbfd8001c7
Fix black hole generator has wrong multiblock update direction 2025-02-08 14:04:16 +07:00
d03991137e
Greatly improve performance of combined energy/matter storage in multiblocks 2025-02-08 13:59:37 +07:00
480fa7cf7c
Hmm yes reinforced redstone lamp is made of reinforced redstone lamp 2025-02-08 12:59:20 +07:00
05544df25b
Default chart text gravity to top left 2025-02-08 10:10:02 +07:00
5d232a28ed
Fix west/east being swapped in multiblock configuration 2025-02-08 09:50:39 +07:00
70fdf98d0f flywheel battery blocks textures 2025-02-08 04:20:54 +05:00
d1e14ddde6
Fix column arguments being swapped 2025-02-08 00:24:33 +07:00
a0f605c396
Workaround rare race condition related to setLevel racing with other minecraft code 2025-02-08 00:16:30 +07:00
b9d85b7b17
Replace exception with "short circuit" flag on cables 2025-02-07 21:43:53 +07:00
b10b1c0da4
Failsafe when blackhole block entity gets removed 2025-02-07 21:11:07 +07:00
7d075ccfc3
Merge remote-tracking branch 'origin/1.21' into 1.21 2025-02-07 19:54:35 +07:00
da13d77af3
⚙ SHOCKY — Сегодня, в 19:53
не могу
мультиблок
влепить текстуры что есть
ибо мультиблок ещё на машине Дбота
2025-02-07 19:54:17 +07:00
fb3b547b5d dilithium texture 2025-02-07 02:58:55 +05:00
c3c43d7af6
Fix error message 2025-01-23 12:35:11 +07:00
a93fe595be
Merge remote-tracking branch 'origin/1.21' into 1.21 2025-01-22 22:11:52 +07:00
b01dba2a21
Add generics to ColoredDecorativeBlock so manual casts are no longer required 2025-01-22 22:11:42 +07:00
b4c8676daa
Update comments 2025-01-22 13:27:13 +07:00
99ebeddae4 m 2025-01-21 23:04:17 +05:00
7a1edd5e4a Merge remote-tracking branch 'origin/1.21' into 1.21
# Conflicts:
#	src/main/kotlin/ru/dbotthepony/mc/otm/registry/game/MItems.kt
2025-01-21 21:29:36 +05:00
d03439b076
missing tags for dilithium crystal block 2025-01-21 17:03:51 +03:00
90aa1ee523
resources not components 2025-01-21 16:46:22 +03:00
975b540fe4
Deepslate Dilithium Kot 2025-01-21 16:42:38 +03:00
15417e65aa p 2025-01-21 17:00:22 +05:00
1a50ecd6af
Mark star chair as having description 2025-01-21 15:43:20 +07:00
f922df53be
Remove savedcountingmap as it is not used 2025-01-21 15:33:19 +07:00
fc675811be
Rename "content" to "game", as it better resemble what that package contains 2025-01-21 15:31:31 +07:00
0d9be21cff
Move more registry objects to subpackages 2025-01-21 15:21:31 +07:00
122ca66e65
Move MBlockEntities to subpackage 2025-01-21 15:08:21 +07:00
ca264e9292
Move MItems, MBlocks, MFluids and MCreativeTabs to content subpackage 2025-01-21 15:03:58 +07:00
5a5ef2cd68
YuRaNnNzZZ — 15.01.2025 17:56
надо наверное эмиссив прописать на модели активных кабелей
2025-01-21 03:25:02 +03:00
216a923b53
missing models 2025-01-21 03:06:58 +03:00
92df9579f0
multi-level pattern storages with upgrade recipes (upgrade ops)
AMD User — Сегодня, в 2:55
Юра пошёл делать upgradeops

AMD User — Сегодня, в 2:56
MLC
TLC
YuRaNnNzZZ — Сегодня, в 2:56
верно
AMD User — Сегодня, в 2:56
А потом не меняя цены меняем на QLC
Втихую
2025-01-21 02:59:57 +03:00
bf87d48254
require mekanism loaded for mekanism painter recipes 2025-01-20 19:32:12 +03:00
76cb2c83f0
лишнее 2025-01-20 17:15:56 +03:00
495447648f
Split loot tables file 2025-01-20 20:46:14 +07:00
4888dad2dd
Split tags file into several files 2025-01-20 20:40:30 +07:00
6de80d792e
Bump bottom limit of how spread out ore is in large tritanium vein, as well make it appear less often 2025-01-20 20:26:09 +07:00
e63bbb79d2
Dilithium ore and crystals 2025-01-20 20:22:55 +07:00
e331790a71 Armor assembly 2025-01-20 15:07:25 +05:00
6661384dfd add a few pixels on upgrade textures 2025-01-20 15:06:40 +05:00
4898d18112 h 2025-01-20 13:25:57 +05:00
32f3803cb9 :wires: 2025-01-20 13:04:46 +05:00
75e9b782fa Merge remote-tracking branch 'origin/1.21' into 1.21 2025-01-20 12:40:14 +05:00
bbb8471d26 Texture tweaks 2025-01-20 12:39:57 +05:00
a47ec64cbb
Ronna and Quetta SI prefixes 2025-01-20 08:41:53 +07:00
3f91e554cb
Throttle "powered" cable updates even further when it doesn't oscillate 2025-01-19 23:12:18 +07:00
a9b191eb72
Greatly improve cable network segment slicing and splicing 2025-01-19 22:51:37 +07:00
aa41647c04
Speed up cable Segment splitting 2025-01-19 21:12:59 +07:00
9579bc6a0c
LinkedHashSet instead of ObjectLinkedOpenHashSet for update performance
because LinkedHashSet uses linked list, while ObjectLinkedOpenHashSet use sequential array of keys
2025-01-19 20:56:32 +07:00
20b3fe78ba
Further reduce amount of small tritanium patches 2025-01-19 15:12:42 +07:00
2e2af1bc69
Reduce amount of regular tritanium ore in deepslate layer 2025-01-19 15:12:01 +07:00
d528f8465c
Tritanium cloud/ellipsoid ore distribution 2025-01-19 15:10:46 +07:00
35e871890c
Move DecimalProvider to data.world subpackage 2025-01-19 13:30:58 +07:00
6fc26c869a
Move codecs to subpackage 2025-01-19 13:28:54 +07:00
77821768bc
Better tritanium ore placement 2025-01-19 13:22:56 +07:00
c8c8e75b62
Update cables throughput values and recipes 2025-01-19 10:45:53 +07:00
b0bf4adb0f
Not/Normal Pill along Suspicious food 2025-01-19 01:58:18 +07:00
78896089ec
Update deprecated method usage 2025-01-19 01:50:37 +07:00
e53a7f65d8
Add JEI search aliases 2025-01-19 01:44:34 +07:00
8c4e2b1ea6
Add portable grill to smoking catalysts 2025-01-19 01:34:24 +07:00
4ef66dff7c
Don't sort cable paths when simulating transfer 2025-01-18 16:11:17 +07:00
7846b3f5a4
amongus 2025-01-18 16:01:06 +07:00
c36690fe94
Bump max lines limit 2025-01-18 15:36:27 +07:00
38227bc937
Add back proper on-block level gauge textures 2025-01-18 15:28:33 +07:00
bc9a78c514
Visual and audio feedback when trying to type stuff out of bounds
Add creative holo sign bounds
2025-01-18 13:45:00 +07:00
082f1478f5
Switching battery mode by right clicking while holding shift 2025-01-16 20:02:23 +07:00
805e760c52
💀 2025-01-15 22:26:59 +07:00
eeea537715
Fix splitted segments getting attached to unrelated paths 2025-01-15 21:53:33 +07:00
bd4fe17e33
Increase cable visuals update frequency the more it oscillate during last 17 ticks 2025-01-15 21:52:30 +07:00
b4e37fbd1f
Cable segment merging 2025-01-15 21:27:13 +07:00
90dc125b1b
Fix cable wrong "transferred" calculation 2025-01-15 20:32:06 +07:00
6fb9f4474e
Use linked hash set for cable internals, which improves iteration performance 2025-01-15 13:08:49 +07:00
655a9c541e
If multiple paths exist to target, and they differ in throughput, now cables will combine their throughput 2025-01-15 11:44:52 +07:00
61eab5fb37
Multi path in cable system 2025-01-15 09:59:13 +07:00
436456dcc5
Fix cable path heuristics 2025-01-14 18:27:20 +07:00
07121d8b41
Fix crash in addLivelyNode 2025-01-14 18:19:44 +07:00
43afa73df7
Minimally functional segmented power network, with functional per-tick limited throughput 2025-01-14 16:55:36 +07:00
0673fbf352
Merge remote-tracking branch 'origin/1.21' into 1.21 2025-01-11 10:24:06 +07:00
c0b8488afd Railing 2025-01-10 19:42:10 +05:00
2067c9cceb h2 2025-01-10 18:59:55 +05:00
9c834e21e7 Merge remote-tracking branch 'origin/1.21' into 1.21 2025-01-10 18:33:43 +05:00
140eecf57d h 2025-01-10 18:33:29 +05:00
3f75e40e9c
Merge remote-tracking branch 'origin/1.21' into 1.21 2025-01-10 20:02:31 +07:00
5f6da754f9
I just need multiblock rendering
Have to add a little multiblock rendering
Are you okay? - Yeah, i just need to `add a little more multiblock rendering`
Rend-er-ing
Rend
and R in ING is RENDER-MAN
Hard Rendy the Bender Render Fender
2025-01-10 20:02:25 +07:00
d8744841d9
powered energy cables blockstate, БАГНУТАЯ ХУЙНЯ!!!!!!!!!!!! 2025-01-10 15:05:28 +03:00
057977f4a4 swap cable states since there aren't any atm 2025-01-10 16:08:47 +05:00
b2ee766194
генерация моделей мусора и полосок опасности вместе с блокстейтами 2025-01-09 20:47:59 +03:00
5dd4c027a9
если вы ещё не поняли что я ненормальный 2025-01-09 20:11:54 +03:00
e7ae4977d3
да и остальное тритановое тоже 2025-01-09 19:57:30 +03:00
12d63e962f
двери с люками тоже. и некрашенные блоки с полоской 2025-01-09 19:49:28 +03:00
cc8a149c25
генерация colomposed текстур и автотрек текстур для датагена 2025-01-09 19:34:32 +03:00
13d76df9fa
генерируем перекрашенные текстуры в рантайме
AMD User — Сегодня, в 15:29
no wae
imagemagick in my meinkraft coed!!1?/
2025-01-09 15:50:50 +03:00
b7f1f34b9c Ok party pooper 2025-01-07 19:28:13 +05:00
05907276e1
Fix blackhole generator guide not drawing when main block if off-screen 2025-01-07 19:26:29 +07:00
7403edf157
Bump holo sign survival limits 2025-01-07 18:29:58 +07:00
9621356682
Captain Redstone Keyes 2025-01-07 18:17:03 +07:00
6f67912041
Fix spontaneous crashes in android station screen 2025-01-07 16:22:31 +07:00
ffa0e3d6d5
Add briefcase grill to condensed creative compat 2025-01-07 15:46:28 +07:00
cf021a5260 Merge remote-tracking branch 'origin/1.21' into 1.21 2025-01-07 02:26:32 +05:00
dc523973b0 forgot 2025-01-07 01:44:01 +05:00
d69eef7464 New power cables, the texture contains both unpowered and powered states, and I have no idea how to handle this, also the UVs on them are still wrong, the second half of the cable texture is not used at all. 2025-01-07 01:40:30 +05:00
db01f126f4 texture updates 2025-01-07 01:38:38 +05:00
78a1fecf92 Please replace danger stripe with these 50/50% 2 variant textures, I have no idea where the blockstates are to make it 2025-01-07 01:37:30 +05:00
b52b49a468
Allow computer terminal tick timer to be changed 2025-01-07 00:42:05 +07:00
0298968042
Mark alignButtons as private 2025-01-07 00:05:13 +07:00
65cbaf95b1
Button for manual stored experience drain from machine 2025-01-06 16:45:03 +07:00
c5edd9ff59
Briefcase grill config 2025-01-06 12:53:16 +07:00
dfeb638b7c
Experience storage for briefcase grill 2025-01-06 12:46:22 +07:00
7c35c284cd
Briefcase grill 2025-01-05 23:50:43 +07:00
a09795ad74
Improve sizeToContents() 2025-01-05 16:35:21 +07:00
057c97fae9
Give enough heap during test because neoforge now finally launches game before launching unit tests
THIS also means, we can FINALLY unit-test pieces which rely on game being initialized
2024-12-25 07:55:51 +07:00
2dd93da8bd
бары энергии и материи в тултипах предметов
AMD User — Сегодня, в 17:27
Ты успел быстрее меня это сделать
2024-12-12 17:55:09 +03:00
ab83fc9d45
развернул. но всё равно всрато 2024-12-12 17:45:16 +03:00
9689153910
вовращаем меканизм + бамп версии неофбабрика + рецепты покраски для красителя из меканизма #203 2024-12-12 07:58:55 +03:00
3cbc7b417f
hide layers in f1 2024-12-12 06:44:40 +03:00
7a5ce91995
switch hud elements to gui layers 2024-12-10 07:07:24 +03:00
72b1b5550d
AMD User — Сегодня, в 6:50
Просто вынеси в верх тика
Итерацию
2024-12-10 06:52:24 +03:00
65b328a577
мини-игра: найди крысу 2024-12-09 23:33:08 +03:00
4101f0e184
Merge remote-tracking branch 'origin/1.21' into 1.21 2024-12-06 13:06:27 +07:00
3b53369598
https://tenor.com/view/kobold-dota-2-dota-gif-11237083995805096987 2024-12-06 13:06:13 +07:00
8d0aa38b91
it's not static anymore ??? 2024-11-19 04:37:18 +03:00
3b758def8d
change worldedit file to neoforge compatible one
FINALLY 0 WARNINGS IN RUNCLIENT
2024-11-19 03:42:46 +03:00
1712f92335
Kotlin for Kotlin (switch to KFF loader) 2024-11-19 03:40:18 +03:00
991582f930
Kotlin for (Neo)Forge 2024-11-19 03:12:26 +03:00
3b769fdfd1
Increase width of painter window by 44 gui pixels 2024-11-16 11:22:02 +07:00
08061a69c5
Fix tooltips of device controls panel 2024-11-16 11:18:35 +07:00
acd5c06b7a
Rollback text input panel dimensions change 2024-11-16 11:17:17 +07:00
87de48fffe
Fix "upgrades" button width 2024-11-16 11:16:49 +07:00
a92b893bc9
Fix fluid tank item crashing server during save 2024-11-16 11:13:09 +07:00
9daa3df589
Fix fluid tank not working properly with items 2024-11-16 10:51:27 +07:00
f870c2cefc
Use dist provided to constructor 2024-11-15 17:22:58 +07:00
9820505c0d
Update black hole placement code 2024-11-15 16:56:33 +07:00
89aa300b9b
Merge remote-tracking branch 'origin/1.21' into 1.21 2024-11-15 15:24:46 +07:00
4fa46505b6
Improve performance of clusterization used in chart rendering 2024-11-15 15:24:38 +07:00
ac2c387601
Switch energy counter chart guiding line to clustering too 2024-11-15 14:38:14 +07:00
7664b0b4de
Significantly improve chart clarity in tooltips 2024-11-15 13:41:16 +07:00
0d250dea2f
это не руда, это ворлдген.
потвикал значения (но шанс наверное всё равно уменьшить надо)
2024-11-14 21:46:19 +03:00
6713adcfe9
ГЕНЕРАЦИЯ ЧЁРНЫХ ДЫР ПОЯВИЛАСЬ РАНЬШЕ ЧЕМ МАНГАЛ ДИПЛОМАТ
// TODO: ЭТО НЕ РУДА
// TODO: твикнуть значения (очевидно)
2024-11-14 08:25:50 +03:00
46d04a4217
Merge remote-tracking branch 'origin/1.21' into 1.21 2024-11-13 18:52:04 +07:00
ab5a2275c2
Singularity generator operation modes, inject rate, (visual) radio button 2024-11-13 18:51:58 +07:00
13a9f58b74
сжимаем капсулы и баки
сам ты жидкостная бака
2024-11-12 07:31:21 +03:00
fef11d3bdc
заменил 2024-11-12 06:29:49 +03:00
13a7829016
не ну раз уж я начал закидывать итемблоки в .block тогда и этот туда же логично? логично. 2024-11-12 06:11:19 +03:00
0f77ed34c2
рецепты и тултип для энергетических кабелей
Konstantin Linev, [6:01]

Konstantin Linev, [6:02]
Но имеет смысл
2024-11-12 06:04:01 +03:00
fc76e0fbcb
рецепт ящикатора 2024-11-12 05:22:31 +03:00
71094aed76
Remove ad astra compat config 2024-11-11 09:22:15 +07:00
eb38466467
Allow to use scroll wheel to switch enum button mode 2024-11-10 14:16:00 +07:00
a50cad6832
Refactor buttons to have more streamlined hierarchy 2024-11-10 14:10:27 +07:00
583b9dc208
"Draw building guide" checkbox 2024-11-07 13:11:15 +07:00
6f75ca785d
Fix various block entity rendering issues 2024-11-05 23:15:51 +07:00
6c5b7fc72f
Fix energy hatches not ticking 2024-11-05 22:34:08 +07:00
7bf309173f
Allow only gravitation stabilizer between injectors and blackhole, require empty space between collector and blackhole 2024-11-05 22:25:31 +07:00
cdfa529d7b
Updated gauge design, horizontal matter gauge, added missing gauges to menus 2024-11-05 22:03:11 +07:00
868cd753d5
dockGravity 2024-11-05 17:43:10 +07:00
56e2e70a5c
"Low power" HUD element 2024-11-03 12:21:12 +07:00
604999ebe3
Don't wrap blockstate and blockentity in lazy 2024-10-30 20:59:58 +07:00
35ae7ed88a
Merge remote-tracking branch 'origin/1.21' into 1.21 2024-10-30 20:54:53 +07:00
58af515f9a
Black hole generator test (for real this time) 2024-10-30 20:54:41 +07:00
b832873203
Fix WriteOnce not properly handling nulls 2024-10-27 10:35:20 +07:00
bb7d3425f4
рендерим текст во всю ширину блока
font.width выдаёт ширину на 1 пиксель больше, так что чем больше текст тем больше смещение от этого самого пикселя
2024-10-24 06:26:30 +03:00
29ab315e43
УРА БОЛЬШЕ ВСРАТЫХ ИКОНОК (перенос чекбокса блокировки содержимого вправо + тултип для переключения ресайза) 2024-10-24 05:54:08 +03:00
84da57719d
переключение скейлинга текста в табличке
(и всратая палитра на иконку выбора цвета)
2024-10-23 20:50:31 +03:00
5913f56fb0
автоскейлинг текста на табличках (пока не переключаемый)
AMD User — Сегодня, в 11:36
Изображение
наверное ветер
2024-10-23 11:47:28 +03:00
74f75ebfc6
лёгкий нёрф молотка для крафта пластин, теперь максимум стак на 1 молоток 2024-10-17 03:53:45 +03:00
0e1dcbf1fe
попытка пофиксить отсутствующие блоки в структурах 2024-10-16 00:32:02 +03:00
434f06be7f
костыли от костылей (для костылей) 2024-10-15 18:32:23 +03:00
35b8652161
командная работа
- вычленение команд в отдельные файлы
- команда /android теперь может выдавать/забирать исследования
2024-10-11 22:21:13 +03:00
04b71b7cc8
защита от мгновенного сдува наноботов постоянным уроном (кактус, магмаблоки) 2024-10-11 21:00:46 +03:00
e2d4f810d4
Move chart levels text to left 2024-10-11 14:10:13 +07:00
fb573cb483
Optimize Air/NotAir 2024-10-10 21:50:35 +07:00
7d088d6433
Multiblock docs 2024-10-10 20:30:57 +07:00
36ec7855f0
Move black hole generator controller block to blackhole subpackage 2024-10-10 12:19:32 +07:00
876c6180cb
Remove widget2panel text input wrapper 2024-10-10 12:12:11 +07:00
b80da0e214
Energy counter limit input using panel instead of widget 2024-10-08 12:10:46 +07:00
064fbd0f36
/clear command should also remove exopack energy and battery 2024-10-08 09:53:58 +07:00
5299c20970
Ah yes, matter slots 2024-10-08 09:42:18 +07:00
e13ab9f087
Merge remote-tracking branch 'origin/1.21' into 1.21 2024-10-08 09:40:06 +07:00
0049cd4d06
real player [REAL] 2024-10-08 04:55:05 +03:00
358287df9c
real player 2024-10-08 03:45:42 +03:00
b3bc98b187
AMD User — Сегодня, в 3:32
Я специально это фиксил
Но спасибо что убрали fakeplayer базу
Теперь я хз как это фиксить
2024-10-08 03:36:40 +03:00
385a00c55b
do not recreate exopack menu if it's not ready 2024-10-07 15:24:23 +03:00
bdb34ba28f
Add little padding 2024-10-07 19:22:55 +07:00
1c3fc4e6e6
Chart smooth bends 2024-10-06 20:44:24 +07:00
d0e6ab2829
Yurie — Сегодня, в 22:02
Переслано
Единица энергии странная какая-то
2024-10-05 22:03:33 +07:00
0f2da66816
Merge remote-tracking branch 'origin/1.21' into 1.21 2024-10-05 20:56:53 +07:00
7d0b257928
Chart rendering right on energy counter 2024-10-05 20:43:00 +07:00
35769e5b57
a 2024-10-05 19:40:34 +07:00
37cd1600ab
Stateful dont have to inherit nullable tag types 2024-10-05 10:36:15 +07:00
c80954aea9
loot for vaults (and matter dust loot randomizer) 2024-10-04 19:44:55 +03:00
5bc104b04d
Fix "negative infinity only" case not being correctly handled in history chart rendering in tooltips 2024-10-04 17:14:31 +07:00
a43521c579
Fix negative numbers being displayed wrong 2024-10-04 17:07:27 +07:00
41431a13bd
Merge remote-tracking branch 'origin/1.21' into 1.21 2024-10-04 13:42:01 +07:00
e7ded02d30
Charts in storage tooltips 2024-10-04 13:41:55 +07:00
6112504cf5
data-driven insanity (зачарки) 2024-10-04 04:33:32 +03:00
545bbbd9ed
локализация.....
да.
2024-10-04 02:46:27 +03:00
a193cc83c0
автосейв конфига украли! значит будем сами 2024-10-04 01:14:57 +03:00
ad3a3d94c4
бордеры хочу. 2024-10-03 23:43:40 +03:00
693075d600
Fix blackhole stats rendering outline 2024-10-02 11:59:17 +07:00
4bbcbc8ea6
Less confusing time frames for charts 2024-10-02 11:15:29 +07:00
5898ae0b19
Add "approximate total" to chart tooltips 2024-10-02 10:59:55 +07:00
4e3cf276e9
Add chart time window translations 2024-10-02 10:46:01 +07:00
0f1c1f1653
Bump checked Kotlin version to 2.0.0 2024-10-02 10:44:23 +07:00
bc3492bae3
Update readme 2024-10-02 10:44:11 +07:00
52968ffb1f
Fix crash caused by fair and balanced new item components behavior 2024-10-01 20:08:43 +07:00
cea43a6ac6
Chart "ago" label 2024-10-01 19:57:11 +07:00
184203ee20
Chart levels 2024-10-01 15:13:42 +07:00
badcc5d3d5
Rename GraphRendering -> ChartRendering 2024-10-01 09:38:37 +07:00
ac9095b58d
"Fix" chart rendering winding when rendering straight lines 2024-10-01 09:35:41 +07:00
5ea1b5d004
step 1. add a component 2024-09-29 23:55:40 +03:00
1ae3be6499
Since bad recipes are usually outside of user's control, don't choke and die on them, just log problematic recipes and move on 2024-09-29 11:22:56 +07:00
19a7a8ddf6
Rename Graph to Chart, insanely more memory efficient chart networking 2024-09-24 22:52:22 +07:00
e49a65a2de
Merge remote-tracking branch 'origin/1.21' into 1.21 2024-09-22 18:09:13 +07:00
51f2c21f2d
Rename width/height to canvasWidth/canvasHeight to clarify 2024-09-22 17:52:24 +07:00
a6ff93d74c
"Diagram" basic rendering code, added gui icons for energy counter 2024-09-22 17:51:15 +07:00
8ec175ad90
AMD User — Вчера, в 3:15
Shovel
2024-09-20 01:34:08 +03:00
f8e3fb156c
я вам запрещаю репликацию 2024-09-20 01:33:25 +03:00
a38e1c1548
стул без данных клиенту не нравится
НЕ ТИКАЙ НЕ СВОИМ СТУЛОМ, ЭТО СЕРВЕРНЫЙ
2024-09-18 18:00:41 +03:00
6291cecb7e
How i missed this i have no idea 2024-09-18 17:47:54 +07:00
dc1cf56ed9
YuRaNnNzZZ — Сегодня, в 15:54
а где у этой брони прочность??????
2024-09-16 16:41:01 +03:00
16f5f4c9c9
Improved syncher API, proper history graph class 2024-09-14 19:10:40 +07:00
a06fd6a31a
воцыа9гыаоу2п
ппи8ва729уц2улв
цыпцуле94пыва
ашпцувлцйа
аша94аца
в9н3р3
ццццццццццццццццццццццццццццвааупъма
аа
пм
м

мравркр
ук
ц
йке
пцу
рпыв
пр
варп
2024-09-14 18:55:09 +07:00
fdf8e47e5e
Align power/matter history by biggest values 2024-09-11 20:01:54 +07:00
759c9863e2
U sure? 2024-09-10 07:17:36 +07:00
5995993542
Merge remote-tracking branch 'origin/1.21' into 1.21 2024-09-10 07:16:58 +07:00
2f5981b3de
+0 Attack Damage 2024-09-09 17:09:54 +03:00
bb7dd7f39d
Yurie — Сегодня, в 5:07
экран фейковый, крашеный тританий
2024-09-07 09:43:08 +07:00
f8006b7b49
Declare as concrete types 2024-09-07 09:39:12 +07:00
9683e53115
Make computer terminal behave like redstone button 2024-09-06 21:00:32 +07:00
e6387d7d5b
вам надо для приготовления рецепта: 2024-09-06 20:13:09 +07:00
481f36c04a
Bump JEI 2024-09-05 19:16:20 +07:00
dbdc575c6c
epic remap fail 2024-09-05 02:36:52 +03:00
bf37573f35
вы больше не кормод 2024-09-05 02:32:02 +03:00
5b1540df07
YuRaNnNzZZ — Сегодня, в 17:32
Изображение
мб куриосы откинуть тоже в фолдабл слоты?
косметик которые
ОДИН ХУЙ НИХУЯ НЕ РАБОТАЕТ НОРМАЛЬНО, ХУЖЕ НЕ БУДЕТ
<----------- Clueless
2024-09-04 23:00:00 +03:00
20567a7154
Improve readability of "auto balance" icon 2024-09-04 22:40:27 +07:00
724c5751c6
Fix red slash on "dont balance" icon not matching pixels of similar icon "ignore redstone signal" 2024-09-04 22:30:42 +07:00
c6bf2ab6a3
Add "dyed with" neoforge tags to items 2024-09-04 22:09:54 +07:00
57e42fef33
Precise color setting on color wang using mouse scroll wheel 2024-09-04 15:45:59 +07:00
b208ca1358
Uncolored tritanium blocks all stripe variants 2024-09-04 15:28:32 +07:00
a64010fc85
я забыл количество кабелей на выходе........... 2024-09-03 21:00:13 +03:00
11a5bdf442
стул функционирует!!!!!!!!!! 2024-09-03 03:51:25 +03:00
7bcc1e37e2
стул. пока без функционала 2024-09-03 02:44:18 +03:00
7e9352e60a
Fix slot charge flags being lost during deserialization due to internal changes in CompoundTag code 2024-09-02 20:31:02 +07:00
f3dbcb0dd5
Fix public self remote endpoint not being invalidated 2024-09-02 20:19:28 +07:00
a460a1fc98
Fix double wrapping 2024-09-02 20:18:45 +07:00
aa461c322f
Use CopyOnWrite for panel lists, update panel isHovered to be more reliable, fix FoldableSlotPanel 2024-09-02 19:31:56 +07:00
d7b7ab9a67
broadcastChanges was called on client (even in vanilla code) all this time and found out only now :) 2024-09-02 18:44:52 +07:00
f254d68ec4
fade armor toggle button when not hovered 2024-09-02 05:27:12 +03:00
8b7e3821b4
exopack curios compat improvements 2024-09-01 21:50:34 +03:00
68fedf0257
Fix mattery container not deserializing properly 2024-09-01 18:21:55 +07:00
6ce2181a95
Lock upgrade slots when machine is working 2024-09-01 18:05:34 +07:00
d5027981ca
Mark otm version as 1.5 2024-09-01 13:13:16 +07:00
dc684f5138
Bump kommons 2024-09-01 10:56:00 +07:00
bade31683e
*запускает dota 2* 2024-08-31 14:38:51 +03:00
5c91b1cc8b
fix exopack projectile mixin
YuRaNnNzZZ — 27.08.2024 17:19
Replace "forge" with "fbabric"
2024-08-31 14:26:42 +03:00
cb7cb9991f
glitch renderer mixin fix 2024-08-31 14:15:36 +03:00
717bf4cea1
Require water when re-painting stuff 2024-08-31 16:43:42 +07:00
17d08bd901
Spelling 2024-08-31 16:06:45 +07:00
c4b7f6e78e
year 2024, forge still fires events for gui layers which are not rendered 2024-08-31 14:39:01 +07:00
aac28a4704
Fix registry packets 2024-08-31 14:34:38 +07:00
e2115397fe
Workaround very good decision of mojank to strip client classes from server 2024-08-31 14:20:30 +07:00
90da43ec49
Use global buffer source 2024-08-31 14:12:18 +07:00
e88c2ba9b0
Move tritanium loot tables to datagen 2024-08-31 14:06:40 +07:00
6f9132ee8c
Fix tritanium ore having wrong tag 2024-08-31 14:06:29 +07:00
ae3fef941b
руда. 2024-08-31 07:55:52 +03:00
518a9fc3bf
ПРОЗРАЧНАЯ СЕТКА? 2024-08-31 07:23:14 +03:00
0cd5867063
ещё пару блокстейтов в датаген 2024-08-31 07:09:18 +03:00
3d80a1e069
Merge remote-tracking branch 'origin/1.21' into 1.21 2024-08-31 10:50:53 +07:00
577ea070db
Fix block entity synchers sometimes not ticking 2024-08-31 10:50:45 +07:00
d38c780fdd
thanks NeoFrogge NeoForge NeonForges 2024-08-31 10:38:06 +07:00
3dd7583d4e
Update DynamicBufferSource hooks 2024-08-31 10:31:42 +07:00
09320efa73
Merge branch '1.21' of https://git.dbotthepony.ru/DBot/overdrive_that_matters into 1.21 2024-08-31 06:28:29 +03:00
eeef87dcd1
давайте просто не будем хранить нбт блока который якобы декор 2024-08-31 06:28:05 +03:00
23029e1d43
Fix ItemFilter#set rejecting unsetting filter slots 2024-08-31 10:20:25 +07:00
4e1d2aade7
AAAAHHHHHHHHHHHH 2024-08-31 10:16:52 +07:00
35c9414572
Ah yes 2024-08-31 10:16:13 +07:00
b3ca648be5
Merge remote-tracking branch 'origin/1.21' into 1.21 2024-08-31 10:10:45 +07:00
4d44bd0f67
Specify defaults for item filters 2024-08-31 10:10:10 +07:00
5bdaa8cc88
Allow partial results from codecs in Savetables 2024-08-31 10:01:45 +07:00
cb99fbe749
moved and upgraded structures 2024-08-31 05:51:11 +03:00
64b8956c80
Add missing sound subtitles 2024-08-31 09:48:32 +07:00
c5945723fa
Update energy servo multipart model 2024-08-31 09:47:01 +07:00
a07d5131e3
AMD User
—
09.06.2024 11:41
на размышление даётся ctrl c ctrl v
2024-08-31 03:37:55 +03:00
3624690456
Merge branch '1.21' of https://git.dbotthepony.ru/DBot/overdrive_that_matters into 1.21 2024-08-30 18:47:00 +03:00
aa9c6039dc
o-k 2024-08-30 21:41:32 +07:00
d792063fd0
not bad 2024-08-30 17:41:19 +03:00
7b284f3303
ОНО ПРОЗРАЧНОЕ БЛЯТЬ 2024-08-30 17:00:05 +03:00
f1d011d7c4
missing shapes 2024-08-30 16:53:47 +03:00
85279c4de8
датаген - кабель материи + тонкий кабель (база) 2024-08-30 16:47:25 +03:00
b5d7d99c63
датаген - добив рецептов 2024-08-30 16:40:52 +03:00
7a1becf071
Mark "refusing to add tickable" as debug line 2024-08-30 19:56:03 +07:00
b65c80d55e
Fix flipping Ticker#isEnabled more than twice on same tick causing it to be added twice to ticking list 2024-08-30 19:50:39 +07:00
bc75b61852
Fix CapabilityCache not calling "invalidated" listeners on first cache initialization 2024-08-30 19:39:20 +07:00
83baf5a8a0
Fix cables blockentitytype not having proper block defined 2024-08-30 19:23:22 +07:00
5a6a88e65b
Reimplement "open/close" capability state 2024-08-30 19:05:24 +07:00
9fb57259bd
Fix CapabilityCache reporting wrong block position and direction 2024-08-30 18:32:38 +07:00
f3b6926a45
Make mattery container actually serialize data 2024-08-30 18:25:45 +07:00
fbfca5d937
Operate on panel list copy 2024-08-30 17:43:03 +07:00
8551e2fa64
Fix machines not getting capabilities 2024-08-30 17:25:09 +07:00
859d72defb
Forgor ImmutableMap does not allow null keys 2024-08-30 17:05:28 +07:00
5247771843
Remove SimpleTritaniumArmorItem as class as it does nothing 2024-08-30 16:59:53 +07:00
1d17e59131
Merge remote-tracking branch 'origin/1.21' into 1.21 2024-08-30 16:56:35 +07:00
cd0f52c90a
Use ImmutableMap 2024-08-30 16:56:30 +07:00
61042b574e
fix default armor color + armor textures 2024-08-30 12:55:32 +03:00
940801d247
Fix SupplierMap not preserving order of keys 2024-08-30 16:52:48 +07:00
158f68e068
ah yes 2024-08-28 20:50:00 +07:00
98a4e91df3
put global render state update at bottom or something 2024-08-28 19:50:33 +07:00
d1f5ed3916
RenderSystem.disableBlend() inside clearDepth 2024-08-28 19:17:52 +07:00
16fdd39ac6
Bump JEI and "minecraft" 2024-08-28 19:17:43 +07:00
af0cc383e5
TranslatableContents' arguments must be either a Component, Number, Boolean, or a String. Was given 5fe287af-95ca-46ac-a624-c2f4abc46362 for otm.item.quantum_link_id 2024-08-28 18:32:02 +07:00
5af896e476
Update FLUID_STACK component to use SimpleFluidContent 2024-08-28 18:19:07 +07:00
0446e5adb3
Update js coremods signatures 2024-08-28 18:10:43 +07:00
60429c35b2
Condensed Shit 2024-08-28 12:00:26 +03:00
d9a83dc52b
neofbabric 2024-08-28 10:49:50 +03:00
fa5b6c2840
Make neoforge creative tab checker happy 2024-08-28 00:31:57 +07:00
85e477f386
Update decimal singletons to make neoforge component checker happy 2024-08-28 00:02:01 +07:00
da0f5d544b
Fix wrong sanity check condition 2024-08-28 00:01:44 +07:00
8abd17b670
Optional itemstack stream codecs, for some reason 2024-08-27 23:46:38 +07:00
dc3484d69a
oops 2024-08-27 23:44:00 +07:00
15618622ab
Update a bunch of models to use neoforge constructs 2024-08-27 23:41:50 +07:00
3b06e71fc0
Comment out level renderer patch 2024-08-27 23:41:34 +07:00
8f609b7801
Fix startup crash caused by duplicate rendertypes in vanilla game 2024-08-27 23:41:06 +07:00
f19949b9d6
Move custom stat registration to deferred registrar 2024-08-27 22:34:20 +07:00
d10c7d7829
Fix postLevelTick not listening for proper subclass 2024-08-27 22:32:14 +07:00
a6f7249b54
Fix energetic and matter recipe types of matter entangler wasnt registered 2024-08-27 22:28:40 +07:00
5ce88f7916
Disable POI patch for now 2024-08-27 22:26:37 +07:00
81079a8565
Fix double initialization of android features registry 2024-08-27 22:23:50 +07:00
02db21cde9
Move criteria triggers registration to deferred register 2024-08-27 22:20:54 +07:00
3f77b86bd5
Fix duplicate name 2024-08-27 22:08:06 +07:00
434db48dfd
Bump kommons 2024-08-27 22:04:24 +07:00
d13806d751
Ignore /runs whole 2024-08-27 21:38:35 +07:00
fa3d754455
Update AbstractHurtingProjectile signature 2024-08-27 21:33:30 +07:00
b939f7b020
Update js coremods import 2024-08-27 21:32:17 +07:00
5085fccf14
Update various files to make mod run 2024-08-27 21:30:42 +07:00
7019fe9025
Replace "forge" tag namespace with "c" 2024-08-27 21:19:01 +07:00
657707409d
Make mod compile against 1.21 2024-08-27 21:15:47 +07:00
21f285ca0f
Make main source set compile against 1.21 2024-08-26 20:21:28 +07:00
e3990d7fb5
Update mixins 2024-08-26 20:15:39 +07:00
cb276da292
Make main kotlin source set compile against 1.21 2024-08-25 21:46:04 +07:00
beb09107e3
Workaround K2 compiler bugs related to generics 2024-08-25 21:44:31 +07:00
7e3764e466
aeugh 2024-08-25 21:00:51 +07:00
03244dc630
Update battery bank renderer 2024-08-25 21:00:18 +07:00
4120660ebc
Update MatteryInventoryChangeTrigger 2024-08-25 20:53:55 +07:00
567e03498e
Kind of update dynamic buffer source, but question is, do we still need it 2024-08-25 18:33:24 +07:00
2323854705
Update CopyTileNbtFunction 2024-08-25 13:25:32 +07:00
cb85689ea9
Updates for global registry 2024-08-24 12:15:42 +07:00
12b59ed785
aeugh 2024-08-24 12:09:47 +07:00
0631287d4f
Update chest upgrader item 2024-08-24 12:07:23 +07:00
e3bbc9a51e
Update matter entangler jei compat 2024-08-24 12:00:56 +07:00
d3e9bfe579
Update tirtanium doors and pressure plate 2024-08-24 11:49:04 +07:00
8c78bef33c
Update JEI compat 2024-08-23 20:40:35 +07:00
42124896d4
Bump KFF and Kotlin 2024-08-23 20:40:30 +07:00
4a17a5dc2b
Bump JEI 2024-08-23 20:25:34 +07:00
381ca7dc2d
Update slotChangedCraftingGrid signature 2024-08-23 20:23:38 +07:00
c6d231753a
Update CAS compat 2024-08-23 20:17:34 +07:00
8bc326f082
how did i add forge version of cas and not neoforge 2024-08-23 20:15:33 +07:00
b38d34860c
Update client event hook 2024-08-23 20:12:37 +07:00
302076b90b
Update PhantomAttractorBlock 2024-08-23 20:10:58 +07:00
350c1cc0a9
Update cargo crate block entity 2024-08-23 20:07:47 +07:00
d24cf38b17
Bump cosmetic armor 2024-08-23 16:44:59 +07:00
7e08ee8064
Update essence storage 2024-08-22 22:53:12 +07:00
81107561c0
aeugh 2024-08-22 22:05:48 +07:00
9aac749513
thatwaseasy.wav 2024-08-22 18:14:31 +07:00
7cb6949e27
Update matter entangler recipe, replace ingredient matrix with helpers over shaped recipe pattern 2024-08-22 18:13:16 +07:00
e80947d8d7
Update cooking recipe 2024-08-21 20:37:20 +07:00
bec6f65636
Update painter menu 2024-08-21 20:15:01 +07:00
87b87b9b82
Fix armor materials 2024-08-21 17:56:01 +07:00
64ba95e305
Update painter recipe 2024-08-21 17:55:56 +07:00
a751cebf2d
Remove explosion debugger from registries 2024-08-17 21:06:52 +07:00
4c0bac35c1
Update upgrade recipe, and merge energy container recipe onto upgrade recipe 2024-08-17 21:06:12 +07:00
7f927d5f05
Update plate press recipe 2024-08-16 21:56:54 +07:00
adc2ce0017
Update stats 2024-08-16 16:51:20 +07:00
eaefda867d
Update energy container upgrade recipe 2024-08-15 19:26:37 +07:00
aaecbf8ae5
Update explosive hammer 2024-08-14 21:53:29 +07:00
192b26e8ab
Update energy sword 2024-08-14 20:08:58 +07:00
4cb3acf126
Update portable gravitation stabilizer 2024-08-13 22:10:02 +07:00
e513bb8a8f
Update essence capsule 2024-08-13 13:41:22 +07:00
4a66015d78
Resolve compilation error in matter manager 2024-08-13 12:57:01 +07:00
0db98ef8f8
Update matter registry networking 2024-08-13 00:38:12 +07:00
5b403d3d47
Resolve essence storage screen errors 2024-08-12 22:28:29 +07:00
564622e6fa
null assert player 2024-08-12 22:24:49 +07:00
0c47de93c1
Resolve mattery block errors 2024-08-12 22:22:49 +07:00
ce119269e0
Resolve more misc compilation errors 2024-08-12 22:16:52 +07:00
333238fde5
Update partial tick 2024-08-12 21:55:08 +07:00
4f2978010b
Update android research codecs to map codec 2024-08-12 21:54:52 +07:00
27a93a8133
Update attack boost feature 2024-08-12 21:54:30 +07:00
6356afe295
Argument order 2024-08-12 20:22:32 +07:00
5b4fa2e9ed
Update ItemFilter to behave like it did previously, with fixed amount of slots but still being immutable 2024-08-12 20:21:07 +07:00
aa5d36c488
Re-implement DelegateSyncher using Mojang's StreamCodec 2024-08-10 23:26:17 +07:00
03cec07ffb
Bump kommons 2024-08-10 19:23:12 +07:00
73ce6e8e45
Update curios compat 2024-08-10 18:42:30 +07:00
dcd92f58a5
Bump curios (use Curios API Continuation) 2024-08-10 18:34:32 +07:00
494bf70f6b
Update jade compat 2024-08-10 16:24:17 +07:00
68e1bd9036
Bump Jade version 2024-08-10 10:43:01 +07:00
23f02036b9
Update quantum battery item 2024-08-10 10:37:47 +07:00
ed8717964d
Reflect removal of explosion test blocks in blockentities 2024-08-10 02:01:12 +07:00
25f21e310c
Update storage interfaces to work with itemfilter as immutable class 2024-08-10 01:59:56 +07:00
45294d3b14
Make kotlin compiler happy due to java nullability annotations mismatch 2024-08-10 01:59:29 +07:00
12b7d5c96c
Fix wrong event listeners 2024-08-10 01:58:56 +07:00
ecb9d8a95d
update minecart item 2024-08-10 01:39:07 +07:00
d4806dfb2a
fix damage source 2024-08-10 01:37:17 +07:00
1c23005573
Bump neoforge to 21.1.1 2024-08-10 01:26:01 +07:00
64780fbda5
Resolve most of simple enough compilation errors 2024-08-10 01:24:15 +07:00
9b7e424fc5
Switch to neoforge and neogradle 2024-07-04 19:52:30 +07:00
91835905a3
Some minor changes for 1.21 2024-07-01 20:02:32 +07:00
0a4468fcdd
Bump to Minecraft 1.21, Forge to 58, JEI, KFF, Kotlin to 2.0.0 2024-06-29 14:06:52 +07:00
2d1925e749
Significantly improve EnergyCableGraph#getPath performance 2024-06-05 13:03:38 +07:00
5e844095ef
WiseTree
YuRaNnNzZZ — Вчера, в 16:07
там был текст
и цвет
2024-06-01 20:14:28 +07:00
dc870f7c5f
Bump kommons 2024-05-31 16:43:48 +07:00
f409729385
Update rgb -> bgr in Painter screen 2024-05-31 16:42:05 +07:00
5fdfd9ee2c
Fix UUIDIntModifiersMap nested race condition resulting in wrong final value 2024-05-31 16:36:48 +07:00
ff8d2aa5f3
Bump kommons 2024-05-31 10:52:14 +07:00
6af0affa4f
Fix profiled storage getting stuck with last transfer numbers in history if world is saved (and then loaded) before entire history is cleared with zeroes
YuRaNnNzZZ — Сегодня, в 18:10
:wires:
2024-05-16 18:15:43 +07:00
7b2d9b1bf4
ok kotlin 2024-05-16 18:07:35 +07:00
f416cd69e5
Eliminate most of TickList's internal logic, greatly speeding it up 2024-05-16 18:06:09 +07:00
884caba048
Use PriorityQueue over AVLTreeSet with hacks 2024-05-16 17:48:45 +07:00
dc47b3a13e
Replace toRGB/toARGB with toBGR/toBGRA 2024-05-16 17:41:36 +07:00
4e54cc7d67
Bump kommons 2024-05-16 17:37:59 +07:00
3d8e5fb774
Update "nullable" usage of stream codec 2024-05-16 17:25:44 +07:00
728a7de0bf
Update global event handler to reflect mattery network channel changes 2024-05-16 17:24:17 +07:00
6cc2b37b65
Bump kommons 2024-05-16 17:21:19 +07:00
2006e22e40
Remove separate packet dispatcher channel, since "low" performance of netty dispatcher is caused by underlying socket wakeup() call (which interrupts wait() call on event loop thread), and it shouldn't be a performance issue 2024-05-16 17:20:41 +07:00
e63cce63ff
Call DelegateSyncher.observe 2024-02-25 19:44:50 +07:00
e047341cdb
Specify Kommons as minecraft mod 2024-02-25 19:36:21 +07:00
2fbce58148
Migrate to DelegateSyncher and Delegate<> 2024-02-25 18:30:25 +07:00
22430cd937
Actually add kommons to dependencies 2024-02-15 19:49:05 +07:00
a7fd7fe7e5
Merge remote-tracking branch 'origin/1.20.2' into 1.20.2 2024-02-15 18:52:58 +07:00
82bb39aded
Add kommons to dependencies 2024-02-15 18:52:42 +07:00
059270a2ec
Add lots of multiblock related stuff, more blackhole generator multiblock testcode 2024-02-15 18:47:06 +07:00
3ddb4d3d83
EnergyContainerInputSlot 2024-01-30 17:45:28 +07:00
7d4d718b1e
Global block/state tag, additional predicates for multiblock tests, more multiblock performance improvements 2024-01-30 17:45:17 +07:00
308240ac5b
MatterProviders/MatterConsumers handler filter 2024-01-29 16:46:46 +07:00
c5b987c2de
Slightly buff dense battery throughput 2024-01-29 15:28:27 +07:00
2930ca8841
Bump default max energy config value of energy sword to match capacitor battery 2024-01-29 15:28:06 +07:00
769c1650e5 Fuck interpolation 2024-01-29 11:44:47 +06:00
a885ea4d87 Models and more texture updates 2024-01-29 04:15:13 +06:00
58ed338c7a Various texture updates 2024-01-29 03:03:39 +06:00
eb60c371ed Painting table and water source models 2024-01-29 02:54:49 +06:00
2a8cabe577
Force directional multiblock and multiblock performance improvements 2024-01-28 23:24:24 +07:00
dafa54112e
Forgot to commit tagsprovider for fluid tags 2024-01-28 23:23:48 +07:00
cd5f9dff2e
Un-seal BlockEnergyStorageImpl 2024-01-28 23:23:21 +07:00
7e5711d210
Fix android getting duplicated energy on death if they have battery equipped 2024-01-27 10:23:29 +07:00
3a4d80d084
Mark liquid xp as forge:experience 2024-01-26 19:16:36 +07:00
f29e4b29d7
Make painter table accept water directly from fluid containers 2024-01-26 18:30:53 +07:00
306cad582e
Fix tritanium pressure plates having collision 2024-01-26 15:18:28 +07:00
a51a4a3ad0
datagen biome modifiers for ores 2024-01-22 20:25:47 +03:00
c6059b0393
Merge remote-tracking branch 'origin/1.20.2' into 1.20.2
# Conflicts:
#	src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/decorative/PainterBlockEntity.kt
2024-01-22 11:40:48 +07:00
d18399795b
Void/Unit subscripable 2024-01-21 23:33:03 +07:00
9ad1c8e82a
Micro optimize combinedcontainer stack iterator for best case scenario 2024-01-21 23:32:40 +07:00
8a3ef344e3
essence storage empty/filled blockstate 2024-01-21 13:14:42 +03:00
7c794126b6
slurp 2024-01-21 11:55:58 +03:00
8ebc611c7c
Custom splashes 2024-01-20 18:31:39 +07:00
d669fcb28d
шиза с моделями и блокстейтами кабелей 2024-01-19 15:55:48 +03:00
317cb98613
Блок в точке 559, 62, -131 содержит следующую информацию: -2147481752
Блок в точке 559, 62, -131 содержит следующую информацию: -2147481786
Блок в точке 559, 62, -131 содержит следующую информацию: 1839
Блок в точке 559, 62, -131 содержит следующую информацию: -2147481832
Блок в точке 559, 62, -131 содержит следующую информацию: -2147481854
Блок в точке 559, 62, -131 содержит следующую информацию: 1777
2024-01-19 13:59:05 +03:00
26382d9601
Fix wrong blast resistance of tritanium striped block 2024-01-18 23:22:31 +07:00
d540cbef3c
Overflow prevention inside painter block entity 2024-01-18 19:28:04 +07:00
604029dcd5
Add missing callback info 2024-01-17 20:11:02 +07:00
6999b42b1f
Since OTM does not specifically modify vanilla behavior when it's structures are in "default" state, accept connections to vanilla servers or server with OTM missing 2024-01-17 20:02:14 +07:00
c356cd703e
:mind_blown: More multiblock code 2024-01-17 17:30:50 +07:00
f97ad565d4
Multiblock test 2024-01-17 13:18:40 +07:00
94afd4f19a
How did i mess up left/right sprites of machine side controls again 2024-01-14 10:51:15 +07:00
0ae1cd21fe
Fix secondary furnace recipes not using proper config values 2024-01-14 00:52:38 +07:00
f7e3166ca0
Fix wrong argument order inside children panels 2024-01-14 00:28:06 +07:00
87a7c2961f
Use volatileEnergyValues in BatteryBankBlockEntity 2024-01-13 19:40:15 +07:00
3bd53fdba0
Простота устройства данного аккумулятора позволяет вам заменить . 2024-01-13 13:30:28 +07:00
c2b92b443b
Mods try to be smart by supporting both fabric and forge, while in reality they support for- or -ge 2024-01-13 12:17:15 +07:00
13cac25abd
Also remove player from player2ResubCount when he disconnects 2024-01-13 12:04:37 +07:00
0321e1fa00
Don't spam regular log, instead spam debug one 2024-01-13 12:02:18 +07:00
027d9747bd
Clarify which player got resusbcribed 2024-01-13 11:47:18 +07:00
1f47f51157
Chunk resubscription? for broken mods 2024-01-13 11:42:36 +07:00
c07120a1cb
Common menu base for processing machines 2024-01-12 21:00:48 +07:00
71f13f70bf
Scissor stack fix 2024-01-12 20:57:12 +07:00
0dffe511fd
Remove regular plate press, twin plate press is now the normal one 2024-01-12 19:17:07 +07:00
884336ffa1
Redo old recipes 2024-01-12 19:05:26 +07:00
e86299460b
Move fluid items to tooltiplist 2024-01-12 16:51:55 +07:00
c988c4b869
Fix matter capacitor bank breaking when using creative capacitors 2024-01-12 16:44:16 +07:00
bfd3c89bbf
Add tooltips to a handful of machines 2024-01-12 16:43:38 +07:00
882f1ce408
Tooltips galore 2024-01-12 15:53:58 +07:00
3c2c037ed0
Merge branch '1.20.2' of https://git.dbotthepony.ru/DBot/overdrive_that_matters into 1.20.2 2024-01-11 17:50:14 +07:00
878b715a3e
DBot — Сегодня, в 10:01
Оно создаёт промежуточный список, лучше просто foreach и is проверка
2024-01-11 10:05:37 +03:00
c01b949b45
DBot — Сегодня, в 9:08
Тот же вопрос
Я не думаю.
Я думаю2 что надо удалить предмет
2024-01-11 09:50:45 +03:00
538c36e50a
shield decorator for all shield-like items 2024-01-11 09:47:01 +03:00
8c257db68f
Caching default blockRotation implementation 2024-01-09 23:35:22 +07:00
91ccd0af16
Update explosive hammer tooltip 2024-01-09 20:04:46 +07:00
c45f5f6029
send help 2024-01-09 18:23:38 +07:00
80155ba7bc
Once again i demand you to STOP updating blockstates in being-unloaded chunks 2024-01-09 17:53:17 +07:00
d65b8df579
Now when positioning panels, exopack charge slots are considered into inventory frame height 2024-01-09 14:56:03 +07:00
aa93150f09
We don't need jvm overloads here 2024-01-09 14:40:03 +07:00
6ff737a315
Fix slots hidden behind by other panels still being visible to "lookup recipes" keybind 2024-01-09 14:39:21 +07:00
c1fbdfa1a6
Get rid of slot provider interface 2024-01-09 14:37:55 +07:00
3a813d4353
Calculate fluid operations using Longs 2024-01-09 13:53:06 +07:00
ddaa0dafe5
1984 2024-01-09 13:41:43 +07:00
1c9ea6f8bd
Revert fluid gauge panel clicking for jei recipes 2024-01-09 13:15:41 +07:00
b95a1885e8
Less rigid jei support 2024-01-09 13:15:09 +07:00
0b464c3a0b
Don't display "show recipes" on progress gauge because mouse cursor already tells that 2024-01-09 12:24:39 +07:00
0e60e84eb3
Mod name and JEI on fluid gauge panel 2024-01-09 12:22:53 +07:00
a5c1d7fbf8
Use networked field directly as backing fluid field 2024-01-09 12:01:38 +07:00
7e5ea3be8d
Add missing infinite water source to creative menu 2024-01-09 11:56:41 +07:00
b0dc5baa71
Add fluid container interaction with infinite water source block 2024-01-09 11:53:30 +07:00
0a1cb62479
Add more missing machines to creative menu 2024-01-09 11:19:54 +07:00
eac3bea94a
Relaxed player sets 2024-01-09 01:09:09 +07:00
8ea83dbd40
More compact backlog storage 2024-01-09 00:52:48 +07:00
dda015c5ef
update blockentity backlog phrasing 2024-01-09 00:50:33 +07:00
e009ed33a3
Make progress bar in exopack inventory be clickable 2024-01-08 23:01:49 +07:00
801577fd9e
Readd phantom attractor to machines list 2024-01-08 22:20:51 +07:00
c9f84016c1
i didn't ask for kff function 2024-01-08 21:50:49 +07:00
a7902b66b5
Fix holo sign not marking chunk it is in dirty after setting color 2024-01-08 21:33:20 +07:00
d3b0eb5f92
Add tintindex to holo sign to color its lights 2024-01-08 21:32:53 +07:00
d085979b9e
> minor spelling mistake 2024-01-08 14:28:15 +07:00
0fc99b90d9
whut 2024-01-08 14:16:06 +07:00
c186a6b405
Add missing tritanium block yellow stripe painter recipe 2024-01-08 10:24:52 +07:00
bf450e2ff9
Add block entity sync backlog handling 2024-01-08 10:21:43 +07:00
c04830a3bb
Fluid tank and capsule advancements 2024-01-08 01:47:24 +07:00
4033fd2ba9
Energy servo advancement 2024-01-08 01:45:32 +07:00
e54ca2ecfa
Energy servo advancement 2024-01-08 00:35:46 +07:00
7d08b90020
Double the amount of energy produced by chemical generator from fuels 2024-01-08 00:13:36 +07:00
54a6f9f152
Add essence storage advancement 2024-01-07 20:15:42 +07:00
8164921344
how 2024-01-07 20:03:41 +07:00
b83d2421a1
Remove explosive hammer priming recipe 2024-01-07 11:59:21 +07:00
e5b3d6bf0c
Fix machines turning into disco ball when one slot is working and other is errored 2024-01-06 23:10:14 +07:00
4279840a23
Fix being able to switch inventory charge flag before getting exopack 2024-01-06 21:09:14 +07:00
c97ab62faa
Display whenever upgrade reached bonus limit 2024-01-06 14:19:33 +07:00
05db4a0c05
Use cutout for microwave oven 2024-01-06 11:28:48 +07:00
6aabc72145
Chemical generator, energy servo and energy counter coloring 2024-01-06 11:21:40 +07:00
9be5ca359d
Compute block shapes in background, reduces mod startup time to 1/3 of original 2024-01-05 23:50:10 +07:00
808f152cc3
Fix invalid workProgress calculation 2024-01-05 23:07:19 +07:00
a41856d6c8
Since game objects create intrusive holders statically, which calls into non thread-safe code, disallow parallel registration for now 2024-01-05 22:59:06 +07:00
a113e99a8e
lol dum 2024-01-05 22:20:01 +07:00
91dbb3e587
Fix microwave oven render not account for rotation and yRotationNorth being wrong 2024-01-05 22:13:22 +07:00
e55764c10d
Custom deferred register with parallel entry initialization 2024-01-05 21:35:14 +07:00
2dcfa99f9c
Microwave oven in-world rendering 2024-01-05 19:18:10 +07:00
ef4f65656c
Fix battery bank not being painted in world 2024-01-05 14:16:01 +07:00
796f7fdc98
Fix drive viewer model 2024-01-05 00:45:21 +07:00
a56dbd60f6
Switch render mode to cutout for holo sign and matter replicator 2024-01-05 00:38:53 +07:00
5d44a26493
Fix pattern monitor rotation 2024-01-05 00:32:30 +07:00
a95a5f27ff
Wireless charger, pattern monitor, driver viewer and storage power supplier coloring 2024-01-05 00:24:53 +07:00
028d03b147
Fix registry dumb creating invalid csv file 2024-01-04 23:18:36 +07:00
486c9b00c9
Remove text from text field when doing right mouse click, and text field is not multiline 2024-01-04 20:01:14 +07:00
54ba7e94c6
Cursor type for android research tree 2024-01-04 19:59:57 +07:00
ed73c9fda8
Always display transfer history when pressing shift 2024-01-04 19:41:05 +07:00
f4bbf54095
Android station coloring 2024-01-04 19:37:36 +07:00
c69781c22c
Fix cursor wars between panels when grabbing mouse input 2024-01-04 19:08:20 +07:00
70ec49e546
Display panel's mouse cursor if it grabs mouse input 2024-01-04 18:58:20 +07:00
dbc793a592
Add hand cursor to progress gauge panel 2024-01-04 18:53:12 +07:00
c52995541b
Mouse cursors support 2024-01-04 18:36:52 +07:00
005c8b0396
Holo sign text coloring 2024-01-04 17:48:56 +07:00
a72f2aabb2
Make underwater travel challenge account for displacement, and not distance 2024-01-04 16:57:10 +07:00
ebafdbc925
Set MAX_ENERGY default config value to infinity 2024-01-04 16:38:09 +07:00
9800eb35ba
Fixed energy consumption not being merged properly 2024-01-04 16:37:41 +07:00
b3651b1f86
Powered furnace cleanup 2024-01-04 16:26:42 +07:00
8aa34b3645
Induction furnace and powered furnace painting 2024-01-04 15:57:12 +07:00
26cb0c8cba
Implement matter recycler coloring 2024-01-04 15:11:38 +07:00
ce8c257928
Some cleanup of code from previous commits 2024-01-04 14:57:33 +07:00
3f2e90e55c
Merge remote-tracking branch 'origin/1.20.2' into 1.20.2 2024-01-04 14:06:48 +07:00
5b51c5e655
Microwave oven painting 2024-01-04 14:06:23 +07:00
071bb7b3ad Chug xp 2024-01-04 12:46:19 +06:00
9ecf53342e
More machine coloring 2024-01-04 13:40:40 +07:00
895ed6fbef Fix Computer 1000 yard stare + 4chair 2024-01-04 12:38:38 +06:00
9d876c573c
Merge remote-tracking branch 'origin/1.20.2' into 1.20.2 2024-01-04 12:07:45 +07:00
0c004aedc5
Some unifications regarding item tooltips 2024-01-04 01:06:55 +07:00
1e8aecb5d7
Maintain inner list of decorative blocks to register 2024-01-04 00:00:06 +07:00
f36019b4ef
Subscribe to these vents only when running client 2024-01-03 23:50:05 +07:00
8f92b8d3f1
Add computer terminal as actual block 2024-01-03 20:46:51 +07:00
800fd54d8e
Explicitly inherit string matter value for wool 2024-01-03 20:04:46 +07:00
0dcf6664a3
Add painter recipes to matter recipe finder 2024-01-03 20:03:23 +07:00
b2c2bfa536
Plate press coloring 2024-01-03 19:56:50 +07:00
d6dc8689f8
Essence storage coloring 2024-01-03 18:51:59 +07:00
cb50ee2c68
Colored machines test, update creative menu order
update SupplierList/Map impl to use Java's suppliers
general code layout improvements
2024-01-03 18:36:06 +07:00
73773d4c70 tele jigsaw grunt pathic telepathic st'ructure processor jigsaw worldgenjson 2024-01-03 16:53:27 +06:00
0ab411fd90
Add "none" to BlockRotationFreedom 2024-01-03 15:11:49 +07:00
565819c3e3
Add placeholder textures for liquid xp 2024-01-03 15:06:36 +07:00
c5ea764848
Shorten configuration titles 2024-01-03 15:04:27 +07:00
56db45a0d4
Add liquid xp locale strings 2024-01-03 15:03:20 +07:00
e08c81520f
Actually expose fluid handler of essence storage 2024-01-03 15:00:50 +07:00
6e16364491 Laboratory rebuild WIP + decorative computer model 2024-01-03 09:57:03 +06:00
733b9edcad
Add worldedit to runtime envrionment 2024-01-02 20:32:35 +07:00
a65651a293
Re-enable Jade at dev runtime 2024-01-02 18:14:28 +07:00
c5313d405b
Actually make metal beams behave like pillars 2024-01-02 18:06:14 +07:00
e6203e11b5
Fallback to zero if there is excess data when deserializing infinities 2024-01-02 15:05:22 +07:00
290705dc38
Use proxied cursemaven because direct connection is not very productive 2024-01-02 14:19:19 +07:00
0a5dbf468f
Update author list 2024-01-02 12:24:09 +07:00
46d5f8b76b
Revert import changes 2024-01-02 12:21:48 +07:00
113db7fa9e
Add microwave oven block shape 2024-01-02 11:53:52 +07:00
063095df10
Merge branch 'master' of https://git.dbotthepony.ru/DBot/overdrive_that_matters into master 2024-01-02 11:42:45 +07:00
76de15f01b Update the texture for metal beams and lamps 2024-01-02 00:15:39 +06:00
ea448c5262 More texture adjustments 2024-01-01 23:51:32 +06:00
355242b470 Merge remote-tracking branch 'origin/master' 2024-01-01 23:17:20 +06:00
ffa94d190d Microwave 2024-01-01 23:16:59 +06:00
6bee0784d3 Texture adjustments 2024-01-01 16:42:47 +06:00
2cc8215cb0
Revert "Polyfill dataresult"
This reverts commit e3df0d82e0.
2024-01-01 17:30:48 +07:00
e3df0d82e0
Polyfill dataresult 2024-01-01 17:28:46 +07:00
18965ccfc7
god damn it 2024-01-01 16:50:37 +07:00
64b8346424
Specify proper piston push behavior for most blocks 2024-01-01 16:37:42 +07:00
50112bfbaf
Don't make cables seem to be interactable 2024-01-01 15:00:50 +07:00
3db63aa589
Add MatteryContainer.ContainerListener 2024-01-01 11:45:06 +07:00
716d251ca0
More MGUIGraphics moves 2024-01-01 02:51:54 +07:00
1dab485d29
Specify font implicitly 2024-01-01 02:46:00 +07:00
d81d7885c0
And move it to render subpackage 2024-01-01 02:40:58 +07:00
311de079fa
Add polyfill guigraphics 2024-01-01 02:39:58 +07:00
2e23ce1a04
One more isCancelable 2024-01-01 00:58:17 +07:00
75681fb4c4
Specify isCancelable directly 2024-01-01 00:13:15 +07:00
023ad54b33
Various fixes related to number handling 2023-12-31 23:18:23 +07:00
1681a7bf4a
Streamline trigger instances into single, more portable class 2023-12-31 20:23:45 +07:00
242876d533
Migrate to custom network context 2023-12-31 17:01:57 +07:00
b2d7f6c002
Set copyIdeResources to true 2023-12-31 16:52:17 +07:00
be52bbdc59
Fix not accounting initial cable node limit when transfering energy 2023-12-31 10:53:55 +07:00
6be24540a5
Don't remove self from lively nodes when all we can do is self-feed 2023-12-31 10:29:27 +07:00
a162caefb6
Use pecrentage function 2023-12-31 10:07:44 +07:00
8d222125b5
Specify max battery of cables as positive infinity 2023-12-31 09:41:03 +07:00
1c0cdb8b5b
Energy cable tiers, fix some Client -> Server logic leaks in singleplayer 2023-12-30 20:26:31 +07:00
023081eaaa
Fix accidental LIFO order on tick list when queueing ticks (when it always should be FIFO) 2023-12-30 19:57:21 +07:00
7c9657c6d2
Get rid of block entity specific onceLevel 2023-12-29 16:43:28 +07:00
d5f1d3cde0
e 2023-12-29 16:41:56 +07:00
35e0bc65da
Add more specifics to cable energy cap 2023-12-29 16:39:19 +07:00
79aeca5720
Energy cables test 2023-12-29 16:35:32 +07:00
6de2f14fcd
Update energy impls to make more use of infinity 2023-12-29 10:52:01 +07:00
2276f0ef45
Fix zero decimal formatting 2023-12-29 10:51:13 +07:00
a1515d54c4
Introduce infinity to energy impl, move creative battery to plain infinite values instead of special logic 2023-12-28 20:37:18 +07:00
f13c725298
Concept of infinity, for Decimals 2023-12-28 20:13:03 +07:00
6784271ac7
Fix shapegen for storage bus 2023-12-28 19:59:15 +07:00
93942161ad
Fold cables block code 2023-12-28 15:03:13 +07:00
d7c5b76098
Bump required kotlin to 1.9 2023-12-25 11:40:15 +07:00
a5dcf5a331
Fix field synchronizer set not reacting properly to global markDirty() 2023-12-23 19:42:38 +07:00
8b7363b130
Remove parchment from buildscript 2023-12-23 16:00:27 +07:00
1e2c505fbd
Unify experience storage in machines, Liquid XP 2023-12-22 20:08:12 +07:00
8fece2a517
Move capabilities impls to subpackages 2023-12-22 14:53:25 +07:00
9eeb4c2190
Use global constant instead of handwritten number 2023-12-22 14:51:05 +07:00
29cb78bbd5
Remove frame title from exopack inventory screen 2023-12-22 14:42:58 +07:00
19bb6600dd
Bump KFF and Forge 2023-12-22 14:27:41 +07:00
6fb6687cd0
Update block entity synchronization to match 1.20.2 chunk queue changes 2023-11-17 13:19:17 +07:00
db6b5e7efc
Get rid of savetable() 2023-11-17 12:29:32 +07:00
6737d52c10
Update previous commit 2023-11-17 10:18:41 +07:00
940d8333de
Handle vanilla-like trim cloning recipes 2023-11-16 21:44:20 +07:00
280a8f3431
Merge painter recipe types 2023-11-16 21:29:19 +07:00
b26f109f56
Painter Recipes updates 2023-11-16 21:02:19 +07:00
6d21760621
essence storage mending repair (with automation) 2023-11-16 16:36:41 +03:00
8dcf484362
smoother ability cooldown display (rubberbanding due to late sync) 2023-11-16 13:28:15 +03:00
f13f9481ea
smoother shield cooldown display 2023-11-16 13:10:16 +03:00
41fa744d4a
universal wireless charger 2023-11-15 02:25:15 +03:00
993b1ac0fc
extremely fast archaeology 2023-11-15 02:13:30 +03:00
a618436ddd
fix android charger not using battery from its own slot 2023-11-14 13:29:59 +03:00
574d3721b1
YuRaNnNzZZ — Вчера, в 18:38
можно зарядник ещё и на экзопак расширить
2023-11-14 13:19:36 +03:00
8a6e8afa61
machine upgrades 2023-11-13 21:54:10 +03:00
586c43fd6c
hud text scale + reorganize client config 2023-11-04 13:39:08 +03:00
122ebb9688
cheaper/more proper checkerboard background render (still bad)
:trolley:
2023-11-02 02:22:25 +03:00
ee700c442e
undo dye bar static non-dye background color 2023-10-31 22:36:59 +03:00
b130d69da1
better paint bars background 2023-10-31 22:09:46 +03:00
8e3c95159a
display painter recipe name in advanced tooltips 2023-10-30 22:40:07 +03:00
0d474e1991
handle icon color in itemstack icon buttons 2023-10-30 22:38:48 +03:00
92a9fa39df
darken icons in disabled/pressed buttons 2023-10-30 22:38:18 +03:00
608771f441
DBot — Сегодня, в 16:11
добавь margin сверху у кнопки массовой покраски
или у списка снизу
2023-10-30 16:53:21 +03:00
94e1ce6d8e
paint and remove armor dye in painting table 2023-10-30 15:57:39 +03:00
6c9058e72d
darken base tritanium armor color 2023-10-30 12:54:53 +03:00
6aaad2fe88
покраска тритановой брони
#178 :WiseTree:
2023-10-30 12:41:25 +03:00
9d882d2351
draw shields cooldown 2023-10-30 08:30:30 +03:00
55363f5f6a
secondary recipes for powered furnaces + microwaving pattern drives to erase them 2023-10-29 18:41:20 +03:00
c4a5653330
actually add upgrade slots 💀 2023-10-29 01:51:31 +03:00
f3da82beaf
furnaces and plate presses now store experience into essence storage on job finish and neighbour block update 2023-10-29 01:25:54 +03:00
814328630c
fix upgrades not saving in matter decomposer and scanner; added upgrades to bottler and recycler 2023-10-29 00:42:48 +03:00
0bf5ec5487
Пойти нахуй 2023-10-28 06:43:25 +03:00
d7794320fa
jade update 2023-10-27 16:39:34 +03:00
e116f0cd6e
change crafting table tag to a widely used one 2023-10-27 13:48:02 +03:00
83502eb240
we do a little trolling 2023-10-27 02:57:01 +03:00
bc8a52acd4
add portable gravitation stabilizer to chestplates tag 2023-10-27 01:11:37 +03:00
e6b2dec32d
do not add "-SNAPSHOT" to toml mod version 2023-10-27 01:11:00 +03:00
44bf3cca43
remove freeze protection mixin in favor of minecraft tag 2023-10-27 00:57:58 +03:00
c79f686e41
organize tags 2023-10-27 00:57:10 +03:00
87d9df1ce1
equipment slots emit eqiup sound 2023-10-26 22:21:11 +03:00
0e83e08ec6
manual hammer priming 2023-10-26 17:01:36 +03:00
636afe639e
Painter table water ingredient, semi-realistic color mixing 2023-10-26 20:51:26 +07:00
474a19a30b
Make painter table reflect reality (real life colors are mixed subtractively) 2023-10-26 18:52:30 +07:00
171e16a7c4
Remove Mekanism compat since it will not be updated to newer versions 2023-10-26 18:44:03 +07:00
15023b6599
upgrade minecarts as well 2023-10-26 10:21:06 +03:00
cf45fe69c5
DBot — Сегодня, в 8:52
Напомнил
Что ящик должен агрить пиглинов
Ибо они агрятся даже на ендер сундук
И это by design
2023-10-26 09:10:48 +03:00
1f72cd865c
emit events and particles on chest upgrade 2023-10-26 08:53:53 +03:00
db4f24e85e
DBot — Сегодня, в 8:11
Ящикатор?
2023-10-26 08:22:49 +03:00
8d575c34a8
:WiseTree: 2023-10-26 07:43:00 +03:00
40f001fb58
Check for visibility of children panel in calculateAbsoluteObstructingRectangles 2023-10-24 17:39:38 +07:00
831e49c796
chest upgrader test (#281) + multiingredient for datagen + crate recipe accepts barrels 2023-10-24 12:13:52 +03:00
ff547f9a5e
optional item/block tags display in tooltips 2023-10-24 08:01:34 +03:00
c4dbc79707
Update effect list panel sprite locations 2023-10-23 19:11:24 +07:00
a04643e905
Fix inventory change trigger search tree NPE 2023-10-23 18:41:38 +07:00
74f8e316b7
DBot — 30.05.2023 9:49
Да
Но всё равно
Нравится ли тебе капсула опыта
Как концепт
YuRaNnNzZZ — 30.05.2023 9:50
да
только one small issue
DBot — 30.05.2023 9:50
Я не про версию игры
YuRaNnNzZZ — 30.05.2023 9:50
она гейтит возврат опыта за танком опыта
2023-10-23 05:51:07 +03:00
294a402447
mod/toml version != jar version 2023-10-23 00:13:26 +03:00
a70e1f30bd
Fix furnaces not dropping their containers in block break 2023-10-23 00:51:55 +07:00
964a6e17b1
DBot — Сегодня, в 10:09
а почему тогда не копировать весь BlockEntityTag
2023-10-22 10:12:16 +03:00
b9dba513e4
YuRaNnNzZZ — Сегодня, в 10:56
опять всё подбирается в левую руку
2023-10-22 12:19:15 +07:00
5e91da68cf
separate parent recipe in upgrade recipe output 2023-10-22 07:48:03 +03:00
54cfd84103
сейчас мы будем показывать жидкость
closes #258
2023-10-22 06:28:04 +03:00
9b2566e08d
i need more buckets i need more buckets i need more buckets i need more buckets 2023-10-22 03:47:13 +03:00
092b2f0a44
Reverse order of codecs when deserializing 2023-10-21 20:04:47 +07:00
91c8100729
DBot — Сегодня, в 14:51
Считается что работает правильно
Пока не доказано обратное
2023-10-21 15:32:25 +03:00
5be91b2f1a
toast symbols for machine recipes 2023-10-21 14:52:58 +03:00
ed5a549b96
java.lang.RuntimeException: This piece should be unreachable
at TRANSFORMER/overdrive_that_matters@1.4-SNAPSHOT-aa513343/ru.dbotthepony.mc.otm.matter.MatterManager$Resolver.doDetermineValue(MatterManager.kt:935)
2023-10-18 08:04:46 +07:00
aa513343a5
Initial fixes for 1.20.2 2023-10-11 17:40:21 +07:00
d841a5fe1a
Statically initialize criteria triggers 2023-10-11 16:20:57 +07:00
363dc37cbd
Bump forge to 48.0.20 2023-10-09 18:59:35 +07:00
5b46fb9621
Bump FG to 6.0.14 2023-10-08 10:00:33 +07:00
187038c5e3
Bump forge to 48.0.19, remove fakeplayer references 2023-10-08 09:53:47 +07:00
c32a5bf71b
Mod now compiles on 1.20.2 2023-10-07 22:27:02 +07:00
1f4292012b
Bump minecraft version to 1.20.2 2023-09-29 15:40:13 +07:00
16ca531a76
Avoid leaving "empty" tags of fluid containers 2023-08-26 18:39:21 +07:00
8e962f69ff
Add preRender protected hook to panels, and remove unused postrender hook 2023-08-23 16:57:59 +07:00
2766a444d6
Mark panels removed when screen is removed 2023-08-23 16:42:04 +07:00
82d46f4cf4
Update locale casing 2023-08-23 16:21:03 +07:00
8f983b73d6
Non reflective armorWithTrims 2023-08-23 15:26:14 +07:00
6a06850f23
Merge remote-tracking branch 'origin/master' into master 2023-08-23 15:16:10 +07:00
b52c5ce340
Fix using clientside only sorting on server 2023-08-23 14:51:39 +07:00
313f9cb39d
Swim Boosters android feature, electromotor crafting component 2023-08-23 14:24:43 +07:00
61d799fb29
Don't check for null multiple times 2023-08-23 13:13:16 +07:00
51f7fc264c
armor trims for simple tritanium armor
я хочу убивать
2023-08-23 03:24:06 +03:00
9bebe74282
Restore vanilla behavior regarding picking up items 2023-08-23 00:37:24 +07:00
967b8c71d8
Use hash set since we don't need sorting 2023-08-22 17:46:07 +07:00
87d35eb4af
Fix double wrapping sort settings into player input 2023-08-22 16:31:22 +07:00
51ec99d8dd
Actually account for case when both references refer to null 2023-08-22 15:47:50 +07:00
edd16768e3
Store "is bulk" flag inside painting table itself 2023-08-22 12:16:24 +07:00
e61d98e54d
Bulk painting 2023-08-22 11:58:56 +07:00
98e7ea96b2
a 2023-08-22 11:53:40 +07:00
218bb17cc4
Faster filtering and flatmapping iterators 2023-08-22 11:35:00 +07:00
2935b3c2ad
More concise savetables internals 2023-08-22 11:34:41 +07:00
6fbdb04ee4
Micro optimizations regarding mattery network channel 2023-08-21 17:09:20 +07:00
dd2dab37a7
Account for case when both references refer to null 2023-08-21 15:49:04 +07:00
93783a4210
Proper shouldRenderTooltips call 2023-08-21 13:32:01 +07:00
c7442e4ad2
JEI recipes button inside machines GUI 2023-08-21 13:29:24 +07:00
2e94245d7c
YuRaNnNzZZ — Сегодня, в 11:20
слоты брони сбрасываются
на зарядку
2023-08-21 11:25:14 +07:00
4e17c00099
Add profiled gauge widget to item monitor menu 2023-08-21 11:23:06 +07:00
4a606e78b0
Use MatteryCraftingContainer in item monitor 2023-08-21 11:21:59 +07:00
af2d621cee
Hopper and dispenser/dropper menus? 2023-08-21 11:13:48 +07:00
6fc06a620f
Call setByPlayer instead of set on slots when quickmoving 2023-08-21 11:08:39 +07:00
4356117f7d
JEI Transfer handler for matter entangler, plate press and painting table 2023-08-21 00:59:54 +07:00
15b718f28a
Enable inventory scrollbar when having exopack installed, and not having at least 1 extra slot in it 2023-08-21 00:27:32 +07:00
dd91bd2f17
Add sorting buttons to ender chest inside exopack menu 2023-08-21 00:10:31 +07:00
c760348f72
Remove unnecessary unchecked cast 2023-08-20 23:49:59 +07:00
74cf2b42d0
Add 4 pixel padding on top of chest frames 2023-08-20 23:44:29 +07:00
7569b3fe0a
Display offhand slot even when have no extra slots in exopack 2023-08-20 23:41:42 +07:00
9244de0ac2
Vanilla chests with OTM gui 2023-08-20 23:36:13 +07:00
e94a267ac1
Make sorting be performed on client, and sorted slot list be sent to server 2023-08-20 22:31:52 +07:00
4c94e92b90
Add missing addStorageSlot call 2023-08-20 21:20:56 +07:00
bd8e350d10
Move expanded inventory patches to vanilla compat subpackage 2023-08-20 20:40:22 +07:00
464e1aa579
Fix root frame children outside frame bounds not receiving isHovered flag 2023-08-20 20:35:20 +07:00
f26e336785
Fix off by one error 2023-08-20 20:29:15 +07:00
7d05332a90
Update hover check code to properly determine hover status in case of overlapping panels 2023-08-20 20:19:54 +07:00
b31114ba09
Also don't add exopack slots to menus if we don't have exopack 2023-08-20 17:45:39 +07:00
48f933920c
Don't pickup items into exopack inventory if we somehow have no exopack 2023-08-20 17:44:09 +07:00
e7c9abcebb
Proper sorting inputs in regular storage menus 2023-08-20 17:35:39 +07:00
35b186556e
Add "cancel all task" to button tooltip 2023-08-20 15:44:20 +07:00
b93e007388
Fix pattern panel not saving pause state 2023-08-20 15:43:18 +07:00
1ab252e57a
Move sorting order button sprite 1 pixel down 2023-08-20 15:42:49 +07:00
d4c029f27d
Slice container APIs and decouple interface from implementation, container sorting test 2023-08-20 15:39:20 +07:00
67f97dfba6
Move around and update container apis 2023-08-19 19:51:19 +07:00
9d79e52c43
Fix ref hash strategy 2023-08-19 17:38:19 +07:00
159c82cadd
Bump particle collider version 2023-08-19 17:08:40 +07:00
a6c849ef04
StrictReferenceHashStrategy 2023-08-19 15:13:50 +07:00
923f2e8ef6
java.lang.RuntimeException: Processing simple recipe skilltree:gem_insertion 2023-08-19 15:07:36 +07:00
37bb00d73e
Mmm! mmm. Custom Ingredients with getItems() returning literally minecraft:air 2023-08-19 14:52:20 +07:00
d7b5534bb5
Bump particle collider version 2023-08-19 14:37:31 +07:00
df43ac91de
e 2023-08-19 13:11:24 +07:00
b3863a2820
YuRaNnNzZZ — Сегодня, в 11:46
а какой именно стак то блять
2023-08-19 13:09:36 +07:00
fbc2a400de
YuRaNnNzZZ — Сегодня, в 7:46
Изображение
а какой именно стак то блять
2023-08-19 08:14:20 +03:00
62df3558e7
Bump particle collider version 2023-08-19 01:36:49 +07:00
e88c29be57
Revert "Fix ingredients being "empty" when playing multiplayer"
This reverts commit f56884705a.
2023-08-19 01:13:32 +07:00
260be58951
Write ingredients as plain itemstacks if networking 2023-08-19 00:56:03 +07:00
a0b0580bfa
Add circuit plating recipe to datagen 2023-08-19 00:18:48 +07:00
f56884705a
Fix ingredients being "empty" when playing multiplayer
These changes reflects Forge's PR https://github.com/MinecraftForge/MinecraftForge/pull/9688
2023-08-18 23:43:54 +07:00
0428b60561
Update pattern monitor 2023-08-18 21:05:35 +07:00
182bb4c8ba
Make Codec2RecipeSerializer thread safe 2023-08-18 13:59:57 +07:00
933521df10
Remove unused functions 2023-08-17 23:05:03 +07:00
eff453ed1c
Improve performance of IIngredientMatrix.isIncomplete inside baseline implementation 2023-08-17 22:59:30 +07:00
2e4984162b
Add manual invalidation to counter lazies 2023-08-17 22:55:44 +07:00
e6758f1e27
Matter entangler, ingredient matrix, shadow containers, quantum battery recipes, more JEI compat 2023-08-17 22:26:43 +07:00
04524db1a5
TickList tests 2023-08-17 14:33:26 +07:00
dba1e1e4a5
Add weak hash set test 2023-08-17 14:29:38 +07:00
77e6eebe92
If blockentity is ticking, don't synchronize to newly subscribed players right away 2023-08-17 14:15:27 +07:00
f0f1a3cffe
Fix adding timers not making ticklist dirty 2023-08-17 14:15:05 +07:00
b81971babd
Merge branch 'workingfluidcapsules' of https://git.dbotthepony.ru/DBot/overdrive_that_matters into master 2023-08-17 14:04:52 +07:00
66c356bd41
Update chunk map subscribers implementation 2023-08-17 13:58:01 +07:00
90348d5789
idling machines are now faster than ever
Rotate faaaster banan-a
2023-08-17 12:17:03 +07:00
a6eb0ca7f1
Drive rack insert/extract controls, profiled energy, updated menu, make redstone control of drive rack actually do stuff 2023-08-17 00:23:36 +07:00
10de6eb864
Remove flex grid panel since it is no longer utilized, and is flawed in its current state 2023-08-16 23:44:21 +07:00
3b6bac1a83
Follow quickmove slot priorities of vanilla 2023-08-16 20:52:12 +07:00
4430fdcb6b
Don't use own thread for drive syncing to disk, use Minecraft's background executor instead 2023-08-16 20:41:27 +07:00
8e03b4363d
Revisit quantum battery code and clean it up 2023-08-16 18:15:14 +07:00
8e2c1f25dc
lol 2023-08-16 14:26:33 +07:00
e08e6d7830
Reduce file count of painter recipes 2023-08-16 01:43:11 +07:00
840b103ee1
Fix painter table sometimes being unable to mix colors when it is clearly capable to do 2023-08-15 21:02:00 +07:00
320f0655d6
Move painter table to decorations subpackage 2023-08-15 20:48:24 +07:00
61b83d5f5a
Painter table 2023-08-15 20:04:27 +07:00
615912de8b
Rename block rotation freedom once again 2023-08-15 10:52:49 +07:00
7f1971cd81
Add particle collider to runtime 2023-08-13 12:07:16 +07:00
0c23e53bbc
Swap color palette for side controls 2023-08-12 15:01:41 +07:00
71c5e788c6
Update storage power supplier menu 2023-08-12 14:55:37 +07:00
6c7f2226a6
Unify storage exportert/importer menus, profile their energy and add energy config 2023-08-12 14:49:39 +07:00
d3ea51928f
Fix storage importer 2023-08-12 12:16:31 +07:00
dba7f3ad8d
forgor 2023-08-12 11:47:56 +07:00
1afa8e3d21
Flatten filter slots to just gettersetter 2023-08-12 11:44:49 +07:00
839e7cc503
Allow to remove subscribers while iterating them 2023-08-12 01:13:42 +07:00
f8c2be4d4c
Storage bus insert/extract priorities configuration, operation mode, small refactorings 2023-08-12 01:08:42 +07:00
b3249cdcd7
Insert and extract priorities in storage system 2023-08-10 17:36:31 +07:00
5784b3346f
More precise filters in textinputpanel 2023-08-10 17:36:07 +07:00
abe82d456c
Fix computed int not returning proper value clientside 2023-08-10 17:30:21 +07:00
62fdff4a34
Fix hasExopack change does not invalidate current exopack menu 2023-08-10 16:39:07 +07:00
834b05a697
Fix very obscure (undetected by HashSet) concurrent modification 2023-08-10 13:15:43 +07:00
506017f055
Bring storage system back to functional state
Add ISubscriptable, which is implemented by networked fields and networked inputs
Unify storage grid code
Add itemstack and itemstoragestack sorters
2023-08-10 12:55:45 +07:00
81a25973ef
работающие капсулы
DBot — 06.05.2023 15:04
Не поспорю
что увы
пока что
вся проблема знаешь в чём?
что взаимодействие ведра с блоками
не в предмете ведра
а в самих блоках.
за исключением waterlogging, оно в самом ведре
2023-08-07 16:26:54 +03:00
0754cf55eb
Don't throw actual exception when custom tex color shader fails to load 2023-08-07 14:18:55 +07:00
64d5f1b336
Refine storage api, make it compile 2023-08-06 23:13:15 +07:00
48d367b705
Remove Mekanism from runtime 2023-08-06 12:27:51 +07:00
22cac9d7a0
Add dev chest 2023-08-06 12:27:12 +07:00
a86d30dae4
Update storage interface and bus 2023-08-06 11:53:54 +07:00
93d4329acd
Refine graphs logic, make neighbouring be not limited on in-world directions, properly add freshly created nodes to graph after they have been properly initialized 2023-08-06 01:39:16 +07:00
be2424055d
Infinite water source block 2023-08-05 21:13:55 +07:00
ecc89e992c
Rename block rotation freedom to be more precise 2023-08-05 20:39:21 +07:00
2b85e5754f
Decrease initial capacity of hashtable in inventory trigger search tree
to reduce memory footprint
2023-08-05 02:01:44 +07:00
75b7614fdf
Delay advancement granting by one tick 2023-08-05 00:02:36 +07:00
5c3f0e54c1
Final cleanups regarding energy balance values 2023-08-04 22:59:20 +07:00
c3ed7f9556
Unneeded cast 2023-08-04 22:52:11 +07:00
f27f21e3de
Make Exopack slot changes trigger advancements, and optimize them 2023-08-04 22:50:59 +07:00
7662c21f44
Fix false negative assertions 2023-08-04 15:45:47 +07:00
e83933077e
Cleanup 2023-08-04 15:07:11 +07:00
6ab65c6c17
Update default shadow align in Label 2023-08-04 15:04:40 +07:00
e169012d01
Update android station config values 2023-08-04 14:54:30 +07:00
cef79cbe36
Redo chemical generator config values 2023-08-04 01:43:23 +07:00
cbb79c89b6
i had enough of CMEs out of nowhere
because there is no way there should be one
2023-08-03 20:11:32 +07:00
0073f41be6
ugly 2023-08-03 20:05:26 +07:00
98afdd1671
Don't tick side if no neighbour is present 2023-08-03 20:02:56 +07:00
109de2b414
Add streamy iterator docs 2023-08-03 19:50:19 +07:00
9ae099ec23
Add mutating operations to streamy iterators 2023-08-03 19:41:58 +07:00
5e7c8c08f5
Remove capability iterator 2023-08-03 19:32:28 +07:00
06e6168a73
Faster version of Container.balance 2023-08-03 18:36:17 +07:00
20d478cbfb
The fastest code is code which doesn't execute
Side automation no longer ticks if it doesn't automate
2023-08-03 18:32:41 +07:00
c08e262638
Use boolean for indices cow 2023-08-03 17:26:42 +07:00
7b317a2efb
CoW non empty indices in container 2023-08-03 17:25:01 +07:00
f18a3eaaaa
Redo matter bottler 2023-08-03 17:24:32 +07:00
b4c2f27c4c
Don't render exopack on invisible players 2023-08-02 22:05:01 +07:00
2614fd1f02
Rebalanced matter bottler values 2023-08-02 18:08:34 +07:00
c69fb5107c
Split main and dust containers of matter replicator 2023-08-02 17:25:49 +07:00
029a661978
Rebalance matter replicator storage values 2023-08-02 17:13:49 +07:00
cc4fcf398f
Remove isNotEmpty filter because they are already not empty 2023-08-02 16:32:22 +07:00
2720f6fbf0
Shortcuts for when current decimal is zero 2023-08-02 16:21:15 +07:00
8653dd343f
Finely optimize MatteryContainer iterator() and isEmpty(), add Cache<T> to container 2023-08-02 16:14:05 +07:00
0878bd9a7e
Make getMaxStackSize also accept itemstack 2023-08-02 13:50:53 +07:00
716ccae94a
Get rid of lambda container handler creation 2023-08-02 13:42:29 +07:00
6f17ed2767
Fix matter decomposer causing neighbour updates 2023-07-30 21:57:44 +07:00
cd48b90abf
Wrong order of calls 2023-07-30 11:25:03 +07:00
49fc5b5eaf
Fix mattery network dispatcher preventing server from exiting sometimes 2023-07-30 11:19:39 +07:00
7ce30ffd81
Add beforeBroadcast protected open method to mattery menus 2023-07-30 11:06:08 +07:00
99132412cd
Get text right away 2023-07-30 11:03:02 +07:00
5b30f2e916
Use sendNow in menus when sending data for first time 2023-07-30 11:01:22 +07:00
1eb90a5c17
call setChangedLight when job ticks 2023-07-30 10:48:49 +07:00
7053769e26
Inline container.set/get 2023-07-30 10:39:32 +07:00
c4e7b8ff15
Add sendNow methods 2023-07-30 10:17:26 +07:00
85ca7d8a24
Re-enable mixins 2023-07-30 01:56:48 +07:00
ed84905627
Exopack ender chest access upgrade 2023-07-30 01:50:30 +07:00
912e361693
why 2023-07-30 00:56:35 +07:00
bfc7947a62
Exopack smoke particles when furnace is working 2023-07-30 00:54:07 +07:00
fc715da518
Update protected -> public properties 2023-07-29 23:34:53 +07:00
e95e0f7d56
This is already done by KFF 2023-07-29 23:15:21 +07:00
5bb3f91f9a
Bump KFF to 4.4.0, Kotlin to 1.9.0
This fixes issue with "classes" triggering "jar" and "reobfJar"
2023-07-29 22:56:11 +07:00
0da8278998
Update build script 2023-07-29 22:45:52 +07:00
fa478e4b15
Use separate thread to dispatch OTM network packets to players 2023-07-29 19:17:40 +07:00
e57844bc1a
Decapitalize exopack menu/screen name 2023-07-29 18:14:12 +07:00
1c3001595a
Allow to charge offhand slot 2023-07-29 18:13:22 +07:00
9aa2f63a6d
Decapitalize "p" in "Exopack" 2023-07-29 18:05:54 +07:00
2afc01414b
Add offhand slot to all menus when exopack has at least 1 extra slot 2023-07-29 17:57:59 +07:00
dde37bc502
Fix frame tabs being too wide 2023-07-29 17:50:42 +07:00
1a9877a49d
Add exopack charge slots to all guis 2023-07-29 17:43:20 +07:00
232701b8bb
Fix ComputedField being unable to properly handle nullable types 2023-07-29 17:28:08 +07:00
e5d324f4fa
Get rid of registry network channel and merge it into generic network channel 2023-07-29 17:06:46 +07:00
3262cdfe8d
Get rid of world network channel and merge it into generic network channel 2023-07-29 17:05:42 +07:00
651febed96
Use menu inputs for inventory/exopack slot filter changes 2023-07-29 17:02:30 +07:00
092daf80d8
Powered furnaces advancements 2023-07-29 16:50:31 +07:00
ff308ee67a
Actual tabs sprites, and all 4 sprite states for them 2023-07-29 16:30:56 +07:00
1346a3774d
Don't store x and y in separate fields in rendergravity 2023-07-29 14:23:40 +07:00
5466b13496
Exopack battery is no longer dropped on death 2023-07-29 14:18:33 +07:00
d7332f4720
More consistent config names 2023-07-27 20:53:36 +07:00
43d14486b7
Move matter recycler config values to subobject 2023-07-27 20:51:58 +07:00
7bc58bb7ff
Matter reconstructor rebalanced values 2023-07-27 20:49:01 +07:00
8567e75b6f
Fix effect duration on rectangle button being misaligned 2023-07-27 13:42:07 +07:00
db5cdbe802
Bump JEI version, re-enable at runtime 2023-07-26 21:27:48 +07:00
f78094c1c9
Revert previous commit 2023-07-26 17:54:13 +07:00
28950955fd
Add missing matter recipes registration to event bus 2023-07-26 17:30:35 +07:00
aa7e0d9158
Add missing attack boost item requiremenets 2023-07-26 17:09:23 +07:00
0724d35b50
Make pressing enter in essence storage text field also set player level right away 2023-07-26 17:06:36 +07:00
138627f8de
Fix rectangle in android station screen not being transparent 2023-07-26 17:03:12 +07:00
f71bc632a0
Codec2RecipeSerializer.toFinished(), use it for plate press recipes 2023-07-26 16:41:10 +07:00
c0faf97bb8
Codec2RecipeSerializer, move recipe registry to kotlin 2023-07-26 16:23:58 +07:00
7a2ce84e5f
Update binary json funcs docs to reflect latest changes 2023-07-26 12:22:29 +07:00
07d698aeb5
Update IPatternStorage pattern signature 2023-07-26 12:12:28 +07:00
1e2611fd2e
Improve binary json 2023-07-26 12:08:09 +07:00
7c2d446563
Move stream extensions from stream codecs to friendly streams 2023-07-26 11:32:48 +07:00
b1eb99198a
Remove unused read/write type 2023-07-26 11:31:52 +07:00
2489266a40
Rename DataStreams into appropriate StreamCodecs 2023-07-26 11:31:23 +07:00
03403eb54d
Split FriendlyStreams 2023-07-26 11:30:49 +07:00
ea42b19e21
Split and move render classes 2023-07-26 11:27:20 +07:00
f4149b5797
Add constructor checks to replication task 2023-07-26 11:21:43 +07:00
4638899b20
Make Replication Task be only immutable, network Replication Tasks using codecs 2023-07-26 11:20:48 +07:00
a673ed966e
Make PatternState be only immutable, completely move it to codecs, write/read binary json with codec 2023-07-26 01:45:14 +07:00
662801df7d
write/read json -> write/read binary json 2023-07-26 01:11:46 +07:00
48fe9ada79
Update UUID codec 2023-07-26 00:04:52 +07:00
1f4f83367b
Add matter decomposer and scanner upgrades to menus 2023-07-25 20:27:49 +07:00
ee8c641a61
Matter scanner rebalanced values and added upgrades support 2023-07-25 20:18:30 +07:00
9c74b62f10
Move top level matter dust function to matter dust item 2023-07-25 19:41:44 +07:00
c226a988c3
Matter decomposer rebalanced values 2023-07-25 19:39:10 +07:00
325ee5da2e
Fix items with damage have wrong matter value calculation (off by one) 2023-07-25 18:53:05 +07:00
9abdd784c4
Make metal mesh drop itself 2023-07-25 17:17:08 +07:00
f6af6d59be
Use codecs to deserialize replication task from nbt data 2023-07-25 17:04:57 +07:00
c8e7cd4c93
Use codecs to deserialize pattern state from nbt tags 2023-07-25 17:02:34 +07:00
2be09fe5d2
YuRaNnNzZZ — Сегодня, в 10:42
:WiseTree:
2023-07-25 16:16:39 +07:00
1c6889f6bc
Is this some kind of sick joke 2023-07-25 14:57:38 +07:00
f0f3084070
GOD DAMN IT 2023-07-25 14:49:35 +07:00
a99d7e47cb
Bring back old structure names for jobs 2023-07-25 14:43:25 +07:00
88ddc51254
Wait im stupid 2023-07-25 14:29:38 +07:00
5aa52383d8
Merge remote-tracking branch 'origin/master' into master 2023-07-25 14:25:18 +07:00
8a78b299c5
Revamp job event loops, move jobs to codecs
Add PatternState codecs
Add ReplicationTask codecs
Instead of returning job status on job tick, now downstream code directly update status of provided job status object
Make Matter Replicator and Matter Recycler not do full stop when there is not enough matter/nowhere to put matter
2023-07-25 14:19:35 +07:00
e518f2c732
рендер шизы
(или жидкостях в танках-предметах)
#258
2023-07-25 05:58:32 +03:00
28801252fa
display i/o in jade for profiled storage (energy and matter)
closes #270
2023-07-24 21:40:35 +03:00
d4fb6d0b24
Make androids immune to synesthesia and plague from Rats mod 2023-07-24 09:44:13 +07:00
ef2c89ea0a
Merge remote-tracking branch 'origin/master' into master 2023-07-24 09:39:23 +07:00
8407ae1328
Cache text width when aligning it multiple times 2023-07-24 09:35:14 +07:00
e9793037bd
added harvest tool tag for metal junk and metal mesh (#275) 2023-07-24 04:20:08 +03:00
699b4e896c
Im blind 2023-07-24 00:53:57 +07:00
6dccbd5bfa
...unless you are in gui 2023-07-24 00:48:00 +07:00
e7c2f71022
Outline singularity text instead of dropping shadow 2023-07-24 00:44:32 +07:00
a161549392
positive Z is pointing from viewer 2023-07-24 00:43:04 +07:00
9744269ac6
GabeN :wtf: 2023-07-24 00:41:18 +07:00
00c3f17dd2
Add text outlining to hud values 2023-07-24 00:32:15 +07:00
e9f982eb6b
Redo text rendering as single function and revisit render gravity 2023-07-23 23:59:55 +07:00
a2f5f72aa8
Update config values for matter recycler block entity 2023-07-23 18:22:30 +07:00
636f99740a
Allow to undefine work speed in config value 2023-07-23 18:22:26 +07:00
7ba96185e5
Make ObservedConfigValue implement GetterSetter 2023-07-23 17:56:14 +07:00
ad54cfeb9b
Reflect new tritanium block recipe in advancement tree 2023-07-23 17:43:09 +07:00
8c83cce40d
Add close buttons to matter task monitor 2023-07-23 16:56:49 +07:00
7eec1c7032
Don't allow to prime primed hammer 2023-07-23 16:02:59 +07:00
94acd58516
Add exopack upgrades to recipe catalysts 2023-07-23 14:46:48 +07:00
478503e727
Update default plate press config values, and allow consumption and work speed to be configured 2023-07-23 13:04:04 +07:00
be802d1674
Balance furnace inputs before ticking jobs 2023-07-22 20:31:53 +07:00
8f76e1455b
мда 2023-07-22 15:07:35 +07:00
dc2661db9a
Fix quick move not displaying proper item counts 2023-07-22 12:31:58 +07:00
c887025a6c
Fix when Mattery energy is exposed as Mekanism energy it ignore energy flow direction
Just like Mekanism for a long time ignored throughput limits when something charge its items through Forge Energy
2023-07-22 12:05:41 +07:00
d2c2fbd3d2
Fix crash related to tracking mekanism energy 2023-07-22 11:58:24 +07:00
e8d7f0225c
Don't check for energy flow when working with mekanism energy 2023-07-22 11:58:23 +07:00
1ff20b090f *Collapses* 2023-07-22 05:47:43 +06:00
b2e50a6c1b
Fix mekanism energy getting above potential IMatteryEnergyStorage 2023-07-21 21:40:15 +07:00
ca32929f3c
New furnaces shapes 2023-07-21 21:31:49 +07:00
7e0ea033b4
Merge remote-tracking branch 'origin/master' into master 2023-07-21 21:25:25 +07:00
93696261e4
Prevent cargo crate dupe 2023-07-21 21:11:11 +07:00
58b9ea33e4
Add jei catalysts for new furnaces 2023-07-21 20:47:43 +07:00
19e205b527 Furnaces 2023-07-21 17:53:25 +06:00
90ae56dbdc Matter upgrades texture (not implemented) 2023-07-21 02:54:39 +06:00
8d4e0d83ee Electric furnace model (Looks broken atm, TODO: fix it) 2023-07-21 02:52:59 +06:00
77a619cba6
Add worker blockstate to powered furnaces 2023-07-20 18:24:38 +07:00
436d324b50
Less generous recipe for blast furnace, update microwave recipe 2023-07-20 18:17:48 +07:00
e1681a5c6f
recipes for new machines 2023-07-20 18:09:30 +07:00
5659fb2040
YuRaNnNzZZ прокомментировал(а) 1 день назад
электрическая печь - furnace
индукционная печь - blast furnace
микроволновка - smoker
2023-07-20 17:58:14 +07:00
1f1b6e5f59
Powered Furnace, Blast Furnace, Smoker 2023-07-20 17:27:01 +07:00
54bc1bdd40
plasma projectile render 2023-07-20 02:05:33 +03:00
7f22b1e175
block sweeping edge enchantment for energy sword 2023-07-20 01:34:15 +03:00
ecb68ec36f
Make matter reconstructor push excess matter back into network 2023-07-19 21:29:27 +07:00
b3e6caf5ba
Matter replicator failsafe upgrades support 2023-07-19 21:26:33 +07:00
ab51740ddf
Matter reconstructor upgrades support 2023-07-19 21:26:22 +07:00
9cd5bad152
If we are ticking normally, don't use global tick handler to send blockentity changes to players 2023-07-19 18:43:26 +07:00
135dcb667d
Fix matter replicator losing upgrades 2023-07-19 18:39:30 +07:00
2095055e73
Add matter capacity upgrade 2023-07-19 18:30:35 +07:00
91d0f5a65b
I forgor to add replicator upgrades to its menu 💀 2023-07-19 17:32:33 +07:00
31cb9973d5
Shortcut when trying to receive/extract zero matter 2023-07-19 17:18:02 +07:00
d534ebbbf2
GabeN 2023-07-19 17:17:45 +07:00
12cd0b758c
Merge remote-tracking branch 'origin/master' into master 2023-07-19 17:14:54 +07:00
41b5b1a57b
Even more ComputeAction/Constant codecs 2023-07-19 17:14:45 +07:00
47feee8425
Fix blacklist action were not properly serialized 2023-07-19 17:06:39 +07:00
03c12c5737
do use recipe_type for crafting recipe finder
for things like create mechanical crafting support
2023-07-19 11:24:52 +03:00
bd34ad8d3b
replicator return unused matter back to network 2023-07-19 09:28:35 +03:00
3aaa595d7b
Merge remote-tracking branch 'origin/master' into master 2023-07-19 11:34:12 +07:00
fe870bd4a8
Send matter back into network when not working, inside matter replicator 2023-07-19 11:29:07 +07:00
b00d275d0f
Add upgrades to matter replicator 2023-07-19 11:27:10 +07:00
ec8aa1330c
YuRaNnNzZZ — Сегодня, в 6:06
а где.
2023-07-19 06:20:33 +03:00
cc31b6e4bb
pattern monitor pattern advanced tooltip lines 2023-07-19 05:51:59 +03:00
824d75a680
highlight selected enum in tooltips 2023-07-19 05:06:33 +03:00
5c2791c30c
matter scanner visual progress 2023-07-19 04:42:58 +03:00
18a10e1f6c
round down scan percent 2023-07-19 03:13:33 +03:00
ab7e416453
draw research and replication progress in pattern monitor 2023-07-19 02:27:10 +03:00
3b57dcb599
ты кому звонишь 2023-07-19 02:12:03 +03:00
035c3edcad
Make plate press accept processing upgrade 2023-07-18 21:14:06 +07:00
9758a3474c
Fix processing upgrade showing two plus signs in description 2023-07-18 21:13:51 +07:00
cc9d2ef4eb
Move matter registry to codecs, simplify manual writing of matter json files 2023-07-18 20:36:01 +07:00
667e074362
Expose help and close buttons as properties 2023-07-18 13:39:09 +07:00
bafe74ea24
Move quicksearch bar in pattern monitor to not overlap close button 2023-07-18 13:37:16 +07:00
1ee071bfdb
Build creative mode tabs contents when it is not built when using creativetabsorter 2023-07-18 13:32:02 +07:00
c6117e659d
Don't process android ability key logic if we are a spectator
server already ignores feature activation if we are a spectator
2023-07-18 13:19:03 +07:00
15f53ea124
Don't display "slot charging" help if player has no exopack 2023-07-18 13:02:01 +07:00
dc50a79b20
Merge remote-tracking branch 'origin/master' into master
# Conflicts:
#	src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt
#	src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/Russian.kt
2023-07-18 12:04:13 +07:00
a707e49b8c
Exopack coloring and toggle exopack glowing 2023-07-18 01:55:17 +07:00
25875b162e
Improve blocker flashing 2023-07-18 01:54:21 +07:00
0e9a480dd8
Make checkboxes accept GetterSetter as checking property 2023-07-18 00:57:24 +07:00
687b5c9726
Move extension functions to interface itself, add box() GetterSetter 2023-07-18 00:56:16 +07:00
6a5924267a
Make callback be mutable property 2023-07-18 00:52:42 +07:00
67c54357e8
bump forge to recommended build 2023-07-15 22:48:14 +03:00
d0334e761d
better colors for jade bars 2023-07-15 21:02:47 +03:00
4daa0be19a
Color picker panel 2023-07-15 19:41:31 +07:00
9394de61d9
Make TextInputPanel obey acceptsCharacter when pasting from clipboard 2023-07-15 19:40:11 +07:00
9fe8d1734e
Add RGBAColor stream codecs 2023-07-15 19:39:38 +07:00
04f58c01db
Add HSVColor, massively overhaul RGBAColor class 2023-07-15 19:39:25 +07:00
d855234808
Add panel children sorting 2023-07-15 19:38:53 +07:00
c71a1ab0d6
Open FramePanel's title getter/setter to public 2023-07-15 19:37:56 +07:00
57b2b64ff9
Add custom position/tex/color shader without fragment discarding 2023-07-15 19:35:38 +07:00
f5a9e98c6f
Add codec to savetables 2023-07-15 19:35:11 +07:00
f2e4c80d31
jade compat
DBot — Сегодня, в 6:21
Не думай.
2023-07-15 07:48:59 +03:00
027d6ef65f
exopack curios inventory button 2023-07-14 22:25:48 +03:00
6105ca797b
If it ever happens, avoid dividing by zero 2023-07-12 14:41:40 +07:00
203f4e56c9
YuRaNnNzZZ — Вчера, в 20:54
мне кажется надо задать максимальный размер стака 1 в банках
:WiseTree:
2023-07-11 19:02:32 +03:00
30fdd2fd28
procedural battery energy bar 2023-07-11 18:57:15 +03:00
37974d40b9
Refine render methods and functions 2023-07-10 21:48:59 +07:00
0444568c64
YuRaNnNzZZ — Сегодня, в 18:42
убери нахуй курио слоты из экзопака
2023-07-10 18:44:43 +07:00
4b6909fc0b Smelting upgrade texture and machine upgrade textures 2023-07-10 03:38:09 +06:00
5973ea3565 Fix funny blockpos checks for Android chargers 2023-07-10 01:46:22 +06:00
fe77e8df60
updated localization files 2023-07-09 22:58:50 +07:00
2ac990c82d
Make exopack smelter not start new job when no power is present, and make exopack power changes notify smelters 2023-07-09 22:57:59 +07:00
5800ddc9ad
Reorganize advancements, add exopack and more machine advancements 2023-07-09 22:54:21 +07:00
dfb07cc9c5
Fix awarding android stats for using exopack energy 2023-07-09 16:39:37 +07:00
a71cab3564
Fix closing exopack inventory with furnace tab open won't reopen it (visually) on furnace tab 2023-07-09 16:14:36 +07:00
0cab072037
Make onClick public, so code can simulate button press 2023-07-09 16:14:10 +07:00
27e767033e
updated localization files 2023-07-09 16:02:57 +07:00
4e6b6d1681
и почему крестика нет в экзопаке 2023-07-09 16:01:40 +07:00
0b06ea4739
Buff wireless android charger energy capacity 2023-07-09 15:59:42 +07:00
7ec4a66923
Wireless android charger crafting recipe 2023-07-09 15:59:11 +07:00
c12364a855
Fix upgrades not checking correct property 2023-07-09 15:51:33 +07:00
cef4bdb033
Holy shit 2023-07-09 15:50:44 +07:00
5d8b770b94
Do some code cleaning in field synchronizer 2023-07-09 15:48:04 +07:00
2095120abd
Make help and close buttons bigger 2023-07-09 15:22:29 +07:00
86feb87a53
Move empty slot background from constructor to mutable property 2023-07-09 15:09:51 +07:00
f598cc7bbd
Proper charge slot background 2023-07-09 15:06:42 +07:00
2e894abd67
Make help and close buttons lesss ugly 2023-07-09 14:50:55 +07:00
37f4b77994
Exopack arbitrary inventory slots charging 2023-07-09 14:45:13 +07:00
344364520d
Frame panel help button, panel post render, more straightforward tooltips 2023-07-09 11:38:25 +07:00
a3c794271f
Increase "onAttackEvent" listener priority
e.g. so other mods which add armor with fall damage immunity won't receive event of fall damage received when damage is actually negated by android fall dampeners
2023-07-09 00:15:44 +07:00
6f4b028461
Clarify about exopack and android energy max capacity config values 2023-07-09 00:12:36 +07:00
8f450c2058
Actually, internal energy storage of exopack can be made upgradeable instead of giving it huge capacity by default 2023-07-09 00:11:23 +07:00
db99fb339c
Update vanish/clear/drop inventory hooks 2023-07-09 00:09:49 +07:00
024a25f72a
Exopack charger slots 2023-07-08 23:58:41 +07:00
2e4cb8b3f9
Massively buff exopack energy storage 2023-07-08 23:25:26 +07:00
55d56e3efe
Add exopack smelting upgrade recipe 2023-07-08 22:17:26 +07:00
8091f6aeb0
Fix Server being unable to start 2023-07-08 21:57:59 +07:00
86a8011f29
Jump boost now have particles 2023-07-08 21:47:13 +07:00
1902912a3b
Fix exopack battery slot granting android achievements 2023-07-08 15:33:20 +07:00
b957378c60
Iterate IGUIRenderable, update panels to accept IGUIRenderable where applicable 2023-07-08 02:15:09 +07:00
f9c1258afe
Make FramePanel.Tab inherit actual button 2023-07-08 01:12:42 +07:00
109145c3ce
Clear depth after rendering item stack icons 2023-07-08 01:08:48 +07:00
e084221fde
Remove unused hooks code 2023-07-08 01:07:51 +07:00
84640e0ca4
Do the same for inventory clear 2023-07-08 01:04:17 +07:00
c9ef3e635b
Make exopack smelters drop their slots and lose current progress on death 2023-07-08 01:03:13 +07:00
ccf2a162a3
Fix moveItemStackTo not calling onTake 2023-07-08 00:57:16 +07:00
3cacf7f11f
Exopack smelting, RenderGravity, IGUIRenderable 2023-07-08 00:51:37 +07:00
311af4f8d9
This is stupid 2023-07-06 17:07:00 +07:00
f9a365b6dc
Add flat fall damage resistance and nerf percent based damage resistance 2023-07-06 16:51:32 +07:00
27908cfe83
Fix gracefulBlockBreak not dropping correct blockentity drops 2023-07-06 14:06:57 +07:00
a935ce6874
Add battery slot to "storage slots" in android charger menu 2023-07-06 14:01:03 +07:00
92fa4a4130
ConditionalSet#actuallyContains 2023-07-06 13:59:00 +07:00
b578e9d8d8
Add middle and top block entities to android charger 2023-07-06 13:57:13 +07:00
4dbf7cdc1c
Fix gracefulBlockBreak not calling onRemove 2023-07-06 13:54:59 +07:00
6d205b3b4a
Add empty energy storage 2023-07-06 13:13:01 +07:00
0d069a2d8e
Add proxied energy storage 2023-07-06 13:12:54 +07:00
1955975cee
Fix updating machine configuration not marking chunk dirty 2023-07-06 13:12:44 +07:00
e2b340ceaf
Clarify destroy_blocks config option 2023-07-06 12:48:46 +07:00
18f0f833f3
блокстейты + шейпы + модель предмета для зарядника 2023-07-06 03:14:08 +03:00
507f0cbe41 Android charger segmented model 2023-07-06 03:18:12 +06:00
6b5b1f938a
YuRaNnNzZZ — Сегодня, в 0:22
время проводить дестримификацию
2023-07-06 01:09:39 +07:00
296476e1d8
Update singularity formulas, make getEllipsoidBlockPositions return iterator 2023-07-06 00:35:32 +07:00
87d29f0c4b
Blackhole "destroy blocks" config entry 2023-07-05 21:19:31 +07:00
0ad88d668c
Fix unexpected quickmove order for upgrade slots 2023-07-05 18:08:32 +07:00
6d409f29f6
Useless bounds 2023-07-05 18:03:05 +07:00
a8904bf570
Fix energy consumption upgrade not showing its value 2023-07-05 18:02:51 +07:00
5d69275fd4
Fix speed upgrade not actually working 2023-07-05 17:57:08 +07:00
90dc9060cf
Add missing close buttons 2023-07-05 17:45:09 +07:00
1ad0a41786
oh my god 2023-07-05 17:07:59 +07:00
9dcf24cae7
Upgrade system, conditional quickmove slots, frame panel close button 2023-07-05 17:06:31 +07:00
6690ca03c4
YuRaNnNzZZ — Сегодня, в 17:34
это-то легко

<----- clueless
2023-07-01 18:18:15 +03:00
dc70b99868
correct lighting for liquid in tank (no glow) 2023-07-01 17:10:06 +03:00
c110aed90b
выстрел в ногу ВСЕМ
progress towards #258
prototype, missing: lighting, item render
2023-07-01 04:09:43 +03:00
b27ef2ea79
better combat presets for energy sword and explosive hammer (both not autodetected by mod) 2023-06-29 11:31:21 +03:00
e987c64cd9
debug commands to toggle exopack and android capabilities 2023-06-28 19:37:43 +03:00
f08635e192
YuRaNnNzZZ — Сегодня, в 19:51
ну так раздюпай
2023-06-28 19:59:13 +07:00
2f59edd606
чудеса ASM и многократной потери рассудка #193 2023-06-28 15:40:33 +03:00
fced3058d5
Update energy counter screen 2023-06-28 19:29:15 +07:00
4d4ecd28a5
Move sprite panel to general panels 2023-06-28 15:49:21 +07:00
708281df4c
Update mekanism energy integration code pieces 2023-06-28 14:43:12 +07:00
516ba8ca34
Bump mekanism version 2023-06-28 13:50:42 +07:00
6660a929b9
Don't do full battery refill 2023-06-27 22:22:58 +07:00
f6519e12e3
Add missing locale strings for running out of power 2023-06-27 22:21:01 +07:00
48d58c42dc
Further update hunger handling and patch FoodData 2023-06-27 22:01:36 +07:00
d74c8a06f5
Damage android players in event of battery discharge 2023-06-27 20:59:25 +07:00
e3bc9e226f
Wireless android charger and misc fixes 2023-06-27 19:14:16 +07:00
0ec8f3709a Add a few pixels to matter cable texture 2023-06-27 00:22:40 +06:00
3c90489dea Reduce the humongous amount of empty (But not really) space on texture atlas 2023-06-27 00:07:10 +06:00
26236a5b07 Fix twin plate press texture funny 2023-06-26 23:50:50 +06:00
f7af09b62e
Actually make custom machine names working 2023-06-26 23:35:59 +07:00
0704da4be0
Creative tabs no longer appear where they shouldn't 2023-06-26 22:24:54 +07:00
b3d1db2afa
Buff plate press and twin plate press recipes 2023-06-26 19:16:17 +07:00
eec453f7ff
Allow to configure event horizon damage and gravity forces 2023-06-26 18:45:19 +07:00
79c4e560b9
Выстрел себе в ногу 2023-06-26 16:30:08 +07:00
23dc91fb55
use vanilla water/lava textures for cobblegen 2023-06-26 09:58:51 +03:00
5b6a651340
plate press block shape 2 2023-06-26 09:10:21 +03:00
8dd332a2e1 Plate press 2 2023-06-26 01:55:29 +06:00
6a283bafe9
Make datapack registries not persistent
because they don't need to
2023-06-25 21:04:29 +07:00
7eaab24f9d
YuRaNnNzZZ — Сегодня, в 18:27
thanks direwolf
2023-06-25 20:59:28 +07:00
bc340cc317
YuRaNnNzZZ — Сегодня, в 18:27
thanks direwolf
2023-06-25 20:55:13 +07:00
0648667480
Revert "Forge seemingly removed its lootpool deserializer patches"
This reverts commit 926b9a2a17.
2023-06-25 11:00:27 +07:00
d7e62690e1
Bump forge to 47.0.19 2023-06-25 11:00:26 +07:00
65008b2a56 Update cobblestone generator model and make matter decomposer matter canisters glow 2023-06-25 04:03:22 +06:00
7cddbdea31
Optimize Container.balance 2023-06-23 23:56:50 +07:00
dbf28efe89
Optimize Container.balance 2023-06-23 23:42:30 +07:00
4f7c9ea176
Input balancing 2023-06-23 23:30:40 +07:00
2e37ff5de4
Twin plate press 2023-06-23 00:47:32 +07:00
f4c36cc728
Specify "id" of job event loop 2023-06-23 00:04:10 +07:00
97d3a07065
Allow MatteryWorkerBlockEntity to have multiple job event loops 2023-06-23 00:00:35 +07:00
4e62b47f84
Rename fraction() to decimal() in FieldSynchronizer 2023-06-22 22:55:30 +07:00
2298dd17c7
Update black hole code structure 2023-06-22 22:55:00 +07:00
4cd0c4c555
ad astra version bump 2023-06-20 21:03:43 +03:00
c40375d607
Add ConsumeResearchCost event 2023-06-20 21:43:03 +07:00
a518c98999
Visual clarity for added event classes 2023-06-20 21:38:38 +07:00
805297564a
Add more events to android research 2023-06-20 21:37:05 +07:00
070b962df9
Add GatherTooltipsEvent to AndroidResearch 2023-06-20 21:28:01 +07:00
da89401985
updated localization files 2023-06-20 21:15:53 +07:00
1a9ae25fa8
Remove phantom attractor research advancement 2023-06-20 21:01:16 +07:00
c76681d740
React to ESC press while android research tree is open 2023-06-20 20:58:14 +07:00
378f39b877
Remove phantom attractor as android feature 2023-06-20 20:41:35 +07:00
ab61101ab6
Pull and push modes now can be independently configured 2023-06-20 20:36:33 +07:00
e83121c77a
a 2023-06-20 19:26:59 +07:00
85c426e2b6
Update striped tritanium block texture 2023-06-20 18:08:54 +07:00
c6e0777942
YuRaNnNzZZ — Сегодня, в 17:38
:WiseTree:
2023-06-20 17:39:24 +07:00
c9026b1cf7
Bump forge to 47.0.4 2023-06-20 17:20:01 +07:00
02606c5ac6
Mappings are no longer present 2023-06-20 11:33:29 +07:00
a8eeebc166
Useless 2023-06-20 11:32:00 +07:00
734655f53b
Fix "isRigid" being the opposite of "optional" in research builder 2023-06-20 11:30:40 +07:00
fa22fb7cce
Add compound tag to android research for storing arbitrary data with research 2023-06-20 11:22:36 +07:00
3117349757
Move android research type to codecs 2023-06-20 00:32:59 +07:00
e39bb8e1ab
More meaningful error 2023-06-20 00:24:04 +07:00
90de22b288
Update streams tests 2023-06-20 00:23:44 +07:00
ddc3850722
Fix writeJson and readJson trying to correct negative numbers, when writeVarLong already does this 2023-06-20 00:23:34 +07:00
09db4ad9e9
Revisit how android research datapacks work
Instead of "feature results" provide them with just "results", which reference arbitrary features from registry
Do the same to research description, with its own registry
2023-06-19 21:37:43 +07:00
dfa14ca2a1
Add missing json null writer for writeJson 2023-06-19 21:31:14 +07:00
2bc9aa8f06
Put 3 decimals by default when formatting numbers, always SI format numbers smaller than 1
Formatting numbers in SI format when they are smaller than 1 by absolute value
avoids case where we want to see "exact" values, but value is too small to be displayed without SI prefix
2023-06-18 18:32:42 +07:00
849563e7eb
Remove Decimal interning 2023-06-18 18:15:08 +07:00
9276d087df
Greatly increase Decimal cache pool 2023-06-18 17:57:00 +07:00
f8e9d20094
Get rid of Long precision value, since it upper limits possible precision 2023-06-18 17:48:51 +07:00
48ee669458
New Decimal class, with fixed point and compile-time precision 2023-06-18 17:45:48 +07:00
1c7abed6e9
Fix matter manager recipe finder creating item stacks with infinite cost 2023-06-18 17:43:23 +07:00
9efad96aff Sligthly update machine frame 2023-06-16 22:20:32 +06:00
fed99d4104 Remove some unnecessary faces 2023-06-16 22:13:54 +06:00
8c06b0e497 Matter replicator texture update 2023-06-16 17:26:22 +06:00
ab1b752f3c
⚙ SHOCKY — Сегодня, в 1:34
о ниеее рендер предмета что печатается больше не работает
2023-06-16 09:23:44 +07:00
a2dc3c7d97 Updated redstone signal configuration widgets (?) 2023-06-16 01:23:27 +06:00
0da6a8bd28
Better names for additions 2023-06-16 00:18:04 +07:00
afe46b0bd9
Separate job loop logic from Worker Block Entity into own class 2023-06-15 15:34:26 +07:00
a040e4cc63
Bump dependencies in mods.toml 2023-06-13 22:20:13 +07:00
1acb78cc15
I AM ONCE AGAIN disabling runtime dependencies 2023-06-13 20:58:43 +07:00
320bbaaf1d
Bump to Minecraft 1.20.1 2023-06-13 20:58:11 +07:00
2467 changed files with 79031 additions and 43195 deletions

2
.gitignore vendored
View File

@ -31,3 +31,5 @@ logs/
forge*changelog.txt forge*changelog.txt
shapegen_output.java shapegen_output.java
/runs
/.kotlin

View File

@ -1,22 +1,21 @@
# Overdrive That Matters # Overdrive That Matters
Minecraft mod with science fiction style, about matter, and energy, combined. Minecraft tech-oriented mod with science fiction style, about matter, and energy, combined.
### Required mods ### Required mods
* [Kotlin for Forge](https://www.curseforge.com/minecraft/mc-mods/kotlin-for-forge) or have Kotlin standard library in classpath (at least 1.8.0 is required) * [Kotlin for Forge](https://www.curseforge.com/minecraft/mc-mods/kotlin-for-forge) or have Kotlin standard library in classpath (at least 2.0.0 is required)
* [Koremods](https://beta.curseforge.com/minecraft/mc-mods/koremods)
### Recommended mods ### Recommended mods
* [Ferrite Core](https://www.curseforge.com/minecraft/mc-mods/ferritecore), reduces memory usage * [Ferrite Core](https://www.curseforge.com/minecraft/mc-mods/ferritecore), reduces memory usage
* In case of Overdrive That Matters, ***greatly*** reduces JVM heap bloat caused by model data being duplicated * In case of Overdrive That Matters, ***greatly*** reduces JVM heap bloat caused by model data being duplicated
* Better Random
### Mods with special compatibility code ### Mods with special compatibility code
* [JEI](https://www.curseforge.com/minecraft/mc-mods/jei) * [JEI](https://www.curseforge.com/minecraft/mc-mods/jei)
* [Mekanism](https://www.curseforge.com/minecraft/mc-mods/Mekanism)
* [Curios](https://www.curseforge.com/minecraft/mc-mods/curios) * [Curios](https://www.curseforge.com/minecraft/mc-mods/curios)
* [Cosmetic Armor Reworked](https://www.curseforge.com/minecraft/mc-mods/cosmetic-armor-reworked) * [Cosmetic Armor Reworked](https://www.curseforge.com/minecraft/mc-mods/cosmetic-armor-reworked)
@ -45,9 +44,9 @@ to avoid bloating git history with generated blobs.
## License ## License
Unless otherwise stated in [NOTICE](NOTICE.md), material in mod is licensed under **2-Clause BSD** Unless otherwise stated in [NOTICE](NOTICE.md), assets in mod are licensed under **2-Clause BSD**
Copyright 2021-Present DBotThePony, GearShocky, Overdrive That Matters Contributors Copyright 2021-Present DBotThePony, GearShocky, YuRaNnNzZZ, Overdrive That Matters Contributors
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

View File

@ -1,35 +1,30 @@
import groovy.lang.Closure
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.util.Date import java.util.Date
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import it.unimi.dsi.fastutil.io.FastByteArrayOutputStream import it.unimi.dsi.fastutil.io.FastByteArrayOutputStream
import java.util.UUID import org.gradle.kotlin.dsl.accessors.runtime.addDependencyTo
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
val mod_version: String by project val mod_version: String by project
val mc_version: String by project val mc_version: String by project
val parchment_version: String by project
val forge_version: String by project val forge_version: String by project
val mod_id: String by project val mod_id: String by project
val handle_deps: String by project val handle_deps: String by project
val use_commit_hash_in_version: String by project val use_commit_hash_in_version: String by project
val handleDeps = handle_deps.toBoolean() val handleDeps = handle_deps.toBoolean()
val caffeine_cache_version: String by project
plugins { plugins {
java java
kotlin kotlin
idea
`maven-publish` `maven-publish`
id("net.minecraftforge.gradle") id("net.neoforged.gradle.userdev")
id("org.spongepowered.mixin") id("net.neoforged.gradle.mixin")
id("org.parchmentmc.librarian.forgegradle")
} }
configurations { data class GitInfo(val version: String, val tag: String, val buildNumber: String) {
create("library") // non-mod libraries
create("klibrary") // kotlin libs
get("implementation").extendsFrom(get("library"), get("klibrary"))
}
data class GitInfo(val version: String, val count: String, val tag: String, val buildNumber: String) {
// val tagIsVersion: Boolean get() = tag != "" && tag.matches(Regex("v[0-9]+\\.[0-9]\\.[0-9]")) // val tagIsVersion: Boolean get() = tag != "" && tag.matches(Regex("v[0-9]+\\.[0-9]\\.[0-9]"))
val publishVersion: String get() { val publishVersion: String get() {
@ -56,18 +51,11 @@ data class GitInfo(val version: String, val count: String, val tag: String, val
} }
val modVersion: String get() { val modVersion: String get() {
if (tag != "") return if (buildNumber != "") "$mod_version.$buildNumber" else mod_version
return mod_version
if (version != "") {
return "$mod_version-SNAPSHOT-$version"
} else {
return "$mod_version-SNAPSHOT"
}
} }
} }
val gitVersion = getCommitVersion() ?: GitInfo("", "", "", "") val gitVersion = getCommitVersion() ?: GitInfo("", "", "")
version = gitVersion.modVersion version = gitVersion.modVersion
group = "ru.dbotthepony" group = "ru.dbotthepony"
@ -76,7 +64,6 @@ fun getCommitVersion(): GitInfo? {
try { try {
val versionStream = FastByteArrayOutputStream() val versionStream = FastByteArrayOutputStream()
val tagStream = FastByteArrayOutputStream() val tagStream = FastByteArrayOutputStream()
val countStream = FastByteArrayOutputStream()
val gotVersion = exec { val gotVersion = exec {
commandLine("git", "rev-parse", "--short", "HEAD") commandLine("git", "rev-parse", "--short", "HEAD")
@ -84,27 +71,20 @@ fun getCommitVersion(): GitInfo? {
standardOutput = versionStream standardOutput = versionStream
}.exitValue == 0 }.exitValue == 0
val gotCount = exec {
commandLine("git", "rev-list", "--count", "HEAD")
workingDir(".")
standardOutput = countStream
}.exitValue == 0
val gotTag = exec { val gotTag = exec {
commandLine("git", "tag", "--points-at", "HEAD") commandLine("git", "tag", "--points-at", "HEAD")
workingDir(".") workingDir(".")
standardOutput = tagStream standardOutput = tagStream
}.exitValue == 0 }.exitValue == 0
if (!gotVersion || !gotCount || !gotTag) { if (!gotVersion || !gotTag) {
return null return null
} }
val version = versionStream.array.copyOfRange(0, versionStream.length).toString(Charsets.UTF_8).trim() val version = versionStream.array.copyOfRange(0, versionStream.length).toString(Charsets.UTF_8).trim()
val tag = tagStream.array.copyOfRange(0, tagStream.length).toString(Charsets.UTF_8).trim() val tag = tagStream.array.copyOfRange(0, tagStream.length).toString(Charsets.UTF_8).trim()
val count = countStream.array.copyOfRange(0, countStream.length).toString(Charsets.UTF_8).trim()
return GitInfo(version, count, tag, System.getenv("BUILD_NUMBER") ?: "") return GitInfo(version, tag, System.getenv("BUILD_NUMBER") ?: "")
} catch(err: Throwable) { } catch(err: Throwable) {
println("Error getting git version") println("Error getting git version")
println(err) println(err)
@ -113,13 +93,13 @@ fun getCommitVersion(): GitInfo? {
return null return null
} }
java.toolchain.languageVersion.set(JavaLanguageVersion.of(17)) java.toolchain.languageVersion.set(JavaLanguageVersion.of(21))
println("Targeting Java ${java.toolchain.languageVersion.get()}") println("Targeting Java ${java.toolchain.languageVersion.get()}")
tasks.withType(KotlinCompile::class.java) { tasks.withType(KotlinCompile::class.java) {
kotlinOptions { compilerOptions {
freeCompilerArgs = listOf("-Xjvm-default=all") freeCompilerArgs = listOf("-Xjvm-default=all")
jvmTarget = java.toolchain.languageVersion.get().toString() jvmTarget.set(JvmTarget.JVM_21)
} }
} }
@ -130,7 +110,9 @@ tasks.withType(JavaCompile::class.java) {
sourceSets { sourceSets {
create("data") { create("data") {
compileClasspath += sourceSets["main"].output compileClasspath += sourceSets["main"].output
compileClasspath += sourceSets["main"].compileClasspath
runtimeClasspath += sourceSets["main"].output runtimeClasspath += sourceSets["main"].output
runtimeClasspath += sourceSets["main"].runtimeClasspath
} }
this["main"].resources { this["main"].resources {
@ -141,101 +123,119 @@ sourceSets {
tasks.test { tasks.test {
useJUnitPlatform() useJUnitPlatform()
maxHeapSize = "4G"
} }
configurations {
create("embeddedLibs")
}
jarJar.enable()
dependencies { dependencies {
val jupiter_version: String by project val jupiter_version: String by project
val kotlin_version: String by project
val kotlin_for_forge_version: String by project val kotlin_for_forge_version: String by project
val kotlin_coroutines_version: String by project
val kotlin_serialization_version: String by project
val mixin_version: String by project val mixin_version: String by project
val kommons_version: String by project
minecraft("net.minecraftforge:forge:$mc_version-$forge_version") implementation("net.neoforged:neoforge:$forge_version")
testImplementation("org.junit.jupiter:junit-jupiter:${jupiter_version}") testImplementation("org.junit.jupiter:junit-jupiter:${jupiter_version}")
implementation("thedarkcolour:kotlinforforge:$kotlin_for_forge_version") implementation("thedarkcolour:kotlinforforge-neoforge:$kotlin_for_forge_version")
fun library(notation: Any) { this.add("library", notation) } jarJar(implementation("com.github.ben-manes.caffeine:caffeine:[$caffeine_cache_version,)")!!)
fun klibrary(notation: Any) { this.add("klibrary", notation) }
val excludeKGroup = closureOf<Any> { jarJar(implementation("ru.dbotthepony.kommons:kommons:[$kommons_version,)") { setTransitive(false) })
(this as ExternalModuleDependency).exclude(group = "org.jetbrains", module = "annotations") jarJar(implementation("ru.dbotthepony.kommons:kommons-gson:[$kommons_version,)") { setTransitive(false) })
} as Closure<Any> jarJar(implementation("ru.dbotthepony.kommons:kommons-guava:[$kommons_version,)") { setTransitive(false) })
klibrary(create("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version", excludeKGroup))
klibrary(create("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version", excludeKGroup))
klibrary(create("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version", excludeKGroup))
klibrary(create("org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:$kotlin_coroutines_version", excludeKGroup))
klibrary(create("org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlin_serialization_version", excludeKGroup))
compileOnly("yalter.mousetweaks:MouseTweaks:2.23:api") compileOnly("yalter.mousetweaks:MouseTweaks:2.23:api")
annotationProcessor("org.spongepowered:mixin:${mixin_version}:processor") annotationProcessor("org.spongepowered:mixin:${mixin_version}:processor")
if (handleDeps) { if (handleDeps) {
val jei_version: String by project val jei_version: String by project
val mekanism_version: String by project
val cosmetic_armor_reworked_id: String by project val cosmetic_armor_reworked_id: String by project
val jade_id: String by project val jade_id: String by project
val configured_id: String by project val configured_id: String by project
val curios_version: String by project val curios_version: String by project
val jei_mc_version: String by project val jei_mc_version: String by project
val curios_mc_version: String by project val curios_mc_version: String by project
val resourceful_lib_id: String by project
val resourceful_config_id: String by project
val botarium_id: String by project
val ad_astra_id: String by project val ad_astra_id: String by project
val worldedit_id: String by project
val item_borders_id: String by project
val iceberg_id: String by project
val prism_lib_id: String by project
val cloth_config_version: String by project
val condensed_creative_version: String by project
val mekanism_version: String by project
compileOnly(fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}+${curios_mc_version}")) compileOnly("top.theillusivec4.curios:curios-neoforge:${curios_version}+${curios_mc_version}")
compileOnly(fg.deobf("curse.maven:cosmetic-armor-reworked-237307:$cosmetic_armor_reworked_id")) implementation("curse.maven:cosmetic-armor-reworked-237307:$cosmetic_armor_reworked_id")
compileOnly(fg.deobf("mezz.jei:jei-${jei_mc_version}-common-api:${jei_version}")) compileOnly("mezz.jei:jei-${jei_mc_version}-common-api:${jei_version}")
compileOnly(fg.deobf("mezz.jei:jei-${jei_mc_version}-forge-api:${jei_version}")) compileOnly("mezz.jei:jei-${jei_mc_version}-neoforge-api:${jei_version}")
runtimeOnly(fg.deobf("mezz.jei:jei-${jei_mc_version}-forge:${jei_version}")) runtimeOnly("mezz.jei:jei-${jei_mc_version}-neoforge:${jei_version}")
runtimeOnly(fg.deobf("curse.maven:jade-324717:${jade_id}")) // runtimeOnly("ru.dbotthepony:particle-collider:0.4.5")
//runtimeOnly(fg.deobf("curse.maven:configured-457570:${configured_id}"))
compileOnly(fg.deobf("curse.maven:ad-astra-635042:${ad_astra_id}")) implementation("curse.maven:jade-324717:${jade_id}")
compileOnly(fg.deobf("curse.maven:resourceful-lib-570073:4574449")) //runtimeOnly("curse.maven:configured-457570:${configured_id}")
compileOnly(fg.deobf("curse.maven:resourceful-config-714059:4444198"))
compileOnly(fg.deobf("curse.maven:botarium-704113:4416456"))
// runtimeOnly(fg.deobf("curse.maven:worldedit-225608:${worldedit_fileid}")) compileOnly("curse.maven:resourceful-lib-570073:${resourceful_lib_id}")
// runtimeOnly(fg.deobf("at.ridgo8.moreoverlays:MoreOverlays-updated:${more_overlays_version}")) compileOnly("curse.maven:resourceful-config-714059:${resourceful_config_id}")
compileOnly("curse.maven:botarium-704113:${botarium_id}")
compileOnly("curse.maven:ad-astra-635042:${ad_astra_id}")
runtimeOnly("curse.maven:worldedit-225608:${worldedit_id}")
compileOnly(fg.deobf("mekanism:Mekanism:${mekanism_version}:all")) runtimeOnly("me.shedaniel.cloth:cloth-config-neoforge:${cloth_config_version}")
implementation("io.wispforest:condensed_creative-neoforge:${condensed_creative_version}")
// runtimeOnly(fg.deobf("curse.maven:cyclops-core-232758:4392602")) compileOnly("curse.maven:item-borders-513769:${item_borders_id}")
// runtimeOnly(fg.deobf("curse.maven:integrated-dynamics-236307:4391535")) // implementation("curse.maven:item-borders-513769:${item_borders_id}")
// runtimeOnly(fg.deobf("curse.maven:integrated-crafting-287357:4391487")) // runtimeOnly("curse.maven:iceberg-520110:${iceberg_id}")
// runtimeOnly(fg.deobf("curse.maven:integrated-terminals-295910:4400924")) // runtimeOnly("curse.maven:prism-lib-638111:${prism_lib_id}")
// runtimeOnly(fg.deobf("curse.maven:common-capabilities-247007:4391468"))
// runtimeOnly(fg.deobf("curse.maven:integrated-tunnels-251389:4344632")) // runtimeOnly("curse.maven:worldedit-225608:${worldedit_fileid}")
// runtimeOnly("at.ridgo8.moreoverlays:MoreOverlays-updated:${more_overlays_version}")
// runtimeOnly("curse.maven:cyclops-core-232758:4392602")
// runtimeOnly("curse.maven:integrated-dynamics-236307:4391535")
// runtimeOnly("curse.maven:integrated-crafting-287357:4391487")
// runtimeOnly("curse.maven:integrated-terminals-295910:4400924")
// runtimeOnly("curse.maven:common-capabilities-247007:4391468")
// runtimeOnly("curse.maven:integrated-tunnels-251389:4344632")
implementation("mekanism:Mekanism:${mc_version}-${mekanism_version}")
implementation("curse.maven:iron-chests-228756:5491156")
implementation("curse.maven:iron-shulker-boxes-314911:5491246")
} }
} }
configurations {
getByName("dataImplementation").extendsFrom(getByName("implementation"))
getByName("library").resolutionStrategy.cacheChangingModulesFor(10, "minutes")
}
minecraft { minecraft {
val use_parchment: String by project accessTransformers {
files("src/main/resources/META-INF/accesstransformer.cfg")
if (use_parchment.toBoolean()) {
mappings("parchment", parchment_version)
} else {
mappings("official", mc_version)
} }
accessTransformer(file("src/main/resources/META-INF/accesstransformer.cfg"))
runs { runs {
create("client") { configureEach {
mods { // "SCAN": For mods scan.
create(mod_id) { // "REGISTRIES": For firing of registry events.
source(sourceSets["main"]) // "REGISTRYDUMP": For getting the contents of all registries.
} systemProperty("forge.logging.markers", "REGISTRIES")
}
// Log4j console level
systemProperty("forge.logging.console.level", "debug")
dependencies {
runtime("com.github.ben-manes.caffeine:caffeine:[$caffeine_cache_version,)")
}
}
getByName("client") {
val usernameStream = FastByteArrayOutputStream() val usernameStream = FastByteArrayOutputStream()
val gotUsername = exec { val gotUsername = exec {
@ -248,63 +248,32 @@ minecraft {
val originalUsername = usernameStream.array.copyOfRange(0, usernameStream.length).toString(Charsets.UTF_8).trim() val originalUsername = usernameStream.array.copyOfRange(0, usernameStream.length).toString(Charsets.UTF_8).trim()
if (originalUsername.isNotEmpty()) { if (originalUsername.isNotEmpty()) {
args("--username", originalUsername) programArguments.addAll("--username", originalUsername)
} else { } else {
args("--username", "Dev_${System.getProperty("user.name")}") programArguments.addAll("--username", "Dev_${System.getProperty("user.name")}")
} }
} else { } else {
args("--username", "Dev_${System.getProperty("user.name")}") programArguments.addAll("--username", "Dev_${System.getProperty("user.name")}")
} }
} }
create("server") { getByName("server") {
mods { programArguments.addAll("nogui")
create(mod_id) {
source(sourceSets["main"])
}
}
args("nogui")
} }
create("data") { getByName("data") {
args("--mod", mod_id, "--all", "--output", file("src/data/resources/"), "--existing", file("src/main/resources/")) programArguments.addAll("--mod", mod_id, "--all", "--output", file("src/data/resources/").absolutePath, "--existing", file("src/main/resources/").absolutePath)
mods { modSources(sourceSets["main"], sourceSets["data"])
create(mod_id) {
sources(sourceSets["main"], sourceSets["data"])
}
}
} }
} }
} }
mixin { mixin {
add(sourceSets.main.get(), "$mod_id.refmap.json")
config("$mod_id.mixins.json") config("$mod_id.mixins.json")
config("$mod_id.ad_astra.mixins.json") config("$mod_id.ironchest.mixins.json")
} config("$mod_id.ironshulkerbox.mixins.json")
// config("$mod_id.ad_astra.mixins.json")
minecraft.runs.all {
workingDirectory = project.file("run").absolutePath
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
property("forge.logging.markers", "REGISTRIES")
// Log4j console level
property("forge.logging.console.level", "debug")
lazyToken("minecraft_classpath") {
configurations["library"]
.copyRecursive()
.resolve()
.map { it.absolutePath }
.toMutableList()
.also { it.addAll(configurations["klibrary"].copyRecursive().resolve().map { it.absolutePath }) }
.joinToString(File.pathSeparator)
}
} }
repositories { repositories {
@ -318,9 +287,20 @@ repositories {
content { content {
includeGroup("yalter.mousetweaks") includeGroup("yalter.mousetweaks")
includeGroup("mekanism")
includeGroup("lain.mods.cos") includeGroup("lain.mods.cos")
includeGroup("at.ridgo8.moreoverlays") includeGroup("at.ridgo8.moreoverlays")
includeGroup("ru.dbotthepony")
includeGroup("curse.maven")
includeGroup("ru.dbotthepony.kommons")
}
}
maven(url = "https://maven.neoforged.net/releases") {
name = "Neoforge"
content {
includeGroup("net.neoforged.gradle")
includeGroup("net.neoforged")
} }
} }
@ -335,14 +315,6 @@ repositories {
} }
} }
maven {
url = uri("https://www.cursemaven.com")
content {
includeGroup("curse.maven")
}
}
maven { maven {
name = "Jared's Maven" name = "Jared's Maven"
url = uri("https://maven.blamejared.com/") url = uri("https://maven.blamejared.com/")
@ -353,13 +325,37 @@ repositories {
} }
maven { maven {
url = uri("https://maven.theillusivec4.top/") url = uri("https://maven.octo-studios.com/releases")
content { content {
includeGroup("top.theillusivec4.curios") includeGroup("top.theillusivec4.curios")
} }
} }
maven {
url = uri("https://maven.shedaniel.me/")
content {
includeGroup("me.shedaniel.cloth")
}
}
maven {
url = uri("https://maven.wispforest.io")
content {
includeGroup("io.wispforest")
}
}
maven {
url = uri("https://modmaven.dev/")
content {
includeGroup("mekanism")
}
}
// mavenCentral() // mavenCentral()
} }
@ -377,27 +373,38 @@ fun org.gradle.jvm.tasks.Jar.attachManifest() {
} }
} }
// Example configuration to allow publishing using the maven-publish plugin
// This is the preferred method to reobfuscate your jar file
tasks.jar.configure { tasks.jar.configure {
from(configurations["library"].map { if (it.isDirectory) it else zipTree(it) })
finalizedBy("reobfJar")
attachManifest() attachManifest()
archiveClassifier.set("slim")
archiveVersion.set(gitVersion.jarName) archiveVersion.set(gitVersion.jarName)
} }
tasks.jarJar.configure {
archiveClassifier.set("")
archiveVersion.set(gitVersion.jarName)
}
tasks.assemble.configure {
dependsOn(tasks.jarJar)
}
tasks.withType(ProcessResources::class.java) {
val replaceProperties = mapOf(
"mc_version" to mc_version,
"mod_version" to gitVersion.modVersion
)
inputs.properties(replaceProperties)
filesMatching(arrayListOf("META-INF/neoforge.mods.toml", "pack.mcmeta")) {
expand(replaceProperties)
}
}
tasks { tasks {
create("sourceJar", org.gradle.jvm.tasks.Jar::class.java) { create("sourceJar", org.gradle.jvm.tasks.Jar::class.java) {
archiveClassifier.set("sources") archiveClassifier.set("sources")
from(sourceSets.main.get().allSource) from(sourceSets.main.get().allSource)
} }
create("deobfJar", org.gradle.jvm.tasks.Jar::class.java) {
archiveClassifier.set("deobf")
from(configurations["library"].map { if (it.isDirectory) it else zipTree(it) })
from(sourceSets.main.get().output)
attachManifest()
}
} }
if (project.hasProperty("mavenUser") && project.hasProperty("mavenPassword") && project.hasProperty("mavenUrl")) { if (project.hasProperty("mavenUser") && project.hasProperty("mavenPassword") && project.hasProperty("mavenUrl")) {
@ -411,7 +418,6 @@ if (project.hasProperty("mavenUser") && project.hasProperty("mavenPassword") &&
// from(components["java"]) // from(components["java"])
artifact(tasks["jar"]) artifact(tasks["jar"])
artifact(tasks["sourceJar"]) artifact(tasks["sourceJar"])
artifact(tasks["deobfJar"])
version = gitVersion.publishVersion version = gitVersion.publishVersion
@ -441,20 +447,9 @@ if (project.hasProperty("mavenUser") && project.hasProperty("mavenPassword") &&
} }
} }
// 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 idea {
// publish.dependsOn("reobfJar") module {
isDownloadSources = true
/* isDownloadJavadoc = true
publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
}
}
repositories {
maven {
url "file://${project.projectDir}/mcmodsrepo"
}
} }
} }
*/

View File

@ -48,21 +48,24 @@ for (const colorA of colors) {
const magick = child_process.spawn('magick', [ const magick = child_process.spawn('magick', [
'convert', 'convert',
'-compose', 'Multiply',
'-size', `${width}x${height}`, '-size', `${width}x${height}`,
'(', '(',
`${root_main}${texA}.png`, `${root_main}${texA}.png`,
`xc:rgb(${rgbA[0]}, ${rgbA[1]}, ${rgbA[2]})`, `xc:rgb(${rgbA[0]}, ${rgbA[1]}, ${rgbA[2]})`,
'-compose', 'Multiply',
'-composite', '-composite',
')', ')',
'(', '(',
`${root_main}${texB}.png`, `${root_main}${texB}.png`,
`xc:rgb(${rgbB[0]}, ${rgbB[1]}, ${rgbB[2]})`, `xc:rgb(${rgbB[0]}, ${rgbB[1]}, ${rgbB[2]})`,
'-channel', 'rgb',
'-compose', 'Multiply',
'-composite', '-composite',
')', ')',
'-channel', 'rgba',
'-compose', 'Over', '-compose', 'Over',
'-composite', '-composite',

View File

@ -0,0 +1,72 @@
const args = process.argv.slice(2)
if (args.length < 2) {
console.error('Usage: node base_with_mask.js <base_name> <mask_name> [subfolder]\n')
console.error('If subfolder specified, resulting file name will contain only color name\n')
console.error('Subfolder is relative to base texture path\n')
process.exit(2)
}
const fs = require('fs')
const {colorsWithWhite, rootFolder, splitName, getSize} = require('./include.js')
const child_process = require('child_process');
(async function() {
const baseTexture = args[0]
const maskTexture = args[1]
const subfolder = args[2] ?? ''
const fBase = `${rootFolder}${baseTexture}.png`
const fMask = `${rootFolder}${maskTexture}.png`
if (!fs.existsSync(fBase)) {
process.stderr.write(`${fBase} does not exist\n`)
process.exit(1)
}
if (!fs.existsSync(fMask)) {
process.stderr.write(`${fMask} does not exist\n`)
process.exit(1)
}
const [fileName, _, fullBaseFolder] = splitName(baseTexture)
const bSize = (await getSize(fBase))[2]
const mSize = (await getSize(fMask))[2]
if (subfolder !== '') {
fs.mkdirSync(`${fullBaseFolder}/${subfolder}`, {recursive: true})
}
if (bSize != mSize) {
process.stderr.write(`${fBase} has size of ${bSize}, ${fMask} has size of ${mSize}!\n`)
process.exit(3)
}
for (const [name, _, xc] of colorsWithWhite) {
const outputFilename = subfolder === '' ? `${fullBaseFolder}/${fileName}_${name}.png` : `${fullBaseFolder}/${subfolder}/${name}.png`
const magick = child_process.spawn('magick', [
'convert',
fBase,
'(',
fMask,
'-size', bSize,
xc,
'-channel', 'rgb',
'-compose', 'Multiply',
'-composite',
')',
'-compose', 'Over',
'-composite',
outputFilename])
magick.stdout.pipe(process.stdout)
magick.stderr.pipe(process.stderr)
}
})();

View File

@ -0,0 +1,4 @@
#!/bin/bash
node ./base_with_mask.js block/decorative/computer_base block/decorative/computer_base_mask computer_base
node ./base_with_mask.js block/decorative/computer_screen block/decorative/computer_screen_mask computer_screen

View File

@ -0,0 +1,3 @@
#!/bin/bash
node ./base_with_mask.js block/essence_storage block/essence_storage_mask essence_storage

76
color datagen/include.js Normal file
View File

@ -0,0 +1,76 @@
const colors = [
['orange', [245, 116, 16]],
['magenta', [186, 63, 175]],
['light_blue', [59, 180, 219]],
['yellow', [252, 199, 36]],
['lime', [111, 187, 24]],
['pink', [243, 139, 170]],
['gray', [62, 66, 70]],
['light_gray', [140, 140, 131]],
['cyan', [22, 134, 145]],
['purple', [116, 38, 169]],
['blue', [51, 53, 155]],
['brown', [114, 71, 40]],
['green', [84, 109, 28]],
['red', [156, 37, 34]],
['black', [31, 31, 35]],
]
const white = ['white', [235, 235, 235]]
const colorsWithWhite = [...colors]
colorsWithWhite.push(white)
function addRgbString(values) {
for (const row of values) {
const rgb = row[1]
row.push(`xc:rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`)
}
}
addRgbString(colors)
addRgbString(colorsWithWhite)
const rootFolder = '../src/main/resources/assets/overdrive_that_matters/textures/'
const child_process = require('child_process')
process.stdout.setMaxListeners(900)
process.stderr.setMaxListeners(900)
async function getSize(path) {
const identify = child_process.spawn('magick', [
'identify',
path,
])
identify.stderr.pipe(process.stderr)
const chunks = []
identify.stdout.on('data', (a) => chunks.push(a))
await new Promise((resolve) => {
identify.on('close', () => resolve())
})
const chunk = chunks[0].toString('utf-8')
const size = chunk.match(/PNG ([0-9]+)x([0-9]+)/)
const width = parseInt(size[1])
const height = parseInt(size[2])
return [width, height, `${width}x${height}`]
}
function splitName(name) {
const splitted = name.split('/')
const fileName = splitted.pop()
const baseFolder = splitted.join('/')
const fullBaseFolder = `${rootFolder}${baseFolder}`
return [fileName, baseFolder, fullBaseFolder, fileName.indexOf('_white') == -1 ? colorsWithWhite : colors]
}
exports.colors = colors
exports.colorsWithWhite = colorsWithWhite
exports.rootFolder = rootFolder
exports.splitName = splitName
exports.getSize = getSize

View File

@ -0,0 +1,5 @@
#!/bin/bash
node ./base_with_mask.js block/matter_replicator_base block/matter_replicator_base_mask matter_replicator_base
node ./base_with_mask.js block/matter_replicator block/matter_replicator_mask matter_replicator

View File

@ -0,0 +1,4 @@
#!/bin/bash
node ./base_with_mask.js block/tritanium_anvil block/tritanium_anvil_mask tritanium_anvil
node ./base_with_mask.js block/tritanium_anvil_top block/tritanium_anvil_top_mask tritanium_anvil_top

View File

@ -0,0 +1,5 @@
#!/bin/bash
node ./base_with_mask.js block/decorative/tritanium_door_top block/decorative/tritanium_door_color_top
node ./base_with_mask.js block/decorative/tritanium_door_bottom block/decorative/tritanium_door_color_bottom

View File

@ -1,56 +0,0 @@
'use strict';
const fs = require('fs')
const root_main = './src/main/resources/assets/overdrive_that_matters/textures/block/decorative/'
const child_process = require('child_process')
const colors = [
['orange', [245, 116, 16]],
['magenta', [186, 63, 175]],
['light_blue', [59, 180, 219]],
['yellow', [252, 199, 36]],
['lime', [111, 187, 24]],
['pink', [243, 139, 170]],
['gray', [62, 66, 70]],
['light_gray', [140, 140, 131]],
['cyan', [22, 134, 145]],
['purple', [116, 38, 169]],
['blue', [51, 53, 155]],
['brown', [114, 71, 40]],
['green', [84, 109, 28]],
['red', [156, 37, 34]],
['black', [31, 31, 35]],
['white', [235, 235, 235]],
]
process.stderr.setMaxListeners(40)
process.stdout.setMaxListeners(40);
(async function() {
for (const [base, overlay, nameBase] of [['tritanium_door_base_top', 'tritanium_door_color_top', 'tritanium_door_top'], ['tritanium_door_base_bottom', 'tritanium_door_color_bottom', 'tritanium_door_bottom']]) {
for (const [name, rgb] of colors) {
const magick = child_process.spawn('magick', [
'convert',
`${root_main}${base}.png`,
'(',
`${root_main}${overlay}.png`,
'-size', '16x16',
`xc:rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`,
'-channel', 'rgb',
'-compose', 'Multiply',
'-composite',
')',
'-compose', 'Over',
'-composite',
`${root_main}/${nameBase}_${name}.png`])
magick.stdout.pipe(process.stdout)
magick.stderr.pipe(process.stderr)
}
}
})()

View File

@ -6,33 +6,44 @@ kotlin.stdlib.default.dependency=false
org.gradle.vfs.watch=true org.gradle.vfs.watch=true
mod_id=overdrive_that_matters mod_id=overdrive_that_matters
mod_version=1.3 mod_version=1.5
use_commit_hash_in_version=true use_commit_hash_in_version=true
mc_version=1.20 mc_version=1.21.1
use_parchment=false jei_mc_version=1.21.1
parchment_version=2023.03.12-1.19.3 curios_mc_version=1.21
jei_mc_version=1.20
curios_mc_version=1.20
forge_gradle_version=[6.0,6.2) forge_gradle_version=7.0.153
forge_version=46.0.10 forge_version=21.1.21
mixingradle_version=0.7.33 mixingradle_version=0.7.33
mixin_version=0.8.5 mixin_version=0.8.5
jei_version=14.0.0.5 neogradle.subsystems.parchment.minecraftVersion=1.21.1
jupiter_version=5.9.2 neogradle.subsystems.parchment.mappingsVersion=2024.11.17
mekanism_version=1.19.2-10.3.5.homebaked
curios_version=5.2.0-beta.2
cosmetic_armor_reworked_id=4575609
ad_astra_id=4452010
jade_id=4573193
configured_id=4462894
kotlin_for_forge_version=3.1.0 kommons_version=3.9.1
kotlin_version=1.8.0 caffeine_cache_version=3.1.5
kotlin_coroutines_version=1.6.0
kotlin_serialization_version=1.3.2 jei_version=19.16.4.171
jupiter_version=5.9.2
curios_version=9.0.5
cosmetic_armor_reworked_id=5610814
ad_astra_id=4594155
botarium_id=4594094
resourceful_lib_id=4598948
resourceful_config_id=4576455
jade_id=5591256
configured_id=4462894
worldedit_id=5830452
item_borders_id=5591010
iceberg_id=5750025
prism_lib_id=5625115
cloth_config_version=15.0.130
condensed_creative_version=3.4.1+1.21
mekanism_version=10.7.7.64
kotlin_for_forge_version=5.5.0
kotlin_version=2.0.10
handle_deps=true handle_deps=true

Binary file not shown.

View File

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
networkTimeout=10000 networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

35
gradlew vendored
View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# #
# Copyright © 2015-2021 the original authors. # Copyright © 2015-2021 the original authors.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -32,10 +32,10 @@
# Busybox and similar reduced shells will NOT work, because this script # Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features: # requires all of these POSIX shell features:
# * functions; # * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», # * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»; # «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»; # * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit». # * various built-in commands including «command», «set», and «ulimit».
# #
# Important for patching: # Important for patching:
# #
@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop. # Darwin, MinGW, and NonStop.
# #
# (3) This script is generated from the Groovy template # (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project. # within the Gradle project.
# #
# You can find Gradle at https://github.com/gradle/gradle/. # You can find Gradle at https://github.com/gradle/gradle/.
@ -80,13 +80,10 @@ do
esac esac
done done
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # This is normally unused
# shellcheck disable=SC2034
APP_NAME="Gradle"
APP_BASE_NAME=${0##*/} APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum MAX_FD=maximum
@ -143,12 +140,16 @@ fi
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #( case $MAX_FD in #(
max*) max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) || MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit" warn "Could not query maximum file descriptor limit"
esac esac
case $MAX_FD in #( case $MAX_FD in #(
'' | soft) :;; #( '' | soft) :;; #(
*) *)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" || ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD" warn "Could not set maximum file descriptor limit to $MAX_FD"
esac esac
@ -193,6 +194,10 @@ if "$cygwin" || "$msys" ; then
done done
fi fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command; # Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in # shell script including quotes and variable substitutions, so put them in
@ -205,6 +210,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \ org.gradle.wrapper.GradleWrapperMain \
"$@" "$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args. # Use "xargs" to parse quoted args.
# #
# With -n1 it outputs one arg per line, with the quotes and backslashes removed. # With -n1 it outputs one arg per line, with the quotes and backslashes removed.

15
gradlew.bat vendored
View File

@ -14,7 +14,7 @@
@rem limitations under the License. @rem limitations under the License.
@rem @rem
@if "%DEBUG%" == "" @echo off @if "%DEBUG%"=="" @echo off
@rem ########################################################################## @rem ##########################################################################
@rem @rem
@rem Gradle startup script for Windows @rem Gradle startup script for Windows
@ -25,7 +25,8 @@
if "%OS%"=="Windows_NT" setlocal if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0 set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=. if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0 set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME% set APP_HOME=%DIRNAME%
@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1 %JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute if %ERRORLEVEL% equ 0 goto execute
echo. echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
:end :end
@rem End local scope for the variables with windows NT shell @rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd if %ERRORLEVEL% equ 0 goto mainEnd
:fail :fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code! rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 set EXIT_CODE=%ERRORLEVEL%
exit /b 1 if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd :mainEnd
if "%OS%"=="Windows_NT" endlocal if "%OS%"=="Windows_NT" endlocal

113
machine_colorizer.js Normal file
View File

@ -0,0 +1,113 @@
// Использует Image Magick для автоматической перекраски текстур
const fs = require('fs')
const root_main = './src/main/resources/assets/overdrive_that_matters/textures/block/'
const child_process = require('child_process')
const args = process.argv.slice(2)
if (args.length != 1) {
console.error('Usage: <texture name>')
process.exit(2)
}
const colors = [
['white', [255, 255, 255]],
['orange', [245, 116, 16]],
['magenta', [186, 63, 175]],
['light_blue', [59, 180, 219]],
['yellow', [252, 199, 36]],
['lime', [111, 187, 24]],
['pink', [243, 139, 170]],
['gray', [62, 66, 70]],
['light_gray', [140, 140, 131]],
['cyan', [22, 134, 145]],
['purple', [116, 38, 169]],
['blue', [51, 53, 155]],
['brown', [114, 71, 40]],
['green', [84, 109, 28]],
['red', [156, 37, 34]],
['black', [31, 31, 35]],
]
process.stderr.setMaxListeners(40)
process.stdout.setMaxListeners(40)
async function size(path) {
const identify = child_process.spawn('magick', [
'identify',
path,
])
identify.stderr.pipe(process.stderr)
const chunks = []
identify.stdout.on('data', (a) => chunks.push(a))
await new Promise((resolve) => {
identify.on('close', () => resolve())
})
const chunk = chunks[0].toString('utf-8')
const size = chunk.match(/PNG ([0-9]+)x([0-9]+)/)
const width = parseInt(size[1])
const height = parseInt(size[2])
return [width, height]
}
(async function() {
const textureOverlay = args[0]
const textureColor = textureOverlay + '_mask'
if (!fs.existsSync(`${root_main}${textureOverlay}.png`)) {
process.stderr.write(`${textureOverlay}.png does not exist\n`)
process.exit(1)
}
if (!fs.existsSync(`${root_main}${textureColor}.png`)) {
process.stderr.write(`${textureColor}.png does not exist\n`)
process.exit(1)
}
try {
fs.mkdirSync(`${root_main}/${textureOverlay}`)
} catch(err) {
}
const [widthOverlay, heightOverlay] = await size(`${root_main}${textureOverlay}.png`)
const [width, height] = await size(`${root_main}${textureColor}.png`)
if (widthOverlay != width || heightOverlay != height) {
process.stderr.write(`${textureColor}.png has size of ${width}x${height}, overlay has size of ${widthOverlay}x${heightOverlay}!\n`)
process.exit(3)
}
for (const color of colors) {
const name = color[0]
const rgb = color[1]
const magick = child_process.spawn('magick', [
'convert',
`${root_main}${textureOverlay}.png`,
'(',
`${root_main}${textureColor}.png`,
'-size', `${width}x${height}`,
`xc:rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`,
'-channel', 'rgb',
'-compose', 'Multiply',
'-composite',
')',
'-compose', 'Over',
'-composite',
`${root_main}${textureOverlay}/${name}.png`])
magick.stdout.pipe(process.stdout)
magick.stderr.pipe(process.stderr)
}
})()

View File

@ -4,6 +4,7 @@ println("Running with Java ${System.getProperty("java.version")} on JVM: ${Syste
pluginManagement { pluginManagement {
repositories { repositories {
gradlePluginPortal() gradlePluginPortal()
maven(url = "https://maven.neoforged.net/releases")
} }
} }
@ -14,29 +15,12 @@ plugins {
buildscript { buildscript {
repositories { repositories {
// These repositories are only for Gradle plugins, put any other repositories in the repository block further below // 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.neoforged.net/releases") {
name = "Minecraft Forge" name = "Neoforge"
content { content {
includeGroup("net.minecraftforge.gradle") includeGroup("net.neoforged.gradle")
includeGroup("net.minecraftforge") includeGroup("net.neoforged")
}
}
maven(url = "https://repo.spongepowered.org/repository/maven-public/") {
name = "Spongepowered"
content {
includeGroup("org.spongepowered")
}
}
maven(url = "https://maven.parchmentmc.org") {
name = "Parchment mappings"
content {
includeGroup("org.parchmentmc")
includeGroup("org.parchmentmc.feather")
} }
} }
@ -47,14 +31,10 @@ buildscript {
val kotlin_version: String by settings val kotlin_version: String by settings
val forge_gradle_version: String by settings val forge_gradle_version: String by settings
val mixingradle_version: String by settings val mixingradle_version: String by settings
val koremods_modlauncher_version: String by settings
val koremods_script_version: String by settings
classpath(group = "net.minecraftforge.gradle", name = "ForgeGradle", version = forge_gradle_version) classpath(group = "net.neoforged.gradle", name = "userdev", version = forge_gradle_version)
classpath(group = "net.neoforged.gradle", name = "mixin", version = forge_gradle_version)
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}") classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}")
classpath("org.spongepowered:mixingradle:${mixingradle_version}")
classpath(group = "org.parchmentmc", name = "librarian", version = "1.+")
classpath(group = "org.gradle.toolchains", name = "foojay-resolver", version = "0.5.0") classpath(group = "org.gradle.toolchains", name = "foojay-resolver", version = "0.5.0")
} }

File diff suppressed because one or more lines are too long

1
src/bb/loader.bbmodel Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,17 +1,14 @@
package ru.dbotthepony.mc.otm.datagen package ru.dbotthepony.mc.otm.datagen
import net.minecraft.core.RegistrySetBuilder import net.minecraft.data.worldgen.BootstrapContext
import net.minecraft.core.registries.Registries
import net.minecraft.data.worldgen.BootstapContext
import net.minecraft.tags.DamageTypeTags import net.minecraft.tags.DamageTypeTags
import net.minecraft.world.damagesource.DamageEffects
import net.minecraft.world.damagesource.DamageScaling import net.minecraft.world.damagesource.DamageScaling
import net.minecraft.world.damagesource.DamageType import net.minecraft.world.damagesource.DamageType
import net.minecraftforge.common.data.DatapackBuiltinEntriesProvider
import net.minecraftforge.data.event.GatherDataEvent
import ru.dbotthepony.mc.otm.datagen.tags.TagsProvider import ru.dbotthepony.mc.otm.datagen.tags.TagsProvider
import ru.dbotthepony.mc.otm.registry.MDamageTypes import ru.dbotthepony.mc.otm.registry.MDamageTypes
fun registerDamageTypes(context: BootstapContext<DamageType>) { fun registerDamageTypes(context: BootstrapContext<DamageType>) {
context.register(MDamageTypes.EXOPACK_PROBE, DamageType("otm_exopack_probe", DamageScaling.NEVER, 4.0f)) context.register(MDamageTypes.EXOPACK_PROBE, DamageType("otm_exopack_probe", DamageScaling.NEVER, 4.0f))
context.register(MDamageTypes.BECOME_ANDROID, DamageType("otm_become_android", DamageScaling.NEVER, 0f)) context.register(MDamageTypes.BECOME_ANDROID, DamageType("otm_become_android", DamageScaling.NEVER, 0f))
context.register(MDamageTypes.BECOME_HUMANE, DamageType("otm_become_humane", DamageScaling.NEVER, 0f)) context.register(MDamageTypes.BECOME_HUMANE, DamageType("otm_become_humane", DamageScaling.NEVER, 0f))
@ -23,6 +20,8 @@ fun registerDamageTypes(context: BootstapContext<DamageType>) {
context.register(MDamageTypes.COSMIC_RAYS, DamageType("otm_cosmic_rays", DamageScaling.NEVER, 0f)) context.register(MDamageTypes.COSMIC_RAYS, DamageType("otm_cosmic_rays", DamageScaling.NEVER, 0f))
context.register(MDamageTypes.EXPLOSIVE_HAMMER, DamageType("otm_explosive_hammer", DamageScaling.NEVER, 0.1f)) context.register(MDamageTypes.EXPLOSIVE_HAMMER, DamageType("otm_explosive_hammer", DamageScaling.NEVER, 0.1f))
context.register(MDamageTypes.HAMMER_NAIL, DamageType("otm_hammer_nail", DamageScaling.NEVER, 0.1f)) context.register(MDamageTypes.HAMMER_NAIL, DamageType("otm_hammer_nail", DamageScaling.NEVER, 0.1f))
context.register(MDamageTypes.ANDROID_DISCHARGE, DamageType("otm_android_discharge", DamageScaling.NEVER, 4.0f))
context.register(MDamageTypes.NOT_NORMAL_PILL, DamageType("otm_not_normal_pill", DamageScaling.NEVER, 0f, DamageEffects.DROWNING))
} }
fun registerDamageTypeTags(provider: TagsProvider.Delegate<DamageType>) { fun registerDamageTypeTags(provider: TagsProvider.Delegate<DamageType>) {
@ -38,14 +37,20 @@ fun registerDamageTypeTags(provider: TagsProvider.Delegate<DamageType>) {
.add(MDamageTypes.EMP) .add(MDamageTypes.EMP)
.add(MDamageTypes.SHOCKWAVE) .add(MDamageTypes.SHOCKWAVE)
.add(MDamageTypes.COSMIC_RAYS) .add(MDamageTypes.COSMIC_RAYS)
.add(MDamageTypes.ANDROID_DISCHARGE)
.add(MDamageTypes.NOT_NORMAL_PILL)
ignoreMagic ignoreMagic
.add(MDamageTypes.EXOPACK_PROBE) .add(MDamageTypes.EXOPACK_PROBE)
.add(MDamageTypes.BECOME_ANDROID) .add(MDamageTypes.BECOME_ANDROID)
.add(MDamageTypes.BECOME_HUMANE) .add(MDamageTypes.BECOME_HUMANE)
.add(MDamageTypes.COSMIC_RAYS) .add(MDamageTypes.COSMIC_RAYS)
.add(MDamageTypes.ANDROID_DISCHARGE)
.add(MDamageTypes.NOT_NORMAL_PILL)
ignoreInvl ignoreInvl
.add(MDamageTypes.BECOME_HUMANE) .add(MDamageTypes.BECOME_HUMANE)
.add(MDamageTypes.BECOME_ANDROID) .add(MDamageTypes.BECOME_ANDROID)
.add(MDamageTypes.ANDROID_DISCHARGE)
.add(MDamageTypes.NOT_NORMAL_PILL)
} }

View File

@ -2,6 +2,7 @@ package ru.dbotthepony.mc.otm.datagen
import net.minecraft.core.RegistrySetBuilder import net.minecraft.core.RegistrySetBuilder
import net.minecraft.core.registries.Registries import net.minecraft.core.registries.Registries
import net.minecraft.resources.ResourceKey
import net.minecraft.resources.ResourceLocation import net.minecraft.resources.ResourceLocation
import net.minecraft.world.item.DyeColor import net.minecraft.world.item.DyeColor
import net.minecraft.world.level.block.Block import net.minecraft.world.level.block.Block
@ -14,29 +15,30 @@ import net.minecraft.world.level.block.TrapDoorBlock
import net.minecraft.world.level.block.state.properties.DoorHingeSide import net.minecraft.world.level.block.state.properties.DoorHingeSide
import net.minecraft.world.level.block.state.properties.DoubleBlockHalf import net.minecraft.world.level.block.state.properties.DoubleBlockHalf
import net.minecraft.world.level.block.state.properties.Half import net.minecraft.world.level.block.state.properties.Half
import net.minecraftforge.client.model.generators.ModelFile import net.neoforged.bus.api.SubscribeEvent
import net.minecraftforge.common.data.DatapackBuiltinEntriesProvider import net.neoforged.fml.common.EventBusSubscriber
import net.minecraftforge.common.data.ForgeAdvancementProvider import net.neoforged.neoforge.client.model.generators.ModelFile
import net.minecraftforge.eventbus.api.SubscribeEvent import net.neoforged.neoforge.common.data.AdvancementProvider
import net.minecraftforge.fml.common.Mod import net.neoforged.neoforge.common.data.DatapackBuiltinEntriesProvider
import net.minecraftforge.data.event.GatherDataEvent import net.neoforged.neoforge.data.event.GatherDataEvent
import net.neoforged.neoforge.registries.NeoForgeRegistries
import ru.dbotthepony.mc.otm.OverdriveThatMatters import ru.dbotthepony.mc.otm.OverdriveThatMatters
import ru.dbotthepony.mc.otm.android.AndroidResearchDataProvider import ru.dbotthepony.mc.otm.player.android.AndroidResearchDataProvider
import ru.dbotthepony.mc.otm.block.* import ru.dbotthepony.mc.otm.util.ResourceLocation
import ru.dbotthepony.mc.otm.core.math.yRotationBlockstateNorth import ru.dbotthepony.mc.otm.util.math.yRotationBlockstateNorth
import ru.dbotthepony.mc.otm.core.util.WriteOnce import ru.dbotthepony.mc.otm.util.WriteOnce
import ru.dbotthepony.mc.otm.datagen.blocks.BatteryBankProvider import ru.dbotthepony.mc.otm.datagen.blocks.BatteryBankProvider
import ru.dbotthepony.mc.otm.datagen.blocks.MatterBankProvider import ru.dbotthepony.mc.otm.datagen.blocks.MatterBankProvider
import ru.dbotthepony.mc.otm.datagen.blocks.MatteryBlockStateProvider import ru.dbotthepony.mc.otm.datagen.blocks.MatteryBlockStateProvider
import ru.dbotthepony.mc.otm.datagen.items.MatteryItemModelProvider import ru.dbotthepony.mc.otm.datagen.items.MatteryItemModelProvider
import ru.dbotthepony.mc.otm.datagen.lang.AddEnglishLanguage import ru.dbotthepony.mc.otm.datagen.lang.AddEnglishLanguage
import ru.dbotthepony.mc.otm.datagen.models.MatteryBlockModelProvider import ru.dbotthepony.mc.otm.datagen.models.MatteryBlockModelProvider
import ru.dbotthepony.mc.otm.datagen.recipes.MatteryRecipeProvider import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.registry.* import ru.dbotthepony.mc.otm.util.GJRAND64RandomSource
import ru.dbotthepony.mc.otm.core.registryName import ru.dbotthepony.mc.otm.data.FlywheelMaterialDataProvider
import ru.dbotthepony.mc.otm.datagen.advancements.addAdvancements import ru.dbotthepony.mc.otm.datagen.advancements.addAdvancements
import ru.dbotthepony.mc.otm.datagen.advancements.addAndroidAdvancements import ru.dbotthepony.mc.otm.datagen.advancements.addAndroidAdvancements
import ru.dbotthepony.mc.otm.datagen.advancements.addMachineAdvancements import ru.dbotthepony.mc.otm.datagen.blocks.addBlockModels
import ru.dbotthepony.mc.otm.datagen.blocks.addBlockStates import ru.dbotthepony.mc.otm.datagen.blocks.addBlockStates
import ru.dbotthepony.mc.otm.datagen.blocks.addComplexBlockStates import ru.dbotthepony.mc.otm.datagen.blocks.addComplexBlockStates
import ru.dbotthepony.mc.otm.datagen.items.addItemModels import ru.dbotthepony.mc.otm.datagen.items.addItemModels
@ -44,26 +46,33 @@ import ru.dbotthepony.mc.otm.datagen.lang.AddRussianLanguage
import ru.dbotthepony.mc.otm.datagen.lang.MatteryLanguageProvider import ru.dbotthepony.mc.otm.datagen.lang.MatteryLanguageProvider
import ru.dbotthepony.mc.otm.datagen.loot.* import ru.dbotthepony.mc.otm.datagen.loot.*
import ru.dbotthepony.mc.otm.datagen.loot.LootModifiers import ru.dbotthepony.mc.otm.datagen.loot.LootModifiers
import ru.dbotthepony.mc.otm.datagen.models.addBlockModels import ru.dbotthepony.mc.otm.datagen.recipes.*
import ru.dbotthepony.mc.otm.datagen.recipes.addBlastingRecipes
import ru.dbotthepony.mc.otm.datagen.recipes.addCraftingTableRecipes
import ru.dbotthepony.mc.otm.datagen.recipes.addDecorativesRecipes
import ru.dbotthepony.mc.otm.datagen.recipes.addPlatePressRecipes
import ru.dbotthepony.mc.otm.datagen.recipes.addShapelessRecipes
import ru.dbotthepony.mc.otm.datagen.recipes.addOreSmeltingRecipes
import ru.dbotthepony.mc.otm.datagen.tags.TagsProvider import ru.dbotthepony.mc.otm.datagen.tags.TagsProvider
import ru.dbotthepony.mc.otm.datagen.tags.addConstructionTags
import ru.dbotthepony.mc.otm.datagen.tags.addDyeTags
import ru.dbotthepony.mc.otm.datagen.tags.addEquipmentTags
import ru.dbotthepony.mc.otm.datagen.tags.addMineableTags
import ru.dbotthepony.mc.otm.datagen.tags.addResourceTags
import ru.dbotthepony.mc.otm.datagen.tags.addStructureTags
import ru.dbotthepony.mc.otm.datagen.tags.addSuspiciousTags
import ru.dbotthepony.mc.otm.datagen.tags.addTags import ru.dbotthepony.mc.otm.datagen.tags.addTags
import ru.dbotthepony.mc.otm.matter.MatterDataProvider import ru.dbotthepony.mc.otm.matter.MatterDataProvider
import ru.dbotthepony.mc.otm.registry.game.MBlocks
import ru.dbotthepony.mc.otm.registry.objects.ColoredDecorativeBlock import ru.dbotthepony.mc.otm.registry.objects.ColoredDecorativeBlock
import ru.dbotthepony.mc.otm.registry.objects.DecorativeBlock import ru.dbotthepony.mc.otm.registry.objects.DecorativeBlock
import kotlin.properties.Delegates import kotlin.properties.Delegates
internal fun modLocation(string: String) = ResourceLocation(DataGen.MOD_ID, string) internal fun modLocation(string: String) = ResourceLocation(DataGen.MOD_ID, string)
internal fun modLootTable(string: String) = ResourceKey.create(Registries.LOOT_TABLE, ResourceLocation(DataGen.MOD_ID, string))
@Mod.EventBusSubscriber(modid = DataGen.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) @EventBusSubscriber(modid = DataGen.MOD_ID, bus = EventBusSubscriber.Bus.MOD)
object DataGen { object DataGen {
const val MOD_ID = OverdriveThatMatters.MOD_ID const val MOD_ID = OverdriveThatMatters.MOD_ID
// for things which need to be random (e.g. UUIDs),
// so builds continue to be reproducible
val random = GJRAND64RandomSource(822393940230754753L, -2728812999467395658L)
var blockModelProvider: MatteryBlockModelProvider by WriteOnce() var blockModelProvider: MatteryBlockModelProvider by WriteOnce()
private set private set
var itemModelProvider: MatteryItemModelProvider by WriteOnce() var itemModelProvider: MatteryItemModelProvider by WriteOnce()
@ -82,12 +91,19 @@ object DataGen {
private set private set
var matterData: MatterDataProvider by WriteOnce() var matterData: MatterDataProvider by WriteOnce()
private set private set
var flywheelData: FlywheelMaterialDataProvider by WriteOnce()
private set
fun decorativeCubeAll(vararg blocks: Block) { fun decorativeCubeAll(vararg blocks: Block) {
blockModelProvider.decorativeCubeAll(*blocks) blockModelProvider.decorativeCubeAll(*blocks)
blockStateProvider.simpleBlockM(*blocks) blockStateProvider.simpleBlockM(*blocks)
} }
fun decorativeCubeAllCutout(vararg blocks: Block) {
blockModelProvider.decorativeCubeAllCutout(*blocks)
blockStateProvider.simpleBlockM(*blocks)
}
fun decorativeCubeAll(subdir: String, vararg blocks: Block) { fun decorativeCubeAll(subdir: String, vararg blocks: Block) {
blockModelProvider.decorativeCubeAll(subdir, *blocks) blockModelProvider.decorativeCubeAll(subdir, *blocks)
blockStateProvider.simpleBlockM(*blocks) blockStateProvider.simpleBlockM(*blocks)
@ -113,6 +129,11 @@ object DataGen {
blockStateProvider.simpleBlockM(block) blockStateProvider.simpleBlockM(block)
} }
fun decorativePillar(block: Block, side: String, top: String) {
blockModelProvider.decorativeColumn(block, side, top)
blockStateProvider.simplePillar(block)
}
fun stairs(block: StairBlock, side: String, top: String) { fun stairs(block: StairBlock, side: String, top: String) {
blockStateProvider.exec { blockStateProvider.exec {
blockStateProvider.stairsBlock(block, modLocation(side), modLocation(top), modLocation(top)) blockStateProvider.stairsBlock(block, modLocation(side), modLocation(top), modLocation(top))
@ -419,7 +440,7 @@ object DataGen {
} }
} }
fun decoratives(list: ColoredDecorativeBlock) { fun decoratives(list: ColoredDecorativeBlock<*>) {
for (block in list.blocks.values) { for (block in list.blocks.values) {
decorativeCubeAll(block) decorativeCubeAll(block)
} }
@ -429,7 +450,7 @@ object DataGen {
} }
} }
fun decoratives(list: DecorativeBlock) { fun decoratives(list: DecorativeBlock<*>) {
for (block in list.allBlocks.values) { for (block in list.allBlocks.values) {
decorativeCubeAll(block) decorativeCubeAll(block)
} }
@ -439,7 +460,7 @@ object DataGen {
} }
} }
fun decoratives(subdir: String, list: ColoredDecorativeBlock) { fun decoratives(subdir: String, list: ColoredDecorativeBlock<*>) {
for (block in list.blocks.values) { for (block in list.blocks.values) {
decorativeCubeAll(subdir, block) decorativeCubeAll(subdir, block)
} }
@ -449,7 +470,7 @@ object DataGen {
} }
} }
fun decoratives(subdir: String, list: DecorativeBlock) { fun decoratives(subdir: String, list: DecorativeBlock<*>) {
for (block in list.allBlocks.values) { for (block in list.allBlocks.values) {
decorativeCubeAll(subdir, block) decorativeCubeAll(subdir, block)
} }
@ -459,7 +480,7 @@ object DataGen {
} }
} }
fun decoratives(subdir: String, suffix: String, list: ColoredDecorativeBlock) { fun decoratives(subdir: String, suffix: String, list: ColoredDecorativeBlock<*>) {
for (block in list.blocks.values) { for (block in list.blocks.values) {
decorativeCubeAll(subdir, suffix, block) decorativeCubeAll(subdir, suffix, block)
} }
@ -469,7 +490,7 @@ object DataGen {
} }
} }
fun decoratives(subdir: String, suffix: String, list: DecorativeBlock) { fun decoratives(subdir: String, suffix: String, list: DecorativeBlock<*>) {
for (block in list.allBlocks.values) { for (block in list.allBlocks.values) {
decorativeCubeAll(subdir, suffix, block) decorativeCubeAll(subdir, suffix, block)
} }
@ -480,15 +501,14 @@ object DataGen {
} }
@SubscribeEvent @SubscribeEvent
@JvmStatic
@Suppress("unused") @Suppress("unused")
fun onGatherData(event: GatherDataEvent) { fun onGatherData(event: GatherDataEvent) {
val blockModelProvider = MatteryBlockModelProvider(event) val blockModelProvider = MatteryBlockModelProvider(event)
val blockStateProvider = MatteryBlockStateProvider(event) val blockStateProvider = MatteryBlockStateProvider(event)
val itemModelProvider = MatteryItemModelProvider(event) val itemModelProvider = MatteryItemModelProvider(event)
val lootTableProvider = LootTables(event.generator) val lootTableProvider = LootTables(event)
val recipeProvider = MatteryRecipeProvider(event.generator) val recipeProvider = MatteryRecipeProvider(event)
val lootModifier = LootModifiers(event.generator) val lootModifier = LootModifiers(event)
val languageProvider = MatteryLanguageProvider(event.generator) val languageProvider = MatteryLanguageProvider(event.generator)
val matterData = MatterDataProvider(event) val matterData = MatterDataProvider(event)
val researchProvider = AndroidResearchDataProvider(event).also { it.exec { addResearchData(it, languageProvider) } } val researchProvider = AndroidResearchDataProvider(event).also { it.exec { addResearchData(it, languageProvider) } }
@ -502,35 +522,46 @@ object DataGen {
this.languageProvider = languageProvider this.languageProvider = languageProvider
this.researchProvider = researchProvider this.researchProvider = researchProvider
this.matterData = matterData this.matterData = matterData
this.flywheelData = FlywheelMaterialDataProvider(event)
val tagsProvider = TagsProvider(event) val tagsProvider = TagsProvider(event)
val advancementProvider = object : ForgeAdvancementProvider(event.generator.packOutput, event.lookupProvider, event.existingFileHelper, listOf( val advancementProvider = object : AdvancementProvider(event.generator.packOutput, event.lookupProvider, event.existingFileHelper, listOf(
AdvancementGenerator { registries, saver, existingFileHelper -> AdvancementGenerator { registries, saver, existingFileHelper ->
addAdvancements(saver, existingFileHelper, languageProvider) addAdvancements(saver, languageProvider)
addAndroidAdvancements(saver, existingFileHelper, languageProvider) addAndroidAdvancements(saver, languageProvider)
addMachineAdvancements(saver, existingFileHelper, languageProvider)
} }
)) {} )) {}
addTags(tagsProvider) addTags(tagsProvider)
addSuspiciousTags(tagsProvider)
addConstructionTags(tagsProvider)
addResourceTags(tagsProvider)
addEquipmentTags(tagsProvider)
addMineableTags(tagsProvider)
addDyeTags(tagsProvider)
addStructureTags(tagsProvider)
event.generator.addProvider(event.includeClient(), blockModelProvider) event.generator.addProvider(event.includeClient(), blockModelProvider)
event.generator.addProvider(event.includeServer(), blockStateProvider) event.generator.addProvider(event.includeServer(), blockStateProvider)
event.generator.addProvider(event.includeClient(), itemModelProvider) event.generator.addProvider(event.includeClient(), itemModelProvider)
event.generator.addProvider(event.includeServer(), recipeProvider) event.generator.addProvider(event.includeServer(), recipeProvider)
event.generator.addProvider(event.includeClient(), MatterBankProvider(event)) DyeColor.entries.forEach { event.generator.addProvider(event.includeClient(), MatterBankProvider(event, it)) }
event.generator.addProvider(event.includeClient(), BatteryBankProvider(event)) event.generator.addProvider(event.includeClient(), MatterBankProvider(event, null))
DyeColor.entries.forEach { event.generator.addProvider(event.includeClient(), BatteryBankProvider(event, it)) }
event.generator.addProvider(event.includeClient(), BatteryBankProvider(event, null))
event.generator.addProvider(event.includeServer(), lootTableProvider) event.generator.addProvider(event.includeServer(), lootTableProvider)
event.generator.addProvider(event.includeServer(), lootModifier) event.generator.addProvider(event.includeServer(), lootModifier)
event.generator.addProvider(event.includeServer(), SoundDataProvider(event)) event.generator.addProvider(event.includeServer(), SoundDataProvider(event))
event.generator.addProvider(event.includeServer(), researchProvider) event.generator.addProvider(event.includeServer(), researchProvider)
event.generator.addProvider(event.includeServer(), advancementProvider) event.generator.addProvider(event.includeServer(), advancementProvider)
event.generator.addProvider(event.includeServer(), matterData) event.generator.addProvider(event.includeServer(), matterData)
event.generator.addProvider(event.includeServer(), flywheelData)
val registrySetBuilder = RegistrySetBuilder() val registrySetBuilder = RegistrySetBuilder()
.add(Registries.DAMAGE_TYPE, ::registerDamageTypes) .add(Registries.DAMAGE_TYPE, ::registerDamageTypes)
.add(Registries.CONFIGURED_FEATURE, ::registerConfiguredFeatures) .add(Registries.CONFIGURED_FEATURE, ::registerConfiguredFeatures)
.add(Registries.PLACED_FEATURE, ::registerPlacedFeatures) .add(Registries.PLACED_FEATURE, ::registerPlacedFeatures)
.add(NeoForgeRegistries.Keys.BIOME_MODIFIERS, ::registerBiomeModifiers)
event.generator.addProvider(event.includeServer(), DatapackBuiltinEntriesProvider(event.generator.packOutput, event.lookupProvider, registrySetBuilder, setOf(MOD_ID))) event.generator.addProvider(event.includeServer(), DatapackBuiltinEntriesProvider(event.generator.packOutput, event.lookupProvider, registrySetBuilder, setOf(MOD_ID)))
@ -544,7 +575,7 @@ object DataGen {
trapdoor(MBlocks.TRITANIUM_TRAPDOOR[null]!!, modLocation("block/decorative/tritanium_trapdoor")) trapdoor(MBlocks.TRITANIUM_TRAPDOOR[null]!!, modLocation("block/decorative/tritanium_trapdoor"))
for (color in DyeColor.values()) for (color in DyeColor.entries)
trapdoor(MBlocks.TRITANIUM_TRAPDOOR[color]!!, modLocation("block/decorative/tritanium_trapdoor_${color.name.lowercase()}")) trapdoor(MBlocks.TRITANIUM_TRAPDOOR[color]!!, modLocation("block/decorative/tritanium_trapdoor_${color.name.lowercase()}"))
addBlockModels(blockModelProvider) addBlockModels(blockModelProvider)
@ -555,17 +586,31 @@ object DataGen {
addItemModels(itemModelProvider) addItemModels(itemModelProvider)
blockStateProvider.exec { addComplexBlockStates(blockStateProvider) } blockStateProvider.exec { addComplexBlockStates(blockStateProvider) }
addLootTables(lootTableProvider) addLootTables(lootTableProvider)
addMachineLoot(lootTableProvider)
addDecorativeLoot(lootTableProvider)
addAdvancementLoot(lootTableProvider)
addVaultLoot(lootTableProvider)
addEntityLoot(lootTableProvider)
addChestLootTables(lootTableProvider) addChestLootTables(lootTableProvider)
recipeProvider.exec { _, consumer -> recipeProvider.exec { _, consumer ->
addToolsRecipes(consumer)
addComponentRecipes(consumer)
addStorageItemRecipes(consumer)
addCraftingTableRecipes(consumer) addCraftingTableRecipes(consumer)
addMultiblockRecipes(consumer)
addBlastingRecipes(consumer) addBlastingRecipes(consumer)
addDecorativesRecipes(recipeProvider, consumer) addDecorativesRecipes(recipeProvider, consumer)
addMachineUpgradeRecipes(consumer)
addShapelessRecipes(consumer) addShapelessRecipes(consumer)
addOreSmeltingRecipes(consumer) addOreSmeltingRecipes(consumer)
addPainterRecipes(consumer)
addMatterEntanglerRecipes(consumer)
addSuspiciousRecipes(consumer)
} }
addPlatePressRecipes(recipeProvider) addPlatePressRecipes(recipeProvider)
addMicrowaveRecipes(recipeProvider)
lootModifier.lambda { lootModifier.lambda {
addLootModifiers(it) addLootModifiers(it)
@ -574,6 +619,7 @@ object DataGen {
languageProvider.registerProviders() languageProvider.registerProviders()
addMatterData(matterData) addMatterData(matterData)
addFlywheelMaterials(flywheelData)
tagsProvider.register() tagsProvider.register()
} }

View File

@ -1,23 +1,24 @@
package ru.dbotthepony.mc.otm.datagen package ru.dbotthepony.mc.otm.datagen
import net.minecraft.world.item.DyeColor
import net.minecraft.world.level.block.AnvilBlock import net.minecraft.world.level.block.AnvilBlock
import net.minecraft.world.level.block.SlabBlock import net.minecraft.world.level.block.SlabBlock
import net.minecraft.world.level.block.StairBlock import net.minecraft.world.level.block.StairBlock
import net.minecraft.world.level.block.WallBlock import net.minecraft.world.level.block.WallBlock
import net.minecraft.world.level.block.state.properties.BlockStateProperties import net.minecraft.world.level.block.state.properties.BlockStateProperties
import net.minecraftforge.client.model.generators.BlockModelBuilder import net.neoforged.neoforge.client.model.generators.BlockModelBuilder
import net.minecraftforge.client.model.generators.ConfiguredModel import net.neoforged.neoforge.client.model.generators.ConfiguredModel
import net.minecraftforge.client.model.generators.ModelFile import net.neoforged.neoforge.client.model.generators.ModelFile
import ru.dbotthepony.mc.otm.core.get import ru.dbotthepony.mc.otm.util.get
import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom import ru.dbotthepony.mc.otm.util.math.BlockRotationFreedom
import ru.dbotthepony.mc.otm.core.math.xRotationBlockstateNorth import ru.dbotthepony.mc.otm.util.math.xRotationBlockstateNorth
import ru.dbotthepony.mc.otm.core.math.yRotationBlockstateNorth import ru.dbotthepony.mc.otm.util.math.yRotationBlockstateNorth
import ru.dbotthepony.mc.otm.core.registryName import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.datagen.blocks.MatteryBlockStateProvider import ru.dbotthepony.mc.otm.datagen.blocks.MatteryBlockStateProvider
import ru.dbotthepony.mc.otm.datagen.items.MatteryItemModelProvider import ru.dbotthepony.mc.otm.datagen.items.MatteryItemModelProvider
import ru.dbotthepony.mc.otm.datagen.models.MatteryBlockModelProvider import ru.dbotthepony.mc.otm.datagen.models.MatteryBlockModelProvider
import ru.dbotthepony.mc.otm.registry.MBlocks import ru.dbotthepony.mc.otm.registry.game.MBlocks
import ru.dbotthepony.mc.otm.registry.MItems import ru.dbotthepony.mc.otm.registry.game.MItems
import ru.dbotthepony.mc.otm.registry.MNames import ru.dbotthepony.mc.otm.registry.MNames
import ru.dbotthepony.mc.otm.registry.MRegistry import ru.dbotthepony.mc.otm.registry.MRegistry
import kotlin.properties.Delegates import kotlin.properties.Delegates
@ -34,22 +35,42 @@ fun addDecorativeData(blockStateProvider: MatteryBlockStateProvider, itemModelPr
} }
DataGen.decorativeCubeAll(MBlocks.CARBON_FIBRE_BLOCK) DataGen.decorativeCubeAll(MBlocks.CARBON_FIBRE_BLOCK)
DataGen.decorativeCubeAllCutout(MBlocks.METAL_MESH)
DataGen.decoratives(MRegistry.TRITANIUM_BLOCK) DataGen.decoratives(MRegistry.TRITANIUM_BLOCK)
for (anvil in MBlocks.TRITANIUM_ANVIL) { for (color in DyeColor.entries) {
blockStateProvider.exec { blockModelProvider.exec {
blockStateProvider.getVariantBuilder(anvil).forAllStates { blockModelProvider.withExistingParent("block/tritanium_anvil0_${color.name.lowercase()}", "${DataGen.MOD_ID}:block/tritanium_anvil0")
ConfiguredModel.builder() .texture("3", modLocation("block/tritanium_anvil/${color.name.lowercase()}"))
.modelFile(blockStateProvider.models().getExistingFile(modLocation("block/${anvil.registryName!!.path}"))) .texture("particle", modLocation("block/tritanium_anvil/${color.name.lowercase()}"))
.rotationY(it[AnvilBlock.FACING].yRotationBlockstateNorth()) }
.build()
for (i in 1 until MBlocks.TRITANIUM_ANVIL_VARIANTS) {
blockModelProvider.exec {
blockModelProvider.withExistingParent("block/tritanium_anvil${i}_${color.name.lowercase()}", "${DataGen.MOD_ID}:block/tritanium_anvil$i")
.texture("2", modLocation("block/tritanium_anvil_top/${color.name.lowercase()}"))
.texture("3", modLocation("block/tritanium_anvil/${color.name.lowercase()}"))
.texture("particle", modLocation("block/tritanium_anvil/${color.name.lowercase()}"))
}
}
}
for (anvils in MBlocks.TRITANIUM_ANVIL.values) {
for (anvil in anvils) {
blockStateProvider.exec {
blockStateProvider.getVariantBuilder(anvil).forAllStates {
ConfiguredModel.builder()
.modelFile(blockStateProvider.models().getExistingFile(modLocation("block/${anvil.registryName!!.path}")))
.rotationY(it[AnvilBlock.FACING].yRotationBlockstateNorth())
.build()
}
} }
} }
} }
for ((color, block) in MRegistry.TRITANIUM_STAIRS.allBlocks) { for ((color, block) in MRegistry.TRITANIUM_STAIRS.allBlocks) {
DataGen.decorativeStairs(block as StairBlock, MRegistry.TRITANIUM_BLOCK.allBlocks[color]!!.registryName!!.path, MRegistry.TRITANIUM_BLOCK.allBlocks[color]!!.registryName!!.path) DataGen.decorativeStairs(block, MRegistry.TRITANIUM_BLOCK.allBlocks[color]!!.registryName!!.path, MRegistry.TRITANIUM_BLOCK.allBlocks[color]!!.registryName!!.path)
} }
for ((color, block) in MRegistry.TRITANIUM_PRESSURE_PLATE.allBlocks) { for ((color, block) in MRegistry.TRITANIUM_PRESSURE_PLATE.allBlocks) {
@ -77,7 +98,7 @@ fun addDecorativeData(blockStateProvider: MatteryBlockStateProvider, itemModelPr
for ((color, block) in MRegistry.TRITANIUM_SLAB.allBlocks) { for ((color, block) in MRegistry.TRITANIUM_SLAB.allBlocks) {
blockStateProvider.exec { blockStateProvider.exec {
blockStateProvider.slabBlock( blockStateProvider.slabBlock(
block as SlabBlock, block,
MRegistry.TRITANIUM_BLOCK.allBlocks[color]!!.registryName!!, MRegistry.TRITANIUM_BLOCK.allBlocks[color]!!.registryName!!,
modLocation("${DataGen.DECORATIVE_BLOCK_LOCATION}/${MRegistry.TRITANIUM_BLOCK.allBlocks[color]!!.registryName!!.path}") modLocation("${DataGen.DECORATIVE_BLOCK_LOCATION}/${MRegistry.TRITANIUM_BLOCK.allBlocks[color]!!.registryName!!.path}")
) )
@ -87,7 +108,7 @@ fun addDecorativeData(blockStateProvider: MatteryBlockStateProvider, itemModelPr
for ((color, block) in MRegistry.FLOOR_TILES_SLAB.blocks) { for ((color, block) in MRegistry.FLOOR_TILES_SLAB.blocks) {
blockStateProvider.exec { blockStateProvider.exec {
blockStateProvider.slabBlock( blockStateProvider.slabBlock(
block as SlabBlock, block,
MRegistry.FLOOR_TILES.blocks[color]!!.registryName!!, MRegistry.FLOOR_TILES.blocks[color]!!.registryName!!,
modLocation("${DataGen.DECORATIVE_BLOCK_LOCATION}/${MRegistry.FLOOR_TILES.blocks[color]!!.registryName!!.path}") modLocation("${DataGen.DECORATIVE_BLOCK_LOCATION}/${MRegistry.FLOOR_TILES.blocks[color]!!.registryName!!.path}")
) )
@ -96,7 +117,7 @@ fun addDecorativeData(blockStateProvider: MatteryBlockStateProvider, itemModelPr
for ((color, block) in MRegistry.FLOOR_TILES_STAIRS.blocks) { for ((color, block) in MRegistry.FLOOR_TILES_STAIRS.blocks) {
DataGen.decorativeStairs( DataGen.decorativeStairs(
block as StairBlock, block,
MRegistry.FLOOR_TILES.blocks[color]!!.registryName!!.path, MRegistry.FLOOR_TILES.blocks[color]!!.registryName!!.path,
MRegistry.FLOOR_TILES.blocks[color]!!.registryName!!.path MRegistry.FLOOR_TILES.blocks[color]!!.registryName!!.path
) )
@ -104,7 +125,7 @@ fun addDecorativeData(blockStateProvider: MatteryBlockStateProvider, itemModelPr
for ((color, block) in MRegistry.TRITANIUM_WALL.allBlocks) { for ((color, block) in MRegistry.TRITANIUM_WALL.allBlocks) {
DataGen.decorativeWall( DataGen.decorativeWall(
block as WallBlock, block,
sideTexture = MRegistry.TRITANIUM_BLOCK.allBlocks[color]!!.registryName!!.path, sideTexture = MRegistry.TRITANIUM_BLOCK.allBlocks[color]!!.registryName!!.path,
topTexture = MRegistry.TRITANIUM_BLOCK.allBlocks[color]!!.registryName!!.path topTexture = MRegistry.TRITANIUM_BLOCK.allBlocks[color]!!.registryName!!.path
) )
@ -140,6 +161,19 @@ fun addDecorativeData(blockStateProvider: MatteryBlockStateProvider, itemModelPr
blockModelProvider.decorativeGlassAll(MRegistry.INDUSTRIAL_GLASS.allBlocks.values) blockModelProvider.decorativeGlassAll(MRegistry.INDUSTRIAL_GLASS.allBlocks.values)
blockStateProvider.simpleBlockM(MRegistry.INDUSTRIAL_GLASS.allBlocks.values) blockStateProvider.simpleBlockM(MRegistry.INDUSTRIAL_GLASS.allBlocks.values)
blockModelProvider.colored("computer_terminal", mapOf(
"0" to "decorative/computer_base",
"1" to "decorative/computer_screen",
"particle" to "decorative/computer_base",
))
blockStateProvider.block(MRegistry.COMPUTER_TERMINAL.allBlocks.values)
blockModelProvider.colored("star_chair", mapOf(
"1" to "decorative/star_chair",
"2" to "powered_smoker_base",
))
blockStateProvider.block(MRegistry.STAR_CHAIR.allBlocks.values)
blockStateProvider.simpleBlockM(MBlocks.FLUID_TANK) blockStateProvider.simpleBlockM(MBlocks.FLUID_TANK)
for ((block, colors) in MRegistry.TRITANIUM_STRIPED_BLOCK.blocksWithColor) { for ((block, colors) in MRegistry.TRITANIUM_STRIPED_BLOCK.blocksWithColor) {
@ -191,8 +225,8 @@ fun addDecorativeData(blockStateProvider: MatteryBlockStateProvider, itemModelPr
} }
} }
DataGen.decorativeCubeAll(MBlocks.DANGER_STRIPE_BLOCK) DataGen.decorativePillar(MBlocks.METAL_BEAM, "metal_beam_side", "metal_beam_top")
DataGen.decorativeColumn(MBlocks.METAL_BEAM, "metal_beam_side", "metal_beam_top") blockModelProvider.decorativeCubeAll(MBlocks.METAL_BEAM_CENTER, "metal_beam_top")
var labLampOn: BlockModelBuilder? = null var labLampOn: BlockModelBuilder? = null
var labLampOff: BlockModelBuilder? = null var labLampOff: BlockModelBuilder? = null
@ -223,23 +257,26 @@ fun addDecorativeData(blockStateProvider: MatteryBlockStateProvider, itemModelPr
itemModelProvider.block(MItems.LABORATORY_LAMP) itemModelProvider.block(MItems.LABORATORY_LAMP)
itemModelProvider.block(MItems.LABORATORY_LAMP_INVERTED, MItems.LABORATORY_LAMP.registryName!!.path + "_unlit") itemModelProvider.block(MItems.LABORATORY_LAMP_INVERTED, MItems.LABORATORY_LAMP.registryName!!.path + "_unlit")
itemModelProvider.block(MItems.DANGER_STRIPE_BLOCK) itemModelProvider.block(MItems.DANGER_STRIPE_BLOCK, MItems.DANGER_STRIPE_BLOCK.registryName!!.path + "_0")
itemModelProvider.block(MItems.METAL_BEAM) itemModelProvider.block(MItems.METAL_BEAM)
blockStateProvider.block(MBlocks.METAL_BEAM_CENTER)
itemModelProvider.block(MItems.METAL_BEAM_CENTER)
blockStateProvider.exec { blockStateProvider.exec {
blockStateProvider.getVariantBuilder(MBlocks.LABORATORY_LAMP).forAllStates { blockStateProvider.getVariantBuilder(MBlocks.LABORATORY_LAMP).forAllStates {
return@forAllStates ConfiguredModel.builder() return@forAllStates ConfiguredModel.builder()
.modelFile(if (it[BlockStateProperties.LIT]) labLampOn!! else labLampOff!!) .modelFile(if (it[BlockStateProperties.LIT]) labLampOn!! else labLampOff!!)
.rotationX(it[BlockRotationFreedom.TWO.property].front.xRotationBlockstateNorth()) .rotationX(it[BlockRotationFreedom.DIRECTIONAL.property].front.xRotationBlockstateNorth())
.rotationY(it[BlockRotationFreedom.TWO.property].front.yRotationBlockstateNorth()) .rotationY(it[BlockRotationFreedom.DIRECTIONAL.property].front.yRotationBlockstateNorth())
.build() .build()
} }
blockStateProvider.getVariantBuilder(MBlocks.LABORATORY_LAMP_INVERTED).forAllStates { blockStateProvider.getVariantBuilder(MBlocks.LABORATORY_LAMP_INVERTED).forAllStates {
return@forAllStates ConfiguredModel.builder() return@forAllStates ConfiguredModel.builder()
.modelFile(if (it[BlockStateProperties.LIT]) labLampOn!! else labLampOff!!) .modelFile(if (it[BlockStateProperties.LIT]) labLampOn!! else labLampOff!!)
.rotationX(it[BlockRotationFreedom.TWO.property].front.xRotationBlockstateNorth()) .rotationX(it[BlockRotationFreedom.DIRECTIONAL.property].front.xRotationBlockstateNorth())
.rotationY(it[BlockRotationFreedom.TWO.property].front.yRotationBlockstateNorth()) .rotationY(it[BlockRotationFreedom.DIRECTIONAL.property].front.yRotationBlockstateNorth())
.build() .build()
} }
} }
@ -247,26 +284,40 @@ fun addDecorativeData(blockStateProvider: MatteryBlockStateProvider, itemModelPr
blockModelProvider.exec { blockModelProvider.exec {
for (crate in MRegistry.CARGO_CRATES.blocks.values) { for (crate in MRegistry.CARGO_CRATES.blocks.values) {
it.withExistingParent("${crate.registryName!!.path}_closed", modLocation("${MNames.CARGO_CRATE}_closed")) it.withExistingParent("${crate.registryName!!.path}_closed", modLocation("${MNames.CARGO_CRATE}_closed"))
.texture("texture", "block/cargo_crates/${crate.registryName!!.path}") .texture("body", "block/cargo_crates/${crate.registryName!!.path}")
.texture("particle", "block/cargo_crates/${crate.registryName!!.path}") .texture("particle", "block/cargo_crates/${crate.registryName!!.path}")
it.withExistingParent("${crate.registryName!!.path}_open", modLocation("${MNames.CARGO_CRATE}_open")) it.withExistingParent("${crate.registryName!!.path}_open", modLocation("${MNames.CARGO_CRATE}_open"))
.texture("texture", "block/cargo_crates/${crate.registryName!!.path}") .texture("body", "block/cargo_crates/${crate.registryName!!.path}")
.texture("particle", "block/cargo_crates/${crate.registryName!!.path}") .texture("particle", "block/cargo_crates/${crate.registryName!!.path}")
} }
} }
DataGen.decorativeColumn(MBlocks.TRITANIUM_STRIPED_BLOCK, "tritanium_striped_block", "tritanium_block") MBlocks.TRITANIUM_STRIPED_BLOCK.entries.forEach { (c, it) ->
DataGen.decorativeStairs(MBlocks.TRITANIUM_STRIPED_STAIRS as StairBlock, "tritanium_striped_block", "tritanium_block") DataGen.decorativeColumn(it, "stripe/tritanium_striped_block_${c.name.lowercase()}", "tritanium_block")
DataGen.decorativeWall(MBlocks.TRITANIUM_STRIPED_WALL as WallBlock, "tritanium_striped_block", "tritanium_block") }
DataGen.decorativeSlab(MBlocks.TRITANIUM_STRIPED_SLAB as SlabBlock, MBlocks.TRITANIUM_STRIPED_BLOCK.registryName!!, "tritanium_striped_block", "tritanium_block")
itemModelProvider.block(MItems.TRITANIUM_STRIPED_STAIRS) MBlocks.TRITANIUM_STRIPED_STAIRS.entries.forEach { (c, it) ->
itemModelProvider.block(MItems.TRITANIUM_STRIPED_SLAB) DataGen.decorativeStairs(it, "stripe/tritanium_striped_block_${c.name.lowercase()}", "tritanium_block")
}
MBlocks.TRITANIUM_STRIPED_WALL.entries.forEach { (c, it) ->
DataGen.decorativeWall(it, "stripe/tritanium_striped_block_${c.name.lowercase()}", "tritanium_block")
}
MBlocks.TRITANIUM_STRIPED_SLAB.entries.forEach { (c, it) ->
DataGen.decorativeSlab(it, MBlocks.TRITANIUM_STRIPED_BLOCK[c]!!.registryName!!, "stripe/tritanium_striped_block_${c.name.lowercase()}", "tritanium_block")
}
itemModelProvider.blocks(MItems.TRITANIUM_STRIPED_STAIRS.values)
itemModelProvider.blocks(MItems.TRITANIUM_STRIPED_SLAB.values)
itemModelProvider.exec { itemModelProvider.exec {
itemModelProvider.withExistingParent(MItems.TRITANIUM_STRIPED_WALL.registryName!!.path, modLocation("block/wall_inventory")) MBlocks.TRITANIUM_STRIPED_WALL.entries.forEach { (c, it) ->
.texture("wall_side", modLocation("${DataGen.DECORATIVE_BLOCK_LOCATION}/tritanium_striped_block")) itemModelProvider.withExistingParent(it.registryName!!.path, modLocation("block/wall_inventory"))
.texture("wall", modLocation("${DataGen.DECORATIVE_BLOCK_LOCATION}/tritanium_block")) .texture("wall_side", modLocation("${DataGen.DECORATIVE_BLOCK_LOCATION}/stripe/tritanium_striped_block_${c.name.lowercase()}"))
.texture("wall", modLocation("${DataGen.DECORATIVE_BLOCK_LOCATION}/tritanium_block"))
}
} }
for ((color, glass) in MRegistry.INDUSTRIAL_GLASS_PANE.allBlocks) { for ((color, glass) in MRegistry.INDUSTRIAL_GLASS_PANE.allBlocks) {
@ -277,6 +328,7 @@ fun addDecorativeData(blockStateProvider: MatteryBlockStateProvider, itemModelPr
} }
DataGen.bars(MBlocks.TRITANIUM_BARS, modLocation("block/decorative/tritanium_bars")) DataGen.bars(MBlocks.TRITANIUM_BARS, modLocation("block/decorative/tritanium_bars"))
DataGen.bars(MBlocks.METAL_RAILING, modLocation("block/decorative/metal_railing"))
blockStateProvider.block(MBlocks.ENGINE) blockStateProvider.block(MBlocks.ENGINE)
itemModelProvider.block(MItems.ENGINE) itemModelProvider.block(MItems.ENGINE)

View File

@ -0,0 +1,15 @@
package ru.dbotthepony.mc.otm.datagen
import net.neoforged.neoforge.common.Tags
import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.data.FlywheelMaterialDataProvider
import ru.dbotthepony.mc.otm.registry.MBlockTags
fun addFlywheelMaterials(provider: FlywheelMaterialDataProvider) {
provider.add(Tags.Blocks.STORAGE_BLOCKS_DIAMOND, Decimal(25_000_000))
provider.add(Tags.Blocks.STORAGE_BLOCKS_COPPER, Decimal(60_000_000))
provider.add(Tags.Blocks.STORAGE_BLOCKS_IRON, Decimal(50_000_000))
provider.add(Tags.Blocks.STORAGE_BLOCKS_GOLD, Decimal(300_000_000), momentumLossSpeed = Decimal("0.75"))
provider.add(Tags.Blocks.STORAGE_BLOCKS_NETHERITE, Decimal(1_250_000_000), momentumLossSpeed = Decimal.ONE_HALF)
provider.add(MBlockTags.TRITANIUM_BLOCKS, Decimal(225_000_000))
}

View File

@ -3,13 +3,11 @@ package ru.dbotthepony.mc.otm.datagen
import net.minecraft.tags.ItemTags import net.minecraft.tags.ItemTags
import net.minecraft.world.item.Item import net.minecraft.world.item.Item
import net.minecraft.world.item.Items import net.minecraft.world.item.Items
import net.minecraftforge.common.Tags import net.neoforged.neoforge.common.Tags
import ru.dbotthepony.mc.otm.core.math.Decimal import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.matter.ComputeAction
import ru.dbotthepony.mc.otm.matter.MatterDataProvider import ru.dbotthepony.mc.otm.matter.MatterDataProvider
import ru.dbotthepony.mc.otm.matter.MatterFunction
import ru.dbotthepony.mc.otm.registry.MItemTags import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.MItems import ru.dbotthepony.mc.otm.registry.game.MItems
// general rule - anything plant or organic is much more complex than mineral // general rule - anything plant or organic is much more complex than mineral
// and anything mineral has much bigger matter value than complexity (just throw a lot of same molecules) // and anything mineral has much bigger matter value than complexity (just throw a lot of same molecules)
@ -18,8 +16,25 @@ fun addMatterData(provider: MatterDataProvider) {
provider.inherit(Items.CHIPPED_ANVIL, Items.ANVIL, 0.75) provider.inherit(Items.CHIPPED_ANVIL, Items.ANVIL, 0.75)
provider.inherit(Items.DAMAGED_ANVIL, Items.ANVIL, 0.5) provider.inherit(Items.DAMAGED_ANVIL, Items.ANVIL, 0.5)
for (i in 1 until MItems.TRITANIUM_ANVIL.size) { for (anvils in MItems.TRITANIUM_ANVIL.values) {
provider.inherit(MItems.TRITANIUM_ANVIL[i], MItems.TRITANIUM_ANVIL[i - 1], 0.85) for (i in 1 until anvils.size) {
provider.inherit(anvils[i], anvils[i - 1], 0.85)
}
}
provider.inherit(Items.WATER_BUCKET, Items.BUCKET) {
plus(Decimal(1), 20.0)
}
provider.inherit(Items.LAVA_BUCKET, Items.MAGMA_BLOCK) {
plus(Decimal(0), 666.0)
plus(Items.BUCKET)
}
provider.inherit(Items.POWDER_SNOW_BUCKET, Items.SNOW_BLOCK) {
multiply(Decimal(0.75), 1.0)
plus(Decimal(0), 200.0)
plus(Items.BUCKET)
} }
provider.inherit(Items.MILK_BUCKET, Items.BUCKET) { provider.inherit(Items.MILK_BUCKET, Items.BUCKET) {
@ -75,6 +90,23 @@ fun addMatterData(provider: MatterDataProvider) {
provider.inherit(Items.RED_CONCRETE, Items.RED_CONCRETE_POWDER) provider.inherit(Items.RED_CONCRETE, Items.RED_CONCRETE_POWDER)
provider.inherit(Items.BLACK_CONCRETE, Items.BLACK_CONCRETE_POWDER) provider.inherit(Items.BLACK_CONCRETE, Items.BLACK_CONCRETE_POWDER)
provider.inherit(Items.WHITE_WOOL, Items.STRING, Decimal(4))
provider.inherit(Items.ORANGE_WOOL, Items.STRING, Decimal(4))
provider.inherit(Items.MAGENTA_WOOL, Items.STRING, Decimal(4))
provider.inherit(Items.LIGHT_BLUE_WOOL, Items.STRING, Decimal(4))
provider.inherit(Items.YELLOW_WOOL, Items.STRING, Decimal(4))
provider.inherit(Items.LIME_WOOL, Items.STRING, Decimal(4))
provider.inherit(Items.PINK_WOOL, Items.STRING, Decimal(4))
provider.inherit(Items.GRAY_WOOL, Items.STRING, Decimal(4))
provider.inherit(Items.LIGHT_GRAY_WOOL, Items.STRING, Decimal(4))
provider.inherit(Items.CYAN_WOOL, Items.STRING, Decimal(4))
provider.inherit(Items.PURPLE_WOOL, Items.STRING, Decimal(4))
provider.inherit(Items.BLUE_WOOL, Items.STRING, Decimal(4))
provider.inherit(Items.BROWN_WOOL, Items.STRING, Decimal(4))
provider.inherit(Items.GREEN_WOOL, Items.STRING, Decimal(4))
provider.inherit(Items.RED_WOOL, Items.STRING, Decimal(4))
provider.inherit(Items.BLACK_WOOL, Items.STRING, Decimal(4))
with(provider) { with(provider) {
blacklist(Tags.Items.RAW_MATERIALS) blacklist(Tags.Items.RAW_MATERIALS)
blacklist(Tags.Items.RAW_MATERIALS_COPPER) blacklist(Tags.Items.RAW_MATERIALS_COPPER)
@ -121,12 +153,12 @@ fun addMatterData(provider: MatterDataProvider) {
relative(Items.PACKED_ICE, 1.5, 1) relative(Items.PACKED_ICE, 1.5, 1)
// rocks // rocks
scope(Tags.Items.STONE, 1.1, 1.1) { scope(Tags.Items.STONES, 1.1, 1.1) {
equal(Tags.Items.COBBLESTONE) equal(Tags.Items.COBBLESTONES)
equal(Tags.Items.GRAVEL) equal(Tags.Items.GRAVELS)
equal(Items.FLINT) equal(Items.FLINT)
equal(Tags.Items.SAND) equal(Tags.Items.SANDS)
equal(Tags.Items.NETHERRACK) equal(Tags.Items.NETHERRACKS)
scope(1.4, 1.5) { scope(1.4, 1.5) {
equal(Items.BASALT) equal(Items.BASALT)
@ -154,7 +186,7 @@ fun addMatterData(provider: MatterDataProvider) {
relative(Items.REINFORCED_DEEPSLATE, 3, 1.4) relative(Items.REINFORCED_DEEPSLATE, 3, 1.4)
} }
relative(Tags.Items.OBSIDIAN, 10, 1.5) relative(Tags.Items.OBSIDIANS, 10, 1.5)
relative(Items.CRYING_OBSIDIAN, 14, 3) relative(Items.CRYING_OBSIDIAN, 14, 3)
} }
@ -190,7 +222,7 @@ fun addMatterData(provider: MatterDataProvider) {
// drops from mobs // drops from mobs
scope(Items.ROTTEN_FLESH, 8, 1.5) { scope(Items.ROTTEN_FLESH, 8, 1.5) {
equal(Items.INK_SAC) equal(Items.INK_SAC)
equal(Tags.Items.LEATHER) equal(Tags.Items.LEATHERS)
equal(Items.LEATHER) equal(Items.LEATHER)
relative(Items.RABBIT_FOOT, 1.1, 1.5) relative(Items.RABBIT_FOOT, 1.1, 1.5)
@ -200,14 +232,15 @@ fun addMatterData(provider: MatterDataProvider) {
relative(Tags.Items.BONES, 1, 1.25) relative(Tags.Items.BONES, 1, 1.25)
relative(Tags.Items.STRING, 0.8, 0.75) relative(Tags.Items.STRINGS, 0.8, 0.75)
relative(Items.COBWEB, 0.8, 0.75) relative(Items.COBWEB, 0.8, 0.75)
relative(Items.SPIDER_EYE, 0.8, 1.8) relative(Items.SPIDER_EYE, 0.8, 1.8)
relative(Tags.Items.SLIMEBALLS, 1, 1.4) relative(Tags.Items.SLIME_BALLS, 1, 1.4)
relative(Tags.Items.GUNPOWDER, 0.85, 1.15) relative(Tags.Items.GUNPOWDERS, 0.85, 1.15)
relative(Items.SCUTE, 1, 1.5) relative(Items.TURTLE_SCUTE, 1, 1.5)
relative(Items.ARMADILLO_SCUTE, 1, 1.8)
relative(Items.FEATHER, 0.7, 1.25) relative(Items.FEATHER, 0.7, 1.25)
relative(Items.EGG, 1.25, 4) relative(Items.EGG, 1.25, 4)
@ -230,7 +263,7 @@ fun addMatterData(provider: MatterDataProvider) {
relative(Items.SCULK_VEIN, 2.5, 24) relative(Items.SCULK_VEIN, 2.5, 24)
// planty // planty
scope(Items.GRASS, 1.5, 2.5) { scope(Items.SHORT_GRASS, 1.5, 2.5) {
equal(Items.SUNFLOWER) equal(Items.SUNFLOWER)
equal(Items.LILAC) equal(Items.LILAC)
equal(Items.ROSE_BUSH) equal(Items.ROSE_BUSH)
@ -404,4 +437,6 @@ fun addMatterData(provider: MatterDataProvider) {
} }
} }
} }
provider.inherit(MItems.IMPERFECT_BREAD, Items.BREAD, 1.5)
} }

View File

@ -1,58 +0,0 @@
package ru.dbotthepony.mc.otm.datagen
import net.minecraft.core.RegistrySetBuilder
import net.minecraft.core.registries.Registries
import net.minecraft.data.worldgen.BootstapContext
import net.minecraft.resources.ResourceKey
import net.minecraft.tags.BlockTags
import net.minecraft.world.level.levelgen.VerticalAnchor
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature
import net.minecraft.world.level.levelgen.feature.Feature
import net.minecraft.world.level.levelgen.feature.configurations.OreConfiguration
import net.minecraft.world.level.levelgen.placement.CountPlacement
import net.minecraft.world.level.levelgen.placement.HeightRangePlacement
import net.minecraft.world.level.levelgen.placement.InSquarePlacement
import net.minecraft.world.level.levelgen.placement.PlacedFeature
import net.minecraft.world.level.levelgen.structure.templatesystem.TagMatchTest
import net.minecraftforge.common.data.DatapackBuiltinEntriesProvider
import net.minecraftforge.data.event.GatherDataEvent
import ru.dbotthepony.mc.otm.registry.MBlocks
private val oreKey by lazy { ResourceKey.create(Registries.CONFIGURED_FEATURE, modLocation("tritanium_ore")) }
fun registerConfiguredFeatures(context: BootstapContext<ConfiguredFeature<*, *>>) {
val stone = TagMatchTest(BlockTags.STONE_ORE_REPLACEABLES)
val deepslate = TagMatchTest(BlockTags.DEEPSLATE_ORE_REPLACEABLES)
val target = listOf(
OreConfiguration.target(stone, MBlocks.TRITANIUM_ORE.defaultBlockState()),
OreConfiguration.target(deepslate, MBlocks.DEEPSLATE_TRITANIUM_ORE.defaultBlockState()),
)
context.register(oreKey, ConfiguredFeature(Feature.ORE, OreConfiguration(target, 9)))
}
fun registerPlacedFeatures(context: BootstapContext<PlacedFeature>) {
fun location(name: String) = ResourceKey.create(Registries.PLACED_FEATURE, modLocation(name))
val configured = context.lookup(Registries.CONFIGURED_FEATURE)
val ore = configured.getOrThrow(oreKey)
context.register(location("normal_tritanium"), PlacedFeature(
ore,
listOf(
CountPlacement.of(8),
InSquarePlacement.spread(),
HeightRangePlacement.triangle(VerticalAnchor.absolute(0), VerticalAnchor.absolute(50))
)
))
context.register(location("deep_tritanium"), PlacedFeature(
ore,
listOf(
CountPlacement.of(10),
InSquarePlacement.spread(),
HeightRangePlacement.uniform(VerticalAnchor.aboveBottom(8), VerticalAnchor.absolute(0))
)
))
}

View File

@ -2,22 +2,18 @@ package ru.dbotthepony.mc.otm.datagen
import net.minecraft.tags.ItemTags import net.minecraft.tags.ItemTags
import net.minecraft.world.item.Items import net.minecraft.world.item.Items
import net.minecraftforge.common.Tags import net.neoforged.neoforge.common.Tags
import ru.dbotthepony.mc.otm.OverdriveThatMatters import ru.dbotthepony.mc.otm.OverdriveThatMatters
import ru.dbotthepony.mc.otm.android.AndroidResearchType import ru.dbotthepony.mc.otm.player.android.AndroidResearchDescriptions
import ru.dbotthepony.mc.otm.android.feature.EnderTeleporterFeature import ru.dbotthepony.mc.otm.player.android.AndroidResearchResults
import ru.dbotthepony.mc.otm.android.feature.FallDampenersFeature import ru.dbotthepony.mc.otm.player.android.AndroidResearchType
import ru.dbotthepony.mc.otm.android.feature.ItemMagnetFeature
import ru.dbotthepony.mc.otm.android.feature.JumpBoostFeature
import ru.dbotthepony.mc.otm.android.feature.NanobotsArmorFeature
import ru.dbotthepony.mc.otm.android.feature.ShockwaveFeature
import ru.dbotthepony.mc.otm.client.render.ResearchIcons import ru.dbotthepony.mc.otm.client.render.ResearchIcons
import ru.dbotthepony.mc.otm.core.TextComponent import ru.dbotthepony.mc.otm.util.TextComponent
import ru.dbotthepony.mc.otm.core.TranslatableComponent import ru.dbotthepony.mc.otm.util.TranslatableComponent
import ru.dbotthepony.mc.otm.datagen.lang.MatteryLanguageProvider import ru.dbotthepony.mc.otm.datagen.lang.MatteryLanguageProvider
import ru.dbotthepony.mc.otm.registry.AndroidFeatures import ru.dbotthepony.mc.otm.registry.game.AndroidFeatures
import ru.dbotthepony.mc.otm.registry.MItemTags import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.MItems import ru.dbotthepony.mc.otm.registry.game.MItems
import ru.dbotthepony.mc.otm.registry.MNames import ru.dbotthepony.mc.otm.registry.MNames
import java.util.LinkedList import java.util.LinkedList
import java.util.function.Consumer import java.util.function.Consumer
@ -47,6 +43,45 @@ fun addResearchData(serializer: Consumer<AndroidResearchType>, lang: MatteryLang
serializer.accept(IMPROVED_LIMBS) serializer.accept(IMPROVED_LIMBS)
val SWIM_BOOSTERS = AndroidResearchType.Builder(modLocation(MNames.SWIM_BOOSTERS))
.withExperience(26)
.withDescription(AndroidResearchDescriptions.SWIM_BOOSTERS.Instance(0))
.addPrerequisite(IMPROVED_LIMBS)
.addPrerequisite(AIR_BAGS)
.addFeatureResult(AndroidFeatures.SWIM_BOOSTERS)
.withIcon(ResearchIcons.ICON_LIMB_OVERCLOCKING)
.addItem(MItemTags.TRITANIUM_PLATES, 2)
.addItem(MItemTags.COPPER_WIRES, 2)
.addItem(MItems.ELECTROMOTOR, 2)
.build()
serializer.accept(SWIM_BOOSTERS)
val SWIM_BOOSTERS_2 = AndroidResearchType.Builder(modLocation(MNames.SWIM_BOOSTERS + "_2"))
.withExperience(30)
.withDescription(AndroidResearchDescriptions.SWIM_BOOSTERS.Instance(1))
.addPrerequisite(SWIM_BOOSTERS)
.addFeatureLevel(AndroidFeatures.SWIM_BOOSTERS)
.withIcon(ResearchIcons.ICON_LIMB_OVERCLOCKING)
.addItem(MItemTags.GOLD_WIRES, 8)
.addItem(MItems.ELECTROMOTOR, 2)
.build()
serializer.accept(SWIM_BOOSTERS_2)
val SWIM_BOOSTERS_3 = AndroidResearchType.Builder(modLocation(MNames.SWIM_BOOSTERS + "_3"))
.withExperience(30)
.withDescription(AndroidResearchDescriptions.SWIM_BOOSTERS.Instance(2))
.addPrerequisite(SWIM_BOOSTERS_2)
.addFeatureLevel(AndroidFeatures.SWIM_BOOSTERS)
.withIcon(ResearchIcons.ICON_LIMB_OVERCLOCKING)
.addItem(MItemTags.CARBON_PLATES, 8)
.addItem(MItemTags.TRITANIUM_NUGGETS, 4)
.addItem(MItemTags.COPPER_WIRES, 2)
.build()
serializer.accept(SWIM_BOOSTERS_3)
val STEP_ASSIST = AndroidResearchType.Builder(modLocation(MNames.STEP_ASSIST)) val STEP_ASSIST = AndroidResearchType.Builder(modLocation(MNames.STEP_ASSIST))
.withExperience(24) .withExperience(24)
.addFeatureResult(AndroidFeatures.STEP_ASSIST) .addFeatureResult(AndroidFeatures.STEP_ASSIST)
@ -103,7 +138,7 @@ fun addResearchData(serializer: Consumer<AndroidResearchType>, lang: MatteryLang
.addPrerequisite(OverdriveThatMatters.loc(MNames.NANOBOTS)) .addPrerequisite(OverdriveThatMatters.loc(MNames.NANOBOTS))
.addFeatureResult(OverdriveThatMatters.loc(MNames.NANOBOTS_ARMOR)) .addFeatureResult(OverdriveThatMatters.loc(MNames.NANOBOTS_ARMOR))
.withIcon(ResearchIcons.ICON_ARMOR) .withIcon(ResearchIcons.ICON_ARMOR)
.addBlocker(OverdriveThatMatters.loc(MNames.ATTACK_BOOST_1), rigid = true) .addBlocker(OverdriveThatMatters.loc(MNames.ATTACK_BOOST_1), optional = true)
.addItem(MItemTags.TRITANIUM_PLATES, 4) .addItem(MItemTags.TRITANIUM_PLATES, 4)
.addItem(MItemTags.COPPER_WIRES, 8) .addItem(MItemTags.COPPER_WIRES, 8)
.build() .build()
@ -128,15 +163,18 @@ fun addResearchData(serializer: Consumer<AndroidResearchType>, lang: MatteryLang
TranslatableComponent( TranslatableComponent(
"android_research.overdrive_that_matters.limb_overclocking.description", "android_research.overdrive_that_matters.limb_overclocking.description",
(i + 1) * 8, (i + 1) * 8,
(i + 1) * 6 (i + 1) * 6,
(i + 1) * 20
) )
) )
.addItem(MItemTags.COPPER_WIRES, 4 + i * 2) .addItem(MItemTags.COPPER_WIRES, 4 + i * 2)
.addFeatureResult(OverdriveThatMatters.loc(MNames.LIMB_OVERCLOCKING), i)
if (i > 0) { if (i > 0) {
research.addPrerequisite(OverdriveThatMatters.loc(MNames.LIMB_OVERCLOCKING_LIST[i - 1]), rigid = true) research.addFeatureLevel(AndroidFeatures.LIMB_OVERCLOCKING)
research.addPrerequisite(OverdriveThatMatters.loc(MNames.LIMB_OVERCLOCKING_LIST[i - 1]), optional = true)
research.addItem(MItemTags.GOLD_WIRES, i * 2) research.addItem(MItemTags.GOLD_WIRES, i * 2)
} else {
research.addFeatureResult(AndroidFeatures.LIMB_OVERCLOCKING)
} }
research.build() research.build()
@ -155,18 +193,23 @@ fun addResearchData(serializer: Consumer<AndroidResearchType>, lang: MatteryLang
(i + 1) * 15 (i + 1) * 15
) )
) )
.addFeatureResult(AndroidFeatures.ATTACK_BOOST, i) .addItem(MItems.ELECTROMAGNET, 2 + i)
.addItem(MItemTags.GOLD_WIRES, 4 * i + 8)
.addItem(MItemTags.PISTONS)
.addBlocker(NANOBOTS_ARMOR) .addBlocker(NANOBOTS_ARMOR)
if (i > 0) { if (i > 0) {
research.addPrerequisite(OverdriveThatMatters.loc(MNames.ATTACK_BOOST_LIST[i - 1]), rigid = true) research.addFeatureLevel(AndroidFeatures.ATTACK_BOOST)
research.addPrerequisite(OverdriveThatMatters.loc(MNames.ATTACK_BOOST_LIST[i - 1]), optional = true)
} else {
research.addFeatureResult(AndroidFeatures.ATTACK_BOOST)
} }
research.build() research.build()
}) })
regenList.add(run { regenList.add(run {
val regeneration = AndroidResearchType.Builder(modLocation(MNames.NANOBOTS_REGENERATION_LIST[i])) val research = AndroidResearchType.Builder(modLocation(MNames.NANOBOTS_REGENERATION_LIST[i]))
.withExperience(20 + i * 6) .withExperience(20 + i * 6)
.withIconText(TextComponent((i + 1).toString())) .withIconText(TextComponent((i + 1).toString()))
.withIcon(ResearchIcons.ICON_NANOBOTS) .withIcon(ResearchIcons.ICON_NANOBOTS)
@ -179,15 +222,16 @@ fun addResearchData(serializer: Consumer<AndroidResearchType>, lang: MatteryLang
.addItem(MItems.MATTER_CAPACITOR_PARTS, 1) .addItem(MItems.MATTER_CAPACITOR_PARTS, 1)
.addItem(Items.SUGAR, 2 + i * 2) .addItem(Items.SUGAR, 2 + i * 2)
.addItem(Tags.Items.DUSTS_REDSTONE, 2 + i * 2) .addItem(Tags.Items.DUSTS_REDSTONE, 2 + i * 2)
.addFeatureResult(AndroidFeatures.NANOBOTS_REGENERATION, i)
if (i > 0) { if (i > 0) {
regeneration.addPrerequisite(OverdriveThatMatters.loc(MNames.NANOBOTS_REGENERATION_LIST[i - 1]), rigid = true) research.addFeatureLevel(AndroidFeatures.NANOBOTS_REGENERATION)
research.addPrerequisite(OverdriveThatMatters.loc(MNames.NANOBOTS_REGENERATION_LIST[i - 1]), optional = true)
} else { } else {
regeneration.addPrerequisite(OverdriveThatMatters.loc(MNames.NANOBOTS), rigid = true) research.addPrerequisite(OverdriveThatMatters.loc(MNames.NANOBOTS), optional = true)
research.addFeatureResult(AndroidFeatures.NANOBOTS_REGENERATION)
} }
regeneration.build() research.build()
}) })
} }
@ -216,10 +260,7 @@ fun addResearchData(serializer: Consumer<AndroidResearchType>, lang: MatteryLang
.addItem(MItemTags.TRITANIUM_PLATES, 2 + i * 2) .addItem(MItemTags.TRITANIUM_PLATES, 2 + i * 2)
.addItem(Items.SUGAR, 1 + i) .addItem(Items.SUGAR, 1 + i)
.addItem(MItems.ELECTROMAGNET) .addItem(MItems.ELECTROMAGNET)
.addFeatureResult(AndroidFeatures.NANOBOTS_ARMOR, 0, .addResult(AndroidResearchResults.NANOBOTS_ARMOR_STRENGTH)
transformersUp = listOf(NanobotsArmorFeature.STRENGTH_TRANSFORMER_UP.bind(level)),
transformersDown = listOf(NanobotsArmorFeature.STRENGTH_TRANSFORMER_DOWN.bind(level)),
)
.build() .build()
}) })
@ -243,10 +284,7 @@ fun addResearchData(serializer: Consumer<AndroidResearchType>, lang: MatteryLang
) )
) )
.addItem(Tags.Items.DUSTS_REDSTONE, 4 + i * 4) .addItem(Tags.Items.DUSTS_REDSTONE, 4 + i * 4)
.addFeatureResult(AndroidFeatures.NANOBOTS_ARMOR, 0, .addResult(AndroidResearchResults.NANOBOTS_ARMOR_SPEED)
transformersUp = listOf(NanobotsArmorFeature.SPEED_TRANSFORMER_UP.bind(level)),
transformersDown = listOf(NanobotsArmorFeature.SPEED_TRANSFORMER_DOWN.bind(level)),
)
.build() .build()
}) })
} }
@ -261,7 +299,7 @@ fun addResearchData(serializer: Consumer<AndroidResearchType>, lang: MatteryLang
AndroidResearchType.Builder(modLocation(MNames.SHOCKWAVE)) AndroidResearchType.Builder(modLocation(MNames.SHOCKWAVE))
.withExperience(40) .withExperience(40)
.withDescription(0 .. 1) .withDescription(0 .. 1)
.appendDescription(ShockwaveFeature.POWER_COST_DESCRIPTION) .withDescription(AndroidResearchDescriptions.SHOCKWAVE)
.withIcon(ResearchIcons.ICON_SHOCKWAVE) .withIcon(ResearchIcons.ICON_SHOCKWAVE)
.addFeatureResult(AndroidFeatures.SHOCKWAVE) .addFeatureResult(AndroidFeatures.SHOCKWAVE)
.addPrerequisite(attackBoostList[2]) .addPrerequisite(attackBoostList[2])
@ -276,7 +314,7 @@ fun addResearchData(serializer: Consumer<AndroidResearchType>, lang: MatteryLang
AndroidResearchType.Builder(modLocation(MNames.ITEM_MAGNET)) AndroidResearchType.Builder(modLocation(MNames.ITEM_MAGNET))
.withExperience(28) .withExperience(28)
.withDescription(0 .. 1) .withDescription(0 .. 1)
.appendDescription(ItemMagnetFeature.POWER_COST_DESCRIPTION) .withDescription(AndroidResearchDescriptions.ITEM_MAGNET)
.withIcon(ResearchIcons.ICON_ITEM_MAGNET) .withIcon(ResearchIcons.ICON_ITEM_MAGNET)
.addFeatureResult(AndroidFeatures.ITEM_MAGNET) .addFeatureResult(AndroidFeatures.ITEM_MAGNET)
.addPrerequisite(STEP_ASSIST) .addPrerequisite(STEP_ASSIST)
@ -292,9 +330,9 @@ fun addResearchData(serializer: Consumer<AndroidResearchType>, lang: MatteryLang
AndroidResearchType.Builder(modLocation(MNames.FALL_DAMPENERS + "_1")) AndroidResearchType.Builder(modLocation(MNames.FALL_DAMPENERS + "_1"))
.withExperience(25) .withExperience(25)
.withDescription() .withDescription()
.appendDescription(FallDampenersFeature.DESCRIPTION.bind(1)) .withDescription(AndroidResearchDescriptions.FALL_DAMPENERS.Instance(1))
.withIcon(ResearchIcons.ICON_FEATHER_FALLING) .withIcon(ResearchIcons.ICON_FEATHER_FALLING)
.addFeatureResult(AndroidFeatures.FALL_DAMPENERS, 0) .addFeatureResult(AndroidFeatures.FALL_DAMPENERS)
.addPrerequisite(STEP_ASSIST) .addPrerequisite(STEP_ASSIST)
.addItem(MItems.ELECTROMAGNET, 2) .addItem(MItems.ELECTROMAGNET, 2)
.addItem(ItemTags.WOOL, 2) .addItem(ItemTags.WOOL, 2)
@ -305,9 +343,9 @@ fun addResearchData(serializer: Consumer<AndroidResearchType>, lang: MatteryLang
AndroidResearchType.Builder(modLocation(MNames.FALL_DAMPENERS + "_2")) AndroidResearchType.Builder(modLocation(MNames.FALL_DAMPENERS + "_2"))
.withExperience(30) .withExperience(30)
.withDescription() .withDescription()
.appendDescription(FallDampenersFeature.DESCRIPTION.bind(2)) .withDescription(AndroidResearchDescriptions.FALL_DAMPENERS.Instance(2))
.withIcon(ResearchIcons.ICON_FEATHER_FALLING) .withIcon(ResearchIcons.ICON_FEATHER_FALLING)
.addFeatureResult(AndroidFeatures.FALL_DAMPENERS, 1) .addFeatureLevel(AndroidFeatures.FALL_DAMPENERS)
.addPrerequisite(FALL_DAMPENERS_1) .addPrerequisite(FALL_DAMPENERS_1)
.addItem(MItemTags.GOLD_PLATES, 2) .addItem(MItemTags.GOLD_PLATES, 2)
.addItem(MItemTags.COPPER_WIRES, 4) .addItem(MItemTags.COPPER_WIRES, 4)
@ -319,9 +357,9 @@ fun addResearchData(serializer: Consumer<AndroidResearchType>, lang: MatteryLang
AndroidResearchType.Builder(modLocation(MNames.FALL_DAMPENERS + "_3")) AndroidResearchType.Builder(modLocation(MNames.FALL_DAMPENERS + "_3"))
.withExperience(35) .withExperience(35)
.withDescription(0 .. 1) .withDescription(0 .. 1)
.appendDescription(FallDampenersFeature.DESCRIPTION.bind(3)) .withDescription(AndroidResearchDescriptions.FALL_DAMPENERS.Instance(3))
.withIcon(ResearchIcons.ICON_FEATHER_FALLING) .withIcon(ResearchIcons.ICON_FEATHER_FALLING)
.addFeatureResult(AndroidFeatures.FALL_DAMPENERS, 2) .addFeatureLevel(AndroidFeatures.FALL_DAMPENERS)
.addPrerequisite(FALL_DAMPENERS_2) .addPrerequisite(FALL_DAMPENERS_2)
.addItem(MItemTags.ADVANCED_CIRCUIT, 2) .addItem(MItemTags.ADVANCED_CIRCUIT, 2)
.addItem(Tags.Items.GEMS_DIAMOND, 4) .addItem(Tags.Items.GEMS_DIAMOND, 4)
@ -337,7 +375,7 @@ fun addResearchData(serializer: Consumer<AndroidResearchType>, lang: MatteryLang
AndroidResearchType.Builder(modLocation(MNames.ENDER_TELEPORTER)) AndroidResearchType.Builder(modLocation(MNames.ENDER_TELEPORTER))
.withExperience(35) .withExperience(35)
.withDescription() .withDescription()
.appendDescription(EnderTeleporterFeature.POWER_COST_DESCRIPTION) .withDescription(AndroidResearchDescriptions.ENDER_TELEPORTER)
.withIcon(ResearchIcons.ICON_ENDER_TELEPORT) .withIcon(ResearchIcons.ICON_ENDER_TELEPORT)
.addFeatureResult(AndroidFeatures.ENDER_TELEPORTER) .addFeatureResult(AndroidFeatures.ENDER_TELEPORTER)
.addPrerequisite(FALL_DAMPENERS_1) .addPrerequisite(FALL_DAMPENERS_1)
@ -350,27 +388,13 @@ fun addResearchData(serializer: Consumer<AndroidResearchType>, lang: MatteryLang
serializer.accept(ENDER_TELEPORTER) serializer.accept(ENDER_TELEPORTER)
val PHANTOM_ATTRACTOR =
AndroidResearchType.Builder(modLocation(MNames.PHANTOM_ATTRACTOR))
.withExperience(20)
.withDescription()
.withIcon(ResearchIcons.ICON_PHANTOM_ATTRACTOR)
.addFeatureResult(AndroidFeatures.PHANTOM_ATTRACTOR)
.addPrerequisite(NANOBOTS)
.addItem(MItems.PHANTOM_ATTRACTOR)
.addItem(MItemTags.COPPER_WIRES, 2)
.addItem(MItemTags.TRITANIUM_PLATES, 2)
.build()
serializer.accept(PHANTOM_ATTRACTOR)
val JUMP_BOOST_1 = val JUMP_BOOST_1 =
AndroidResearchType.Builder(modLocation(MNames.JUMP_BOOST + "_1")) AndroidResearchType.Builder(modLocation(MNames.JUMP_BOOST + "_1"))
.withExperience(27) .withExperience(27)
.withDescription(0 .. 1) .withDescription(0 .. 1)
.appendDescription(JumpBoostFeature.POWER_COST_DESCRIPTION) .withDescription(AndroidResearchDescriptions.JUMP_BOOST)
.withIcon(ResearchIcons.ICON_JUMP_BOOST) .withIcon(ResearchIcons.ICON_JUMP_BOOST)
.addFeatureResult(AndroidFeatures.JUMP_BOOST, 0) .addFeatureResult(AndroidFeatures.JUMP_BOOST)
.addItem(MItemTags.PISTONS, 2) .addItem(MItemTags.PISTONS, 2)
.addItem(MItemTags.GOLD_WIRES, 4) .addItem(MItemTags.GOLD_WIRES, 4)
.addItem(MItems.ELECTROMAGNET, 2) .addItem(MItems.ELECTROMAGNET, 2)
@ -382,9 +406,9 @@ fun addResearchData(serializer: Consumer<AndroidResearchType>, lang: MatteryLang
AndroidResearchType.Builder(modLocation(MNames.JUMP_BOOST + "_2")) AndroidResearchType.Builder(modLocation(MNames.JUMP_BOOST + "_2"))
.withExperience(34) .withExperience(34)
.withDescription() .withDescription()
.appendDescription(JumpBoostFeature.POWER_COST_DESCRIPTION) .withDescription(AndroidResearchDescriptions.JUMP_BOOST)
.withIcon(ResearchIcons.ICON_JUMP_BOOST) .withIcon(ResearchIcons.ICON_JUMP_BOOST)
.addFeatureResult(AndroidFeatures.JUMP_BOOST, 1) .addFeatureLevel(AndroidFeatures.JUMP_BOOST)
.addItem(MItems.ELECTRIC_PARTS, 4) .addItem(MItems.ELECTRIC_PARTS, 4)
.addItem(MItems.ELECTROMAGNET, 4) .addItem(MItems.ELECTROMAGNET, 4)
.addPrerequisite(JUMP_BOOST_1) .addPrerequisite(JUMP_BOOST_1)
@ -395,20 +419,20 @@ fun addResearchData(serializer: Consumer<AndroidResearchType>, lang: MatteryLang
serializer.accept(JUMP_BOOST_2) serializer.accept(JUMP_BOOST_2)
with(lang) { with(lang) {
misc("fall_dampeners.description", "Reduces fall damage by %s%%") { misc("fall_dampeners.description", "Reduces fall damage by %s%% and increases fall damage flat resist by %s half a hearts") {
russian("Уменьшает урон от падения на %s%%") russian("Уменьшает урон от падения на %s%% и повышает сопротивление урону от падения на %s полусердец")
} }
add(limbList[0], "Limb Overclocking %s") { add(limbList[0], "Limb Overclocking %s") {
russian("Разгон Конечностей %s") russian("Разгон конечностей %s")
} }
add(limbList[0], "description", "Boosts mobility by %s%% and attack speed by %s%%") { add(limbList[0], "description", "Boosts mobility by %s%%, attack speed by %s%% and brushing speed by %s%%") {
russian("Увеличивает мобильность на %s%% и скорость атак на %s%%") russian("Увеличивает мобильность на %s%%, скорость атак на %s%% и скорость чистки блоков на %s%%")
} }
add(AIR_BAGS, "Air Bags") { add(AIR_BAGS, "Air Bags") {
russian("Воздушные Мешки") russian("Воздушные мешки")
} }
add(NANOBOTS, "Nanobots") { add(NANOBOTS, "Nanobots") {
russian("Наноботы") russian("Наноботы")
@ -431,49 +455,64 @@ fun addResearchData(serializer: Consumer<AndroidResearchType>, lang: MatteryLang
} }
add(NANOBOTS_ARMOR, "Nanobots Armor") { add(NANOBOTS_ARMOR, "Nanobots Armor") {
russian("Броня из Наноботов") russian("Броня из наноботов")
} }
add(NANOBOTS_ARMOR, "description", "Allows nanobots to align themselves in cell shape, reducing incoming damage by a %% by absorbing impacts") { add(NANOBOTS_ARMOR, "description", "Allows nanobots to align themselves in cell shape, reducing incoming damage by a %% by absorbing impacts") {
russian("Позволяет наноботам выстраиваться в клеточную структуру, уменьшая внешний урон на определённый проект путём поглощения ударов") russian("Позволяет наноботам выстраиваться в клеточную структуру, уменьшая внешний урон на определённый проект путём поглощения ударов")
} }
add(armorSpeedList[0], "Nanobots Armor Build Speed %s") { add(armorSpeedList[0], "Nanobots Armor Build Speed %s") {
russian("Скорость Построения Слоя Брони Наноботов %s") russian("Скорость аостроения слоя брони наноботов %s")
} }
add(armorSpeedList[0], "description", "Reduces time required for nanobots to form protection layer") { add(armorSpeedList[0], "description", "Reduces time required for nanobots to form protection layer") {
russian("Уменьшает время необходимое наноботам для формирования защитного слоя") russian("Уменьшает время необходимое наноботам для формирования защитного слоя")
} }
add(armorStrengthList[0], "Nanobots Armor Strength %s") { add(armorStrengthList[0], "Nanobots Armor Strength %s") {
russian("Сила Слоя Брони Наноботов %s") russian("Сила слоя брони наноботов %s")
} }
add(armorStrengthList[0], "description", "Increases impact absorption strength of nanobots") { add(armorStrengthList[0], "description", "Increases impact absorption strength of nanobots") {
russian("Увеличивает поглощающею силу брони наноботов") russian("Увеличивает поглощающею силу брони наноботов")
} }
add(EXTENDED_REACH, "Extended Reach") { add(EXTENDED_REACH, "Extended Reach") {
russian("Удлинённые Манипуляторы") russian("Удлинённые манипуляторы")
} }
add(EXTENDED_REACH, "description", "Increases block interaction distance") { add(EXTENDED_REACH, "description", "Increases block interaction distance") {
russian("Увеличивает радиус взаимодействия с блоками") russian("Увеличивает радиус взаимодействия с блоками")
} }
add(IMPROVED_LIMBS, "Improved Limbs") { add(IMPROVED_LIMBS, "Improved Limbs") {
russian("Улучшенные Конечности") russian("Улучшенные конечности")
} }
add(IMPROVED_LIMBS, "description", "Allows limbs to be upgraded") { add(IMPROVED_LIMBS, "description", "Allows limbs to be upgraded") {
russian("Позволяет улучшать конечности") russian("Позволяет улучшать конечности")
} }
add(SWIM_BOOSTERS, "Swim Boosters") {
russian("Плавательные лопасти")
}
add(SWIM_BOOSTERS, "description", "Increases swimming speed by %s%%") {
russian("Ускоряет скорость плавания на %s%%")
}
add(SWIM_BOOSTERS_2, "Swim Boosters 2") {
russian("Плавательные лопасти 2")
}
add(SWIM_BOOSTERS_3, "Swim Boosters 3") {
russian("Плавательные лопасти 3")
}
add(STEP_ASSIST, "Step Assist") { add(STEP_ASSIST, "Step Assist") {
russian("Помощь Подъёма") russian("Помощь подъёма")
} }
add(STEP_ASSIST, "description", "Allows unit to step up whole blocks") { add(STEP_ASSIST, "description", "Allows unit to step up whole blocks") {
russian("Позволяет переступать полные блоки") russian("Позволяет переступать полные блоки")
} }
add(ITEM_MAGNET, "Item Magnet") { add(ITEM_MAGNET, "Item Magnet") {
russian("Предметный Магнит") russian("Предметный магнит")
} }
add(ITEM_MAGNET, "description0", "Pulls nearby items while active") { add(ITEM_MAGNET, "description0", "Pulls nearby items while active") {
russian("Притягивает ближайшие предметы пока активен") russian("Притягивает ближайшие предметы пока активен")
@ -483,21 +522,21 @@ fun addResearchData(serializer: Consumer<AndroidResearchType>, lang: MatteryLang
} }
add(FALL_DAMPENERS_1, "Fall Dampeners") { add(FALL_DAMPENERS_1, "Fall Dampeners") {
russian("Поглотители Инерции") russian("Поглотители инерции")
} }
add(FALL_DAMPENERS_1, "description", "Installs basic equipment in limbs to negate some fall damage") { add(FALL_DAMPENERS_1, "description", "Installs basic equipment in limbs to negate some fall damage") {
russian("Обустраивает конечности примитивными деталями для небольшого смягчения падения") russian("Обустраивает конечности примитивными деталями для небольшого смягчения падения")
} }
add(FALL_DAMPENERS_2, "Fall Dampeners 2") { add(FALL_DAMPENERS_2, "Fall Dampeners 2") {
russian("Поглотители Инерции 2") russian("Поглотители инерции 2")
} }
add(FALL_DAMPENERS_2, "description", "Installs micro displacing and dampening equipment in limbs to negate great deal of fall damage") { add(FALL_DAMPENERS_2, "description", "Installs micro displacing and dampening equipment in limbs to negate great deal of fall damage") {
russian("Оборудует конечности микро смещающимися и смягчающим оборудованием, которое поглощает значительный урон от падения") russian("Оборудует конечности микро смещающимися и смягчающим оборудованием, которое поглощает значительный урон от падения")
} }
add(FALL_DAMPENERS_3, "Fall Dampeners 3") { add(FALL_DAMPENERS_3, "Fall Dampeners 3") {
russian("Поглотители Инерции 3") russian("Поглотители инерции 3")
} }
add(FALL_DAMPENERS_3, "description0", "Installs autonomous fall damage avoidance calculation matrices and hardening to crucial parts") { add(FALL_DAMPENERS_3, "description0", "Installs autonomous fall damage avoidance calculation matrices and hardening to crucial parts") {
russian("Устанавливает автономные матрицы калькуляции избегания урона от падения, а так же усиливает защиту важных деталей") russian("Устанавливает автономные матрицы калькуляции избегания урона от падения, а так же усиливает защиту важных деталей")
@ -507,7 +546,7 @@ fun addResearchData(serializer: Consumer<AndroidResearchType>, lang: MatteryLang
} }
add(SHOCKWAVE, "Shockwave Pulsator") { add(SHOCKWAVE, "Shockwave Pulsator") {
russian("Генератор Ударных Волн") russian("Генератор ударных волн")
} }
add(SHOCKWAVE, "description0", "Releases a shockwave, damaging everything in small radius, as you quickly land on ground") { add(SHOCKWAVE, "description0", "Releases a shockwave, damaging everything in small radius, as you quickly land on ground") {
russian("Вызывает ударную волну при стремительном падении на землю, нанося урон всему, что вас окружает") russian("Вызывает ударную волну при стремительном падении на землю, нанося урон всему, что вас окружает")
@ -516,15 +555,8 @@ fun addResearchData(serializer: Consumer<AndroidResearchType>, lang: MatteryLang
russian("Используйте с осторожностью, так как данная технология сама по себе не поглащает урон от падения!") russian("Используйте с осторожностью, так как данная технология сама по себе не поглащает урон от падения!")
} }
add(PHANTOM_ATTRACTOR, "Builtin Phantom Attractor") {
russian("Встроенный Приманщик Фантомов")
}
add(PHANTOM_ATTRACTOR, "description", "Allows to attract phantoms while active under same conditions as non-Androids") {
russian("Позволяет привлекать фантомов под теми же условиями, как и не Андроиды")
}
add(JUMP_BOOST_1, "Jump Boost") { add(JUMP_BOOST_1, "Jump Boost") {
russian("Усилитель Прыжка") russian("Усилитель прыжка")
} }
add(JUMP_BOOST_1, "description0", "Allows to perform higher jump") { add(JUMP_BOOST_1, "description0", "Allows to perform higher jump") {
russian("Позволяет совершить высокий прыжок") russian("Позволяет совершить высокий прыжок")
@ -534,7 +566,7 @@ fun addResearchData(serializer: Consumer<AndroidResearchType>, lang: MatteryLang
} }
add(JUMP_BOOST_2, "Jump Boost 2") { add(JUMP_BOOST_2, "Jump Boost 2") {
russian("Усилитель Прыжка 2") russian("Усилитель прыжка 2")
} }
add(JUMP_BOOST_2, "description", "Allows to perform extra higher jump") { add(JUMP_BOOST_2, "description", "Allows to perform extra higher jump") {
russian("Позволяет совершить ещё более высокий прыжок") russian("Позволяет совершить ещё более высокий прыжок")
@ -548,14 +580,14 @@ fun addResearchData(serializer: Consumer<AndroidResearchType>, lang: MatteryLang
} }
add(NIGHT_VISION, "Night Vision") { add(NIGHT_VISION, "Night Vision") {
russian("Ночное Зрение") russian("Ночное зрение")
} }
add(NIGHT_VISION, "description", "Allows to clearly see in the dark") { add(NIGHT_VISION, "description", "Allows to clearly see in the dark") {
russian("Позволяет видеть в темноте") russian("Позволяет видеть в темноте")
} }
add(attackBoostList[0], "Attack Boost %s") { add(attackBoostList[0], "Attack Boost %s") {
russian("Усиление Атаки %s") russian("Усиление атаки %s")
} }
add(attackBoostList[0], "description", "Increases total melee attack strength by %s%%") { add(attackBoostList[0], "description", "Increases total melee attack strength by %s%%") {
russian("Увеличивает урон в ближнем бою на %s%%") russian("Увеличивает урон в ближнем бою на %s%%")

View File

@ -1,11 +1,10 @@
package ru.dbotthepony.mc.otm.datagen package ru.dbotthepony.mc.otm.datagen
import net.minecraft.resources.ResourceLocation
import net.minecraft.sounds.SoundEvent import net.minecraft.sounds.SoundEvent
import net.minecraftforge.common.data.SoundDefinition import net.neoforged.neoforge.common.data.SoundDefinition
import net.minecraftforge.common.data.SoundDefinitionsProvider import net.neoforged.neoforge.common.data.SoundDefinitionsProvider
import net.minecraftforge.data.event.GatherDataEvent import net.neoforged.neoforge.data.event.GatherDataEvent
import ru.dbotthepony.mc.otm.registry.MSoundEvents import ru.dbotthepony.mc.otm.registry.game.MSoundEvents
fun SoundDefinition.subtitle(value: SoundEvent): SoundDefinition { fun SoundDefinition.subtitle(value: SoundEvent): SoundDefinition {
return subtitle("otm.sound." + value.location.path) return subtitle("otm.sound." + value.location.path)
@ -13,32 +12,57 @@ fun SoundDefinition.subtitle(value: SoundEvent): SoundDefinition {
class SoundDataProvider(event: GatherDataEvent) : SoundDefinitionsProvider(event.generator.packOutput, DataGen.MOD_ID, event.existingFileHelper) { class SoundDataProvider(event: GatherDataEvent) : SoundDefinitionsProvider(event.generator.packOutput, DataGen.MOD_ID, event.existingFileHelper) {
override fun registerSounds() { override fun registerSounds() {
add(MSoundEvents.PLASMA_WEAPON_OVERHEAT, add(
MSoundEvents.PLASMA_WEAPON_OVERHEAT,
definition().subtitle("otm.sound.plasma_weapon_overheat") definition().subtitle("otm.sound.plasma_weapon_overheat")
.with(SoundDefinition.Sound.sound(modLocation("item/plasma_weapon_overheat"), SoundDefinition.SoundType.SOUND))) .with(SoundDefinition.Sound.sound(modLocation("item/plasma_weapon_overheat"), SoundDefinition.SoundType.SOUND)))
add(MSoundEvents.PLAYER_BECOME_ANDROID, add(
MSoundEvents.PLAYER_BECOME_ANDROID,
definition().subtitle("otm.sound.player_become_android") definition().subtitle("otm.sound.player_become_android")
.with(SoundDefinition.Sound.sound(modLocation("player_become_android"), SoundDefinition.SoundType.SOUND))) .with(SoundDefinition.Sound.sound(modLocation("player_become_android"), SoundDefinition.SoundType.SOUND)))
add(MSoundEvents.RIFLE_SHOT, add(
MSoundEvents.RIFLE_SHOT,
definition().subtitle("otm.sound.rifle_shot") definition().subtitle("otm.sound.rifle_shot")
.with(SoundDefinition.Sound.sound(modLocation("item/rifle_shot"), SoundDefinition.SoundType.SOUND))) .with(SoundDefinition.Sound.sound(modLocation("item/rifle_shot"), SoundDefinition.SoundType.SOUND)))
simple(MSoundEvents.CARGO_CRATE_OPEN) simple(MSoundEvents.CARGO_CRATE_OPEN)
add(MSoundEvents.ANDROID_JUMP_BOOST, add(
MSoundEvents.ANDROID_JUMP_BOOST,
definition().subtitle("otm.sound.android.jump_boost") definition().subtitle("otm.sound.android.jump_boost")
.with(SoundDefinition.Sound.sound(modLocation("android/jump_boost"), SoundDefinition.SoundType.SOUND))) .with(SoundDefinition.Sound.sound(modLocation("android/jump_boost"), SoundDefinition.SoundType.SOUND)))
add(MSoundEvents.ANDROID_SHOCKWAVE, add(
MSoundEvents.ANDROID_SHOCKWAVE,
definition().subtitle("otm.sound.android.shockwave") definition().subtitle("otm.sound.android.shockwave")
.with(SoundDefinition.Sound.sound(modLocation("android/shockwave"), SoundDefinition.SoundType.SOUND))) .with(SoundDefinition.Sound.sound(modLocation("android/shockwave"), SoundDefinition.SoundType.SOUND)))
add(MSoundEvents.ANDROID_PROJ_PARRY, add(
MSoundEvents.BLACK_HOLE,
definition().subtitle("otm.sound.black_hole")
.with(SoundDefinition.Sound.sound(modLocation("singularity/amb_singularity"), SoundDefinition.SoundType.SOUND)
.attenuationDistance(32)
.stream()
))
add(
MSoundEvents.LOADER_AMBIENT,
definition().subtitle("otm.sound.entity.loader.loader_ambient")
.with(
SoundDefinition.Sound.sound(modLocation("entity/loader/loader_ambient"), SoundDefinition.SoundType.SOUND)
.attenuationDistance(32)
.stream(),
SoundDefinition.Sound.sound(modLocation("entity/loader/loader_ambient2"), SoundDefinition.SoundType.SOUND)
.attenuationDistance(32)
.stream()
))
add(
MSoundEvents.ANDROID_PROJ_PARRY,
definition().subtitle("otm.sound.android.projectile_parry") definition().subtitle("otm.sound.android.projectile_parry")
.with(SoundDefinition.Sound.sound(modLocation("android/punch_projectile"), SoundDefinition.SoundType.SOUND)) .with(SoundDefinition.Sound.sound(modLocation("android/punch_projectile"), SoundDefinition.SoundType.SOUND)))
)
} }
private inline fun add(value: SoundEvent, block: SoundDefinition.() -> Unit) { private inline fun add(value: SoundEvent, block: SoundDefinition.() -> Unit) {

View File

@ -0,0 +1,199 @@
package ru.dbotthepony.mc.otm.datagen
import net.minecraft.core.HolderSet
import net.minecraft.core.registries.Registries
import net.minecraft.data.worldgen.BootstrapContext
import net.minecraft.resources.ResourceKey
import net.minecraft.tags.BiomeTags
import net.minecraft.tags.BlockTags
import net.minecraft.util.valueproviders.ClampedNormalFloat
import net.minecraft.util.valueproviders.ClampedNormalInt
import net.minecraft.util.valueproviders.ConstantFloat
import net.minecraft.util.valueproviders.UniformInt
import net.minecraft.world.level.levelgen.GenerationStep
import net.minecraft.world.level.levelgen.VerticalAnchor
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature
import net.minecraft.world.level.levelgen.feature.Feature
import net.minecraft.world.level.levelgen.feature.configurations.OreConfiguration
import net.minecraft.world.level.levelgen.heightproviders.VeryBiasedToBottomHeight
import net.minecraft.world.level.levelgen.placement.CountPlacement
import net.minecraft.world.level.levelgen.placement.HeightRangePlacement
import net.minecraft.world.level.levelgen.placement.InSquarePlacement
import net.minecraft.world.level.levelgen.placement.PlacedFeature
import net.minecraft.world.level.levelgen.placement.RarityFilter
import net.minecraft.world.level.levelgen.structure.templatesystem.TagMatchTest
import net.neoforged.neoforge.common.world.BiomeModifier
import net.neoforged.neoforge.registries.NeoForgeRegistries
import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.data.world.EllipsoidPlacement
import ru.dbotthepony.mc.otm.data.world.StandardDeviationHeightProvider
import ru.dbotthepony.mc.otm.registry.game.MBlocks
import ru.dbotthepony.mc.otm.registry.data.MWorldGenFeatures
import ru.dbotthepony.mc.otm.server.world.feature.BlackHolePlacerFeature
private object ConfiguredFeatures {
val TRITANIUM_ORE = key("tritanium_ore")
val DILITHIUM = key("dilithium")
val BLACK_HOLE = key("black_hole")
private fun key(name: String): ResourceKey<ConfiguredFeature<*, *>> {
return ResourceKey.create(Registries.CONFIGURED_FEATURE, modLocation(name))
}
}
fun registerConfiguredFeatures(context: BootstrapContext<ConfiguredFeature<*, *>>) {
val stone = TagMatchTest(BlockTags.STONE_ORE_REPLACEABLES)
val deepslate = TagMatchTest(BlockTags.DEEPSLATE_ORE_REPLACEABLES)
run {
val target = listOf(
OreConfiguration.target(stone, MBlocks.TRITANIUM_ORE.defaultBlockState()),
OreConfiguration.target(deepslate, MBlocks.DEEPSLATE_TRITANIUM_ORE.defaultBlockState()),
)
context.register(ConfiguredFeatures.TRITANIUM_ORE, ConfiguredFeature(Feature.ORE, OreConfiguration(target, 9)))
}
run {
val target = listOf(
OreConfiguration.target(stone, MBlocks.DILITHIUM_ORE.defaultBlockState()),
OreConfiguration.target(deepslate, MBlocks.DEEPSLATE_DILITHIUM_ORE.defaultBlockState()),
)
context.register(ConfiguredFeatures.DILITHIUM, ConfiguredFeature(Feature.ORE, OreConfiguration(target, 3)))
}
context.register(ConfiguredFeatures.BLACK_HOLE, ConfiguredFeature(
MWorldGenFeatures.BLACK_HOLE_PLACER,
BlackHolePlacerFeature.Config(Decimal("0.25"), Decimal(1))))
}
private object PlacedFeatures {
val NORMAL_TRITANIUM = key("normal_tritanium")
val DEEP_TRITANIUM = key("deep_tritanium")
val CLOUD_TITANIUM = key("cloud_tritanium")
val DILITHIUM = key("dilithium")
val BLACK_HOLE = key("black_hole")
private fun key(name: String): ResourceKey<PlacedFeature> {
return ResourceKey.create(Registries.PLACED_FEATURE, modLocation(name))
}
}
fun registerPlacedFeatures(context: BootstrapContext<PlacedFeature>) {
val configured = context.lookup(Registries.CONFIGURED_FEATURE)
run {
val ore = configured.getOrThrow(ConfiguredFeatures.TRITANIUM_ORE)
context.register(PlacedFeatures.NORMAL_TRITANIUM, PlacedFeature(
ore,
listOf(
CountPlacement.of(UniformInt.of(2, 6)),
InSquarePlacement.spread(),
HeightRangePlacement.of(StandardDeviationHeightProvider(VerticalAnchor.absolute(10), 15.0))
)
))
context.register(PlacedFeatures.DEEP_TRITANIUM, PlacedFeature(
ore,
listOf(
CountPlacement.of(UniformInt.of(4, 8)),
InSquarePlacement.spread(),
HeightRangePlacement.of(VeryBiasedToBottomHeight.of(VerticalAnchor.aboveBottom(4), VerticalAnchor.absolute(0), 16))
)
))
context.register(PlacedFeatures.CLOUD_TITANIUM, PlacedFeature(
ore,
listOf(
RarityFilter.onAverageOnceEvery(16),
InSquarePlacement.spread(),
HeightRangePlacement.of(StandardDeviationHeightProvider(VerticalAnchor.absolute(10), 15.0)),
EllipsoidPlacement(
x = ClampedNormalInt.of(0f, 6f, Int.MIN_VALUE, Int.MAX_VALUE),
y = ClampedNormalInt.of(0f, 12f, Int.MIN_VALUE, Int.MAX_VALUE),
z = ClampedNormalInt.of(0f, 6f, Int.MIN_VALUE, Int.MAX_VALUE),
count = ClampedNormalInt.of(60f, 60f, 40, 160),
xLength = ClampedNormalFloat.of(11f, 4f, 6f, 14f),
yLength = ClampedNormalFloat.of(11f, 4f, 6f, 14f),
zLength = ClampedNormalFloat.of(11f, 4f, 6f, 14f),
)
)
))
}
run {
val ore = configured.getOrThrow(ConfiguredFeatures.DILITHIUM)
context.register(PlacedFeatures.DILITHIUM, PlacedFeature(
ore,
listOf(
RarityFilter.onAverageOnceEvery(12),
InSquarePlacement.spread(),
HeightRangePlacement.of(StandardDeviationHeightProvider(VerticalAnchor.absolute(0), 15.0)),
EllipsoidPlacement(
x = ClampedNormalInt.of(0f, 8f, Int.MIN_VALUE, Int.MAX_VALUE),
y = ClampedNormalInt.of(0f, 20f, Int.MIN_VALUE, Int.MAX_VALUE),
z = ClampedNormalInt.of(0f, 8f, Int.MIN_VALUE, Int.MAX_VALUE),
count = ClampedNormalInt.of(200f, 200f, 200, 600),
xLength = ClampedNormalFloat.of(11f, 4f, 8f, 14f),
// allow crystals to generate as far as standard deviation allows
// to increase chance for player to discover crystal vein
yLength = ConstantFloat.of(60f),
zLength = ClampedNormalFloat.of(11f, 4f, 8f, 14f),
)
)
))
}
val blackHole = configured.getOrThrow(ConfiguredFeatures.BLACK_HOLE)
context.register(PlacedFeatures.BLACK_HOLE, PlacedFeature(
blackHole,
listOf(
RarityFilter.onAverageOnceEvery(1000),
InSquarePlacement.spread(),
HeightRangePlacement.uniform(VerticalAnchor.absolute(64), VerticalAnchor.absolute(128))
)
))
}
private object BiomeModifiers {
val ORES = key("ores")
val BLACK_HOLE = key("black_hole")
private fun key(name: String): ResourceKey<BiomeModifier> {
return ResourceKey.create(NeoForgeRegistries.Keys.BIOME_MODIFIERS, modLocation(name))
}
}
fun registerBiomeModifiers(context: BootstrapContext<BiomeModifier>) {
val placed = context.lookup(Registries.PLACED_FEATURE)
val biomes = context.lookup(Registries.BIOME)
context.register(
BiomeModifiers.ORES,
net.neoforged.neoforge.common.world.BiomeModifiers.AddFeaturesBiomeModifier(
biomes.getOrThrow(BiomeTags.IS_OVERWORLD),
HolderSet.direct(
placed.getOrThrow(PlacedFeatures.NORMAL_TRITANIUM),
placed.getOrThrow(PlacedFeatures.DEEP_TRITANIUM),
placed.getOrThrow(PlacedFeatures.CLOUD_TITANIUM),
placed.getOrThrow(PlacedFeatures.DILITHIUM),
),
GenerationStep.Decoration.UNDERGROUND_ORES
)
)
context.register(
BiomeModifiers.BLACK_HOLE,
net.neoforged.neoforge.common.world.BiomeModifiers.AddFeaturesBiomeModifier(
biomes.getOrThrow(BiomeTags.IS_OVERWORLD),
HolderSet.direct(
placed.getOrThrow(PlacedFeatures.BLACK_HOLE)
),
GenerationStep.Decoration.SURFACE_STRUCTURES
)
)
}

View File

@ -1,28 +1,27 @@
package ru.dbotthepony.mc.otm.datagen.advancements package ru.dbotthepony.mc.otm.datagen.advancements
import net.minecraft.advancements.Advancement import net.minecraft.advancements.AdvancementHolder
import net.minecraft.advancements.AdvancementRewards import net.minecraft.advancements.AdvancementRewards
import net.minecraft.advancements.FrameType import net.minecraft.advancements.AdvancementRequirements.Strategy
import net.minecraft.advancements.RequirementsStrategy import net.minecraft.advancements.AdvancementType
import net.minecraft.advancements.critereon.InventoryChangeTrigger import net.minecraft.advancements.critereon.InventoryChangeTrigger
import net.minecraft.world.item.DyeColor import net.minecraft.world.item.DyeColor
import net.minecraft.world.item.ItemStack import net.minecraft.world.item.ItemStack
import net.minecraftforge.common.data.ExistingFileHelper import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.core.registryName
import ru.dbotthepony.mc.otm.datagen.lang.MatteryLanguageProvider import ru.dbotthepony.mc.otm.datagen.lang.MatteryLanguageProvider
import ru.dbotthepony.mc.otm.datagen.modLocation import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.registry.MItemTags import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.MItems import ru.dbotthepony.mc.otm.registry.game.MItems
import ru.dbotthepony.mc.otm.registry.MRegistry import ru.dbotthepony.mc.otm.registry.MRegistry
import ru.dbotthepony.mc.otm.triggers.BlackHoleTrigger import ru.dbotthepony.mc.otm.server.triggers.BlackHoleTrigger
import ru.dbotthepony.mc.otm.triggers.NailedEntityTrigger import ru.dbotthepony.mc.otm.server.triggers.NailedEntityTrigger
import java.util.function.Consumer import java.util.function.Consumer
fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: ExistingFileHelper, lang: MatteryLanguageProvider) { fun addAdvancements(serializer: Consumer<AdvancementHolder>, lang: MatteryLanguageProvider) {
val translation = lang.MultiBuilder("otm.advancements.regular") val translation = lang.MultiBuilder("otm.advancements.regular")
val root = AdvancementBuilder() val root = AdvancementBuilder()
.requirements(RequirementsStrategy.OR) .requirements(Strategy.OR)
.display( .display(
itemStack = ItemStack(MItems.TRITANIUM_INGOT), itemStack = ItemStack(MItems.TRITANIUM_INGOT),
title = translation.add("root", "Overdrive That Matters"), title = translation.add("root", "Overdrive That Matters"),
@ -36,7 +35,9 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
.addCriterion("has_tritanium_ore", criterion(MItemTags.TRITANIUM_ORES)) .addCriterion("has_tritanium_ore", criterion(MItemTags.TRITANIUM_ORES))
.addCriterion("has_tritanium_ore_clump", criterion(MItemTags.TRITANIUM_ORE_CLUMPS)) .addCriterion("has_tritanium_ore_clump", criterion(MItemTags.TRITANIUM_ORE_CLUMPS))
.addCriterion("has_tritanium_ingot", InventoryChangeTrigger.TriggerInstance.hasItems(MItems.TRITANIUM_INGOT)) .addCriterion("has_tritanium_ingot", InventoryChangeTrigger.TriggerInstance.hasItems(MItems.TRITANIUM_INGOT))
.save(serializer, modLocation("regular/root"), existingFileHelper) .save(serializer, modLocation("regular/root"))
addMachineAdvancements(serializer, lang, root)
val crude = AdvancementBuilder() val crude = AdvancementBuilder()
.parent(root) .parent(root)
@ -50,7 +51,7 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
}, },
) )
.addCriterion("has_item", criterion(MItems.BATTERY_CRUDE)) .addCriterion("has_item", criterion(MItems.BATTERY_CRUDE))
.save(serializer, modLocation("regular/crude_battery"), existingFileHelper) .save(serializer, modLocation("regular/crude_battery"))
val normal = AdvancementBuilder() val normal = AdvancementBuilder()
.parent(crude) .parent(crude)
@ -64,7 +65,7 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
}, },
) )
.addCriterion("has_item", criterion(MItems.BATTERY_NORMAL)) .addCriterion("has_item", criterion(MItems.BATTERY_NORMAL))
.save(serializer, modLocation("regular/normal_battery"), existingFileHelper) .save(serializer, modLocation("regular/normal_battery"))
AdvancementBuilder() AdvancementBuilder()
.parent(normal) .parent(normal)
@ -78,7 +79,7 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
}, },
) )
.addCriterion("has_item", criterion(MItems.BATTERY_DENSE)) .addCriterion("has_item", criterion(MItems.BATTERY_DENSE))
.save(serializer, modLocation("regular/dense_battery"), existingFileHelper) .save(serializer, modLocation("regular/dense_battery"))
val capacitor = AdvancementBuilder() val capacitor = AdvancementBuilder()
.parent(normal) .parent(normal)
@ -92,7 +93,7 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
}, },
) )
.addCriterion("has_item", criterion(MItems.BATTERY_CAPACITOR)) .addCriterion("has_item", criterion(MItems.BATTERY_CAPACITOR))
.save(serializer, modLocation("regular/capacitor_battery"), existingFileHelper) .save(serializer, modLocation("regular/capacitor_battery"))
AdvancementBuilder() AdvancementBuilder()
.parent(capacitor) .parent(capacitor)
@ -104,10 +105,10 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
description = translation.add("energy_sword.desc", "Wield a High-Frequency Blade, a melee weapon intended to slice Creepers into creep-cakes") { description = translation.add("energy_sword.desc", "Wield a High-Frequency Blade, a melee weapon intended to slice Creepers into creep-cakes") {
russian("Получите высокочастотный клинок, оружие ближнего боя предназначенное для нарезания Криперов на крипо-тортики") russian("Получите высокочастотный клинок, оружие ближнего боя предназначенное для нарезания Криперов на крипо-тортики")
}, },
frameType = FrameType.GOAL frameType = AdvancementType.GOAL
) )
.addCriterion("has_item", criterion(MItems.ENERGY_SWORD)) .addCriterion("has_item", criterion(MItems.ENERGY_SWORD))
.save(serializer, modLocation("regular/energy_sword"), existingFileHelper) .save(serializer, modLocation("regular/energy_sword"))
AdvancementBuilder() AdvancementBuilder()
.parent(normal) .parent(normal)
@ -119,15 +120,15 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
description = translation.add("quantum_battery.desc", "Put together a Quantum Battery, powered by Ender technologies") { description = translation.add("quantum_battery.desc", "Put together a Quantum Battery, powered by Ender technologies") {
russian("Создайте квантовый аккумулятор, пропитанную технологиями Края") russian("Создайте квантовый аккумулятор, пропитанную технологиями Края")
}, },
frameType = FrameType.GOAL frameType = AdvancementType.GOAL
) )
.rewards(AdvancementRewards.Builder.experience(50)) .rewards(AdvancementRewards.Builder.experience(50))
.requirements(RequirementsStrategy.OR) .requirements(Strategy.OR)
.addCriterion("has_item0", criterion(MItems.QUANTUM_BATTERY)) .addCriterion("has_item0", criterion(MItems.QUANTUM_BATTERY))
.addCriterion("has_item1", criterion(MItems.QUANTUM_CAPACITOR)) .addCriterion("has_item1", criterion(MItems.QUANTUM_CAPACITOR))
.save(serializer, modLocation("regular/quantum_battery"), existingFileHelper) .save(serializer, modLocation("regular/quantum_battery"))
AdvancementBuilder() val zpm = AdvancementBuilder()
.parent(root) .parent(root)
.display( .display(
itemStack = ItemStack(MItems.ZPM_BATTERY), itemStack = ItemStack(MItems.ZPM_BATTERY),
@ -137,12 +138,14 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
description = translation.add("zpm_battery.desc", "Find Zero Point Module, something from different multiverse of ours, created using technologies lost in time in all possible multiverses") { description = translation.add("zpm_battery.desc", "Find Zero Point Module, something from different multiverse of ours, created using technologies lost in time in all possible multiverses") {
russian("Найдите модуль нулевой точки, вещь из другой мультивселенной, созданная с использованием технологий, потерянных во времени во всех возможных мультивслеленных") russian("Найдите модуль нулевой точки, вещь из другой мультивселенной, созданная с использованием технологий, потерянных во времени во всех возможных мультивслеленных")
}, },
frameType = FrameType.CHALLENGE, frameType = AdvancementType.CHALLENGE,
hidden = true hidden = true
) )
.rewards(AdvancementRewards.Builder.experience(800)) .rewards(AdvancementRewards.Builder.experience(800))
.addCriterion("has_item", criterion(MItems.ZPM_BATTERY)) .addCriterion("has_item", criterion(MItems.ZPM_BATTERY))
.save(serializer, modLocation("regular/zpm_battery"), existingFileHelper) .save(serializer, modLocation("regular/zpm_battery"))
addExopackAdvancements(serializer, lang, root, zpm)
val blackhole = AdvancementBuilder() val blackhole = AdvancementBuilder()
.parent(root) .parent(root)
@ -156,8 +159,8 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
}, },
hidden = true hidden = true
) )
.addCriterion("pulled_by_black_hole", BlackHoleTrigger.Instance) .addCriterion("pulled_by_black_hole", BlackHoleTrigger.criterion)
.save(serializer, modLocation("regular/black_hole"), existingFileHelper) .save(serializer, modLocation("regular/black_hole"))
AdvancementBuilder() AdvancementBuilder()
.parent(blackhole) .parent(blackhole)
@ -171,7 +174,7 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
}, },
) )
.addCriterion("has_item", criterion(MItems.BLACK_HOLE_SCANNER)) .addCriterion("has_item", criterion(MItems.BLACK_HOLE_SCANNER))
.save(serializer, modLocation("regular/black_hole_scanner"), existingFileHelper) .save(serializer, modLocation("regular/black_hole_scanner"))
AdvancementBuilder() AdvancementBuilder()
.parent(blackhole) .parent(blackhole)
@ -185,7 +188,7 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
}, },
) )
.addCriterion("has_item", criterion(MItems.GRAVITATION_STABILIZER)) .addCriterion("has_item", criterion(MItems.GRAVITATION_STABILIZER))
.save(serializer, modLocation("regular/stabilizer"), existingFileHelper) .save(serializer, modLocation("regular/stabilizer"))
AdvancementBuilder() AdvancementBuilder()
.parent(blackhole) .parent(blackhole)
@ -199,11 +202,11 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
}, },
) )
.addCriterion("has_item", criterion(MItems.PORTABLE_GRAVITATION_STABILIZER)) .addCriterion("has_item", criterion(MItems.PORTABLE_GRAVITATION_STABILIZER))
.save(serializer, modLocation("regular/portable_stabilizer"), existingFileHelper) .save(serializer, modLocation("regular/portable_stabilizer"))
val ore = AdvancementBuilder() val ore = AdvancementBuilder()
.parent(root) .parent(root)
.requirements(RequirementsStrategy.OR) .requirements(Strategy.OR)
.display( .display(
itemStack = ItemStack(MItems.TRITANIUM_ORE_CLUMP), itemStack = ItemStack(MItems.TRITANIUM_ORE_CLUMP),
title = translation.add("ore", "Blue Metal Discovery") { title = translation.add("ore", "Blue Metal Discovery") {
@ -215,7 +218,7 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
) )
.addCriterion("has_tritanium_ore", criterion(MItemTags.TRITANIUM_ORES)) .addCriterion("has_tritanium_ore", criterion(MItemTags.TRITANIUM_ORES))
.addCriterion("has_tritanium_ore_clump", criterion(MItemTags.TRITANIUM_ORE_CLUMPS)) .addCriterion("has_tritanium_ore_clump", criterion(MItemTags.TRITANIUM_ORE_CLUMPS))
.save(serializer, modLocation("regular/ore"), existingFileHelper) .save(serializer, modLocation("regular/ore"))
val ingot = AdvancementBuilder() val ingot = AdvancementBuilder()
.parent(ore) .parent(ore)
@ -229,7 +232,7 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
}, },
) )
.addCriterion("has_tritanium_ingot", criterion(MItemTags.TRITANIUM_INGOTS)) .addCriterion("has_tritanium_ingot", criterion(MItemTags.TRITANIUM_INGOTS))
.save(serializer, modLocation("regular/ingot"), existingFileHelper) .save(serializer, modLocation("regular/ingot"))
AdvancementBuilder() AdvancementBuilder()
.parent(ingot) .parent(ingot)
@ -243,7 +246,7 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
}, },
) )
.addCriterion("has_tritanium_pickaxe", criterion(MItems.TRITANIUM_PICKAXE)) .addCriterion("has_tritanium_pickaxe", criterion(MItems.TRITANIUM_PICKAXE))
.save(serializer, modLocation("regular/pickaxe"), existingFileHelper) .save(serializer, modLocation("regular/pickaxe"))
AdvancementBuilder() AdvancementBuilder()
.parent(ingot) .parent(ingot)
@ -258,7 +261,7 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
hidden = true hidden = true
) )
.addCriterion("hoe", criterion(MItems.TRITANIUM_HOE)) .addCriterion("hoe", criterion(MItems.TRITANIUM_HOE))
.save(serializer, modLocation("regular/hoe"), existingFileHelper) .save(serializer, modLocation("regular/hoe"))
val plate = AdvancementBuilder() val plate = AdvancementBuilder()
.parent(ingot) .parent(ingot)
@ -272,7 +275,7 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
} }
) )
.addCriterion("has_item", criterion(MItemTags.TRITANIUM_PLATES)) .addCriterion("has_item", criterion(MItemTags.TRITANIUM_PLATES))
.save(serializer, modLocation("regular/plate"), existingFileHelper) .save(serializer, modLocation("regular/plate"))
AdvancementBuilder() AdvancementBuilder()
.parent(plate) .parent(plate)
@ -285,12 +288,12 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
russian("Согните немного тритановых пластин вместе с углеродной сеткой в невероятно прочную броню") russian("Согните немного тритановых пластин вместе с углеродной сеткой в невероятно прочную броню")
} }
) )
.requirements(RequirementsStrategy.OR) .requirements(Strategy.OR)
.addCriterion("has_item0", criterion(MItems.TRITANIUM_HELMET)) .addCriterion("has_item0", criterion(MItems.TRITANIUM_HELMET))
.addCriterion("has_item1", criterion(MItems.TRITANIUM_CHESTPLATE)) .addCriterion("has_item1", criterion(MItems.TRITANIUM_CHESTPLATE))
.addCriterion("has_item2", criterion(MItems.TRITANIUM_PANTS)) .addCriterion("has_item2", criterion(MItems.TRITANIUM_PANTS))
.addCriterion("has_item3", criterion(MItems.TRITANIUM_BOOTS)) .addCriterion("has_item3", criterion(MItems.TRITANIUM_BOOTS))
.save(serializer, modLocation("regular/armor"), existingFileHelper) .save(serializer, modLocation("regular/armor"))
AdvancementBuilder() AdvancementBuilder()
.parent(ingot) .parent(ingot)
@ -303,12 +306,12 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
russian("Создайте простую тритановую броню из слитков, просто и эффективно") russian("Создайте простую тритановую броню из слитков, просто и эффективно")
} }
) )
.requirements(RequirementsStrategy.OR) .requirements(Strategy.OR)
.addCriterion("has_item0", criterion(MItems.SIMPLE_TRITANIUM_HELMET)) .addCriterion("has_item0", criterion(MItems.SIMPLE_TRITANIUM_HELMET))
.addCriterion("has_item1", criterion(MItems.SIMPLE_TRITANIUM_CHESTPLATE)) .addCriterion("has_item1", criterion(MItems.SIMPLE_TRITANIUM_CHESTPLATE))
.addCriterion("has_item2", criterion(MItems.SIMPLE_TRITANIUM_PANTS)) .addCriterion("has_item2", criterion(MItems.SIMPLE_TRITANIUM_PANTS))
.addCriterion("has_item3", criterion(MItems.SIMPLE_TRITANIUM_BOOTS)) .addCriterion("has_item3", criterion(MItems.SIMPLE_TRITANIUM_BOOTS))
.save(serializer, modLocation("regular/simple_armor"), existingFileHelper) .save(serializer, modLocation("regular/simple_armor"))
val glass = AdvancementBuilder() val glass = AdvancementBuilder()
.parent(plate) .parent(plate)
@ -321,11 +324,19 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
russian("В инструкции указано что оно должно быть пуленепробиваемо.") russian("В инструкции указано что оно должно быть пуленепробиваемо.")
} }
) )
.requirements(RequirementsStrategy.OR) .requirements(Strategy.OR)
.also { advancement -> .also { advancement ->
MRegistry.INDUSTRIAL_GLASS.allItems.values.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) } MRegistry.INDUSTRIAL_GLASS.allItems.values.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) }
} }
.save(serializer, modLocation("regular/industrial_glass"), existingFileHelper) .save(serializer, modLocation("regular/industrial_glass"))
CraftEntry(
MItems.FLUID_TANK, "Liquid Packaging",
russianName = "Упаковка для жидкостей").make(serializer, glass, translation)
CraftEntry(
MItems.FLUID_CAPSULE, "Liquid Canning",
russianName = "Банка для жидкостей").make(serializer, glass, translation)
AdvancementBuilder() AdvancementBuilder()
.parent(glass) .parent(glass)
@ -337,13 +348,13 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
description = translation.add("industrial_glass2.desc", "Paint Industrial Glass all possible colors") { description = translation.add("industrial_glass2.desc", "Paint Industrial Glass all possible colors") {
russian("Покрасьте промышленное стекло во все возможные цвета") russian("Покрасьте промышленное стекло во все возможные цвета")
}, },
frameType = FrameType.GOAL frameType = AdvancementType.GOAL
) )
.requirements(RequirementsStrategy.AND) .requirements(Strategy.AND)
.also { advancement -> .also { advancement ->
MRegistry.INDUSTRIAL_GLASS.allItems.values.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) } MRegistry.INDUSTRIAL_GLASS.allItems.values.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) }
} }
.save(serializer, modLocation("regular/industrial_glass2"), existingFileHelper) .save(serializer, modLocation("regular/industrial_glass2"))
val cargoCrate = AdvancementBuilder() val cargoCrate = AdvancementBuilder()
.parent(plate) .parent(plate)
@ -356,11 +367,11 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
russian("Грузовые ящики, будто двойные сундуки, но одинарные.") russian("Грузовые ящики, будто двойные сундуки, но одинарные.")
} }
) )
.requirements(RequirementsStrategy.OR) .requirements(Strategy.OR)
.also { advancement -> .also { advancement ->
MRegistry.CARGO_CRATES.allItems.values.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) } MRegistry.CARGO_CRATES.allItems.values.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) }
} }
.save(serializer, modLocation("regular/cargo_crate"), existingFileHelper) .save(serializer, modLocation("regular/cargo_crate"))
val cargoCrateInMinecart = AdvancementBuilder() val cargoCrateInMinecart = AdvancementBuilder()
.parent(cargoCrate) .parent(cargoCrate)
@ -373,11 +384,11 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
russian("Сбросьте грузовой ящик в вагонетку и посмотрите, что получится") russian("Сбросьте грузовой ящик в вагонетку и посмотрите, что получится")
} }
) )
.requirements(RequirementsStrategy.OR) .requirements(Strategy.OR)
.also { advancement -> .also { advancement ->
MItems.CARGO_CRATE_MINECARTS.values.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) } MItems.CARGO_CRATE_MINECARTS.values.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) }
} }
.save(serializer, modLocation("regular/cargo_crate_minecart"), existingFileHelper) .save(serializer, modLocation("regular/cargo_crate_minecart"))
AdvancementBuilder() AdvancementBuilder()
.parent(cargoCrateInMinecart) .parent(cargoCrateInMinecart)
@ -389,13 +400,13 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
description = translation.add("cargo_crate_minecart2.desc", "Have all color variants of Minecarts with Cargo Crates") { description = translation.add("cargo_crate_minecart2.desc", "Have all color variants of Minecarts with Cargo Crates") {
russian("Создайте все варианты покрасок вагонеток с грузовыми Ящиками") russian("Создайте все варианты покрасок вагонеток с грузовыми Ящиками")
}, },
frameType = FrameType.GOAL frameType = AdvancementType.GOAL
) )
.requirements(RequirementsStrategy.AND) .requirements(Strategy.AND)
.also { advancement -> .also { advancement ->
MItems.CARGO_CRATE_MINECARTS.values.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) } MItems.CARGO_CRATE_MINECARTS.values.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) }
} }
.save(serializer, modLocation("regular/cargo_crate_minecart2"), existingFileHelper) .save(serializer, modLocation("regular/cargo_crate_minecart2"))
AdvancementBuilder() AdvancementBuilder()
.parent(cargoCrate) .parent(cargoCrate)
@ -407,16 +418,16 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
description = translation.add("cargo_crate2.desc", "Craft all color variants of Cargo Crates") { description = translation.add("cargo_crate2.desc", "Craft all color variants of Cargo Crates") {
russian("Покрасьте грузовые ящики во все возможные цвета") russian("Покрасьте грузовые ящики во все возможные цвета")
}, },
frameType = FrameType.GOAL frameType = AdvancementType.GOAL
) )
.requirements(RequirementsStrategy.AND) .requirements(Strategy.AND)
.also { advancement -> .also { advancement ->
MRegistry.CARGO_CRATES.allItems.values.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) } MRegistry.CARGO_CRATES.allItems.values.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) }
} }
.save(serializer, modLocation("regular/cargo_crate2"), existingFileHelper) .save(serializer, modLocation("regular/cargo_crate2"))
val tritaniumBlock = AdvancementBuilder() val tritaniumBlock = AdvancementBuilder()
.parent(plate) .parent(ingot)
.display( .display(
itemStack = ItemStack(MRegistry.TRITANIUM_BLOCK.item), itemStack = ItemStack(MRegistry.TRITANIUM_BLOCK.item),
title = translation.add("tritanium_block", "Cold, Impregnable Wall") { title = translation.add("tritanium_block", "Cold, Impregnable Wall") {
@ -426,21 +437,21 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
russian("Покройте булыжник в тритане, дешёвый, но невероятно прочный материал") russian("Покройте булыжник в тритане, дешёвый, но невероятно прочный материал")
} }
) )
.requirements(RequirementsStrategy.OR) .requirements(Strategy.OR)
.also { advancement -> .also { advancement ->
MRegistry.TRITANIUM_BLOCK.allItems.values.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) } MRegistry.TRITANIUM_BLOCK.allItems.values.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) }
MRegistry.TRITANIUM_STRIPED_BLOCK.flatItems.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) } MRegistry.TRITANIUM_STRIPED_BLOCK.flatItems.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) }
MRegistry.TRITANIUM_STAIRS.allItems.values.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) } MRegistry.TRITANIUM_STAIRS.allItems.values.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) }
MRegistry.TRITANIUM_STRIPED_STAIRS.flatItems.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) } MRegistry.TRITANIUM_STRIPED_STAIRS.flatItems.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) }
MItems.TRITANIUM_STRIPED_BLOCK.also { advancement.addCriterion(it.registryName!!.path, criterion(it)) } MItems.TRITANIUM_STRIPED_BLOCK.values.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) }
MItems.TRITANIUM_STRIPED_STAIRS.also { advancement.addCriterion(it.registryName!!.path, criterion(it)) } MItems.TRITANIUM_STRIPED_STAIRS.values.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) }
} }
.save(serializer, modLocation("regular/tritanium_block"), existingFileHelper) .save(serializer, modLocation("regular/tritanium_block"))
AdvancementBuilder() AdvancementBuilder()
.parent(tritaniumBlock) .parent(tritaniumBlock)
.display( .display(
itemStack = ItemStack(MItems.TRITANIUM_STRIPED_BLOCK), itemStack = ItemStack(MItems.TRITANIUM_STRIPED_BLOCK[DyeColor.YELLOW]!!),
title = translation.add("striped_tritanium_block", "Old Fashion Color Touch") { title = translation.add("striped_tritanium_block", "Old Fashion Color Touch") {
russian("Старомодная цветовая отделка") russian("Старомодная цветовая отделка")
}, },
@ -448,12 +459,12 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
russian("Бледно синяя покраска с жёлтой полоской, я готов поспорить вы знаете чей это дизайн") russian("Бледно синяя покраска с жёлтой полоской, я готов поспорить вы знаете чей это дизайн")
} }
) )
.requirements(RequirementsStrategy.OR) .requirements(Strategy.OR)
.addCriterion("has_item", criterion(MItems.TRITANIUM_STRIPED_BLOCK)) .addCriterion("has_item", criterion(MItems.TRITANIUM_STRIPED_BLOCK[DyeColor.YELLOW]!!))
.addCriterion("has_item1", criterion(MItems.TRITANIUM_STRIPED_STAIRS)) .addCriterion("has_item1", criterion(MItems.TRITANIUM_STRIPED_STAIRS[DyeColor.YELLOW]!!))
.addCriterion("has_item2", criterion(MItems.TRITANIUM_STRIPED_SLAB)) .addCriterion("has_item2", criterion(MItems.TRITANIUM_STRIPED_SLAB[DyeColor.YELLOW]!!))
.addCriterion("has_item3", criterion(MItems.TRITANIUM_STRIPED_WALL)) .addCriterion("has_item3", criterion(MItems.TRITANIUM_STRIPED_WALL[DyeColor.YELLOW]!!))
.save(serializer, modLocation("regular/striped_tritanium_block"), existingFileHelper) .save(serializer, modLocation("regular/striped_tritanium_block"))
val colorTritaniumBlock = AdvancementBuilder() val colorTritaniumBlock = AdvancementBuilder()
.parent(tritaniumBlock) .parent(tritaniumBlock)
@ -466,16 +477,16 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
russian("Покрасьте тритановый блок для придания ему сказочных оттенков") russian("Покрасьте тритановый блок для придания ему сказочных оттенков")
} }
) )
.requirements(RequirementsStrategy.OR) .requirements(Strategy.OR)
.also { advancement -> .also { advancement ->
MRegistry.TRITANIUM_BLOCK.items.values.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) } MRegistry.TRITANIUM_BLOCK.items.values.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) }
MRegistry.TRITANIUM_STAIRS.items.values.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) } MRegistry.TRITANIUM_STAIRS.items.values.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) }
MRegistry.TRITANIUM_STRIPED_BLOCK.flatItems.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) } MRegistry.TRITANIUM_STRIPED_BLOCK.flatItems.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) }
MRegistry.TRITANIUM_STRIPED_STAIRS.flatItems.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) } MRegistry.TRITANIUM_STRIPED_STAIRS.flatItems.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) }
MItems.TRITANIUM_STRIPED_BLOCK.also { advancement.addCriterion(it.registryName!!.path, criterion(it)) } MItems.TRITANIUM_STRIPED_BLOCK.values.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) }
MItems.TRITANIUM_STRIPED_STAIRS.also { advancement.addCriterion(it.registryName!!.path, criterion(it)) } MItems.TRITANIUM_STRIPED_STAIRS.values.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) }
} }
.save(serializer, modLocation("regular/tritanium_block2"), existingFileHelper) .save(serializer, modLocation("regular/tritanium_block2"))
val colorfulTritaniumBlock = AdvancementBuilder() val colorfulTritaniumBlock = AdvancementBuilder()
.parent(colorTritaniumBlock) .parent(colorTritaniumBlock)
@ -487,14 +498,14 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
description = translation.add("tritanium_block3.desc", "Craft all color variants of Tritanium Blocks") { description = translation.add("tritanium_block3.desc", "Craft all color variants of Tritanium Blocks") {
russian("Создайте все варианты покрасок тритановых Блоков") russian("Создайте все варианты покрасок тритановых Блоков")
}, },
frameType = FrameType.GOAL frameType = AdvancementType.GOAL
) )
.rewards(AdvancementRewards.Builder.loot(modLocation("tritanium_block3")).addExperience(100)) .rewards(advancementLoot("tritanium_block3").addExperience(100))
.requirements(RequirementsStrategy.AND) .requirements(Strategy.AND)
.also { advancement -> .also { advancement ->
MRegistry.TRITANIUM_BLOCK.items.values.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) } MRegistry.TRITANIUM_BLOCK.items.values.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) }
} }
.save(serializer, modLocation("regular/tritanium_block3"), existingFileHelper) .save(serializer, modLocation("regular/tritanium_block3"))
AdvancementBuilder() AdvancementBuilder()
.parent(colorfulTritaniumBlock) .parent(colorfulTritaniumBlock)
@ -506,16 +517,16 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
description = translation.add("tritanium_block4.desc", "Craft ALL color variants of Tritanium Blocks including striped ones") { description = translation.add("tritanium_block4.desc", "Craft ALL color variants of Tritanium Blocks including striped ones") {
russian("Создайте АБСОЛЮТНО ВСЕ варианты покрасок тритановых блоков, включая с полосками") russian("Создайте АБСОЛЮТНО ВСЕ варианты покрасок тритановых блоков, включая с полосками")
}, },
frameType = FrameType.CHALLENGE frameType = AdvancementType.CHALLENGE
) )
.rewards(AdvancementRewards.Builder.loot(modLocation("tritanium_block4")).addExperience(400)) .rewards(advancementLoot("tritanium_block4").addExperience(400))
.requirements(RequirementsStrategy.AND) .requirements(Strategy.AND)
.also { advancement -> .also { advancement ->
MRegistry.TRITANIUM_BLOCK.items.values.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) } MRegistry.TRITANIUM_BLOCK.items.values.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) }
MRegistry.TRITANIUM_STRIPED_BLOCK.flatItems.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) } MRegistry.TRITANIUM_STRIPED_BLOCK.flatItems.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) }
MItems.TRITANIUM_STRIPED_BLOCK.also { advancement.addCriterion(it.registryName!!.path, criterion(it)) } MItems.TRITANIUM_STRIPED_BLOCK.values.forEach { advancement.addCriterion(it.registryName!!.path, criterion(it)) }
} }
.save(serializer, modLocation("regular/tritanium_block4"), existingFileHelper) .save(serializer, modLocation("regular/tritanium_block4"))
val pill = AdvancementBuilder() val pill = AdvancementBuilder()
.parent(root) .parent(root)
@ -528,12 +539,12 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
russian("Найдите одну из этих ваших мистических пилюль") russian("Найдите одну из этих ваших мистических пилюль")
}, },
) )
.requirements(RequirementsStrategy.OR) .requirements(Strategy.OR)
.addCriterion("pill1", criterion(MItems.PILL_ANDROID)) .also {
.addCriterion("pill2", criterion(MItems.PILL_HEAL)) for ((i, item) in MItems.PILLS.withIndex())
.addCriterion("pill3", criterion(MItems.PILL_HUMANE)) it.addCriterion("pill$i", criterion(item))
.addCriterion("pill4", criterion(MItems.PILL_OBLIVION)) }
.save(serializer, modLocation("regular/pill"), existingFileHelper) .save(serializer, modLocation("regular/pill"))
AdvancementBuilder() AdvancementBuilder()
.parent(pill) .parent(pill)
@ -545,18 +556,18 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
description = translation.add("all_pills.desc", "Find all possible pill types") { description = translation.add("all_pills.desc", "Find all possible pill types") {
russian("Найдите всевозможные варианты пилюль") russian("Найдите всевозможные варианты пилюль")
}, },
frameType = FrameType.CHALLENGE, frameType = AdvancementType.CHALLENGE,
hidden = true hidden = true
) )
.rewards(AdvancementRewards.Builder.experience(200)) .rewards(AdvancementRewards.Builder.experience(200))
.requirements(RequirementsStrategy.AND) .requirements(Strategy.AND)
.addCriterion("pill1", criterion(MItems.PILL_ANDROID)) .also {
.addCriterion("pill2", criterion(MItems.PILL_HEAL)) for ((i, item) in MItems.PILLS.withIndex())
.addCriterion("pill3", criterion(MItems.PILL_HUMANE)) it.addCriterion("pill$i", criterion(item))
.addCriterion("pill4", criterion(MItems.PILL_OBLIVION)) }
.save(serializer, modLocation("regular/all_pills"), existingFileHelper) .save(serializer, modLocation("regular/all_pills"))
AdvancementBuilder() val essenceCapsule = AdvancementBuilder()
.parent(root) .parent(root)
.display( .display(
itemStack = ItemStack(MItems.ESSENCE_CAPSULE), itemStack = ItemStack(MItems.ESSENCE_CAPSULE),
@ -567,10 +578,10 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
russian("Верните капсулу эссенции. Воспоминания...") russian("Верните капсулу эссенции. Воспоминания...")
}, },
) )
.requirements(RequirementsStrategy.OR) .requirements(Strategy.OR)
.addCriterion("essence1", criterion(MItems.ESSENCE_CAPSULE)) .addCriterion("essence1", criterion(MItems.ESSENCE_CAPSULE))
.addCriterion("essence2", criterion(MItems.ESSENCE_DRIVE)) .addCriterion("essence2", criterion(MItems.ESSENCE_DRIVE))
.save(serializer, modLocation("regular/essence_capsule"), existingFileHelper) .save(serializer, modLocation("regular/essence_capsule"))
AdvancementBuilder() AdvancementBuilder()
.parent(root) .parent(root)
@ -583,6 +594,10 @@ fun addAdvancements(serializer: Consumer<Advancement>, existingFileHelper: Exist
russian("Пригвоздите что-либо (или кого-либо)") russian("Пригвоздите что-либо (или кого-либо)")
} }
) )
.addCriterion("damage", NailedEntityTrigger.Instance()) .addCriterion("damage", NailedEntityTrigger.Instance().criterion())
.save(serializer, modLocation("regular/explosive_hammer"), existingFileHelper) .save(serializer, modLocation("regular/explosive_hammer"))
CraftEntry(
MItems.ESSENCE_STORAGE.values, "Did not Forget to Remember",
russianName = "Не забыл запомнить").make(serializer, essenceCapsule, translation)
} }

View File

@ -1,38 +1,38 @@
package ru.dbotthepony.mc.otm.datagen.advancements package ru.dbotthepony.mc.otm.datagen.advancements
import net.minecraft.advancements.Advancement import net.minecraft.advancements.AdvancementHolder
import net.minecraft.advancements.AdvancementRequirements.Strategy
import net.minecraft.advancements.AdvancementRewards import net.minecraft.advancements.AdvancementRewards
import net.minecraft.advancements.FrameType import net.minecraft.advancements.AdvancementType
import net.minecraft.advancements.RequirementsStrategy
import net.minecraft.advancements.critereon.EntityPredicate import net.minecraft.advancements.critereon.EntityPredicate
import net.minecraft.advancements.critereon.ItemPredicate import net.minecraft.advancements.critereon.ItemPredicate
import net.minecraft.advancements.critereon.MinMaxBounds.Doubles import net.minecraft.advancements.critereon.MinMaxBounds.Doubles
import net.minecraft.world.entity.EntityType import net.minecraft.world.entity.EntityType
import net.minecraft.world.item.ItemStack import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.Items import net.minecraft.world.item.Items
import net.minecraftforge.common.data.ExistingFileHelper
import ru.dbotthepony.mc.otm.datagen.DataGen import ru.dbotthepony.mc.otm.datagen.DataGen
import ru.dbotthepony.mc.otm.datagen.lang.MatteryLanguageProvider import ru.dbotthepony.mc.otm.datagen.lang.MatteryLanguageProvider
import ru.dbotthepony.mc.otm.datagen.modLocation import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.registry.AndroidFeatures import ru.dbotthepony.mc.otm.registry.game.AndroidFeatures
import ru.dbotthepony.mc.otm.registry.MItems import ru.dbotthepony.mc.otm.registry.game.MItems
import ru.dbotthepony.mc.otm.registry.MNames import ru.dbotthepony.mc.otm.registry.MNames
import ru.dbotthepony.mc.otm.triggers.AndroidBatteryTrigger import ru.dbotthepony.mc.otm.server.triggers.AndroidBatteryTrigger
import ru.dbotthepony.mc.otm.triggers.AndroidResearchTrigger import ru.dbotthepony.mc.otm.server.triggers.AndroidResearchTrigger
import ru.dbotthepony.mc.otm.triggers.AndroidTravelUnderwater import ru.dbotthepony.mc.otm.server.triggers.AndroidTravelUnderwater
import ru.dbotthepony.mc.otm.triggers.BecomeAndroidDeathTrigger import ru.dbotthepony.mc.otm.server.triggers.BecomeAndroidDeathTrigger
import ru.dbotthepony.mc.otm.triggers.BecomeAndroidSleepTrigger import ru.dbotthepony.mc.otm.server.triggers.BecomeAndroidSleepTrigger
import ru.dbotthepony.mc.otm.triggers.BecomeAndroidTrigger import ru.dbotthepony.mc.otm.server.triggers.BecomeAndroidTrigger
import ru.dbotthepony.mc.otm.triggers.BecomeHumaneTrigger import ru.dbotthepony.mc.otm.server.triggers.BecomeHumaneTrigger
import ru.dbotthepony.mc.otm.triggers.EnderTeleporterFallDeathTrigger import ru.dbotthepony.mc.otm.server.triggers.EnderTeleporterFallDeathTrigger
import ru.dbotthepony.mc.otm.triggers.FallDampenersSaveTrigger import ru.dbotthepony.mc.otm.server.triggers.FallDampenersSaveTrigger
import ru.dbotthepony.mc.otm.triggers.KillAsAndroidTrigger import ru.dbotthepony.mc.otm.server.triggers.KillAsAndroidTrigger
import ru.dbotthepony.mc.otm.triggers.NanobotsArmorTrigger import ru.dbotthepony.mc.otm.server.triggers.NanobotsArmorTrigger
import ru.dbotthepony.mc.otm.triggers.ShockwaveDamageMobTrigger import ru.dbotthepony.mc.otm.server.triggers.ShockwaveDamageMobTrigger
import ru.dbotthepony.mc.otm.triggers.ShockwaveTrigger import ru.dbotthepony.mc.otm.server.triggers.ShockwaveTrigger
import java.util.*
import java.util.function.Consumer import java.util.function.Consumer
fun addAndroidAdvancements(serializer: Consumer<Advancement>, existingFileHelper: ExistingFileHelper, lang: MatteryLanguageProvider) { fun addAndroidAdvancements(serializer: Consumer<AdvancementHolder>, lang: MatteryLanguageProvider) {
val translation = lang.MultiBuilder("otm.advancements.android") val translation = lang.MultiBuilder("otm.advancements.android")
val root = AdvancementBuilder() val root = AdvancementBuilder()
@ -48,8 +48,8 @@ fun addAndroidAdvancements(serializer: Consumer<Advancement>, existingFileHelper
announceChat = false, announceChat = false,
background = modLocation("textures/block/decorative/metal_beam_top.png") background = modLocation("textures/block/decorative/metal_beam_top.png")
) )
.addCriterion("became_android", BecomeAndroidTrigger.Instance) .addCriterion("became_android", BecomeAndroidTrigger.criterion)
.save(serializer, modLocation("android/root"), existingFileHelper) .save(serializer, modLocation("android/root"))
AdvancementBuilder() AdvancementBuilder()
.parent(root) .parent(root)
@ -62,10 +62,10 @@ fun addAndroidAdvancements(serializer: Consumer<Advancement>, existingFileHelper
russian("Используйте модуль нулевой точки как внутренний источник питания. Теперь только вечность будет вашим злейшим врагом") russian("Используйте модуль нулевой точки как внутренний источник питания. Теперь только вечность будет вашим злейшим врагом")
}, },
hidden = true, hidden = true,
frameType = FrameType.CHALLENGE frameType = AdvancementType.CHALLENGE
) )
.addCriterion("item", AndroidBatteryTrigger.Instance(ItemPredicate.Builder.item().of(MItems.ZPM_BATTERY).build())) .addCriterion("item", AndroidBatteryTrigger.Instance(ItemPredicate.Builder.item().of(MItems.ZPM_BATTERY).build()).criterion())
.save(serializer, modLocation("android/zpm"), existingFileHelper) .save(serializer, modLocation("android/zpm"))
AdvancementBuilder() AdvancementBuilder()
.parent(root) .parent(root)
@ -78,12 +78,12 @@ fun addAndroidAdvancements(serializer: Consumer<Advancement>, existingFileHelper
russian("Используйте Квантовый Аккумулятор как внутренний источник питания, можно даже подключить другой конец к Реактору Распада") russian("Используйте Квантовый Аккумулятор как внутренний источник питания, можно даже подключить другой конец к Реактору Распада")
}, },
hidden = true, hidden = true,
frameType = FrameType.GOAL frameType = AdvancementType.GOAL
) )
.requirements(RequirementsStrategy.OR) .requirements(Strategy.OR)
.addCriterion("item0", AndroidBatteryTrigger.Instance(ItemPredicate.Builder.item().of(MItems.QUANTUM_BATTERY).build())) .addCriterion("item0", AndroidBatteryTrigger.Instance(ItemPredicate.Builder.item().of(MItems.QUANTUM_BATTERY).build()).criterion())
.addCriterion("item1", AndroidBatteryTrigger.Instance(ItemPredicate.Builder.item().of(MItems.QUANTUM_CAPACITOR).build())) .addCriterion("item1", AndroidBatteryTrigger.Instance(ItemPredicate.Builder.item().of(MItems.QUANTUM_CAPACITOR).build()).criterion())
.save(serializer, modLocation("android/quantum_battery"), existingFileHelper) .save(serializer, modLocation("android/quantum_battery"))
AdvancementBuilder() AdvancementBuilder()
.parent(root) .parent(root)
@ -97,8 +97,8 @@ fun addAndroidAdvancements(serializer: Consumer<Advancement>, existingFileHelper
}, },
hidden = true, hidden = true,
) )
.addCriterion("became_android", BecomeAndroidSleepTrigger.Instance) .addCriterion("became_android", BecomeAndroidSleepTrigger.criterion)
.save(serializer, modLocation("android/become_thru_sleep"), existingFileHelper) .save(serializer, modLocation("android/become_thru_sleep"))
AdvancementBuilder() AdvancementBuilder()
.parent(root) .parent(root)
@ -108,12 +108,12 @@ fun addAndroidAdvancements(serializer: Consumer<Advancement>, existingFileHelper
russian("Изготовленный по старинке") russian("Изготовленный по старинке")
}, },
description = translation.add("death.desc", "In event of death, become an Android; Veteran's favorite") { description = translation.add("death.desc", "In event of death, become an Android; Veteran's favorite") {
russian("Будучи умерев, станьте андроидом; Ветераны оценят") russian("Станьте андроидом, будучи умерев; Ветераны оценят")
}, },
hidden = true, hidden = true,
) )
.addCriterion("became_android", BecomeAndroidDeathTrigger.Instance) .addCriterion("became_android", BecomeAndroidDeathTrigger.criterion)
.save(serializer, modLocation("android/become_thru_death"), existingFileHelper) .save(serializer, modLocation("android/become_thru_death"))
AdvancementBuilder() AdvancementBuilder()
.parent(root) .parent(root)
@ -126,43 +126,29 @@ fun addAndroidAdvancements(serializer: Consumer<Advancement>, existingFileHelper
russian("Вновь обретите плоть после своей жизни как набор гаек и болтов, но вот чего-то всё равно не хватает, что было при вас с самого начала...") russian("Вновь обретите плоть после своей жизни как набор гаек и болтов, но вот чего-то всё равно не хватает, что было при вас с самого начала...")
}, },
hidden = true, hidden = true,
frameType = FrameType.GOAL frameType = AdvancementType.GOAL
) )
.addCriterion("become_humane", BecomeHumaneTrigger.Instance) .addCriterion("become_humane", BecomeHumaneTrigger.criterion)
.save(serializer, modLocation("android/become_humane"), existingFileHelper) .save(serializer, modLocation("android/become_humane"))
val attractor = AdvancementBuilder() val attractor = AdvancementBuilder()
.parent(root) .parent(root)
.display( .display(
itemStack = ItemStack(MItems.PHANTOM_ATTRACTOR), itemStack = ItemStack(MItems.PHANTOM_ATTRACTOR),
title = translation.add("phantom_attractor", "Eversleeping Decoy") { title = translation.add("phantom_attractor", "Eversleeping Decoy") {
russian("Вечноспящий декой") russian("Фантоматичная приманка")
}, },
description = translation.add("phantom_attractor.desc", "Put together a Phantom Attractor, to be able to fight Phantoms as Android again") { description = translation.add("phantom_attractor.desc", "Put together a Phantom Attractor, to be able to fight Phantoms as Android again") {
russian("Создайте приманщик фантомов, для привлечения фантомов вновь, будучи андроидом") russian("Создайте приманщик фантомов, для привлечения фантомов вновь, будучи андроидом")
}, },
) )
.addCriterion("has_item", criterion(MItems.PHANTOM_ATTRACTOR)) .addCriterion("has_item", criterion(MItems.PHANTOM_ATTRACTOR))
.save(serializer, modLocation("regular/phantom_attractor"), existingFileHelper) .save(serializer, modLocation("regular/phantom_attractor"))
AdvancementBuilder()
.parent(attractor)
.display(
itemStack = ItemStack(MItems.PHANTOM_ATTRACTOR),
title = translation.add("phantom_attractor_research", "Deception of Phantoms") {
russian("Обман фантомов")
},
description = translation.add("phantom_attractor_research.desc", "Research into how to attract Phantoms the same way as the ones who need to sleep") {
russian("Исследуйте привлечение фантомов, чтоб привлекать их так же, как те, кому нужно спать")
},
)
.addCriterion("researched", AndroidResearchTrigger.Instance(modLocation(MNames.PHANTOM_ATTRACTOR)))
.save(serializer, modLocation("regular/phantom_attractor_research"), existingFileHelper)
val researchAnything = AdvancementBuilder() val researchAnything = AdvancementBuilder()
.parent(root) .parent(root)
.display( .display(
itemStack = ItemStack(MItems.ANDROID_STATION), itemStack = ItemStack(MItems.ANDROID_STATION[null]!!),
title = translation.add("research_anything", "New Trick") { title = translation.add("research_anything", "New Trick") {
russian("Новый фокус") russian("Новый фокус")
}, },
@ -170,8 +156,8 @@ fun addAndroidAdvancements(serializer: Consumer<Advancement>, existingFileHelper
russian("Исследуйте что либо за андроида") russian("Исследуйте что либо за андроида")
}, },
) )
.addCriterion("research_anything", AndroidResearchTrigger.Instance(null)) .addCriterion("research_anything", AndroidResearchTrigger.Instance(Optional.empty(), Optional.empty()).criterion())
.save(serializer, modLocation("android/research_anything"), existingFileHelper) .save(serializer, modLocation("android/research_anything"))
AdvancementBuilder() AdvancementBuilder()
.parent(researchAnything) .parent(researchAnything)
@ -184,8 +170,8 @@ fun addAndroidAdvancements(serializer: Consumer<Advancement>, existingFileHelper
russian("Исследуйте воздушные мешки, дабы быть вновь поплавком в воде") russian("Исследуйте воздушные мешки, дабы быть вновь поплавком в воде")
}, },
) )
.addCriterion("air_bags", AndroidResearchTrigger.Instance(modLocation(MNames.AIR_BAGS))) .addCriterion("air_bags", AndroidResearchTrigger.Instance(modLocation(MNames.AIR_BAGS)).criterion())
.save(serializer, modLocation("android/research_air_bags"), existingFileHelper) .save(serializer, modLocation("android/research_air_bags"))
AdvancementBuilder() AdvancementBuilder()
.parent(researchAnything) .parent(researchAnything)
@ -198,8 +184,8 @@ fun addAndroidAdvancements(serializer: Consumer<Advancement>, existingFileHelper
russian("Исследуйте ночное зрение за андроида, дабы видеть во темноте") russian("Исследуйте ночное зрение за андроида, дабы видеть во темноте")
}, },
) )
.addCriterion("night_vision", AndroidResearchTrigger.Instance(modLocation(MNames.NIGHT_VISION))) .addCriterion("night_vision", AndroidResearchTrigger.Instance(modLocation(MNames.NIGHT_VISION)).criterion())
.save(serializer, modLocation("android/research_night_vision"), existingFileHelper) .save(serializer, modLocation("android/research_night_vision"))
val nanobots = AdvancementBuilder() val nanobots = AdvancementBuilder()
.parent(researchAnything) .parent(researchAnything)
@ -213,8 +199,8 @@ fun addAndroidAdvancements(serializer: Consumer<Advancement>, existingFileHelper
}, },
hidden = true hidden = true
) )
.addCriterion("nanobots", AndroidResearchTrigger.Instance(modLocation(MNames.NANOBOTS))) .addCriterion("nanobots", AndroidResearchTrigger.Instance(modLocation(MNames.NANOBOTS)).criterion())
.save(serializer, modLocation("android/research_nanobots"), existingFileHelper) .save(serializer, modLocation("android/research_nanobots"))
val shielding = AdvancementBuilder() val shielding = AdvancementBuilder()
.parent(nanobots) .parent(nanobots)
@ -227,10 +213,10 @@ fun addAndroidAdvancements(serializer: Consumer<Advancement>, existingFileHelper
russian("Дайте наноботам поглотить 5 сердец урона, не отключившись насовсем") russian("Дайте наноботам поглотить 5 сердец урона, не отключившись насовсем")
}, },
hidden = true, hidden = true,
frameType = FrameType.GOAL frameType = AdvancementType.GOAL
) )
.addCriterion("damage", NanobotsArmorTrigger.Instance(Doubles.atLeast(10.0))) .addCriterion("damage", NanobotsArmorTrigger.Instance(Doubles.atLeast(10.0)).criterion())
.save(serializer, modLocation("android/nanobots_armor_deflect"), existingFileHelper) .save(serializer, modLocation("android/nanobots_armor_deflect"))
AdvancementBuilder() AdvancementBuilder()
.parent(shielding) .parent(shielding)
@ -243,10 +229,10 @@ fun addAndroidAdvancements(serializer: Consumer<Advancement>, existingFileHelper
russian("Дайте наноботам поглотить 10 сердец урона, не отключившись насовсем") russian("Дайте наноботам поглотить 10 сердец урона, не отключившись насовсем")
}, },
hidden = true, hidden = true,
frameType = FrameType.CHALLENGE frameType = AdvancementType.CHALLENGE
) )
.addCriterion("damage", NanobotsArmorTrigger.Instance(Doubles.atLeast(20.0))) .addCriterion("damage", NanobotsArmorTrigger.Instance(Doubles.atLeast(20.0)).criterion())
.save(serializer, modLocation("android/nanobots_armor_deflect2"), existingFileHelper) .save(serializer, modLocation("android/nanobots_armor_deflect2"))
AdvancementBuilder() AdvancementBuilder()
.parent(researchAnything) .parent(researchAnything)
@ -258,10 +244,10 @@ fun addAndroidAdvancements(serializer: Consumer<Advancement>, existingFileHelper
description = translation.add("fall_dampeners_save.desc", "Survive fall that would have otherwise be fatal without Fall Dampeners") { description = translation.add("fall_dampeners_save.desc", "Survive fall that would have otherwise be fatal without Fall Dampeners") {
russian("Выживите после падения, которое было бы фатальным без поглотителей инерции") russian("Выживите после падения, которое было бы фатальным без поглотителей инерции")
}, },
frameType = FrameType.GOAL frameType = AdvancementType.GOAL
) )
.addCriterion("saved", FallDampenersSaveTrigger.Instance) .addCriterion("saved", FallDampenersSaveTrigger.criterion)
.save(serializer, modLocation("android/fall_dampeners_save"), existingFileHelper) .save(serializer, modLocation("android/fall_dampeners_save"))
AdvancementBuilder() AdvancementBuilder()
.parent(researchAnything) .parent(researchAnything)
@ -273,11 +259,11 @@ fun addAndroidAdvancements(serializer: Consumer<Advancement>, existingFileHelper
description = translation.add("ender_teleport_fall_death.desc", "Fall to your demise moments after Teleporting as Android") { description = translation.add("ender_teleport_fall_death.desc", "Fall to your demise moments after Teleporting as Android") {
russian("Разбейтесь насмерть через мгновения после телепортации за андроида") russian("Разбейтесь насмерть через мгновения после телепортации за андроида")
}, },
frameType = FrameType.GOAL, frameType = AdvancementType.GOAL,
hidden = true hidden = true
) )
.addCriterion("death", EnderTeleporterFallDeathTrigger.Instance) .addCriterion("death", EnderTeleporterFallDeathTrigger.criterion)
.save(serializer, modLocation("android/ender_teleport_fall_death"), existingFileHelper) .save(serializer, modLocation("android/ender_teleport_fall_death"))
val regen = AdvancementBuilder() val regen = AdvancementBuilder()
.parent(nanobots) .parent(nanobots)
@ -290,8 +276,8 @@ fun addAndroidAdvancements(serializer: Consumer<Advancement>, existingFileHelper
russian("Исследуйте регенерацию наноботов за андроида") russian("Исследуйте регенерацию наноботов за андроида")
}, },
) )
.addCriterion("regen0", AndroidResearchTrigger.Instance(modLocation(MNames.NANOBOTS_REGENERATION_1))) .addCriterion("regen0", AndroidResearchTrigger.Instance(modLocation(MNames.NANOBOTS_REGENERATION_1)).criterion())
.save(serializer, modLocation("android/regen"), existingFileHelper) .save(serializer, modLocation("android/regen"))
AdvancementBuilder() AdvancementBuilder()
.parent(regen) .parent(regen)
@ -303,35 +289,35 @@ fun addAndroidAdvancements(serializer: Consumer<Advancement>, existingFileHelper
description = translation.add("regen_all.desc", "Max out Nanobots Regeneration research") { description = translation.add("regen_all.desc", "Max out Nanobots Regeneration research") {
russian("Полностью исследуйте регенерацию наноботов за андроида") russian("Полностью исследуйте регенерацию наноботов за андроида")
}, },
frameType = FrameType.GOAL, frameType = AdvancementType.GOAL,
) )
.addCriterion("regen0", AndroidResearchTrigger.Instance(modLocation(MNames.NANOBOTS_REGENERATION_1))) .addCriterion("regen0", AndroidResearchTrigger.Instance(modLocation(MNames.NANOBOTS_REGENERATION_1)).criterion())
.addCriterion("regen1", AndroidResearchTrigger.Instance(modLocation(MNames.NANOBOTS_REGENERATION_2))) .addCriterion("regen1", AndroidResearchTrigger.Instance(modLocation(MNames.NANOBOTS_REGENERATION_2)).criterion())
.addCriterion("regen2", AndroidResearchTrigger.Instance(modLocation(MNames.NANOBOTS_REGENERATION_3))) .addCriterion("regen2", AndroidResearchTrigger.Instance(modLocation(MNames.NANOBOTS_REGENERATION_3)).criterion())
.addCriterion("regen3", AndroidResearchTrigger.Instance(modLocation(MNames.NANOBOTS_REGENERATION_4))) .addCriterion("regen3", AndroidResearchTrigger.Instance(modLocation(MNames.NANOBOTS_REGENERATION_4)).criterion())
.save(serializer, modLocation("android/regen_all"), existingFileHelper) .save(serializer, modLocation("android/regen_all"))
AdvancementBuilder() AdvancementBuilder()
.parent(researchAnything) .parent(researchAnything)
.display( .display(
itemStack = ItemStack(MItems.ANDROID_STATION), itemStack = ItemStack(MItems.ANDROID_STATION[null]!!),
title = translation.add("research_all", "Mecha-Agnomination") { title = translation.add("research_all", "Mecha-Agnomination") {
russian("Меха-зумие") russian("Меха-зумие")
}, },
description = translation.add("research_all.desc", "Research everything as Android (that don't block or get blocked by any other research)") { description = translation.add("research_all.desc", "Research everything as Android (that don't block or get blocked by any other research)") {
russian("Исследуйте все технологии за андроида (которые не блокируют и не блокируются другими технологиями)") russian("Исследуйте все технологии за андроида (которые не блокируют и не блокируются другими технологиями)")
}, },
frameType = FrameType.CHALLENGE frameType = AdvancementType.CHALLENGE
) )
.rewards(AdvancementRewards.Builder.experience(400).addLootTable(modLocation("research_all_android"))) .rewards(AdvancementRewards.Builder.experience(400).addLootTable(modLocation("research_all_android")))
.also { advancement -> .also { advancement ->
DataGen.researchProvider.generatedView.stream() DataGen.researchProvider.generatedView.stream()
.filter { it.allBlockedBy.isEmpty() && it.allBlocking.isEmpty() } .filter { it.allBlockedBy.isEmpty() && it.allBlocking.isEmpty() }
.forEach { .forEach {
advancement.addCriterion(it.id.toString(), AndroidResearchTrigger.Instance(it)) advancement.addCriterion(it.id.toString(), AndroidResearchTrigger.Instance(it).criterion())
} }
} }
.save(serializer, modLocation("android/research_everything"), existingFileHelper) .save(serializer, modLocation("android/research_everything"))
val shockwave = AdvancementBuilder() val shockwave = AdvancementBuilder()
.parent(researchAnything) .parent(researchAnything)
@ -344,8 +330,8 @@ fun addAndroidAdvancements(serializer: Consumer<Advancement>, existingFileHelper
russian("Вызовите ударную волну при приземлении") russian("Вызовите ударную волну при приземлении")
}, },
) )
.addCriterion("shockwave", ShockwaveTrigger.Instance) .addCriterion("shockwave", ShockwaveTrigger.criterion)
.save(serializer, modLocation("android/shockwave"), existingFileHelper) .save(serializer, modLocation("android/shockwave"))
AdvancementBuilder() AdvancementBuilder()
.parent(shockwave) .parent(shockwave)
@ -357,10 +343,10 @@ fun addAndroidAdvancements(serializer: Consumer<Advancement>, existingFileHelper
description = translation.add("shockwave_warden.desc", "Hurt Warden using Shockwave ability") { description = translation.add("shockwave_warden.desc", "Hurt Warden using Shockwave ability") {
russian("Нанесите хранителю урон используя ударную волну") russian("Нанесите хранителю урон используя ударную волну")
}, },
frameType = FrameType.GOAL frameType = AdvancementType.GOAL
) )
.addCriterion("shockwave_warden", ShockwaveDamageMobTrigger.Instance(EntityPredicate.Builder.entity().of(EntityType.WARDEN).build().wrap())) .addCriterion("shockwave_warden", ShockwaveDamageMobTrigger.Instance(Optional.of(EntityPredicate.Builder.entity().of(EntityType.WARDEN).build().wrap())).criterion())
.save(serializer, modLocation("android/shockwave_warden"), existingFileHelper) .save(serializer, modLocation("android/shockwave_warden"))
AdvancementBuilder() AdvancementBuilder()
.parent(root) .parent(root)
@ -372,13 +358,13 @@ fun addAndroidAdvancements(serializer: Consumer<Advancement>, existingFileHelper
description = translation.add("wither.desc", "Defeat The Wither as Android. The Wither was surely confused over kind of thing you are") { description = translation.add("wither.desc", "Defeat The Wither as Android. The Wither was surely confused over kind of thing you are") {
russian("Победите Иссушителя будучи андроидом. Наверняка Иссушитель был ошеломлён таким раскладом дел") russian("Победите Иссушителя будучи андроидом. Наверняка Иссушитель был ошеломлён таким раскладом дел")
}, },
frameType = FrameType.GOAL, frameType = AdvancementType.GOAL,
hidden = true hidden = true
) )
.addCriterion("kill_wither", KillAsAndroidTrigger.Instance( .addCriterion("kill_wither", KillAsAndroidTrigger.Instance(
predicate = EntityPredicate.Builder.entity().of(EntityType.WITHER).build().wrap(), predicate = Optional.of(EntityPredicate.Builder.entity().of(EntityType.WITHER).build().wrap()),
)) ).criterion())
.save(serializer, modLocation("android/wither"), existingFileHelper) .save(serializer, modLocation("android/wither"))
val underwater = AdvancementBuilder() val underwater = AdvancementBuilder()
.parent(root) .parent(root)
@ -390,11 +376,11 @@ fun addAndroidAdvancements(serializer: Consumer<Advancement>, existingFileHelper
description = translation.add("travel_underwater.desc", "Travel at least 200 meters underwater as Android without Air Bags research. This reminds us of someone...") { description = translation.add("travel_underwater.desc", "Travel at least 200 meters underwater as Android without Air Bags research. This reminds us of someone...") {
russian("Преодолейте как минимум 200 метров под водой будучи андроидом без исследования воздушных мешков. Кого-то это нам напоминает...") russian("Преодолейте как минимум 200 метров под водой будучи андроидом без исследования воздушных мешков. Кого-то это нам напоминает...")
}, },
frameType = FrameType.GOAL, frameType = AdvancementType.GOAL,
hidden = true hidden = true
) )
.addCriterion("travel", AndroidTravelUnderwater.Instance(200.0)) .addCriterion("travel", AndroidTravelUnderwater.Instance(200.0).criterion())
.save(serializer, modLocation("android/underwater"), existingFileHelper) .save(serializer, modLocation("android/underwater"))
AdvancementBuilder() AdvancementBuilder()
.parent(underwater) .parent(underwater)
@ -406,11 +392,11 @@ fun addAndroidAdvancements(serializer: Consumer<Advancement>, existingFileHelper
description = translation.add("travel_underwater2.desc", "Travel at least 1046 meters underwater as Android without Air Bags research, like someone else did so") { description = translation.add("travel_underwater2.desc", "Travel at least 1046 meters underwater as Android without Air Bags research, like someone else did so") {
russian("Преодолейте как минимум 1046 метров под водой будучи андроидом без исследования воздушных мешков, прям как тот, кто так однажды так и сделал") russian("Преодолейте как минимум 1046 метров под водой будучи андроидом без исследования воздушных мешков, прям как тот, кто так однажды так и сделал")
}, },
frameType = FrameType.CHALLENGE, frameType = AdvancementType.CHALLENGE,
hidden = true hidden = true
) )
.addCriterion("travel", AndroidTravelUnderwater.Instance(1046.0)) .addCriterion("travel", AndroidTravelUnderwater.Instance(1046.0).criterion())
.save(serializer, modLocation("android/underwater2"), existingFileHelper) .save(serializer, modLocation("android/underwater2"))
AdvancementBuilder() AdvancementBuilder()
.parent(root) .parent(root)
@ -422,12 +408,12 @@ fun addAndroidAdvancements(serializer: Consumer<Advancement>, existingFileHelper
description = translation.add("elder_guardian.desc", "Slay Elder Guardian as Android without Air Bags researched") { description = translation.add("elder_guardian.desc", "Slay Elder Guardian as Android without Air Bags researched") {
russian("Победите Древнего стража будучи андроидом без исследования воздушных мешков") russian("Победите Древнего стража будучи андроидом без исследования воздушных мешков")
}, },
frameType = FrameType.CHALLENGE, frameType = AdvancementType.CHALLENGE,
hidden = true hidden = true
) )
.addCriterion("kill_elder_guardian", KillAsAndroidTrigger.Instance( .addCriterion("kill_elder_guardian", KillAsAndroidTrigger.Instance(
predicate = EntityPredicate.Builder.entity().of(EntityType.ELDER_GUARDIAN).build().wrap(), predicate = Optional.of(EntityPredicate.Builder.entity().of(EntityType.ELDER_GUARDIAN).build().wrap()),
featurePredicate = KillAsAndroidTrigger.Not(KillAsAndroidTrigger.Has(AndroidFeatures.AIR_BAGS.registryName!!)) featurePredicate = KillAsAndroidTrigger.Not(KillAsAndroidTrigger.Has(AndroidFeatures.AIR_BAGS.registryName!!))
)) ).criterion())
.save(serializer, modLocation("android/elder_guardian"), existingFileHelper) .save(serializer, modLocation("android/elder_guardian"))
} }

View File

@ -0,0 +1,263 @@
package ru.dbotthepony.mc.otm.datagen.advancements
import net.minecraft.advancements.AdvancementHolder
import net.minecraft.advancements.AdvancementType
import net.minecraft.advancements.critereon.ItemPredicate
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.Items
import ru.dbotthepony.mc.otm.datagen.lang.MatteryLanguageProvider
import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.registry.game.MItems
import ru.dbotthepony.mc.otm.server.triggers.ExopackBatterySlotTrigger
import ru.dbotthepony.mc.otm.server.triggers.ExopackGainedCraftingTrigger
import ru.dbotthepony.mc.otm.server.triggers.ExopackGainedEnderAccessTrigger
import ru.dbotthepony.mc.otm.server.triggers.ExopackGainedSmeltingTrigger
import ru.dbotthepony.mc.otm.server.triggers.ExopackObtainedTrigger
import ru.dbotthepony.mc.otm.server.triggers.ExopackSlotsExpandedTrigger
import java.util.function.Consumer
fun addExopackAdvancements(serializer: Consumer<AdvancementHolder>, lang: MatteryLanguageProvider, root: AdvancementHolder, zpm: AdvancementHolder) {
val translation = lang.MultiBuilder("otm.advancements.exopack")
AdvancementBuilder()
.parent(zpm)
.display(
hidden = true,
itemStack = ItemStack(MItems.ZPM_BATTERY),
title = translation.add("zpm_battery", "At Maximum Battery Capacity") {
russian("Достигнут максимальный заряд батареи")
},
description = translation.add("zpm_battery.desc", "Use Zero Point Module as power source in Exopack") {
russian("Используйте модуль нулевой точки как источник питания в Экзопаке")
},
frameType = AdvancementType.GOAL
)
.addCriterion("zpm_battery", ExopackBatterySlotTrigger.Instance(ItemPredicate.Builder.item().of(MItems.ZPM_BATTERY).build()).criterion())
.save(serializer, modLocation("exopack/zpm_battery"))
val obtained = AdvancementBuilder()
.parent(root)
.display(
itemStack = ItemStack(MItems.EXOPACK_PROBE),
title = translation.add("obtained", "One Dimension Bigger") {
russian("Больше на одно измерение")
},
description = translation.add("obtained.desc", "Obtain an Exopack, a mysterious, semi-present, light as a feather, stuff storage on your back") {
russian("Получите Экзопак, загадочное, полу-присутствующее, лёгкое как пёрышко, хранилище штуковин на вашей спине")
},
frameType = AdvancementType.GOAL
)
.addCriterion("obtained", ExopackObtainedTrigger.criterion)
.save(serializer, modLocation("exopack/obtained"))
AdvancementBuilder()
.parent(obtained)
.display(
itemStack = ItemStack(Items.CRAFTING_TABLE),
title = translation.add("crafting", "Crafting on Go") {
russian("Крафт по пути")
},
description = translation.add("crafting.desc", "Install Crafting Upgrade in your Exopack, allowing to craft 3x3 recipes") {
russian("Установите улучшение сетки крафта в ваш Экзопаке, который позволяет создавать предметы, требующие сетку крафта рабочего стола")
},
)
.addCriterion("crafting", ExopackGainedCraftingTrigger.criterion)
.save(serializer, modLocation("exopack/crafting"))
AdvancementBuilder()
.parent(obtained)
.display(
itemStack = ItemStack(Items.FURNACE),
title = translation.add("smelting", "Pocket Furnace") {
russian("Печь в кармане")
},
description = translation.add("smelting.desc", "Install Smelting Module in your Exopack, allowing to smelt items right inside your inventory") {
russian("Установите модуль переплавки в ваш Экзопак, позволяющий переплавлять предметы прямо у вас в инвентаре")
},
)
.addCriterion("smelting", ExopackGainedSmeltingTrigger.criterion)
.save(serializer, modLocation("exopack/smelting"))
AdvancementBuilder()
.parent(obtained)
.display(
itemStack = ItemStack(Items.ENDER_CHEST),
title = translation.add("ender_access", "Ender-ious Access") {
russian("Эендер-иумый Доступ")
},
description = translation.add("ender_access.desc", "Gain direct access to your Ender Chest out of your Exopack") {
russian("Получите прямой доступ к содержимому вашего сундука края прямо из Экзопака")
},
)
.addCriterion("ender_access", ExopackGainedEnderAccessTrigger.criterion)
.save(serializer, modLocation("ender_access/smelting"))
var size = AdvancementBuilder()
.parent(obtained)
.display(
itemStack = ItemStack(Items.CHEST),
title = translation.add("size0", "Closet Upgrade") {
russian("Обновление чуланчика")
},
description = translation.add("size0.desc", "Upgrade Exopack storage") {
russian("Улучшите размер инвентаря Экзопака")
},
)
.addCriterion("size0", ExopackSlotsExpandedTrigger.Instance(minTotal = 1).criterion())
.save(serializer, modLocation("exopack/size0"))
val size0 = size
size = AdvancementBuilder()
.parent(size)
.display(
itemStack = ItemStack(Items.CHEST),
title = translation.add("size1", "Double the Capacity") {
russian("Двойной объём")
},
description = translation.add("size1.desc", "Reach 27 slots in your Exopack storage") {
russian("Достигните 27 слотов хранилища Экзопака")
},
)
.addCriterion("size1", ExopackSlotsExpandedTrigger.Instance(minTotal = 27).criterion())
.save(serializer, modLocation("exopack/size1"))
size = AdvancementBuilder()
.parent(size)
.display(
itemStack = ItemStack(Items.CHEST),
hidden = true,
title = translation.add("size2", "Pack Rat") {
russian("Воришка")
},
description = translation.add("size2.desc", "Reach 54 slots in your Exopack storage") {
russian("Достигните 54 слотов хранилища Экзопака")
},
)
.addCriterion("size2", ExopackSlotsExpandedTrigger.Instance(minTotal = 54).criterion())
.save(serializer, modLocation("exopack/size2"))
size = AdvancementBuilder()
.parent(size)
.display(
itemStack = ItemStack(Items.CHEST),
hidden = true,
title = translation.add("size3", "Its Getting Big In Here") {
russian("Тут становится просторно")
},
description = translation.add("size3.desc", "Reach 108 slots in your Exopack storage") {
russian("Достигните 108 слотов хранилища Экзопака")
},
frameType = AdvancementType.GOAL
)
.addCriterion("size3", ExopackSlotsExpandedTrigger.Instance(minTotal = 108).criterion())
.save(serializer, modLocation("exopack/size3"))
size = AdvancementBuilder()
.parent(size)
.display(
itemStack = ItemStack(Items.ENDER_CHEST),
hidden = true,
title = translation.add("size4", "Warehousing Pioneer") {
russian("Пионер складских решений")
},
description = translation.add("size4.desc", "Reach 432 slots in your Exopack storage. You could fit a house in there") {
russian("Достигните 432 слотов хранилища Экзопака. Туда можно уже впихнуть целый дом")
},
frameType = AdvancementType.CHALLENGE
)
.addCriterion("size4", ExopackSlotsExpandedTrigger.Instance(minTotal = 432).criterion())
.save(serializer, modLocation("exopack/size4"))
AdvancementBuilder()
.parent(size)
.display(
itemStack = ItemStack(Items.ENDER_CHEST),
hidden = true,
title = translation.add("size5", "With Volume Like This...") {
russian("С таким объёмом...")
},
description = translation.add("size5.desc", "Reach 1728 slots in your Exopack storage. Why would you need to go any bigger?!") {
russian("Достигните 1728 слотов хранилища Экзопака. Куда вам столько?!")
},
frameType = AdvancementType.CHALLENGE
)
.addCriterion("size5", ExopackSlotsExpandedTrigger.Instance(minTotal = 1728).criterion())
.save(serializer, modLocation("exopack/size5"))
var once = AdvancementBuilder()
.parent(size0)
.display(
itemStack = ItemStack(Items.CHEST),
title = translation.add("once0", "One Module - One Row") {
russian("Один модуль - одна строка")
},
description = translation.add("once0.desc", "Upgrade your Exopack storage with 9 slots using one module") {
russian("Улучшите хранилище Экзопака модулем на 9 слотов")
},
)
.addCriterion("once0", ExopackSlotsExpandedTrigger.Instance(minGained = 9).criterion())
.save(serializer, modLocation("exopack/once0"))
once = AdvancementBuilder()
.parent(once)
.display(
itemStack = ItemStack(Items.CHEST),
title = translation.add("once1", "One Module - One Chest") {
russian("Один модуль - один сундук")
},
description = translation.add("once1.desc", "Upgrade your Exopack storage with 27 slots using one module") {
russian("Улучшите хранилище Экзопака модулем на 27 слотов")
},
)
.addCriterion("once1", ExopackSlotsExpandedTrigger.Instance(minGained = 27).criterion())
.save(serializer, modLocation("exopack/once1"))
once = AdvancementBuilder()
.parent(once)
.display(
itemStack = ItemStack(Items.CHEST),
hidden = true,
title = translation.add("once2", "One Module - Two Chests?") {
russian("Один модуль - два сундука?")
},
description = translation.add("once2.desc", "Upgrade your Exopack storage with 54 slots using one module") {
russian("Улучшите хранилище Экзопака модулем на 54 слотов")
},
frameType = AdvancementType.GOAL
)
.addCriterion("once2", ExopackSlotsExpandedTrigger.Instance(minGained = 54).criterion())
.save(serializer, modLocation("exopack/once2"))
once = AdvancementBuilder()
.parent(once)
.display(
itemStack = ItemStack(Items.ENDER_CHEST),
hidden = true,
title = translation.add("once3", "Storage Housing Construct") {
russian("Хранилище быстрого приготовления")
},
description = translation.add("once3.desc", "Upgrade your Exopack storage with 90 slots using one module") {
russian("Улучшите хранилище Экзопака модулем на 90 слотов")
},
frameType = AdvancementType.GOAL
)
.addCriterion("once3", ExopackSlotsExpandedTrigger.Instance(minGained = 90).criterion())
.save(serializer, modLocation("exopack/once3"))
AdvancementBuilder()
.parent(once)
.display(
itemStack = ItemStack(Items.ENDER_CHEST),
hidden = true,
title = translation.add("once4", "Non-Euclidean Wardrobe") {
russian("Неевклидов Шкаф")
},
description = translation.add("once4.desc", "Upgrade your Exopack storage with 150 slots using one module. After you open one, tens meters long racks roll out of it!") {
russian("Улучшите хранилище Экзопака модулем на 150 слотов. Открой один - и покатились стеллажи на десятки метров!")
},
frameType = AdvancementType.CHALLENGE
)
.addCriterion("once4", ExopackSlotsExpandedTrigger.Instance(minGained = 150).criterion())
.save(serializer, modLocation("exopack/once4"))
}

View File

@ -1,29 +1,53 @@
package ru.dbotthepony.mc.otm.datagen.advancements package ru.dbotthepony.mc.otm.datagen.advancements
import net.minecraft.advancements.Advancement import net.minecraft.advancements.Advancement
import net.minecraft.advancements.CriterionTriggerInstance import net.minecraft.advancements.AdvancementHolder
import net.minecraft.advancements.AdvancementRewards
import net.minecraft.advancements.AdvancementType
import net.minecraft.advancements.Criterion
import net.minecraft.advancements.DisplayInfo import net.minecraft.advancements.DisplayInfo
import net.minecraft.advancements.FrameType
import net.minecraft.advancements.critereon.ContextAwarePredicate import net.minecraft.advancements.critereon.ContextAwarePredicate
import net.minecraft.advancements.critereon.EntityPredicate import net.minecraft.advancements.critereon.EntityPredicate
import net.minecraft.advancements.critereon.InventoryChangeTrigger import net.minecraft.advancements.critereon.InventoryChangeTrigger
import net.minecraft.advancements.critereon.ItemPredicate import net.minecraft.advancements.critereon.ItemPredicate
import net.minecraft.core.registries.Registries
import net.minecraft.network.chat.Component import net.minecraft.network.chat.Component
import net.minecraft.resources.ResourceKey
import net.minecraft.resources.ResourceLocation import net.minecraft.resources.ResourceLocation
import net.minecraft.tags.TagKey import net.minecraft.tags.TagKey
import net.minecraft.world.item.Item import net.minecraft.world.item.Item
import net.minecraft.world.item.ItemStack import net.minecraft.world.item.ItemStack
import net.minecraft.world.level.ItemLike import net.minecraft.world.level.ItemLike
import ru.dbotthepony.mc.otm.core.TextComponent import ru.dbotthepony.mc.otm.util.TextComponent
import ru.dbotthepony.mc.otm.datagen.modLocation
import java.util.function.Consumer
fun AdvancementBuilder(): Advancement.Builder = Advancement.Builder.advancement() fun AdvancementBuilder(): Advancement.Builder = Advancement.Builder.advancement()
fun Advancement.Builder.save(serializer: Consumer<AdvancementHolder>, name: ResourceLocation): AdvancementHolder {
val built = build(name)
serializer.accept(built)
return built
}
fun advancementLoot(location: ResourceLocation): AdvancementRewards.Builder {
return AdvancementRewards.Builder.loot(ResourceKey.create(Registries.LOOT_TABLE, location))
}
fun advancementLoot(location: String): AdvancementRewards.Builder {
return advancementLoot(modLocation(location))
}
fun AdvancementRewards.Builder.addLootTable(location: ResourceLocation): AdvancementRewards.Builder {
return addLootTable(ResourceKey.create(Registries.LOOT_TABLE, location))
}
fun DisplayInfo( fun DisplayInfo(
itemStack: ItemStack, itemStack: ItemStack,
title: Component = TextComponent("undefined"), title: Component = TextComponent("undefined"),
description: Component = TextComponent("undefined"), description: Component = TextComponent("undefined"),
background: ResourceLocation? = null, background: ResourceLocation? = null,
frameType: FrameType = FrameType.TASK, frameType: AdvancementType = AdvancementType.TASK,
showToast: Boolean = true, showToast: Boolean = true,
announceChat: Boolean = true, announceChat: Boolean = true,
hidden: Boolean = false, hidden: Boolean = false,
@ -47,7 +71,7 @@ fun Advancement.Builder.display(
title: Component = TextComponent("undefined"), title: Component = TextComponent("undefined"),
description: Component = TextComponent("undefined"), description: Component = TextComponent("undefined"),
background: ResourceLocation? = null, background: ResourceLocation? = null,
frameType: FrameType = FrameType.TASK, frameType: AdvancementType = AdvancementType.TASK,
showToast: Boolean = true, showToast: Boolean = true,
announceChat: Boolean = true, announceChat: Boolean = true,
hidden: Boolean = false, hidden: Boolean = false,
@ -57,7 +81,7 @@ fun predicate(tag: TagKey<Item>): ItemPredicate {
return ItemPredicate.Builder.item().of(tag).build() return ItemPredicate.Builder.item().of(tag).build()
} }
fun criterion(tag: TagKey<Item>): CriterionTriggerInstance { fun criterion(tag: TagKey<Item>): Criterion<*> {
return InventoryChangeTrigger.TriggerInstance.hasItems(predicate(tag)) return InventoryChangeTrigger.TriggerInstance.hasItems(predicate(tag))
} }
@ -65,7 +89,7 @@ fun predicate(item: ItemLike): ItemPredicate {
return ItemPredicate.Builder.item().of(item).build() return ItemPredicate.Builder.item().of(item).build()
} }
fun criterion(item: ItemLike): CriterionTriggerInstance { fun criterion(item: ItemLike): Criterion<*> {
return InventoryChangeTrigger.TriggerInstance.hasItems(predicate(item)) return InventoryChangeTrigger.TriggerInstance.hasItems(predicate(item))
} }

View File

@ -1,55 +1,76 @@
package ru.dbotthepony.mc.otm.datagen.advancements package ru.dbotthepony.mc.otm.datagen.advancements
import net.minecraft.advancements.Advancement import net.minecraft.advancements.AdvancementHolder
import net.minecraft.advancements.RequirementsStrategy import net.minecraft.advancements.AdvancementRequirements
import net.minecraft.network.chat.contents.TranslatableContents import net.minecraft.advancements.AdvancementType
import net.minecraft.advancements.critereon.ItemPredicate
import net.minecraft.world.item.Item import net.minecraft.world.item.Item
import net.minecraft.world.item.ItemStack import net.minecraft.world.item.ItemStack
import net.minecraftforge.common.data.ExistingFileHelper import net.minecraft.world.item.Items
import ru.dbotthepony.mc.otm.core.TranslatableComponent import ru.dbotthepony.mc.otm.util.TranslatableComponent
import ru.dbotthepony.mc.otm.core.key import ru.dbotthepony.mc.otm.util.key
import ru.dbotthepony.mc.otm.core.registryName import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.datagen.lang.MatteryLanguageProvider import ru.dbotthepony.mc.otm.datagen.lang.MatteryLanguageProvider
import ru.dbotthepony.mc.otm.datagen.modLocation import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.registry.MItemTags import ru.dbotthepony.mc.otm.registry.game.MItems
import ru.dbotthepony.mc.otm.registry.MItems import ru.dbotthepony.mc.otm.server.triggers.TakeItemOutOfReplicatorTrigger
import java.util.function.Consumer import java.util.function.Consumer
private data class CraftEntry( data class CraftEntry(
val item: Item, val item: Collection<Item>,
val englishName: String, val englishName: String,
val englishSuffix: String? = null, val englishSuffix: String? = null,
val russianName: String? = null, val russianName: String? = null,
val russianSuffix: String? = null, val russianSuffix: String? = null,
) ) {
constructor(
item: Item,
englishName: String,
englishSuffix: String? = null,
russianName: String? = null,
russianSuffix: String? = null,
) : this(listOf(item), englishName, englishSuffix, russianName, russianSuffix)
fun addMachineAdvancements(serializer: Consumer<Advancement>, existingFileHelper: ExistingFileHelper, lang: MatteryLanguageProvider) { fun make(serializer: Consumer<AdvancementHolder>, parent: AdvancementHolder, translation: MatteryLanguageProvider.MultiBuilder): AdvancementHolder {
val path = item.first().registryName!!.path
val translated = translation.add("$path.desc", "Craft a %s%s") {
russian("Создайте %s%s")
}
val translatedSuffix = translation.add("$path.suffix", if (englishSuffix != null) ". $englishSuffix" else "") {
russian(if (russianSuffix != null) ". $russianSuffix" else "")
}
return AdvancementBuilder()
.parent(parent)
.display(
itemStack = ItemStack(item.first()),
title = translation.add(path, englishName) {
if (russianName != null) {
russian(russianName)
}
},
description = TranslatableComponent(translated.contents.key, item.first().description, translatedSuffix),
)
.also {
for ((i, item) in item.withIndex()) {
it.addCriterion(i.toString(), criterion(item))
}
}
.requirements(AdvancementRequirements.Strategy.OR)
.save(serializer, modLocation("machines/$path"))
}
}
fun addMachineAdvancements(serializer: Consumer<AdvancementHolder>, lang: MatteryLanguageProvider, root: AdvancementHolder) {
val translation = lang.MultiBuilder("otm.advancements.machine") val translation = lang.MultiBuilder("otm.advancements.machine")
val root = AdvancementBuilder()
.requirements(RequirementsStrategy.OR)
.display(
itemStack = ItemStack(MItems.CHEMICAL_GENERATOR),
title = translation.add("root", "Tritanium Empowered Machinery") {
russian("Тританово запитанные механизмы")
},
description = translation.add("root.desc", "Do not drop in anything if you want the latter preserved intact") {
russian("Не роняйте ничего внутрь если хотите чтоб последнее осталось таким, какое оно есть")
},
showToast = false,
announceChat = false,
background = modLocation("textures/block/decorative/floor_tiles_gray.png")
)
.addCriterion("has_machine", criterion(MItemTags.MACHINES))
.addCriterion("has_tritanium_ingot", criterion(MItemTags.TRITANIUM_INGOTS))
.addCriterion("has_tritanium_plate_somehow", criterion(MItemTags.TRITANIUM_PLATES))
.save(serializer, modLocation("machines/root"), existingFileHelper)
val chem = AdvancementBuilder() val chem = AdvancementBuilder()
.parent(root) .parent(root)
.display( .display(
itemStack = ItemStack(MItems.CHEMICAL_GENERATOR), itemStack = ItemStack(MItems.CHEMICAL_GENERATOR[null]!!),
title = translation.add("chemical_generator", "Burning the Organics") { title = translation.add("chemical_generator", "Burning the Organics") {
russian("Сжигание органики") russian("Сжигание органики")
}, },
@ -57,13 +78,17 @@ fun addMachineAdvancements(serializer: Consumer<Advancement>, existingFileHelper
russian("Создайте химический генератор. Лучше установить его снаружи") russian("Создайте химический генератор. Лучше установить его снаружи")
}, },
) )
.addCriterion("has_machine", criterion(MItems.CHEMICAL_GENERATOR)) .also {
.save(serializer, modLocation("machines/chemical_generator"), existingFileHelper) for ((i, v) in MItems.CHEMICAL_GENERATOR.values.withIndex())
it.addCriterion("has_machine_$i", criterion(v))
}
.requirements(AdvancementRequirements.Strategy.OR)
.save(serializer, modLocation("machines/chemical_generator"))
val press = AdvancementBuilder() val press = AdvancementBuilder()
.parent(chem) .parent(chem)
.display( .display(
itemStack = ItemStack(MItems.PLATE_PRESS), itemStack = ItemStack(MItems.TWIN_PLATE_PRESS[null]!!),
title = translation.add("plate_press", "Bending the Material") { title = translation.add("plate_press", "Bending the Material") {
russian("Раскатка металла") russian("Раскатка металла")
}, },
@ -71,58 +96,147 @@ fun addMachineAdvancements(serializer: Consumer<Advancement>, existingFileHelper
russian("Создайте пресс пластин, не суйте свои или чужие конечности внутрь") russian("Создайте пресс пластин, не суйте свои или чужие конечности внутрь")
}, },
) )
.addCriterion("has_machine", criterion(MItems.PLATE_PRESS)) .also {
.save(serializer, modLocation("machines/plate_press"), existingFileHelper) for ((i, m) in MItems.TWIN_PLATE_PRESS.values.withIndex())
it.addCriterion(i.toString(), criterion(m))
}
.requirements(AdvancementRequirements.Strategy.OR)
.save(serializer, modLocation("machines/plate_press"))
val entries = listOf( CraftEntry(
CraftEntry(MItems.MATTER_SCANNER, "Scanning Things that Matter", MItems.ENERGY_SERVO.values, "Power Goes In, Powered Things Go Out",
russianName = "Сканируем вещи которые материальны"), russianName = "Энергия на вход, электроинструмент на выход").make(serializer, press, translation)
CraftEntry(MItems.PATTERN_STORAGE, "Digital Knowledge Library",
russianName = "Цифровая библиотека знаний"),
CraftEntry(MItems.MATTER_DECOMPOSER, "Decaying the Atoms", "Keep your limbs outside of the working chamber at all times",
russianName = "Разлагаем атомы", russianSuffix = "Во всех ситуациях держите свои конечности вне рабочей камеры"),
CraftEntry(MItems.MATTER_PANEL, "Indexing the Library",
russianName = "Индексируем библиотеку"),
CraftEntry(MItems.MATTER_REPLICATOR, "Local Bakery", "Now let's bake some perfect bread",
russianName = "Местная выпечка", russianSuffix = "А теперь давайте выпечем немного идеального хлеба"),
CraftEntry(MItems.MATTER_BOTTLER, "Transfusing Pure Matter", "For those who loved to play with water in their childhood",
russianName = "Переливаем чистую материю", russianSuffix = "Для тех, кто любил играться в воде в детстве"),
CraftEntry(MItems.MATTER_RECYCLER, "Refine and Redefine", "This is what waste recycling should look like",
russianName = "Переработка и перегонка", russianSuffix = "Вот он, пик переработки отходов"),
CraftEntry(MItems.MATTER_CAPACITOR_BANK, "Modular Matter Tank",
russianName = "Модульный бак материи"),
CraftEntry(MItems.ENERGY_COUNTER, "Visualize Power Burn", val scanner = CraftEntry(
russianName = "Визуализация сжигания энергии"), MItems.MATTER_SCANNER.values, "Scanning Things that Matter",
CraftEntry(MItems.BATTERY_BANK, "Batteries Not Included", "By all means avoid the urge to hammer incompatible batteries into the power bus.", russianName = "Сканируем вещи которые материальны")
russianName = "Батарейки в комплект не входят", russianSuffix = "Пожалуйста, воздержитесь от вбивания кувалдой несовместимых батарей в энергетическую шину."), val decomposer = CraftEntry(
) MItems.MATTER_DECOMPOSER.values, "Decaying the Atoms", "Keep your limbs outside of the working chamber at all times",
russianName = "Разлагаем атомы", russianSuffix = "Во всех ситуациях держите свои конечности вне рабочей камеры")
val panel = CraftEntry(
MItems.MATTER_PANEL.values, "Indexing the Library",
russianName = "Индексируем библиотеку")
val replicator = CraftEntry(
MItems.MATTER_REPLICATOR.values, "Cook with (Im)Perfection", "Now let's bake some perfect bread",
russianName = "Повар с (не) идеальностями", russianSuffix = "А теперь давайте выпечем немного идеального хлеба")
val bottler = CraftEntry(
MItems.MATTER_BOTTLER.values, "Transfusing Pure Matter", "For those who loved to play with water in their childhood",
russianName = "Переливаем чистую материю", russianSuffix = "Для тех, кто любил играться в воде в детстве")
val recycler = CraftEntry(
MItems.MATTER_RECYCLER.values, "Refine and Redefine", "This is what waste recycling should look like",
russianName = "Переработка и перегонка", russianSuffix = "Вот он, пик переработки отходов")
val capacitor = CraftEntry(
MItems.MATTER_CAPACITOR_BANK.values, "Modular Matter Tank",
russianName = "Модульный бак материи")
val built = mutableMapOf<Item, Advancement>() val counter = CraftEntry(
MItems.ENERGY_COUNTER.values, "Visualize Power Burn",
russianName = "Визуализация сжигания энергии")
val battery = CraftEntry(
MItems.BATTERY_BANK.values, "Batteries Not Included", "By all means avoid the urge to hammer incompatible batteries into the power bus.",
russianName = "Батарейки в комплект не входят", russianSuffix = "Пожалуйста, воздержитесь от вбивания кувалдой несовместимых батарей в энергетическую шину.")
for (entry in entries) { val pattern = CraftEntry(
val path = entry.item.registryName!!.path MItems.PATTERN_STORAGE, "Digital Knowledge Library",
russianName = "Цифровая библиотека знаний")
val translated = translation.add("$path.desc", "Craft a %s%s") { val reconstructor = CraftEntry(
russian("Создайте %s%s") MItems.MATTER_RECONSTRUCTOR.values, "Flipping Hourglass",
russianName = "Переворачиваем песочные часы")
decomposer.make(serializer, press, translation).also {
pattern.make(serializer, it, translation).also {
scanner.make(serializer, it, translation)
panel.make(serializer, it, translation)
replicator.make(serializer, it, translation).also {
AdvancementBuilder()
.parent(it)
.display(
itemStack = ItemStack(Items.BREAD),
title = translation.add("replicate_something", "Local Bakery") {
russian("Местная выпечка")
},
description = translation.add("replicate_something.desc", "Replicate something using Matter Replicator. If you replicated some food, be first to taste it among your company") {
russian("Среплицируйте что либо используя репликатор материи. Если это еда, то не стесняйтесь быть первым, кто попробует её на вкус среди вашей компании")
},
frameType = AdvancementType.GOAL
)
.addCriterion("replicate_something", TakeItemOutOfReplicatorTrigger.Instance(ItemPredicate.Builder.item().of(
MItems.MATTER_DUST).build(), true).criterion())
.save(serializer, modLocation("machines/replicate_something"))
AdvancementBuilder()
.parent(it)
.display(
hidden = true,
itemStack = ItemStack(MItems.MATTER_DUST),
title = translation.add("replicate_failure", "Unhealthy Flavor") {
russian("Вредная посыпка")
},
description = translation.add("replicate_failure.desc", "Experience replication failure and have your thing turn into matter dust") {
russian("Наблюдайте неудачный результат репликации, где ваш заказ рассыпался в материальную труху")
},
)
.addCriterion("replicate_failure", TakeItemOutOfReplicatorTrigger.Instance(ItemPredicate.Builder.item().of(
MItems.MATTER_DUST).build()).criterion())
.save(serializer, modLocation("machines/replicate_failure"))
}
reconstructor.make(serializer, it, translation)
} }
val translatedSuffix = translation.add("$path.suffix", if (entry.englishSuffix != null) ". " + entry.englishSuffix else "") { bottler.make(serializer, it, translation)
russian(if (entry.russianSuffix != null) ". " + entry.russianSuffix else "") recycler.make(serializer, it, translation)
capacitor.make(serializer, it, translation)
}
counter.make(serializer, press, translation).also {
battery.make(serializer, it, translation)
}
val station = CraftEntry(
MItems.ANDROID_STATION.values, "Android Home Page",
russianName = "Домашняя страница андроидов",
russianSuffix = "Только пользоваться этим устройством могут вёдра с болтами",
englishSuffix = "Except only buckets of bolts can use this thing")
val charger = CraftEntry(
MItems.ANDROID_CHARGER.values, "Android Home Router",
russianName = "Домашняя страница андроидов")
station.make(serializer, press, translation).also {
charger.make(serializer, it, translation)
}
CraftEntry(
MItems.COBBLESTONE_GENERATOR.values, "Cobblestone: Infinity + 1",
russianName = "Булыжник: бесконечность + 1",
russianSuffix = "Смотрите, чтоб он не просыпался во все сундуки",
englishSuffix = "Watch for not to spill it over all your chests").make(serializer, press, translation)
.also {
CraftEntry(
MItems.INFINITE_WATER_SOURCE, "We Got A Leak!",
russianName = "У нас утечка!",
russianSuffix = "Как это вообще возможно!?",
englishSuffix = "How is that even possible!?")
.make(serializer, it, translation)
} }
built[entry.item] = AdvancementBuilder() CraftEntry(
.parent(press) MItems.POWERED_FURNACE.values, "One Big Resistor",
.display( russianName = "Один большой резистор",
itemStack = ItemStack(entry.item), russianSuffix = "Каждый элемент электрической цепи способен испускать свет и тепло, единожды.",
title = translation.add(path, entry.englishName) { englishSuffix = "Any electrical element can emit light and heat, once.")
if (entry.russianName != null) { .make(serializer, press, translation)
russian(entry.russianName) .also {
} CraftEntry(
}, MItems.POWERED_BLAST_FURNACE.values, "Big Microwave Oven",
description = TranslatableComponent(translated.contents.key, entry.item.description, translatedSuffix), russianName = "Большая микроволновая печь").make(serializer, it, translation)
)
.addCriterion("has_machine", criterion(entry.item)) CraftEntry(
.save(serializer, modLocation("machines/$path"), existingFileHelper) MItems.POWERED_SMOKER.values, "Small Microwave Oven",
russianName = "Маленькая микроволновая печь").make(serializer, it, translation)
} }
} }

View File

@ -1,15 +1,16 @@
package ru.dbotthepony.mc.otm.datagen.blocks package ru.dbotthepony.mc.otm.datagen.blocks
import net.minecraft.world.item.DyeColor
import net.minecraft.world.level.block.Block import net.minecraft.world.level.block.Block
import net.minecraftforge.client.model.generators.BlockStateProvider import net.neoforged.neoforge.client.model.generators.BlockStateProvider
import net.minecraftforge.client.model.generators.ConfiguredModel import net.neoforged.neoforge.client.model.generators.ConfiguredModel
import net.minecraftforge.data.event.GatherDataEvent import net.neoforged.neoforge.data.event.GatherDataEvent
import ru.dbotthepony.mc.otm.core.get import ru.dbotthepony.mc.otm.util.get
import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom import ru.dbotthepony.mc.otm.util.math.BlockRotationFreedom
import ru.dbotthepony.mc.otm.core.math.yRotationBlockstateNorth import ru.dbotthepony.mc.otm.util.math.yRotationBlockstateNorth
import ru.dbotthepony.mc.otm.datagen.DataGen import ru.dbotthepony.mc.otm.datagen.DataGen
import ru.dbotthepony.mc.otm.datagen.modLocation import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.registry.MBlocks import ru.dbotthepony.mc.otm.registry.game.MBlocks
private fun nothingOrNumber(input: Int): String { private fun nothingOrNumber(input: Int): String {
if (input == 0) if (input == 0)
@ -18,35 +19,35 @@ private fun nothingOrNumber(input: Int): String {
return (input - 1).toString() return (input - 1).toString()
} }
open class BatteryBankProvider(event: GatherDataEvent) : BlockStateProvider(event.generator.packOutput, DataGen.MOD_ID, event.existingFileHelper) { open class BatteryBankProvider(event: GatherDataEvent, val color: DyeColor?) : BlockStateProvider(event.generator.packOutput, DataGen.MOD_ID, event.existingFileHelper) {
protected var block = "battery_bank" protected var block = "battery_bank"
protected var batteryPath = "block/battery/battery" protected var batteryPath = "block/battery/battery"
protected var registry: Block = MBlocks.BATTERY_BANK protected var registry: Block = MBlocks.BATTERY_BANK[color]!!
override fun registerStatesAndModels() { override fun registerStatesAndModels() {
with(getVariantBuilder(registry)) { with(getVariantBuilder(registry)) {
forAllStates { forAllStates {
ConfiguredModel.builder() ConfiguredModel.builder()
.modelFile(models().getExistingFile(modLocation("block/$block"))) .modelFile(models().getExistingFile(modLocation("block/$block${if (color != null) "_${color.name.lowercase()}" else ""}")))
.rotationY(it[BlockRotationFreedom.ONE.property].front.yRotationBlockstateNorth()) .rotationY(it[BlockRotationFreedom.HORIZONTAL.property].front.yRotationBlockstateNorth())
.build() .build()
} }
} }
} }
override fun getName(): String { override fun getName(): String {
return "Battery Bank Model Provider" return "Battery Bank Model Provider for color $color"
} }
} }
class MatterBankProvider(event: GatherDataEvent) : BatteryBankProvider(event) { class MatterBankProvider(event: GatherDataEvent, color: DyeColor?) : BatteryBankProvider(event, color) {
init { init {
block = "matter_capacitor_bank" block = "matter_capacitor_bank"
batteryPath = "block/battery/matter_capacitor" batteryPath = "block/battery/matter_capacitor"
registry = MBlocks.MATTER_CAPACITOR_BANK registry = MBlocks.MATTER_CAPACITOR_BANK[color]!!
} }
override fun getName(): String { override fun getName(): String {
return "Matter Bank Model Provider" return "Matter Bank Model Provider for color $color"
} }
} }

View File

@ -0,0 +1,117 @@
package ru.dbotthepony.mc.otm.datagen.blocks
import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.datagen.models.MatteryBlockModelProvider
import ru.dbotthepony.mc.otm.registry.game.MBlocks
fun addBlockModels(provider: MatteryBlockModelProvider) {
with(provider) {
resourceCubeAll(MBlocks.TRITANIUM_ORE)
resourceCubeAll(MBlocks.TRITANIUM_RAW_BLOCK)
resourceCubeAll(MBlocks.DEEPSLATE_TRITANIUM_ORE)
resourceCubeAll(MBlocks.TRITANIUM_INGOT_BLOCK)
resourceCubeAll(MBlocks.WITHERED_STEEL_BLOCK)
resourceCubeAll(MBlocks.DILITHIUM_ORE)
resourceCubeAll(MBlocks.DEEPSLATE_DILITHIUM_ORE)
resourceCubeAll(MBlocks.DILITHIUM_CRYSTAL_BLOCK)
provider.exec {
provider.cubeAll("reinforced_redstone_lamp", modLocation("block/reinforced_redstone_lamp"))
provider.cubeAll("reinforced_redstone_lamp_on", modLocation("block/reinforced_redstone_lamp_on"))
}
cubeAll(MBlocks.FLYWHEEL_HOUSING)
column(MBlocks.FLYWHEEL_BEARING, "block/flywheel_bearing","block/flywheel_bearing_top")
column(MBlocks.FLYWHEEL_SHAFT, "block/flywheel_shaft","block/flywheel_shaft_top")
orientable(MBlocks.FLYWHEEL_BATTERY,"block/flywheel_housing","block/flywheel_controller")
column(MBlocks.GENERATOR_BLOCK, "block/generator_block","block/generator_block_top")
cubeAllFramed("modular_frame", "block/modular_frame")
cubeAllFramed("heavy_modular_frame", "block/heavy_modular_frame")
cubeAll(MBlocks.ENERGY_INPUT_INTERFACE)
cubeAll(MBlocks.ENERGY_OUTPUT_INTERFACE)
cubeAll(MBlocks.TRITANIUM_HULL)
orientable(MBlocks.MATTER_INPUT_HATCH,"block/tritanium_hull","block/matter_input_hatch")
orientable(MBlocks.MATTER_OUTPUT_HATCH,"block/tritanium_hull","block/matter_output_hatch")
orientable(MBlocks.ENERGY_INPUT_HATCH,"block/tritanium_hull","block/energy_input_hatch")
orientable(MBlocks.ENERGY_OUTPUT_HATCH,"block/tritanium_hull","block/energy_output_hatch")
orientable(MBlocks.ITEM_INPUT_HATCH,"block/tritanium_hull","block/item_input_hatch")
orientable(MBlocks.ITEM_OUTPUT_HATCH,"block/tritanium_hull","block/item_output_hatch")
cable("crude_energy_cable", "block/power_cable_0", powered = true)
cable("regular_energy_cable", "block/power_cable_1", powered = true)
cable("advanced_energy_cable", "block/power_cable_2", powered = true)
cable("superconductor_energy_cable", "block/power_cable_3", powered = true)
cable("matter_cable", "block/matter_cable", thin = true)
cable("storage_cable", "block/storage_cable")
colored(MBlocks.COBBLESTONE_GENERATOR, listOf("0", "particle"))
colored(MBlocks.ITEM_MONITOR, listOf("0", "particle"))
colored(MBlocks.MATTER_RECONSTRUCTOR, listOf("0", "particle"))
colored(MBlocks.ENERGY_SERVO, listOf("0", "particle"))
colored("essence_storage", "_empty", listOf("0"))
colored("essence_storage", "_filled", listOf("0"))
colored("matter_capacitor_bank", listOf("1", "particle"), "mattercapacitorbank_frame")
colored("battery_bank", listOf("0", "particle"), "batterybank_frame")
colored("android_charger", "_base", listOf("0", "particle"))
colored("android_charger", "_middle", listOf("0", "particle"))
colored("android_charger", "_top", listOf("0", "particle"))
colored("chemical_generator", "_idle", listOf("0", "particle"))
colored("chemical_generator", "_working", listOf("0", "particle"))
colored("storage_power_supplier", listOf("0", "particle"))
colored("matter_panel", listOf("texture", "particle"))
colored("drive_viewer", "_idle", listOf("texture", "particle"))
colored("drive_viewer", "_working", listOf("texture", "particle"))
coloredMachineCombined("plate_press", "plate_press2", listOf("0", "particle"))
coloredMachineCombined("twin_plate_press", "plate_press2", listOf("0", "particle"))
coloredMachineCombined("matter_recycler", listOf("0", "particle"))
coloredMachineCombined("matter_scanner", listOf("texture", "particle"))
coloredMachineCombined("matter_bottler", listOf("texture", "particle"))
coloredMachineCombined("matter_decomposer", listOf("texture", "particle"))
coloredMachineCombined("matter_recycler", listOf("0", "particle"))
colored("matter_replicator", "_idle", mapOf("1" to "matter_replicator_base", "particle" to "matter_replicator_base", "texture" to "matter_replicator"))
colored("matter_replicator", "_error", mapOf("1" to "matter_replicator_base", "particle" to "matter_replicator_base", "texture" to "matter_replicator"))
colored("matter_replicator", "_working", mapOf("1" to "matter_replicator_base", "particle" to "matter_replicator_base", "texture" to "matter_replicator"))
colored("powered_smoker", "_idle", mapOf("0" to "powered_smoker_base", "1" to "powered_smoker_interior_0", "particle" to "powered_smoker_base"))
colored("powered_smoker", "_error", mapOf("0" to "powered_smoker_base", "1" to "powered_smoker_interior_2", "particle" to "powered_smoker_base"))
colored("powered_smoker", "_working", mapOf("0" to "powered_smoker_base", "1" to "powered_smoker_interior_1", "particle" to "powered_smoker_base"))
colored("powered_furnace", "_idle", mapOf("0" to "electric_furnace_offline", "particle" to "electric_furnace_offline"))
colored("powered_furnace", "_error", mapOf("0" to "electric_furnace_offline", "particle" to "electric_furnace_offline"))
colored("powered_furnace", "_working", mapOf("0" to "electric_furnace", "particle" to "electric_furnace"))
colored("powered_blast_furnace", "_idle", mapOf("texture" to "induction_furnace_offline", "particle" to "induction_furnace_offline"))
colored("powered_blast_furnace", "_error", mapOf("texture" to "induction_furnace_offline", "particle" to "induction_furnace_offline"))
colored("powered_blast_furnace", "_working", mapOf("texture" to "induction_furnace", "particle" to "induction_furnace"))
colored("android_station", "_idle", mapOf("1" to "android_station_base", "particle" to "android_station_base"))
colored("android_station", "_working", mapOf("2" to "android_station_base", "particle" to "android_station_base"))
val energyCounter = setOf(
"down", "east", "north", "south",
"north_down", "north_east", "north_west",
"south_down", "south_east", "south_west",
"up", "west",
)
for (model in energyCounter) {
colored("energy_counter_$model", listOf("texture", "particle"), "energy_counter")
}
}
}

View File

@ -2,93 +2,182 @@ package ru.dbotthepony.mc.otm.datagen.blocks
import net.minecraft.world.level.block.state.properties.BlockStateProperties import net.minecraft.world.level.block.state.properties.BlockStateProperties
import net.minecraft.world.level.block.state.properties.DoubleBlockHalf import net.minecraft.world.level.block.state.properties.DoubleBlockHalf
import net.minecraftforge.client.model.generators.ConfiguredModel import net.neoforged.neoforge.client.model.generators.ConfiguredModel
import ru.dbotthepony.mc.otm.block.CableBlock import ru.dbotthepony.mc.otm.block.CableBlock
import ru.dbotthepony.mc.otm.block.decorative.CargoCrateBlock import ru.dbotthepony.mc.otm.block.decorative.CargoCrateBlock
import ru.dbotthepony.mc.otm.block.entity.WorkerState import ru.dbotthepony.mc.otm.block.entity.WorkerState
import ru.dbotthepony.mc.otm.block.matter.MatterBottlerBlock import ru.dbotthepony.mc.otm.block.matter.MatterBottlerBlock
import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom import ru.dbotthepony.mc.otm.block.tech.AndroidChargerBlock
import ru.dbotthepony.mc.otm.core.math.xRotationBlockstateNorth import ru.dbotthepony.mc.otm.block.tech.EssenceStorageBlock
import ru.dbotthepony.mc.otm.core.math.xRotationBlockstateSouth import ru.dbotthepony.mc.otm.util.ResourceLocation
import ru.dbotthepony.mc.otm.core.math.yRotationBlockstateNorth import ru.dbotthepony.mc.otm.util.get
import ru.dbotthepony.mc.otm.core.math.yRotationBlockstateSouth import ru.dbotthepony.mc.otm.util.math.BlockRotationFreedom
import ru.dbotthepony.mc.otm.core.registryName import ru.dbotthepony.mc.otm.util.math.xRotationBlockstateNorth
import ru.dbotthepony.mc.otm.util.math.xRotationBlockstateSouth
import ru.dbotthepony.mc.otm.util.math.yRotationBlockstateNorth
import ru.dbotthepony.mc.otm.util.math.yRotationBlockstateSouth
import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.datagen.modLocation import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.registry.MBlocks import ru.dbotthepony.mc.otm.registry.game.MBlocks
import ru.dbotthepony.mc.otm.registry.MNames import ru.dbotthepony.mc.otm.registry.MNames
import ru.dbotthepony.mc.otm.registry.MRegistry import ru.dbotthepony.mc.otm.registry.MRegistry
import java.util.ArrayList
fun addBlockStates(provider: MatteryBlockStateProvider) { fun addBlockStates(provider: MatteryBlockStateProvider) {
provider.block(MBlocks.BLACK_HOLE) provider.block(MBlocks.BLACK_HOLE)
provider.block(MBlocks.ANDROID_STATION) provider.block(MBlocks.ANDROID_STATION.values)
provider.ore(MBlocks.DEEPSLATE_TRITANIUM_ORE) provider.ore(MBlocks.DEEPSLATE_TRITANIUM_ORE)
provider.ore(MBlocks.TRITANIUM_ORE) provider.ore(MBlocks.TRITANIUM_ORE)
provider.ore(MBlocks.TRITANIUM_RAW_BLOCK) provider.ore(MBlocks.TRITANIUM_RAW_BLOCK)
provider.block(MBlocks.TRITANIUM_INGOT_BLOCK) provider.block(MBlocks.TRITANIUM_INGOT_BLOCK)
provider.block(MBlocks.METAL_MESH)
provider.block(MBlocks.CHEMICAL_GENERATOR) provider.block(MBlocks.WITHERED_STEEL_BLOCK)
provider.block(MBlocks.MATTER_SCANNER) provider.exec {
provider.block(MBlocks.ITEM_MONITOR) provider.getVariantBuilder(MBlocks.ROFLITE_ALLOY_BLOCK).forAllStates {
val side1 = modLocation("block/resource/roflite_alloy_1")
val side2 = modLocation("block/resource/roflite_alloy_2")
val top = modLocation("block/resource/roflite_alloy_top")
val a = provider.models().cube(MBlocks.ROFLITE_ALLOY_BLOCK.registryName!!.path, top, top, side1, side1, side2, side2).texture("particle", side1)
val b = provider.models().cube("${MBlocks.ROFLITE_ALLOY_BLOCK.registryName!!.path}_b", top, top, side2, side2, side1, side1).texture("particle", side2)
return@forAllStates arrayOf(ConfiguredModel.builder().modelFile(a).buildLast(), ConfiguredModel.builder().modelFile(b).buildLast())
}
}
provider.ore(MBlocks.DILITHIUM_ORE)
provider.ore(MBlocks.DEEPSLATE_DILITHIUM_ORE)
provider.block(MBlocks.DILITHIUM_CRYSTAL_BLOCK)
provider.block(MBlocks.CHEMICAL_GENERATOR.values)
provider.block(MBlocks.MATTER_SCANNER.values)
provider.block(MBlocks.ITEM_MONITOR.values)
provider.block(MBlocks.HOLO_SIGN) provider.block(MBlocks.HOLO_SIGN)
provider.exec { provider.exec {
with(provider.getMultipartBuilder(MBlocks.PHANTOM_ATTRACTOR)) { with(provider.getMultipartBuilder(MBlocks.PHANTOM_ATTRACTOR)) {
for (dir in BlockRotationFreedom.ONE.possibleValues) { for (dir in BlockRotationFreedom.HORIZONTAL.possibleValues) {
part().modelFile(provider.models().getExistingFile(modLocation("block/${MNames.PHANTOM_ATTRACTOR}"))) part().modelFile(provider.models().getExistingFile(modLocation("block/${MNames.PHANTOM_ATTRACTOR}")))
.rotationY(dir.front.yRotationBlockstateNorth()) .rotationY(dir.front.yRotationBlockstateNorth())
.addModel() .addModel()
.condition(BlockStateProperties.DOUBLE_BLOCK_HALF, DoubleBlockHalf.LOWER) .condition(BlockStateProperties.DOUBLE_BLOCK_HALF, DoubleBlockHalf.LOWER)
.condition(BlockRotationFreedom.ONE.property, dir) .condition(BlockRotationFreedom.HORIZONTAL.property, dir)
.end() .end()
} }
} }
with(provider.getMultipartBuilder(MBlocks.MATTER_BOTTLER)) { for (block in MBlocks.ANDROID_CHARGER.values) {
for (dir in BlockRotationFreedom.ONE.possibleValues) { with(provider.getMultipartBuilder(block)) {
for (enum in WorkerState.SEMI_WORKER_STATE.possibleValues) { for (dir in BlockRotationFreedom.HORIZONTAL.possibleValues) {
part().modelFile(provider.models().getExistingFile(modLocation("matter_bottler_${enum.name.lowercase()}"))) for (part in AndroidChargerBlock.PART.possibleValues) {
.rotationY(dir.front.yRotationBlockstateNorth()) part().modelFile(provider.models().getExistingFile(modLocation("block/${block.registryName!!.path}_${part.serializedName}")))
.addModel() .rotationY(dir.front.yRotationBlockstateNorth())
.condition(BlockRotationFreedom.ONE.property, dir) .addModel()
.condition(WorkerState.WORKER_STATE, enum) .condition(AndroidChargerBlock.PART, part)
.end() .condition(BlockRotationFreedom.HORIZONTAL.property, dir)
.end()
}
} }
} }
}
for (dir in BlockRotationFreedom.ONE.possibleValues) { for (block in MBlocks.MATTER_BOTTLER.values) {
for (enum in MatterBottlerBlock.SLOT_PROPERTIES) { with(provider.getMultipartBuilder(block)) {
part().modelFile(provider.models().getExistingFile(modLocation("matter_bottler_${enum.name}_open"))) for (dir in BlockRotationFreedom.HORIZONTAL.possibleValues) {
.rotationY(dir.front.yRotationBlockstateNorth()) for (enum in WorkerState.SEMI_WORKER_STATE.possibleValues) {
.addModel() part().modelFile(provider.models().getExistingFile(modLocation("matter_bottler_${enum.name.lowercase()}")))
.condition(BlockRotationFreedom.ONE.property, dir) .rotationY(dir.front.yRotationBlockstateNorth())
.condition(enum, false) .addModel()
.end() .condition(BlockRotationFreedom.HORIZONTAL.property, dir)
.condition(WorkerState.WORKER_STATE, enum)
.end()
}
}
part().modelFile(provider.models().getExistingFile(modLocation("matter_bottler_${enum.name}_closed"))) for (dir in BlockRotationFreedom.HORIZONTAL.possibleValues) {
.rotationY(dir.front.yRotationBlockstateNorth()) for (enum in MatterBottlerBlock.SLOT_PROPERTIES) {
.addModel() part().modelFile(provider.models().getExistingFile(modLocation("matter_bottler_${enum.name}_open")))
.condition(BlockRotationFreedom.ONE.property, dir) .rotationY(dir.front.yRotationBlockstateNorth())
.condition(enum, true) .addModel()
.end() .condition(BlockRotationFreedom.HORIZONTAL.property, dir)
.condition(enum, false)
.end()
part().modelFile(provider.models().getExistingFile(modLocation("matter_bottler_${enum.name}_closed")))
.rotationY(dir.front.yRotationBlockstateNorth())
.addModel()
.condition(BlockRotationFreedom.HORIZONTAL.property, dir)
.condition(enum, true)
.end()
}
} }
} }
} }
} }
provider.block(MBlocks.MATTER_DECOMPOSER) provider.block(MBlocks.MATTER_DECOMPOSER.values)
provider.block(MBlocks.MATTER_REPLICATOR) provider.block(MBlocks.MATTER_REPLICATOR.values)
provider.block(MBlocks.PLATE_PRESS) provider.block(MBlocks.MATTER_ENTANGLER)
provider.block(MBlocks.PLATE_PRESS.values)
provider.block(MBlocks.TWIN_PLATE_PRESS.values)
provider.block(MBlocks.GRAVITATION_STABILIZER) provider.block(MBlocks.GRAVITATION_STABILIZER)
provider.block(MBlocks.GRAVITATION_STABILIZER_LENS) provider.block(MBlocks.GRAVITATION_STABILIZER_LENS)
provider.block(MBlocks.STORAGE_POWER_SUPPLIER) provider.block(MBlocks.POWERED_BLAST_FURNACE.values)
provider.block(MBlocks.MATTER_RECYCLER) provider.block(MBlocks.POWERED_FURNACE.values)
provider.block(MBlocks.MATTER_RECONSTRUCTOR) provider.block(MBlocks.POWERED_SMOKER.values)
provider.block(MBlocks.ENERGY_SERVO)
provider.block(MBlocks.COBBLESTONE_GENERATOR) provider.block(MBlocks.STORAGE_POWER_SUPPLIER.values)
provider.block(MBlocks.ESSENCE_STORAGE) provider.block(MBlocks.MATTER_PANEL.values)
provider.block(MBlocks.MATTER_RECYCLER.values)
provider.block(MBlocks.MATTER_RECONSTRUCTOR.values)
provider.block(MBlocks.ENERGY_SERVO.values)
provider.block(MBlocks.COBBLESTONE_GENERATOR.values)
provider.block(MBlocks.DRIVE_RACK)
provider.block(MBlocks.PAINTER)
provider.block(MBlocks.INFINITE_WATER_SOURCE)
provider.exec {
provider.getVariantBuilder(MBlocks.REDSTONE_LAMP_INVERTED)
.forAllStates {
ConfiguredModel.builder()
.modelFile(provider.models().getExistingFile(ResourceLocation("minecraft", "redstone_lamp${if (it[BlockStateProperties.LIT]) "" else "_on"}")))
.build()
}
provider.getVariantBuilder(MBlocks.REINFORCED_REDSTONE_LAMP)
.forAllStates {
ConfiguredModel.builder()
.modelFile(provider.models().getExistingFile(modLocation("reinforced_redstone_lamp${if (it[BlockStateProperties.LIT]) "_on" else ""}")))
.build()
}
provider.getVariantBuilder(MBlocks.REINFORCED_REDSTONE_LAMP_INVERTED)
.forAllStates {
ConfiguredModel.builder()
.modelFile(provider.models().getExistingFile(modLocation("reinforced_redstone_lamp${if (it[BlockStateProperties.LIT]) "" else "_on"}")))
.build()
}
}
provider.exec {
for (block in MBlocks.ESSENCE_STORAGE.values) {
provider.getVariantBuilder(block).forAllStates {
return@forAllStates arrayOf(
ConfiguredModel.builder()
.modelFile(provider.models().getExistingFile(
modLocation("${block.registryName!!.path}_${if (it.getValue(
EssenceStorageBlock.FILLED)) "filled" else "empty"}")
))
.rotationY(it.getValue(BlockRotationFreedom.HORIZONTAL.property).front.yRotationBlockstateNorth())
.buildLast()
)
}
}
}
provider.exec { provider.exec {
for (crate in MRegistry.CARGO_CRATES.allBlocks.values) { for (crate in MRegistry.CARGO_CRATES.allBlocks.values) {
@ -99,19 +188,19 @@ fun addBlockStates(provider: MatteryBlockStateProvider) {
modLocation("${crate.registryName!!.path}_${if (it.getValue( modLocation("${crate.registryName!!.path}_${if (it.getValue(
CargoCrateBlock.IS_OPEN)) "open" else "closed"}") CargoCrateBlock.IS_OPEN)) "open" else "closed"}")
)) ))
.rotationY(it.getValue(BlockRotationFreedom.ONE.property).front.yRotationBlockstateNorth()) .rotationY(it.getValue(BlockRotationFreedom.HORIZONTAL.property).front.yRotationBlockstateNorth())
.buildLast() .buildLast()
) )
} }
} }
with(provider.getMultipartBuilder(MBlocks.STORAGE_BUS)) { with(provider.getMultipartBuilder(MBlocks.STORAGE_BUS)) {
for (dir in BlockRotationFreedom.TWO.possibleValues) { for (dir in BlockRotationFreedom.DIRECTIONAL.possibleValues) {
part().modelFile(provider.models().getExistingFile(modLocation("storage_bus"))) part().modelFile(provider.models().getExistingFile(modLocation("storage_bus")))
.rotationX(dir.front.xRotationBlockstateNorth()) .rotationX(dir.front.xRotationBlockstateNorth())
.rotationY(dir.front.yRotationBlockstateNorth()) .rotationY(dir.front.yRotationBlockstateNorth())
.addModel() .addModel()
.condition(BlockRotationFreedom.TWO.property, dir) .condition(BlockRotationFreedom.DIRECTIONAL.property, dir)
.end() .end()
part().modelFile(provider.models().getExistingFile(modLocation("storage_cable_connection"))) part().modelFile(provider.models().getExistingFile(modLocation("storage_cable_connection")))
@ -127,12 +216,12 @@ fun addBlockStates(provider: MatteryBlockStateProvider) {
} }
with(provider.getMultipartBuilder(MBlocks.STORAGE_IMPORTER)) { with(provider.getMultipartBuilder(MBlocks.STORAGE_IMPORTER)) {
for (dir in BlockRotationFreedom.TWO.possibleValues) { for (dir in BlockRotationFreedom.DIRECTIONAL.possibleValues) {
part().modelFile(provider.models().getExistingFile(modLocation("storage_importer"))) part().modelFile(provider.models().getExistingFile(modLocation("storage_importer")))
.rotationX(dir.front.xRotationBlockstateNorth()) .rotationX(dir.front.xRotationBlockstateNorth())
.rotationY(dir.front.yRotationBlockstateNorth()) .rotationY(dir.front.yRotationBlockstateNorth())
.addModel() .addModel()
.condition(BlockRotationFreedom.TWO.property, dir) .condition(BlockRotationFreedom.DIRECTIONAL.property, dir)
.end() .end()
part().modelFile(provider.models().getExistingFile(modLocation("storage_cable_connection"))) part().modelFile(provider.models().getExistingFile(modLocation("storage_cable_connection")))
@ -148,12 +237,12 @@ fun addBlockStates(provider: MatteryBlockStateProvider) {
} }
with(provider.getMultipartBuilder(MBlocks.STORAGE_EXPORTER)) { with(provider.getMultipartBuilder(MBlocks.STORAGE_EXPORTER)) {
for (dir in BlockRotationFreedom.TWO.possibleValues) { for (dir in BlockRotationFreedom.DIRECTIONAL.possibleValues) {
part().modelFile(provider.models().getExistingFile(modLocation("storage_exporter"))) part().modelFile(provider.models().getExistingFile(modLocation("storage_exporter")))
.rotationX(dir.front.xRotationBlockstateNorth()) .rotationX(dir.front.xRotationBlockstateNorth())
.rotationY(dir.front.yRotationBlockstateNorth()) .rotationY(dir.front.yRotationBlockstateNorth())
.addModel() .addModel()
.condition(BlockRotationFreedom.TWO.property, dir) .condition(BlockRotationFreedom.DIRECTIONAL.property, dir)
.end() .end()
part().modelFile(provider.models().getExistingFile(modLocation("storage_cable_connection"))) part().modelFile(provider.models().getExistingFile(modLocation("storage_cable_connection")))
@ -167,5 +256,121 @@ fun addBlockStates(provider: MatteryBlockStateProvider) {
part().modelFile(provider.models().getExistingFile(modLocation("storage_cable_core"))) part().modelFile(provider.models().getExistingFile(modLocation("storage_cable_core")))
.addModel().end() .addModel().end()
} }
with(provider.getMultipartBuilder(MBlocks.MATTER_CABLE)) {
for (dir in BlockRotationFreedom.DIRECTIONAL.possibleValues) {
part().modelFile(provider.models().getExistingFile(modLocation("matter_cable_connection")))
.rotationX(dir.front.xRotationBlockstateSouth())
.rotationY(dir.front.yRotationBlockstateSouth())
.addModel()
.condition(CableBlock.MAPPING_CONNECTION_PROP[dir.front]!!, true)
.end()
}
part().modelFile(provider.models().getExistingFile(modLocation("matter_cable_core")))
.addModel().end()
}
with(provider.getMultipartBuilder(MBlocks.STORAGE_CABLE)) {
for (dir in BlockRotationFreedom.DIRECTIONAL.possibleValues) {
part().modelFile(provider.models().getExistingFile(modLocation("storage_cable_connection")))
.rotationX(dir.front.xRotationBlockstateSouth())
.rotationY(dir.front.yRotationBlockstateSouth())
.addModel()
.condition(CableBlock.MAPPING_CONNECTION_PROP[dir.front]!!, true)
.end()
}
part().modelFile(provider.models().getExistingFile(modLocation("storage_cable_core")))
.addModel().end()
}
for (block in MBlocks.ENERGY_CABLES) {
with(provider.getMultipartBuilder(block.value)) {
for (dir in BlockRotationFreedom.DIRECTIONAL.possibleValues) {
part().modelFile(provider.models().getExistingFile(modLocation("${block.value.registryName!!.path}_connection")))
.rotationX(dir.front.xRotationBlockstateSouth())
.rotationY(dir.front.yRotationBlockstateSouth())
.addModel()
.condition(CableBlock.MAPPING_CONNECTION_PROP[dir.front]!!, true)
.condition(BlockStateProperties.POWERED, false)
.end()
part().modelFile(provider.models().getExistingFile(modLocation("${block.value.registryName!!.path}_connection_powered")))
.rotationX(dir.front.xRotationBlockstateSouth())
.rotationY(dir.front.yRotationBlockstateSouth())
.addModel()
.condition(CableBlock.MAPPING_CONNECTION_PROP[dir.front]!!, true)
.condition(BlockStateProperties.POWERED, true)
.end()
}
part().modelFile(provider.models().getExistingFile(modLocation("${block.value.registryName!!.path}_core")))
.addModel().condition(BlockStateProperties.POWERED, false).end()
part().modelFile(provider.models().getExistingFile(modLocation("${block.value.registryName!!.path}_core_powered")))
.addModel().condition(BlockStateProperties.POWERED, true).end()
}
}
provider.getVariantBuilder(MBlocks.METAL_JUNK).forAllStates {
val generated = ArrayList<ConfiguredModel>()
for (suffix in arrayOf("_a", "_b", "_c", "_d")) {
val model = provider.models().cubeAll("block/metal_junk$suffix", modLocation("block/decorative/metal_junk$suffix"))
generated.add(with(ConfiguredModel.builder()) {
modelFile(model)
return@with buildLast()
})
generated.add(with(ConfiguredModel.builder()) {
modelFile(model)
rotationY(180)
return@with buildLast()
})
}
return@forAllStates generated.toTypedArray()
}
provider.getVariantBuilder(MBlocks.DANGER_STRIPE_BLOCK).forAllStates {
val generated = ArrayList<ConfiguredModel>()
for (suffix in arrayOf("_0", "_1")) {
generated.add(with(ConfiguredModel.builder()) {
modelFile(provider.models().cubeAll("block/danger_stripe_block$suffix", modLocation("block/decorative/danger_stripe_block$suffix")))
return@with buildLast()
})
}
return@forAllStates generated.toTypedArray()
}
} }
provider.block(MBlocks.TRITANIUM_HULL)
provider.block(MBlocks.FLYWHEEL_HOUSING)
provider.block(MBlocks.FLYWHEEL_BEARING)
provider.block(MBlocks.FLYWHEEL_SHAFT)
provider.block(MBlocks.FLYWHEEL_BATTERY)
provider.block(MBlocks.GENERATOR_BLOCK)
provider.block(MBlocks.MODULAR_FRAME)
provider.block(MBlocks.HEAVY_MODULAR_FRAME)
provider.block(MBlocks.ENERGY_INPUT_INTERFACE)
provider.block(MBlocks.ENERGY_OUTPUT_INTERFACE)
provider.block(MBlocks.ENERGY_INPUT_HATCH)
provider.block(MBlocks.ENERGY_OUTPUT_HATCH)
provider.block(MBlocks.MATTER_INPUT_HATCH)
provider.block(MBlocks.MATTER_OUTPUT_HATCH)
provider.block(MBlocks.ITEM_INPUT_HATCH)
provider.block(MBlocks.ITEM_OUTPUT_HATCH)
} }

View File

@ -5,91 +5,97 @@ import ru.dbotthepony.mc.otm.block.tech.EnergyCounterBlock
import ru.dbotthepony.mc.otm.block.entity.WorkerState import ru.dbotthepony.mc.otm.block.entity.WorkerState
import ru.dbotthepony.mc.otm.block.matter.PatternStorageBlock import ru.dbotthepony.mc.otm.block.matter.PatternStorageBlock
import ru.dbotthepony.mc.otm.block.storage.DriveViewerBlock import ru.dbotthepony.mc.otm.block.storage.DriveViewerBlock
import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom import ru.dbotthepony.mc.otm.util.math.BlockRotationFreedom
import ru.dbotthepony.mc.otm.core.math.yRotationBlockstateNorth import ru.dbotthepony.mc.otm.util.math.yRotationBlockstateNorth
import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.datagen.modLocation import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.registry.MBlocks import ru.dbotthepony.mc.otm.registry.game.MBlocks
fun addComplexBlockStates(provider: MatteryBlockStateProvider) { fun addComplexBlockStates(provider: MatteryBlockStateProvider) {
with(provider.getMultipartBuilder(MBlocks.DRIVE_VIEWER)) { for (block in MBlocks.DRIVE_VIEWER.values) {
for (facing in BlockRotationFreedom.ONE.possibleValues) { with(provider.getMultipartBuilder(block)) {
part() for (facing in BlockRotationFreedom.HORIZONTAL.possibleValues) {
.modelFile(provider.models().getExistingFile(modLocation("block/drive_viewer_drive_part")))
.rotationY(facing.front.yRotationBlockstateNorth())
.addModel()
.condition(BlockRotationFreedom.ONE.property, facing)
.condition(DriveViewerBlock.DRIVE_PRESENT, true)
for (workState in WorkerState.SEMI_WORKER_STATE.possibleValues) {
part() part()
.modelFile(provider.models().getExistingFile(modLocation("block/drive_viewer_${workState.name.lowercase()}"))) .modelFile(provider.models().getExistingFile(modLocation("block/drive_viewer_drive_part")))
.rotationY(facing.front.yRotationBlockstateNorth()) .rotationY(facing.front.yRotationBlockstateNorth())
.addModel() .addModel()
.condition(WorkerState.SEMI_WORKER_STATE, workState) .condition(BlockRotationFreedom.HORIZONTAL.property, facing)
.condition(BlockRotationFreedom.ONE.property, facing) .condition(DriveViewerBlock.DRIVE_PRESENT, true)
for (workState in WorkerState.SEMI_WORKER_STATE.possibleValues) {
part()
.modelFile(provider.models().getExistingFile(modLocation("block/${block.registryName!!.path}_${workState.name.lowercase()}")))
.rotationY(facing.front.yRotationBlockstateNorth())
.addModel()
.condition(WorkerState.SEMI_WORKER_STATE, workState)
.condition(BlockRotationFreedom.HORIZONTAL.property, facing)
}
} }
} }
} }
with(provider.getMultipartBuilder(MBlocks.PATTERN_STORAGE)) { with(provider.getMultipartBuilder(MBlocks.PATTERN_STORAGE)) {
for (facing in BlockRotationFreedom.ONE.possibleValues) { for (facing in BlockRotationFreedom.HORIZONTAL.possibleValues) {
part() part()
.modelFile(provider.models().getExistingFile(modLocation("block/pattern_storage"))) .modelFile(provider.models().getExistingFile(modLocation("block/pattern_storage")))
.rotationY(facing.front.yRotationBlockstateNorth()) .rotationY(facing.front.yRotationBlockstateNorth())
.addModel() .addModel()
.condition(BlockRotationFreedom.ONE.property, facing) .condition(BlockRotationFreedom.HORIZONTAL.property, facing)
for (i in 0 .. 7) { for (i in 0 .. 7) {
part() part()
.modelFile(provider.models().getExistingFile(modLocation("block/pattern/model$i"))) .modelFile(provider.models().getExistingFile(modLocation("block/pattern/model$i")))
.rotationY(facing.front.yRotationBlockstateNorth()) .rotationY(facing.front.yRotationBlockstateNorth())
.addModel() .addModel()
.condition(BlockRotationFreedom.ONE.property, facing) .condition(BlockRotationFreedom.HORIZONTAL.property, facing)
.condition(PatternStorageBlock.PATTERN_STORAGE_DISKS_PROPS[i], true) .condition(PatternStorageBlock.PATTERN_STORAGE_DISKS_PROPS[i], true)
} }
} }
} }
with(provider.getMultipartBuilder(MBlocks.ENERGY_COUNTER)) { for ((dye, block) in MBlocks.ENERGY_COUNTER) {
// даваааййй with(provider.getMultipartBuilder(block)) {
val up = provider.models().getExistingFile(modLocation("block/energy_counter_up")) val dyeName = dye?.name?.lowercase()?.let { "_$it" } ?: ""
val down = provider.models().getExistingFile(modLocation("block/energy_counter_down")) // даваааййй
val west = provider.models().getExistingFile(modLocation("block/energy_counter_west")) val up = provider.models().getExistingFile(modLocation("block/energy_counter_up$dyeName"))
val east = provider.models().getExistingFile(modLocation("block/energy_counter_east")) val down = provider.models().getExistingFile(modLocation("block/energy_counter_down$dyeName"))
val west = provider.models().getExistingFile(modLocation("block/energy_counter_west$dyeName"))
val east = provider.models().getExistingFile(modLocation("block/energy_counter_east$dyeName"))
// ДАААА ДАВАЙЙ ДАААВАААЙЙЙЙЙЙ // ДАААА ДАВАЙЙ ДАААВАААЙЙЙЙЙЙ
val north = provider.models().getExistingFile(modLocation("block/energy_counter_north")) val north = provider.models().getExistingFile(modLocation("block/energy_counter_north$dyeName"))
val northDown = provider.models().getExistingFile(modLocation("block/energy_counter_north_down")) val northDown = provider.models().getExistingFile(modLocation("block/energy_counter_north_down$dyeName"))
val northEast = provider.models().getExistingFile(modLocation("block/energy_counter_north_east")) val northEast = provider.models().getExistingFile(modLocation("block/energy_counter_north_east$dyeName"))
val northWest = provider.models().getExistingFile(modLocation("block/energy_counter_north_west")) val northWest = provider.models().getExistingFile(modLocation("block/energy_counter_north_west$dyeName"))
val south = provider.models().getExistingFile(modLocation("block/energy_counter_south")) val south = provider.models().getExistingFile(modLocation("block/energy_counter_south$dyeName"))
val southDown = provider.models().getExistingFile(modLocation("block/energy_counter_south_down")) val southDown = provider.models().getExistingFile(modLocation("block/energy_counter_south_down$dyeName"))
val southEast = provider.models().getExistingFile(modLocation("block/energy_counter_south_east")) val southEast = provider.models().getExistingFile(modLocation("block/energy_counter_south_east$dyeName"))
val southWest = provider.models().getExistingFile(modLocation("block/energy_counter_south_west")) val southWest = provider.models().getExistingFile(modLocation("block/energy_counter_south_west$dyeName"))
for (dir in arrayOf(Direction.EAST, Direction.WEST, Direction.SOUTH, Direction.NORTH)) { for (dir in arrayOf(Direction.EAST, Direction.WEST, Direction.SOUTH, Direction.NORTH)) {
part().modelFile(down).rotationY(dir.yRotationBlockstateNorth()).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.UP).condition(EnergyCounterBlock.IF_DIRECTION, dir) part().modelFile(down).rotationY(dir.yRotationBlockstateNorth()).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.UP).condition(EnergyCounterBlock.IF_DIRECTION, dir)
part().modelFile(up).rotationY(dir.yRotationBlockstateNorth()).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.DOWN).condition(EnergyCounterBlock.IF_DIRECTION, dir) part().modelFile(up).rotationY(dir.yRotationBlockstateNorth()).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.DOWN).condition(EnergyCounterBlock.IF_DIRECTION, dir)
} }
// низкий поклон за полностью рабочий поворот вокруг оси Z // низкий поклон за полностью рабочий поворот вокруг оси Z
part().modelFile(north).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.NORTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.UP) part().modelFile(north).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.NORTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.UP)
part().modelFile(northDown).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.NORTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.DOWN) part().modelFile(northDown).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.NORTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.DOWN)
part().modelFile(northEast).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.NORTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.EAST) part().modelFile(northEast).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.NORTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.EAST)
part().modelFile(northWest).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.NORTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.WEST) part().modelFile(northWest).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.NORTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.WEST)
part().modelFile(south).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.SOUTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.UP) part().modelFile(south).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.SOUTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.UP)
part().modelFile(southDown).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.SOUTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.DOWN) part().modelFile(southDown).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.SOUTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.DOWN)
part().modelFile(southEast).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.SOUTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.EAST) part().modelFile(southEast).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.SOUTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.EAST)
part().modelFile(southWest).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.SOUTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.WEST) part().modelFile(southWest).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.SOUTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.WEST)
for (dir in arrayOf(Direction.WEST, Direction.EAST)) { for (dir in arrayOf(Direction.WEST, Direction.EAST)) {
val mdl = if (dir === Direction.WEST) west else east val mdl = if (dir === Direction.WEST) west else east
part().modelFile(mdl).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, dir).condition(EnergyCounterBlock.IF_DIRECTION, Direction.NORTH) part().modelFile(mdl).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, dir).condition(EnergyCounterBlock.IF_DIRECTION, Direction.NORTH)
part().modelFile(mdl).rotationX(-90).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, dir).condition(EnergyCounterBlock.IF_DIRECTION, Direction.UP) part().modelFile(mdl).rotationX(-90).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, dir).condition(EnergyCounterBlock.IF_DIRECTION, Direction.UP)
part().modelFile(mdl).rotationX(180).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, dir).condition(EnergyCounterBlock.IF_DIRECTION, Direction.SOUTH) part().modelFile(mdl).rotationX(180).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, dir).condition(EnergyCounterBlock.IF_DIRECTION, Direction.SOUTH)
part().modelFile(mdl).rotationX(90).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, dir).condition(EnergyCounterBlock.IF_DIRECTION, Direction.DOWN) part().modelFile(mdl).rotationX(90).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, dir).condition(EnergyCounterBlock.IF_DIRECTION, Direction.DOWN)
}
} }
} }
} }

View File

@ -1,19 +1,22 @@
package ru.dbotthepony.mc.otm.datagen.blocks package ru.dbotthepony.mc.otm.datagen.blocks
import net.minecraft.core.Direction
import net.minecraft.resources.ResourceLocation
import net.minecraft.world.level.block.Block import net.minecraft.world.level.block.Block
import net.minecraft.world.level.block.RotatedPillarBlock
import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.state.BlockState
import net.minecraftforge.client.model.generators.BlockStateProvider import net.neoforged.neoforge.client.model.generators.BlockStateProvider
import net.minecraftforge.client.model.generators.ConfiguredModel import net.neoforged.neoforge.client.model.generators.ConfiguredModel
import net.minecraftforge.data.event.GatherDataEvent import net.neoforged.neoforge.data.event.GatherDataEvent
import ru.dbotthepony.mc.otm.block.entity.WorkerState import ru.dbotthepony.mc.otm.block.entity.WorkerState
import ru.dbotthepony.mc.otm.core.getValueNullable import ru.dbotthepony.mc.otm.util.getValueNullable
import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom import ru.dbotthepony.mc.otm.util.math.BlockRotationFreedom
import ru.dbotthepony.mc.otm.core.math.xRotationBlockstateNorth import ru.dbotthepony.mc.otm.util.math.xRotationBlockstateNorth
import ru.dbotthepony.mc.otm.core.math.yRotationBlockstateNorth import ru.dbotthepony.mc.otm.util.math.yRotationBlockstateNorth
import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.datagen.DataGen import ru.dbotthepony.mc.otm.datagen.DataGen
import ru.dbotthepony.mc.otm.core.registryName
import ru.dbotthepony.mc.otm.datagen.modLocation import ru.dbotthepony.mc.otm.datagen.modLocation
import java.util.LinkedList import java.util.*
typealias BlockStateTransform = (state: BlockState, builder: ConfiguredModel.Builder<*>, path: String) -> String? typealias BlockStateTransform = (state: BlockState, builder: ConfiguredModel.Builder<*>, path: String) -> String?
private val EMPTY: BlockStateTransform = { _, _, _ -> null } private val EMPTY: BlockStateTransform = { _, _, _ -> null }
@ -21,16 +24,16 @@ private val EMPTY: BlockStateTransform = { _, _, _ -> null }
private fun initialTransform(it: BlockState, modelPath: String, builder: ConfiguredModel.Builder<*>): String { private fun initialTransform(it: BlockState, modelPath: String, builder: ConfiguredModel.Builder<*>): String {
@Suppress("NAME_SHADOWING") var modelPath = modelPath @Suppress("NAME_SHADOWING") var modelPath = modelPath
it.getValueNullable(BlockRotationFreedom.ONE.property)?.let { it.getValueNullable(BlockRotationFreedom.HORIZONTAL.property)?.let {
builder.rotationY(it.front.yRotationBlockstateNorth()) builder.rotationY(it.front.yRotationBlockstateNorth())
} }
it.getValueNullable(BlockRotationFreedom.TWO.property)?.let { it.getValueNullable(BlockRotationFreedom.DIRECTIONAL.property)?.let {
builder.rotationY(it.front.yRotationBlockstateNorth()) builder.rotationY(it.front.yRotationBlockstateNorth())
builder.rotationX(it.front.xRotationBlockstateNorth()) builder.rotationX(it.front.xRotationBlockstateNorth())
} }
it.getValueNullable(BlockRotationFreedom.THREE.property)?.let { it.getValueNullable(BlockRotationFreedom.DIRECTIONAL_WITH_ROTATION.property)?.let {
builder.rotationY(it.front.yRotationBlockstateNorth() + it.top.yRotationBlockstateNorth()) builder.rotationY(it.front.yRotationBlockstateNorth() + it.top.yRotationBlockstateNorth())
builder.rotationX(it.front.xRotationBlockstateNorth()) builder.rotationX(it.front.xRotationBlockstateNorth())
} }
@ -54,10 +57,10 @@ class MatteryBlockStateProvider(event: GatherDataEvent) : BlockStateProvider(eve
return this return this
} }
fun block(block: Block, func: BlockStateTransform) = exec { fun block(block: Block, model: String = "block/${block.registryName!!.path}", func: BlockStateTransform = EMPTY) = exec {
getVariantBuilder(block).forAllStates { getVariantBuilder(block).forAllStates {
val builder = ConfiguredModel.builder() val builder = ConfiguredModel.builder()
var modelPath = initialTransform(it, "block/${block.registryName!!.path}", builder) var modelPath = initialTransform(it, model, builder)
modelPath = func(it, builder, modelPath) ?: modelPath modelPath = func(it, builder, modelPath) ?: modelPath
builder.modelFile(models().getExistingFile(modLocation(modelPath))) builder.modelFile(models().getExistingFile(modLocation(modelPath)))
@ -68,7 +71,7 @@ class MatteryBlockStateProvider(event: GatherDataEvent) : BlockStateProvider(eve
fun block(blocks: Collection<Block>): MatteryBlockStateProvider { fun block(blocks: Collection<Block>): MatteryBlockStateProvider {
for (block in blocks) { for (block in blocks) {
this.block(block, EMPTY) this.block(block)
} }
return this return this
@ -76,19 +79,40 @@ class MatteryBlockStateProvider(event: GatherDataEvent) : BlockStateProvider(eve
fun block(vararg blocks: Block): MatteryBlockStateProvider { fun block(vararg blocks: Block): MatteryBlockStateProvider {
for (block in blocks) { for (block in blocks) {
this.block(block, EMPTY) block(block)
} }
return this return this
} }
fun simpleBlockM(vararg blocks: Block): MatteryBlockStateProvider { fun simpleBlockM(vararg blocks: Block): MatteryBlockStateProvider {
for (block in blocks) {
simpleBlockM(block)
}
return this
}
fun simpleBlockM(block: Block, model: ResourceLocation = checkNotNull(block.registryName) {"$block registry name is null!"}): MatteryBlockStateProvider {
exec {
getVariantBuilder(block).forAllStates {
return@forAllStates arrayOf(ConfiguredModel(models().getExistingFile(model)))
}
}
return this
}
fun simplePillar(vararg blocks: Block): MatteryBlockStateProvider {
for (block in blocks) { for (block in blocks) {
exec { exec {
getVariantBuilder(block).forAllStates { getVariantBuilder(block)
check(block.registryName != null) {"$block registry name is null!"} .partialState().with(RotatedPillarBlock.AXIS, Direction.Axis.Y)
return@forAllStates arrayOf(ConfiguredModel(models().getExistingFile(block.registryName))) .modelForState().modelFile(models().getExistingFile(block.registryName)).addModel()
} .partialState().with(RotatedPillarBlock.AXIS, Direction.Axis.Z)
.modelForState().modelFile(models().getExistingFile(block.registryName)).rotationX(90).addModel()
.partialState().with(RotatedPillarBlock.AXIS, Direction.Axis.X)
.modelForState().modelFile(models().getExistingFile(block.registryName)).rotationX(90).rotationY(90).addModel()
} }
} }

View File

@ -1,15 +1,16 @@
package ru.dbotthepony.mc.otm.datagen.items package ru.dbotthepony.mc.otm.datagen.items
import net.minecraft.world.item.DyeColor import net.minecraft.world.item.DyeColor
import ru.dbotthepony.mc.otm.core.registryName import ru.dbotthepony.mc.otm.util.ResourceLocation
import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.datagen.modLocation import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.registry.MItems import ru.dbotthepony.mc.otm.registry.game.MItems
import ru.dbotthepony.mc.otm.registry.MRegistry import ru.dbotthepony.mc.otm.registry.MRegistry
fun addItemModels(provider: MatteryItemModelProvider) { fun addItemModels(provider: MatteryItemModelProvider) {
provider.block(MItems.ANDROID_STATION, "android_station_working") provider.coloredWithBaseBlock(MItems.ANDROID_STATION, "android_station", "_working")
provider.block(MItems.BATTERY_BANK) provider.coloredWithBaseBlock(MItems.BATTERY_BANK, "matter_capacitor_bank")
provider.block(MItems.MATTER_CAPACITOR_BANK) provider.coloredWithBaseBlock(MItems.MATTER_CAPACITOR_BANK, "matter_capacitor_bank")
provider.block(MItems.PATTERN_STORAGE) provider.block(MItems.PATTERN_STORAGE)
provider.exec { provider.exec {
@ -20,23 +21,36 @@ fun addItemModels(provider: MatteryItemModelProvider) {
} }
provider.block(MItems.CARBON_FIBRE_BLOCK) provider.block(MItems.CARBON_FIBRE_BLOCK)
provider.block(MItems.METAL_JUNK) provider.block(MItems.METAL_JUNK, MItems.METAL_JUNK.registryName!!.path + "_a")
provider.block(MItems.METAL_MESH) provider.block(MItems.METAL_MESH)
provider.generatedTranslucent(MItems.TRITANIUM_BARS, modLocation("block/decorative/tritanium_bars")) provider.generatedTranslucent(MItems.TRITANIUM_BARS, modLocation("block/decorative/tritanium_bars"))
provider.block(MItems.DEEPSLATE_TRITANIUM_ORE) provider.generatedTranslucent(MItems.METAL_RAILING, modLocation("block/decorative/metal_railing"))
provider.block(MItems.TRITANIUM_ORE) provider.blocks(MItems.TRITANIUM_STRIPED_BLOCK.values)
provider.block(MItems.TRITANIUM_STRIPED_BLOCK) provider.coloredWithBaseBlock(MItems.ITEM_MONITOR, "item_monitor")
provider.block(MItems.TRITANIUM_RAW_BLOCK)
provider.block(MItems.TRITANIUM_INGOT_BLOCK)
provider.block(MItems.ITEM_MONITOR)
provider.block(MItems.PHANTOM_ATTRACTOR) provider.block(MItems.PHANTOM_ATTRACTOR)
provider.block(MItems.HOLO_SIGN) provider.block(MItems.HOLO_SIGN)
provider.generated(MItems.FLUID_CAPSULE)
provider.block(MItems.FLUID_TANK) provider.block(MItems.TRITANIUM_ORE)
provider.block(MItems.DEEPSLATE_TRITANIUM_ORE)
provider.block(MItems.TRITANIUM_RAW_BLOCK)
provider.block(MItems.TRITANIUM_INGOT_BLOCK)
provider.block(MItems.WITHERED_STEEL_BLOCK)
provider.block(MItems.ROFLITE_ALLOY_BLOCK)
provider.block(MItems.DILITHIUM_ORE)
provider.block(MItems.DEEPSLATE_DILITHIUM_ORE)
provider.block(MItems.DILITHIUM_CRYSTAL_BLOCK)
provider.withExistingParent(MItems.REDSTONE_LAMP_INVERTED, ResourceLocation("minecraft", "block/redstone_lamp_on"))
provider.withExistingParent(MItems.REINFORCED_REDSTONE_LAMP, modLocation("block/reinforced_redstone_lamp"))
provider.withExistingParent(MItems.REINFORCED_REDSTONE_LAMP_INVERTED, modLocation("block/reinforced_redstone_lamp_on"))
MRegistry.VENT.allItems.values.forEach(provider::block) MRegistry.VENT.allItems.values.forEach(provider::block)
MRegistry.VENT_ALTERNATIVE.allItems.values.forEach(provider::block) MRegistry.VENT_ALTERNATIVE.allItems.values.forEach(provider::block)
MRegistry.TRITANIUM_BLOCK.allItems.values.forEach(provider::block) MRegistry.TRITANIUM_BLOCK.allItems.values.forEach(provider::block)
MRegistry.COMPUTER_TERMINAL.allItems.values.forEach(provider::block)
MRegistry.STAR_CHAIR.allItems.values.forEach(provider::block)
MRegistry.INDUSTRIAL_GLASS.allItems.values.forEach(provider::block) MRegistry.INDUSTRIAL_GLASS.allItems.values.forEach(provider::block)
for (block in MRegistry.TRITANIUM_STRIPED_BLOCK.flatItems) { for (block in MRegistry.TRITANIUM_STRIPED_BLOCK.flatItems) {
@ -55,7 +69,10 @@ fun addItemModels(provider: MatteryItemModelProvider) {
provider.generated(MItems.PILL_HUMANE) provider.generated(MItems.PILL_HUMANE)
provider.generated(MItems.PILL_OBLIVION) provider.generated(MItems.PILL_OBLIVION)
provider.generated(MItems.PILL_HEAL) provider.generated(MItems.PILL_HEAL)
provider.generated(MItems.PILL_NOT_NORMAL)
provider.generated(MItems.NUTRIENT_PASTE) provider.generated(MItems.NUTRIENT_PASTE)
provider.generated(MItems.IMPERFECT_BREAD)
provider.generated(MItems.REDSTONE_INTERACTOR)
provider.generated(MItems.ESSENCE_DRIVE) provider.generated(MItems.ESSENCE_DRIVE)
provider.generated(MItems.ESSENCE_CAPSULE) provider.generated(MItems.ESSENCE_CAPSULE)
@ -77,33 +94,112 @@ fun addItemModels(provider: MatteryItemModelProvider) {
provider.generated(MItems.ExopackUpgrades.INVENTORY_UPGRADE_CREATIVE) provider.generated(MItems.ExopackUpgrades.INVENTORY_UPGRADE_CREATIVE)
provider.generated(MItems.ExopackUpgrades.CRAFTING_UPGRADE) provider.generated(MItems.ExopackUpgrades.CRAFTING_UPGRADE)
provider.generated(MItems.ExopackUpgrades.SMELTING_UPGRADE)
provider.generated(MItems.ExopackUpgrades.ENDER_UPGRADE)
provider.component(MItems.TRITANIUM_DUST) provider.resource(MItems.TRITANIUM_DUST)
provider.component(MItems.TRITANIUM_INGOT) provider.resource(MItems.TRITANIUM_INGOT)
provider.component(MItems.TRITANIUM_NUGGET) provider.resource(MItems.TRITANIUM_NUGGET)
provider.resource(MItems.TRITANIUM_ORE_CLUMP) provider.resource(MItems.TRITANIUM_ORE_CLUMP)
provider.resource(MItems.DILITHIUM_CRYSTAL)
provider.resource(MItems.WITHERED_STEEL)
provider.resource(MItems.ROFLITE_ALLOY_INGOT)
provider.generated(MItems.EXOPACK_PROBE) provider.generated(MItems.EXOPACK_PROBE)
provider.handheld(MItems.TRITANIUM_TOOLS) provider.handheld(MItems.TRITANIUM_TOOLS)
provider.generated(MItems.TRITANIUM_ARMOR) provider.armorColored(MItems.TRITANIUM_ARMOR)
provider.generated(MItems.SIMPLE_TRITANIUM_ARMOR) provider.armorWithTrims(MItems.SIMPLE_TRITANIUM_ARMOR)
provider.generatedTiered(MItems.BATTERIES, "battery_tier") provider.handheld(MItems.CHEST_UPGRADER)
provider.exec {
val path = MItems.CONFIGURATOR.registryName!!.path
val ready = provider.withExistingParent("${path}_ready", MatteryItemModelProvider.HANDHELD)
.texture("layer0", modLocation("item/${path}_ready"))
provider.withExistingParent(path, MatteryItemModelProvider.HANDHELD)
.texture("layer0", modLocation("item/$path"))
.override().predicate(modLocation("has_configuration_saved"), 1f).model(ready).end()
}
provider.generated(MItems.BREAD_MONSTER_SPAWN_EGG, modLocation("item/egg/bread_monster"))
provider.generated(MItems.LOADER_SPAWN_EGG, modLocation("item/egg/loader"))
provider.capacitorWithGauge(MItems.BATTERY_CRUDE, 10, "battery_gauge_", modLocation("item/battery_tier0"))
provider.capacitorWithGauge(MItems.BATTERY_BASIC, 10, "battery_gauge_", modLocation("item/battery_tier1"))
provider.capacitorWithGauge(MItems.BATTERY_NORMAL, 10, "battery_gauge_", modLocation("item/battery_tier2"))
provider.capacitorWithGauge(MItems.BATTERY_DENSE, 10, "battery_gauge_", modLocation("item/battery_tier3"))
provider.capacitorWithGauge(MItems.BATTERY_CAPACITOR, 10, "battery_gauge_", modLocation("item/battery_tier4"))
provider.generated(MItems.BATTERY_CREATIVE) provider.generated(MItems.BATTERY_CREATIVE)
provider.capacitorWithGauge(MItems.PROCEDURAL_BATTERY, 9, "battery_procedural_gauge_", modLocation("item/battery_procedural"))
provider.generated(MItems.MATTER_CAPACITOR_BASIC, modLocation("item/matter_capacitor_tier1")) provider.capacitorWithGauge(MItems.MATTER_CAPACITOR_BASIC, 8, "matter_capacitor_gauge_", modLocation("item/matter_capacitor_tier1"))
provider.generated(MItems.MATTER_CAPACITOR_NORMAL, modLocation("item/matter_capacitor_tier2")) provider.capacitorWithGauge(MItems.MATTER_CAPACITOR_NORMAL, 8, "matter_capacitor_gauge_", modLocation("item/matter_capacitor_tier2"))
provider.generated(MItems.MATTER_CAPACITOR_DENSE, modLocation("item/matter_capacitor_tier3")) provider.capacitorWithGauge(MItems.MATTER_CAPACITOR_DENSE, 8, "matter_capacitor_gauge_", modLocation("item/matter_capacitor_tier3"))
provider.generated(MItems.MATTER_CAPACITOR_CREATIVE) provider.generated(MItems.MATTER_CAPACITOR_CREATIVE)
provider.generated(MItems.QUANTUM_BATTERY) provider.generated(MItems.MachineUpgrades.Basic.BLANK, modLocation("item/machine_upgrade_tier1"))
provider.generated(MItems.QUANTUM_CAPACITOR) provider.upgrade(MItems.MachineUpgrades.Basic.SPEED, "speed", "tier1")
provider.upgrade(MItems.MachineUpgrades.Basic.ENERGY_CONSUMPTION, "energy", "tier1")
provider.upgrade(MItems.MachineUpgrades.Basic.FAILSAFE, "failure", "tier1")
provider.upgrade(MItems.MachineUpgrades.Basic.ENERGY_STORAGE, "capacity", "tier1")
provider.upgrade(MItems.MachineUpgrades.Basic.MATTER_STORAGE, "matter", "tier1")
provider.upgrade(MItems.MachineUpgrades.Basic.PROCESSING_ITEMS, "processing", "tier1")
provider.generated(MItems.MachineUpgrades.Normal.BLANK, modLocation("item/machine_upgrade_tier2"))
provider.upgrade(MItems.MachineUpgrades.Normal.SPEED, "speed", "tier2")
provider.upgrade(MItems.MachineUpgrades.Normal.ENERGY_CONSUMPTION, "energy", "tier2")
provider.upgrade(MItems.MachineUpgrades.Normal.FAILSAFE, "failure", "tier2")
provider.upgrade(MItems.MachineUpgrades.Normal.ENERGY_STORAGE, "capacity", "tier2")
provider.upgrade(MItems.MachineUpgrades.Normal.MATTER_STORAGE, "matter", "tier2")
provider.upgrade(MItems.MachineUpgrades.Normal.PROCESSING_ITEMS, "processing", "tier2")
provider.generated(MItems.MachineUpgrades.Advanced.BLANK, modLocation("item/machine_upgrade_tier3"))
provider.upgrade(MItems.MachineUpgrades.Advanced.SPEED, "speed", "tier3")
provider.upgrade(MItems.MachineUpgrades.Advanced.ENERGY_CONSUMPTION, "energy", "tier3")
provider.upgrade(MItems.MachineUpgrades.Advanced.FAILSAFE, "failure", "tier3")
provider.upgrade(MItems.MachineUpgrades.Advanced.ENERGY_STORAGE, "capacity", "tier3")
provider.upgrade(MItems.MachineUpgrades.Advanced.MATTER_STORAGE, "matter", "tier3")
provider.upgrade(MItems.MachineUpgrades.Advanced.PROCESSING_ITEMS, "processing", "tier3")
provider.upgrade(MItems.MachineUpgrades.Creative.SPEED, "speed", "creative")
provider.upgrade(MItems.MachineUpgrades.Creative.ENERGY_CONSUMPTION, "energy", "creative")
provider.upgrade(MItems.MachineUpgrades.Creative.ENERGY_THROUGHPUT, "energy", "creative")
provider.upgrade(MItems.MachineUpgrades.Creative.ENERGY_THROUGHPUT_FLAT, "energy", "creative")
provider.upgrade(MItems.MachineUpgrades.Creative.ENERGY_THROUGHPUT_FLAT_SMALL, "energy", "creative")
provider.upgrade(MItems.MachineUpgrades.Creative.ENERGY_STORAGE, "capacity", "creative")
provider.upgrade(MItems.MachineUpgrades.Creative.ENERGY_STORAGE_FLAT, "capacity", "creative")
provider.upgrade(MItems.MachineUpgrades.Creative.ENERGY_STORAGE_FLAT_SMALL, "capacity", "creative")
provider.upgrade(MItems.MachineUpgrades.Creative.FAILSAFE, "failure", "creative")
provider.upgrade(MItems.MachineUpgrades.Creative.FAILURE, "failure", "creative")
provider.upgrade(MItems.MachineUpgrades.Creative.PROCESSING_ITEMS, "processing", "creative")
provider.upgrade(MItems.MachineUpgrades.Creative.MATTER_STORAGE, "matter", "creative")
provider.upgrade(MItems.MachineUpgrades.Creative.MATTER_STORAGE_FLAT, "matter", "creative")
provider.upgrade(MItems.MachineUpgrades.Creative.MATTER_STORAGE_FLAT_SMALL, "matter", "creative")
provider.capacitorWithGauge(MItems.QUANTUM_BATTERY, 10, "battery_gauge_")
provider.capacitorWithGauge(MItems.QUANTUM_CAPACITOR, 10, "battery_gauge_")
provider.generated(MItems.QUANTUM_BATTERY_CREATIVE) provider.generated(MItems.QUANTUM_BATTERY_CREATIVE)
provider.generated(MItems.PATTERN_DRIVE_NORMAL, modLocation("item/pattern_drive_tier1"))
provider.generated(MItems.PATTERN_DRIVE_DOUBLE, modLocation("item/pattern_drive_tier2"))
provider.generated(MItems.PATTERN_DRIVE_TRIPLE, modLocation("item/pattern_drive_tier3"))
provider.generated(MItems.PATTERN_DRIVE_QUAD, modLocation("item/pattern_drive_tier4"))
provider.generated(MItems.PATTERN_DRIVE_CREATIVE) provider.generated(MItems.PATTERN_DRIVE_CREATIVE)
provider.generated(MItems.PATTERN_DRIVE_CREATIVE2) provider.generated(MItems.PATTERN_DRIVE_CREATIVE2)
provider.withExistingParent(MItems.GOLD_DISK, MItems.PATTERN_DRIVE_CREATIVE.registryName!!)
provider.generated(MItems.MATTER_DUST) provider.generated(MItems.MATTER_DUST)
provider.generated(MItems.TRITANIUM_DOOR.values) provider.generated(MItems.TRITANIUM_DOOR.values)
@ -111,36 +207,88 @@ fun addItemModels(provider: MatteryItemModelProvider) {
provider.block(MItems.TRITANIUM_TRAPDOOR[null]!!, "tritanium_trapdoor_bottom") provider.block(MItems.TRITANIUM_TRAPDOOR[null]!!, "tritanium_trapdoor_bottom")
for (color in DyeColor.values()) for (color in DyeColor.entries)
provider.block(MItems.TRITANIUM_TRAPDOOR[color]!!, "tritanium_trapdoor_${color.name.lowercase()}_bottom") provider.block(MItems.TRITANIUM_TRAPDOOR[color]!!, "tritanium_trapdoor_${color.name.lowercase()}_bottom")
for (item in MRegistry.CARGO_CRATES.allItems.values) { for (item in MRegistry.CARGO_CRATES.allItems.values)
provider.block(item, "${item.registryName!!.path}_closed") provider.block(item, "${item.registryName!!.path}_closed")
provider.coloredWithBaseBlock(MItems.CHEMICAL_GENERATOR, "chemical_generator", "_working")
provider.coloredWithBaseBlock(MItems.ENERGY_COUNTER, "energy_counter_down")
provider.coloredWithBaseBlock(MItems.MATTER_BOTTLER, "matter_bottler", "_idle")
provider.coloredWithBaseBlock(MItems.MATTER_SCANNER, "matter_scanner", "_idle")
provider.coloredWithBaseBlock(MItems.MATTER_REPLICATOR, "matter_replicator", "_idle")
provider.block(MItems.MATTER_ENTANGLER, "matter_entangler_idle")
provider.coloredWithBaseBlock(MItems.DRIVE_VIEWER, "drive_viewer", "_idle")
provider.coloredWithBaseBlock(MItems.MATTER_DECOMPOSER, "matter_decomposer", "_idle")
provider.coloredWithBaseBlock(MItems.ENERGY_SERVO, "energy_servo")
provider.coloredWithBaseBlock(MItems.MATTER_RECONSTRUCTOR, "matter_reconstructor")
provider.coloredWithBaseBlock(MItems.POWERED_BLAST_FURNACE, "powered_blast_furnace", "_idle")
provider.coloredWithBaseBlock(MItems.POWERED_FURNACE, "powered_furnace", "_idle")
provider.coloredWithBaseBlock(MItems.POWERED_SMOKER, "powered_smoker", "_idle")
provider.coloredWithBaseBlock(MItems.PLATE_PRESS, "plate_press", "_idle")
provider.coloredWithBaseBlock(MItems.TWIN_PLATE_PRESS, "twin_plate_press", "_idle")
provider.coloredWithBaseBlock(MItems.STORAGE_POWER_SUPPLIER, "storage_power_supplier")
provider.coloredWithBaseBlock(MItems.MATTER_RECYCLER, "matter_recycler", "_idle")
provider.coloredWithBaseBlock(MItems.COBBLESTONE_GENERATOR, "cobblestone_generator")
provider.block(MItems.PAINTER, "painter")
provider.block(MItems.INFINITE_WATER_SOURCE, "infinite_water_source")
provider.exec {
provider.withExistingParent("essence_storage", modLocation("block/essence_storage_empty"))
.override()
.predicate(modLocation("is_filled"), 1f)
.model(provider.withExistingParent("essence_storage_filled", modLocation("block/essence_storage_filled")))
.end()
} }
provider.block(MItems.CHEMICAL_GENERATOR, "chemical_generator_working") for (dye in DyeColor.entries) {
provider.block(MItems.ENERGY_COUNTER, "energy_counter_down") provider.exec {
provider.block(MItems.MATTER_BOTTLER, "matter_bottler_working") provider.withExistingParent("android_charger_${dye.name.lowercase()}", modLocation("item/android_charger")).texture("0", modLocation("block/android_charger/${dye.name.lowercase()}"))
provider.block(MItems.MATTER_CABLE, "matter_cable_core") provider.withExistingParent("matter_panel_${dye.name.lowercase()}", modLocation("item/matter_panel")).texture("texture", modLocation("block/matter_panel/${dye.name.lowercase()}"))
provider.block(MItems.MATTER_DECOMPOSER, "matter_decomposer_working") provider.withExistingParent("essence_storage_${dye.name.lowercase()}", modLocation("block/essence_storage_${dye.name.lowercase()}_empty"))
provider.block(MItems.ENERGY_SERVO, "energy_servo") .override()
provider.block(MItems.ESSENCE_STORAGE, "essence_storage") .predicate(modLocation("is_filled"), 1f)
provider.block(MItems.MATTER_RECONSTRUCTOR, "matter_reconstructor") .model(provider.withExistingParent("essence_storage_${dye.name.lowercase()}_filled", modLocation("block/essence_storage_${dye.name.lowercase()}_filled")))
.end()
provider.block(MItems.PLATE_PRESS, "plate_press_idle") }
provider.block(MItems.STORAGE_POWER_SUPPLIER, "storage_power_supplier") }
provider.block(MItems.MATTER_RECYCLER, "matter_recycler_working")
provider.block(MItems.COBBLESTONE_GENERATOR, "cobblestone_generator")
provider.block(MItems.STORAGE_BUS) provider.block(MItems.STORAGE_BUS)
provider.block(MItems.STORAGE_IMPORTER) provider.block(MItems.STORAGE_IMPORTER)
provider.block(MItems.STORAGE_EXPORTER) provider.block(MItems.STORAGE_EXPORTER)
for (item in MItems.TRITANIUM_ANVIL) { provider.block(MItems.FLYWHEEL_HOUSING)
provider.block(item) provider.block(MItems.FLYWHEEL_BEARING)
} provider.block(MItems.FLYWHEEL_SHAFT)
provider.block(MItems.FLYWHEEL_BATTERY)
provider.block(MItems.TRITANIUM_HULL)
provider.block(MItems.GENERATOR_BLOCK)
provider.block(MItems.ENERGY_INPUT_INTERFACE)
provider.block(MItems.ENERGY_OUTPUT_INTERFACE)
provider.block(MItems.ENERGY_INPUT_HATCH)
provider.block(MItems.ENERGY_OUTPUT_HATCH)
provider.block(MItems.MATTER_INPUT_HATCH)
provider.block(MItems.MATTER_OUTPUT_HATCH)
provider.block(MItems.ITEM_INPUT_HATCH)
provider.block(MItems.ITEM_OUTPUT_HATCH)
provider.block(MItems.MODULAR_FRAME)
provider.block(MItems.HEAVY_MODULAR_FRAME)
MItems.TRITANIUM_ANVIL.values.forEach { provider.blocks(it) }
for ((color, item) in MItems.CARGO_CRATE_MINECARTS) { for ((color, item) in MItems.CARGO_CRATE_MINECARTS) {
provider.generated(item) provider.generated(item)
} }
MItems.SUSPICIOUS_FOODS.ITEMS.forEach { provider.inherit(it, it.mimicking()) }
} }

View File

@ -1,12 +1,17 @@
package ru.dbotthepony.mc.otm.datagen.items package ru.dbotthepony.mc.otm.datagen.items
import net.minecraft.data.models.ItemModelGenerators
import net.minecraft.resources.ResourceLocation import net.minecraft.resources.ResourceLocation
import net.minecraft.server.packs.PackType
import net.minecraft.world.item.ArmorItem
import net.minecraft.world.item.DyeColor
import net.minecraft.world.item.Item import net.minecraft.world.item.Item
import net.minecraftforge.client.model.generators.ItemModelProvider import net.neoforged.neoforge.client.model.generators.ItemModelProvider
import net.minecraftforge.data.event.GatherDataEvent import net.neoforged.neoforge.data.event.GatherDataEvent
import org.apache.logging.log4j.LogManager import org.apache.logging.log4j.LogManager
import ru.dbotthepony.mc.otm.util.ResourceLocation
import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.datagen.DataGen import ru.dbotthepony.mc.otm.datagen.DataGen
import ru.dbotthepony.mc.otm.core.registryName
import ru.dbotthepony.mc.otm.datagen.modLocation import ru.dbotthepony.mc.otm.datagen.modLocation
import java.util.LinkedList import java.util.LinkedList
@ -26,6 +31,29 @@ class MatteryItemModelProvider(event: GatherDataEvent) : ItemModelProvider(event
fun block(item: Item) = exec { withExistingParent(item.registryName!!.path, modLocation("block/${item.registryName!!.path}")) } fun block(item: Item) = exec { withExistingParent(item.registryName!!.path, modLocation("block/${item.registryName!!.path}")) }
fun block(item: Item, path: String) = exec { withExistingParent(item.registryName!!.path, modLocation("block/$path")) } fun block(item: Item, path: String) = exec { withExistingParent(item.registryName!!.path, modLocation("block/$path")) }
fun withExistingParent(item: Item, path: ResourceLocation) = exec { withExistingParent(item.registryName!!.path, path) }
fun inherit(item: Item, parent: Item) {
exec { withExistingParent(item.registryName!!.path, parent.registryName!!) }
}
fun coloredWithBaseBlock(items: Map<DyeColor?, Item>, path: String) {
for (color in DyeColor.entries) {
block(items[color]!!, path + "_${color.name.lowercase()}")
}
block(items[null]!!, path)
}
fun coloredWithBaseBlock(items: Map<DyeColor?, Item>, path: String, suffix: String) {
for (color in DyeColor.entries) {
block(items[color]!!, path + "_${color.name.lowercase()}$suffix")
}
block(items[null]!!, path + suffix)
}
fun blocks(vararg items: Item) = items.forEach(this::block) fun blocks(vararg items: Item) = items.forEach(this::block)
fun blocks(items: Collection<Item>) = items.forEach(this::block) fun blocks(items: Collection<Item>) = items.forEach(this::block)
@ -78,7 +106,72 @@ class MatteryItemModelProvider(event: GatherDataEvent) : ItemModelProvider(event
} }
} }
fun armorWithTrims(item: Item, texture: ResourceLocation) = exec {
val mainModel = withExistingParent(item.registryName!!.path, GENERATED).texture("layer0", texture)
if (item is ArmorItem) {
for ((i, material) in ARMOR_TRIM_MATERIALS.withIndex()) {
val trimLocation = ResourceLocation.withDefaultNamespace("trims/items/${item.type.getName()}_trim_${material}")
existingFileHelper.trackGenerated(trimLocation, PackType.CLIENT_RESOURCES, ".png", "textures")
val overrideModel = withExistingParent("${item.registryName!!.path}_${material}_trim", GENERATED)
.texture("layer0", texture)
.texture("layer1", trimLocation)
mainModel.override()
.predicate(ItemModelGenerators.TRIM_TYPE_PREDICATE_ID, (i + 1).toFloat() / ARMOR_TRIM_MATERIALS.size.toFloat())
.model(overrideModel)
.end()
}
}
}
fun armorWithTrims(vararg items: Item) = items.forEach { armorWithTrims(it, modLocation("item/${it.registryName!!.path}")) }
fun armorWithTrims(items: Collection<Item>) = items.forEach { armorWithTrims(it, modLocation("item/${it.registryName!!.path}")) }
fun armorColored(item: Item) = exec {
withExistingParent(item.registryName!!.path, GENERATED)
.texture("layer0", modLocation("item/${item.registryName!!.path}_base"))
.texture("layer1", modLocation("item/${item.registryName!!.path}_overlay"))
}
fun armorColored(vararg items: Item) = items.forEach { armorColored(it) }
fun armorColored(items: Collection<Item>) = items.forEach { armorColored(it) }
fun upgrade(item: Item, upgradeType: String, tier: String = "tier0") = exec {
withExistingParent(item.registryName!!.path, GENERATED)
.texture("layer0", modLocation("item/machine_upgrade_$tier"))
.texture("layer1", modLocation("item/machine_upgrade_icon_$upgradeType"))
}
fun capacitorWithGauge(item: Item, fillTextures: Int, gaugePrefix: String, baseTexture: ResourceLocation? = null) = exec {
val path = item.registryName!!.path
val texture = baseTexture ?: modLocation("item/$path")
val empty = withExistingParent("${path}_empty", GENERATED)
.texture("layer0", texture)
val basic = withExistingParent(path, GENERATED)
.texture("layer0", texture)
.texture("layer1", modLocation("item/${gaugePrefix}$fillTextures"))
.override()
.predicate(modLocation("capacitor_gauge"), 0f)
.model(empty)
.end()
for (i in 1 .. fillTextures) {
val model = withExistingParent("${path}_fill_$i", GENERATED)
.texture("layer0", texture)
.texture("layer1", modLocation("item/${gaugePrefix}$i"))
basic.override()
.predicate(modLocation("capacitor_gauge"), i.toFloat() / fillTextures.toFloat())
.model(model)
.end()
}
}
companion object { companion object {
val ARMOR_TRIM_MATERIALS = listOf("quartz", "iron", "netherite", "redstone", "copper", "gold", "emerald", "diamond", "lapis", "amethyst")
val GENERATED = ResourceLocation("minecraft", "item/generated") val GENERATED = ResourceLocation("minecraft", "item/generated")
val HANDHELD = ResourceLocation("minecraft", "item/handheld") val HANDHELD = ResourceLocation("minecraft", "item/handheld")
private val LOGGER = LogManager.getLogger() private val LOGGER = LogManager.getLogger()

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,5 @@
package ru.dbotthepony.mc.otm.datagen.lang package ru.dbotthepony.mc.otm.datagen.lang
import com.google.common.collect.ImmutableList
import com.google.common.collect.ImmutableMap import com.google.common.collect.ImmutableMap
import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap
import net.minecraft.data.DataGenerator import net.minecraft.data.DataGenerator
@ -13,14 +12,13 @@ import net.minecraft.world.entity.EntityType
import net.minecraft.world.item.DyeColor import net.minecraft.world.item.DyeColor
import net.minecraft.world.item.Item import net.minecraft.world.item.Item
import net.minecraft.world.item.ItemStack import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.enchantment.Enchantment
import net.minecraft.world.level.block.Block import net.minecraft.world.level.block.Block
import net.minecraftforge.common.data.LanguageProvider import net.neoforged.neoforge.common.data.LanguageProvider
import ru.dbotthepony.mc.otm.OverdriveThatMatters import ru.dbotthepony.mc.otm.OverdriveThatMatters
import ru.dbotthepony.mc.otm.android.AndroidFeatureType import ru.dbotthepony.mc.otm.player.android.AndroidFeatureType
import ru.dbotthepony.mc.otm.android.AndroidResearch import ru.dbotthepony.mc.otm.player.android.AndroidResearchType
import ru.dbotthepony.mc.otm.android.AndroidResearchType import ru.dbotthepony.mc.otm.util.TranslatableComponent
import ru.dbotthepony.mc.otm.core.TranslatableComponent import ru.dbotthepony.mc.otm.datagen.DataGen
import ru.dbotthepony.mc.otm.registry.objects.ColoredDecorativeBlock import ru.dbotthepony.mc.otm.registry.objects.ColoredDecorativeBlock
private fun researchString(key: AndroidResearchType): String { private fun researchString(key: AndroidResearchType): String {
@ -80,11 +78,13 @@ class MatteryLanguageProvider(private val gen: DataGenerator) {
fun add(key: String, value: String) = slave.add(key, value) fun add(key: String, value: String) = slave.add(key, value)
fun add(key: Block, value: String) = slave.add(key, value) fun add(key: Block, value: String) = slave.add(key, value)
fun addBlock(key: Collection<Block>, value: String) = key.forEach { add(it, value) }
fun add(key: Block, suffix: String, value: String) = slave.add("${key.descriptionId}.${suffix}", value) fun add(key: Block, suffix: String, value: String) = slave.add("${key.descriptionId}.${suffix}", value)
fun addBlock(key: Collection<Block>, suffix: String, value: String) = key.forEach { add(it, suffix, value) }
fun add(key: Item, value: String) = slave.add(key, value) fun add(key: Item, value: String) = slave.add(key, value)
fun addItem(key: Collection<Item>, value: String) = key.forEach { add(it, value) }
fun add(key: Item, suffix: String, value: String) = slave.add("${key.descriptionId}.${suffix}", value) fun add(key: Item, suffix: String, value: String) = slave.add("${key.descriptionId}.${suffix}", value)
fun add(key: ItemStack, value: String) = slave.add(key, value) fun add(key: ItemStack, value: String) = slave.add(key, value)
fun add(key: Enchantment, value: String) = slave.add(key, value)
fun add(key: MobEffect, value: String) = slave.add(key, value) fun add(key: MobEffect, value: String) = slave.add(key, value)
fun add(key: EntityType<*>, value: String) = slave.add(key, value) fun add(key: EntityType<*>, value: String) = slave.add(key, value)
@ -104,6 +104,11 @@ class MatteryLanguageProvider(private val gen: DataGenerator) {
fun sound(key: String, value: String) = slave.add("otm.sound.$key", value) fun sound(key: String, value: String) = slave.add("otm.sound.$key", value)
fun sound(key: SoundEvent, value: String) = slave.add("otm.sound.${key.location.path}", value) fun sound(key: SoundEvent, value: String) = slave.add("otm.sound.${key.location.path}", value)
fun jade(key: String, value: String) = slave.add("otm.jade.$key", value)
fun jadeloc(key: String, value: String) = slave.add("config.jade.plugin_${DataGen.MOD_ID}.$key", value)
fun map(key: String, value: String) = slave.add("filled_map.otm_$key", value)
inner class Prepended(path: String) { inner class Prepended(path: String) {
val path = "$path." val path = "$path."
constructor(vararg path: String) : this(path.joinToString(".")) constructor(vararg path: String) : this(path.joinToString("."))
@ -118,6 +123,7 @@ class MatteryLanguageProvider(private val gen: DataGenerator) {
inner class Colors( inner class Colors(
language: String, language: String,
val lowercaseIntermediate: Boolean,
val white: String, val white: String,
val orange: String, val orange: String,
@ -138,86 +144,7 @@ class MatteryLanguageProvider(private val gen: DataGenerator) {
) { ) {
val slave: LanguageProvider = slaves.computeIfAbsent(language, ::Slave) val slave: LanguageProvider = slaves.computeIfAbsent(language, ::Slave)
val list: List<String> = ImmutableList.builder<String>() val mapped: Map<DyeColor, String> = ImmutableMap.builder<DyeColor, String>()
.add(white)
.add(orange)
.add(magenta)
.add(lightBlue)
.add(yellow)
.add(lime)
.add(pink)
.add(gray)
.add(lightGray)
.add(cyan)
.add(purple)
.add(blue)
.add(brown)
.add(green)
.add(red)
.add(black)
.build()
val pairList: List<Pair<String, String>> = ImmutableList.builder<Pair<String, String>>()
.add("white" to white)
.add("orange" to orange)
.add("magenta" to magenta)
.add("light_blue" to lightBlue)
.add("yellow" to yellow)
.add("lime" to lime)
.add("pink" to pink)
.add("gray" to gray)
.add("light_gray" to lightGray)
.add("cyan" to cyan)
.add("purple" to purple)
.add("blue" to blue)
.add("brown" to brown)
.add("green" to green)
.add("red" to red)
.add("black" to black)
.build()
val mapped: Map<String, String> = ImmutableMap.builder<String, String>()
.put("white", white)
.put("orange", orange)
.put("magenta", magenta)
.put("lightBlue", lightBlue)
.put("light_blue", lightBlue)
.put("yellow", yellow)
.put("lime", lime)
.put("pink", pink)
.put("gray", gray)
.put("lightGray", lightGray)
.put("light_gray", lightGray)
.put("cyan", cyan)
.put("purple", purple)
.put("blue", blue)
.put("brown", brown)
.put("green", green)
.put("red", red)
.put("black", black)
.put("WHITE", white)
.put("ORANGE", orange)
.put("MAGENTA", magenta)
.put("LIGHTBLUE", lightBlue)
.put("LIGHT_BLUE", lightBlue)
.put("YELLOW", yellow)
.put("LIME", lime)
.put("PINK", pink)
.put("GRAY", gray)
.put("LIGHTGRAY", lightGray)
.put("LIGHT_GRAY", lightGray)
.put("CYAN", cyan)
.put("PURPLE", purple)
.put("BLUE", blue)
.put("BROWN", brown)
.put("GREEN", green)
.put("RED", red)
.put("BLACK", black)
.build()
val dyeClassMapped: Map<DyeColor, String> = ImmutableMap.builder<DyeColor, String>()
.put(DyeColor.WHITE, white) .put(DyeColor.WHITE, white)
.put(DyeColor.ORANGE, orange) .put(DyeColor.ORANGE, orange)
.put(DyeColor.MAGENTA, magenta) .put(DyeColor.MAGENTA, magenta)
@ -236,37 +163,30 @@ class MatteryLanguageProvider(private val gen: DataGenerator) {
.put(DyeColor.BLACK, black) .put(DyeColor.BLACK, black)
.build() .build()
val dyeClassPairs: List<Pair<DyeColor, String>> = ImmutableList.builder<Pair<DyeColor, String>>() fun add(list: ColoredDecorativeBlock<*>, toFormat: String) {
.add(DyeColor.WHITE to white) for ((color, target) in mapped) {
.add(DyeColor.ORANGE to orange)
.add(DyeColor.MAGENTA to magenta)
.add(DyeColor.LIGHT_BLUE to lightBlue)
.add(DyeColor.YELLOW to yellow)
.add(DyeColor.LIME to lime)
.add(DyeColor.PINK to pink)
.add(DyeColor.GRAY to gray)
.add(DyeColor.LIGHT_GRAY to lightGray)
.add(DyeColor.CYAN to cyan)
.add(DyeColor.PURPLE to purple)
.add(DyeColor.BLUE to blue)
.add(DyeColor.BROWN to brown)
.add(DyeColor.GREEN to green)
.add(DyeColor.RED to red)
.add(DyeColor.BLACK to black)
.build()
fun add(list: ColoredDecorativeBlock, toFormat: String) {
for ((color, target) in dyeClassPairs) {
slave.add(list.blocks[color]!!, toFormat.format(target)) slave.add(list.blocks[color]!!, toFormat.format(target))
} }
} }
fun forEach(consumer: (color: DyeColor, name: String) -> Unit) { fun forEach(consumer: (color: DyeColor, name: String) -> Unit) {
for ((a, b) in dyeClassPairs) { for ((a, b) in mapped) {
consumer.invoke(a, b) consumer.invoke(a, b)
} }
} }
fun add(map: Map<in DyeColor, Block>, toFormat: String) {
for ((color, block) in map) {
slave.add(block, toFormat.format(mapped[color]!!))
}
}
fun addIntermediate(map: Map<in DyeColor, Block>, toFormat: String) {
for ((color, block) in map) {
slave.add(block, toFormat.format(if (lowercaseIntermediate) mapped[color]!!.lowercase() else mapped[color]!!))
}
}
fun add( fun add(
whiteBlock: Block, whiteBlock: Block,
orangeBlock: Block, orangeBlock: Block,
@ -342,55 +262,9 @@ class MatteryLanguageProvider(private val gen: DataGenerator) {
slave.add(redItem, toFormat.format(red)) slave.add(redItem, toFormat.format(red))
slave.add(blackItem, toFormat.format(black)) slave.add(blackItem, toFormat.format(black))
} }
fun addBlocks(list: List<Block>, toFormat: String) {
add(
whiteBlock = list[0],
orangeBlock = list[1],
magentaBlock = list[2],
lightBlueBlock = list[3],
yellowBlock = list[4],
limeBlock = list[5],
pinkBlock = list[6],
grayBlock = list[7],
lightGrayBlock = list[8],
cyanBlock = list[9],
purpleBlock = list[10],
blueBlock = list[11],
brownBlock = list[12],
greenBlock = list[13],
redBlock = list[14],
blackBlock = list[15],
toFormat = toFormat
)
}
fun addItems(list: List<Item>, toFormat: String) {
add(
whiteItem = list[0],
orangeItem = list[1],
magentaItem = list[2],
lightBlueItem = list[3],
yellowItem = list[4],
limeItem = list[5],
pinkItem = list[6],
grayItem = list[7],
lightGrayItem = list[8],
cyanItem = list[9],
purpleItem = list[10],
blueItem = list[11],
brownItem = list[12],
greenItem = list[13],
redItem = list[14],
blackItem = list[15],
toFormat = toFormat
)
}
} }
val englishColors = Colors("en_us", val englishColors = Colors("en_us", lowercaseIntermediate = false,
"White", "White",
"Orange", "Orange",
"Magenta", "Magenta",
@ -409,18 +283,18 @@ class MatteryLanguageProvider(private val gen: DataGenerator) {
"Black", "Black",
) )
val russianColors = Colors("ru_ru", val russianColors = Colors("ru_ru", lowercaseIntermediate = true,
"Белый", "Белый",
"Оранжевый", "Оранжевый",
"Маджентовый", "Пурпурный",
"Светло Синий", "Голубой",
"Жёлтый", "Жёлтый",
"Лаймовый", "Лаймовый",
"Розовый", "Розовый",
"Серый", "Серый",
"Светло Серый", "Светло-серый",
"Циановый", "Бирюзовый",
"Пурпурный", "Фиолетовый",
"Синий", "Синий",
"Коричневый", "Коричневый",
"Зелёный", "Зелёный",

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,53 @@
package ru.dbotthepony.mc.otm.datagen.loot
import net.minecraft.world.item.Items
import net.minecraft.world.level.storage.loot.entries.LootItem
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets
import ru.dbotthepony.mc.otm.datagen.modLootTable
import ru.dbotthepony.mc.otm.registry.game.MItems
fun addAdvancementLoot(lootTables: LootTables) {
lootTables.builder(LootContextParamSets.ADVANCEMENT_ENTITY, modLootTable("research_all_android")) {
lootPool {
add(LootItem.lootTableItem(MItems.ExopackUpgrades.INVENTORY_UPGRADE_HUGE))
}
}
lootTables.builder(LootContextParamSets.ADVANCEMENT_ENTITY, modLootTable("tritanium_block3")) {
lootPool { item(Items.WHITE_DYE) { setCount(8) } }
lootPool { item(Items.ORANGE_DYE) { setCount(8) } }
lootPool { item(Items.MAGENTA_DYE) { setCount(8) } }
lootPool { item(Items.LIGHT_BLUE_DYE) { setCount(8) } }
lootPool { item(Items.YELLOW_DYE) { setCount(8) } }
lootPool { item(Items.LIME_DYE) { setCount(8) } }
lootPool { item(Items.PINK_DYE) { setCount(8) } }
lootPool { item(Items.GRAY_DYE) { setCount(8) } }
lootPool { item(Items.LIGHT_GRAY_DYE) { setCount(8) } }
lootPool { item(Items.CYAN_DYE) { setCount(8) } }
lootPool { item(Items.PURPLE_DYE) { setCount(8) } }
lootPool { item(Items.BLUE_DYE) { setCount(8) } }
lootPool { item(Items.BROWN_DYE) { setCount(8) } }
lootPool { item(Items.GREEN_DYE) { setCount(8) } }
lootPool { item(Items.RED_DYE) { setCount(8) } }
lootPool { item(Items.BLACK_DYE) { setCount(8) } }
}
lootTables.builder(LootContextParamSets.ADVANCEMENT_ENTITY, modLootTable("tritanium_block4")) {
lootPool { item(Items.WHITE_DYE) { setCount(64) } }
lootPool { item(Items.ORANGE_DYE) { setCount(64) } }
lootPool { item(Items.MAGENTA_DYE) { setCount(64) } }
lootPool { item(Items.LIGHT_BLUE_DYE) { setCount(64) } }
lootPool { item(Items.YELLOW_DYE) { setCount(64) } }
lootPool { item(Items.LIME_DYE) { setCount(64) } }
lootPool { item(Items.PINK_DYE) { setCount(64) } }
lootPool { item(Items.GRAY_DYE) { setCount(64) } }
lootPool { item(Items.LIGHT_GRAY_DYE) { setCount(64) } }
lootPool { item(Items.CYAN_DYE) { setCount(64) } }
lootPool { item(Items.PURPLE_DYE) { setCount(64) } }
lootPool { item(Items.BLUE_DYE) { setCount(64) } }
lootPool { item(Items.BROWN_DYE) { setCount(64) } }
lootPool { item(Items.GREEN_DYE) { setCount(64) } }
lootPool { item(Items.RED_DYE) { setCount(64) } }
lootPool { item(Items.BLACK_DYE) { setCount(64) } }
}
}

View File

@ -0,0 +1,88 @@
package ru.dbotthepony.mc.otm.datagen.loot
import net.minecraft.world.level.block.state.properties.BlockStateProperties
import net.minecraft.world.level.block.state.properties.DoubleBlockHalf
import net.minecraft.world.level.storage.loot.predicates.ExplosionCondition
import ru.dbotthepony.mc.otm.registry.game.MBlocks
import ru.dbotthepony.mc.otm.registry.MRegistry
fun addDecorativeLoot(lootTables: LootTables) {
lootTables.dropsSelf(MRegistry.DECORATIVE_CRATE.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MRegistry.COMPUTER_TERMINAL.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MRegistry.STAR_CHAIR.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MRegistry.CARGO_CRATES.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MRegistry.INDUSTRIAL_GLASS.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MRegistry.INDUSTRIAL_GLASS_PANE.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MRegistry.TRITANIUM_BLOCK.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MRegistry.TRITANIUM_WALL.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MRegistry.TRITANIUM_STAIRS.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.createSlabItemTable(MRegistry.TRITANIUM_SLAB.allBlocks.values)
lootTables.dropsSelf(MRegistry.VENT.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MRegistry.VENT_ALTERNATIVE.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MRegistry.FLOOR_TILES.blocks.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MRegistry.UNREFINED_FLOOR_TILES.blocks.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MRegistry.TRITANIUM_STRIPED_BLOCK.flatBlocks) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MRegistry.TRITANIUM_STRIPED_STAIRS.flatBlocks) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MRegistry.TRITANIUM_STRIPED_WALL.flatBlocks) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.createSlabItemTable(MRegistry.TRITANIUM_STRIPED_SLAB.flatBlocks) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MRegistry.FLOOR_TILES_STAIRS.blocks.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.createSlabItemTable(MRegistry.FLOOR_TILES_SLAB.blocks.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.CARBON_FIBRE_BLOCK) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.METAL_MESH) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.METAL_RAILING) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.METAL_JUNK) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.TRITANIUM_RAW_BLOCK) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.TRITANIUM_STRIPED_BLOCK.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.TRITANIUM_STRIPED_WALL.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.TRITANIUM_STRIPED_STAIRS.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.createSlabItemTable(MBlocks.TRITANIUM_STRIPED_SLAB.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.LABORATORY_LAMP) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.LABORATORY_LAMP_INVERTED) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.DANGER_STRIPE_BLOCK) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.METAL_BEAM) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.TRITANIUM_INGOT_BLOCK) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.TRITANIUM_BARS) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.WITHERED_STEEL_BLOCK) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.TRITANIUM_HULL) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.GENERATOR_BLOCK) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.MODULAR_FRAME) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.HEAVY_MODULAR_FRAME) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.FLYWHEEL_SHAFT) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.FLYWHEEL_HOUSING) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.FLYWHEEL_BEARING) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.ENGINE) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.REDSTONE_LAMP_INVERTED) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.REINFORCED_REDSTONE_LAMP) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.REINFORCED_REDSTONE_LAMP_INVERTED) { condition(ExplosionCondition.survivesExplosion()) }
MBlocks.TRITANIUM_ANVIL.values.forEach { it.forEach { lootTables.dropsSelf(it) { condition(ExplosionCondition.survivesExplosion()) } } }
for (door in MBlocks.TRITANIUM_TRAPDOOR.values)
lootTables.dropsSelf(door) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MRegistry.TRITANIUM_PRESSURE_PLATE.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) }
for (door in MBlocks.TRITANIUM_DOOR.values) {
lootTables.block(door) {
item(door) {
blockStateCondition(door) {
this[BlockStateProperties.DOUBLE_BLOCK_HALF] = DoubleBlockHalf.LOWER
}
}
condition(ExplosionCondition.survivesExplosion())
}
}
}

View File

@ -0,0 +1,32 @@
package ru.dbotthepony.mc.otm.datagen.loot
import net.minecraft.world.level.storage.loot.functions.SetComponentsFunction
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets
import ru.dbotthepony.mc.otm.datagen.modLootTable
import ru.dbotthepony.mc.otm.registry.game.MDataComponentTypes
import ru.dbotthepony.mc.otm.registry.game.MEntityTypes
import ru.dbotthepony.mc.otm.registry.game.MItems
fun addEntityLoot(loot: LootTables) {
loot.builder(LootContextParamSets.ENTITY, modLootTable("entities/loader")) {
lootPool {
item(MItems.MECHANICAL_PARTS) {
setCount(1, 3)
setWeight(7)
}
item(MItems.ELECTRIC_PARTS) {
setCount(1, 1)
setWeight(1)
}
setRolls(1)
}
}
loot.builder(LootContextParamSets.ENTITY, MEntityTypes.BREAD_MONSTER.defaultLootTable) {
lootPool {
item(MItems.IMPERFECT_BREAD) {
apply(SetComponentsFunction.setComponent(MDataComponentTypes.INERT, true))
}
}
}
}

View File

@ -1,9 +1,9 @@
package ru.dbotthepony.mc.otm.datagen.loot package ru.dbotthepony.mc.otm.datagen.loot
import net.minecraft.data.DataGenerator
import net.minecraft.world.item.ItemStack import net.minecraft.world.item.ItemStack
import net.minecraft.world.level.storage.loot.predicates.LootItemCondition import net.minecraft.world.level.storage.loot.predicates.LootItemCondition
import net.minecraftforge.common.data.GlobalLootModifierProvider import net.neoforged.neoforge.common.data.GlobalLootModifierProvider
import net.neoforged.neoforge.data.event.GatherDataEvent
import ru.dbotthepony.mc.otm.data.loot.LootPoolAppender import ru.dbotthepony.mc.otm.data.loot.LootPoolAppender
import ru.dbotthepony.mc.otm.datagen.DataGen import ru.dbotthepony.mc.otm.datagen.DataGen
import java.util.Arrays import java.util.Arrays
@ -51,7 +51,7 @@ fun PlainLootAppender(
vararg items: Pair<ItemStack, Double> vararg items: Pair<ItemStack, Double>
) = PlainLootAppender(conditions, Arrays.stream(items)) ) = PlainLootAppender(conditions, Arrays.stream(items))
class LootModifiers(generator: DataGenerator) : GlobalLootModifierProvider(generator.packOutput, DataGen.MOD_ID) { class LootModifiers(generator: GatherDataEvent) : GlobalLootModifierProvider(generator.generator.packOutput, generator.lookupProvider, DataGen.MOD_ID) {
private val lambdas = ArrayList<(LootModifiers) -> Unit>() private val lambdas = ArrayList<(LootModifiers) -> Unit>()
fun lambda(lambda: (LootModifiers) -> Unit) { fun lambda(lambda: (LootModifiers) -> Unit) {

View File

@ -1,23 +1,30 @@
package ru.dbotthepony.mc.otm.datagen.loot package ru.dbotthepony.mc.otm.datagen.loot
import net.minecraft.resources.ResourceKey
import net.minecraft.resources.ResourceLocation import net.minecraft.resources.ResourceLocation
import net.minecraft.util.valueproviders.UniformInt import net.minecraft.util.valueproviders.UniformInt
import net.minecraft.world.entity.EntityType import net.minecraft.world.entity.EntityType
import net.minecraft.world.item.ItemStack import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.Rarity import net.minecraft.world.item.Items
import net.minecraft.world.level.storage.loot.BuiltInLootTables import net.minecraft.world.level.storage.loot.BuiltInLootTables
import net.minecraft.world.level.storage.loot.LootTable
import net.minecraft.world.level.storage.loot.predicates.LootItemCondition import net.minecraft.world.level.storage.loot.predicates.LootItemCondition
import net.minecraftforge.common.loot.LootTableIdCondition import net.neoforged.neoforge.common.loot.AddTableLootModifier
import ru.dbotthepony.mc.otm.core.math.Decimal import net.neoforged.neoforge.common.loot.LootTableIdCondition
import ru.dbotthepony.mc.otm.data.UniformDecimal import ru.dbotthepony.mc.otm.util.ResourceLocation
import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.data.world.UniformDecimal
import ru.dbotthepony.mc.otm.data.condition.ChanceWithPlaytimeCondition import ru.dbotthepony.mc.otm.data.condition.ChanceWithPlaytimeCondition
import ru.dbotthepony.mc.otm.data.condition.HasExoPackCondition import ru.dbotthepony.mc.otm.data.condition.HasExoPackCondition
import ru.dbotthepony.mc.otm.data.condition.ItemInInventoryCondition import ru.dbotthepony.mc.otm.data.condition.ItemInInventoryCondition
import ru.dbotthepony.mc.otm.data.condition.KilledByRealPlayerOrIndirectly import ru.dbotthepony.mc.otm.data.condition.KilledByRealPlayerOrIndirectly
import ru.dbotthepony.mc.otm.data.loot.LootPoolAppender import ru.dbotthepony.mc.otm.data.loot.LootPoolAppender
import ru.dbotthepony.mc.otm.datagen.DataGen
import ru.dbotthepony.mc.otm.datagen.modLootTable
import ru.dbotthepony.mc.otm.item.ProceduralBatteryItem import ru.dbotthepony.mc.otm.item.ProceduralBatteryItem
import ru.dbotthepony.mc.otm.item.exopack.ProceduralExoPackSlotUpgradeItem import ru.dbotthepony.mc.otm.item.exopack.ProceduralExopackSlotUpgradeItem
import ru.dbotthepony.mc.otm.registry.MItems import ru.dbotthepony.mc.otm.item.matter.GoldDiskItem
import ru.dbotthepony.mc.otm.registry.game.MItems
@Suppress("FunctionName") @Suppress("FunctionName")
fun LootTableIdCondition(location: String): LootItemCondition { fun LootTableIdCondition(location: String): LootItemCondition {
@ -29,18 +36,23 @@ fun LootTableIdCondition(location: ResourceLocation): LootItemCondition {
return LootTableIdCondition.Builder(location).build() return LootTableIdCondition.Builder(location).build()
} }
@Suppress("FunctionName")
fun LootTableIdCondition(location: ResourceKey<LootTable>): LootItemCondition {
return LootTableIdCondition.Builder(location.location()).build()
}
fun addLootModifiers(it: LootModifiers) { fun addLootModifiers(it: LootModifiers) {
it.add("dungeon_exopack", LootPoolAppender( it.add("dungeon_exopack", LootPoolAppender(
arrayOf(LootTableIdCondition(BuiltInLootTables.SIMPLE_DUNGEON)), arrayOf(LootTableIdCondition(BuiltInLootTables.SIMPLE_DUNGEON)),
singleItem(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) { singleItem(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) {
chanceCondition(0.2) chanceCondition(0.2)
apply(ProceduralExoPackSlotUpgradeItem.Randomizer(UniformInt.of(6, 9))) apply(ProceduralExopackSlotUpgradeItem.Randomizer(UniformInt.of(6, 9)))
}, },
singleItem(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) { singleItem(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) {
chanceCondition(0.05) chanceCondition(0.05)
apply(ProceduralExoPackSlotUpgradeItem.Randomizer(UniformInt.of(9, 18))) apply(ProceduralExopackSlotUpgradeItem.Randomizer(UniformInt.of(9, 18)))
}, },
)) ))
@ -49,12 +61,17 @@ fun addLootModifiers(it: LootModifiers) {
singleItem(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) { singleItem(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) {
chanceCondition(0.1) chanceCondition(0.1)
apply(ProceduralExoPackSlotUpgradeItem.Randomizer(UniformInt.of(4, 8))) apply(ProceduralExopackSlotUpgradeItem.Randomizer(UniformInt.of(4, 8)))
}, },
singleItem(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) { singleItem(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) {
chanceCondition(0.1) chanceCondition(0.1)
apply(ProceduralExoPackSlotUpgradeItem.Randomizer(UniformInt.of(4, 10))) apply(ProceduralExopackSlotUpgradeItem.Randomizer(UniformInt.of(4, 10)))
},
singleItem(MItems.GOLD_DISK) {
chanceCondition(0.1)
apply(GoldDiskItem.patterns(DataGen.random, MItems.IMPERFECT_BREAD))
}, },
singleItem(MItems.PROCEDURAL_BATTERY) { singleItem(MItems.PROCEDURAL_BATTERY) {
@ -73,12 +90,12 @@ fun addLootModifiers(it: LootModifiers) {
singleItem(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) { singleItem(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) {
chanceCondition(0.1) chanceCondition(0.1)
apply(ProceduralExoPackSlotUpgradeItem.Randomizer(UniformInt.of(12, 18))) apply(ProceduralExopackSlotUpgradeItem.Randomizer(UniformInt.of(12, 18)))
}, },
singleItem(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) { singleItem(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) {
chanceCondition(0.25) chanceCondition(0.25)
apply(ProceduralExoPackSlotUpgradeItem.Randomizer(UniformInt.of(4, 9))) apply(ProceduralExopackSlotUpgradeItem.Randomizer(UniformInt.of(4, 9)))
}, },
)) ))
@ -87,12 +104,12 @@ fun addLootModifiers(it: LootModifiers) {
singleItem(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) { singleItem(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) {
chanceCondition(0.15) chanceCondition(0.15)
apply(ProceduralExoPackSlotUpgradeItem.Randomizer(UniformInt.of(9, 18))) apply(ProceduralExopackSlotUpgradeItem.Randomizer(UniformInt.of(9, 18)))
}, },
singleItem(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) { singleItem(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) {
chanceCondition(0.35) chanceCondition(0.35)
apply(ProceduralExoPackSlotUpgradeItem.Randomizer(UniformInt.of(16, 28), UniformInt.of(2, 6))) apply(ProceduralExopackSlotUpgradeItem.Randomizer(UniformInt.of(16, 28), UniformInt.of(2, 6)))
}, },
)) ))
@ -101,17 +118,22 @@ fun addLootModifiers(it: LootModifiers) {
singleItem(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) { singleItem(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) {
chanceCondition(0.4) chanceCondition(0.4)
apply(ProceduralExoPackSlotUpgradeItem.Randomizer(UniformInt.of(9, 18))) apply(ProceduralExopackSlotUpgradeItem.Randomizer(UniformInt.of(9, 18)))
}, },
singleItem(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) { singleItem(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) {
chanceCondition(0.2) chanceCondition(0.2)
apply(ProceduralExoPackSlotUpgradeItem.Randomizer(UniformInt.of(14, 27), UniformInt.of(2, 6))) apply(ProceduralExopackSlotUpgradeItem.Randomizer(UniformInt.of(14, 27), UniformInt.of(2, 6)))
}, },
singleItem(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) { singleItem(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) {
chanceCondition(0.1) chanceCondition(0.1)
apply(ProceduralExoPackSlotUpgradeItem.Randomizer(UniformInt.of(27, 56), UniformInt.of(2, 6))) apply(ProceduralExopackSlotUpgradeItem.Randomizer(UniformInt.of(27, 56), UniformInt.of(2, 6)))
},
singleItem(MItems.GOLD_DISK) {
chanceCondition(0.15)
apply(GoldDiskItem.patterns(DataGen.random, Items.ENDER_PEARL))
}, },
)) ))
@ -120,6 +142,7 @@ fun addLootModifiers(it: LootModifiers) {
ItemStack(MItems.PILL_ANDROID, 1) to 0.1, ItemStack(MItems.PILL_ANDROID, 1) to 0.1,
ItemStack(MItems.PILL_HEAL, 2) to 0.5, ItemStack(MItems.PILL_HEAL, 2) to 0.5,
ItemStack(MItems.PILL_HEAL, 1) to 0.75, ItemStack(MItems.PILL_HEAL, 1) to 0.75,
ItemStack(MItems.PILL_NOT_NORMAL, 3) to 0.25,
)) ))
it.add("mineshaft_pill", PlainLootAppender( it.add("mineshaft_pill", PlainLootAppender(
@ -127,6 +150,7 @@ fun addLootModifiers(it: LootModifiers) {
ItemStack(MItems.PILL_ANDROID, 1) to 0.04, ItemStack(MItems.PILL_ANDROID, 1) to 0.04,
ItemStack(MItems.PILL_HEAL, 2) to 0.1, ItemStack(MItems.PILL_HEAL, 2) to 0.1,
ItemStack(MItems.PILL_HEAL, 1) to 0.4, ItemStack(MItems.PILL_HEAL, 1) to 0.4,
ItemStack(MItems.PILL_NOT_NORMAL, 3) to 0.25,
)) ))
it.add("mineshaft_nutrient_paste", PlainLootAppender( it.add("mineshaft_nutrient_paste", PlainLootAppender(
@ -140,11 +164,13 @@ fun addLootModifiers(it: LootModifiers) {
arrayOf(LootTableIdCondition(BuiltInLootTables.DESERT_PYRAMID)), arrayOf(LootTableIdCondition(BuiltInLootTables.DESERT_PYRAMID)),
ItemStack(MItems.PILL_ANDROID, 1) to 0.15, ItemStack(MItems.PILL_ANDROID, 1) to 0.15,
ItemStack(MItems.PILL_HEAL, 1) to 0.3, ItemStack(MItems.PILL_HEAL, 1) to 0.3,
ItemStack(MItems.PILL_NOT_NORMAL, 3) to 0.25,
)) ))
it.add("jungle_temple_pill", PlainLootAppender( it.add("jungle_temple_pill", PlainLootAppender(
arrayOf(LootTableIdCondition(BuiltInLootTables.JUNGLE_TEMPLE)), arrayOf(LootTableIdCondition(BuiltInLootTables.JUNGLE_TEMPLE)),
ItemStack(MItems.PILL_ANDROID, 1) to 0.5 ItemStack(MItems.PILL_ANDROID, 1) to 0.5,
ItemStack(MItems.PILL_NOT_NORMAL, 8) to 0.2,
)) ))
it.add("end_city_modifications", PlainLootAppender( it.add("end_city_modifications", PlainLootAppender(
@ -152,7 +178,8 @@ fun addLootModifiers(it: LootModifiers) {
ItemStack(MItems.PILL_ANDROID, 1) to 0.15, ItemStack(MItems.PILL_ANDROID, 1) to 0.15,
ItemStack(MItems.PILL_HUMANE, 1) to 0.3, ItemStack(MItems.PILL_HUMANE, 1) to 0.3,
ItemStack(MItems.PILL_OBLIVION, 1) to 0.5, ItemStack(MItems.PILL_OBLIVION, 1) to 0.5,
ItemStack(MItems.ZPM_BATTERY, 1) to 0.005, ItemStack(MItems.ZPM_BATTERY, 1) to 0.004,
ItemStack(MItems.ANTIMATTER_TRANSFORM_MATRIX, 1) to 0.5,
)) ))
it.add("shipwreck_supply_pill", PlainLootAppender( it.add("shipwreck_supply_pill", PlainLootAppender(
@ -162,6 +189,7 @@ fun addLootModifiers(it: LootModifiers) {
ItemStack(MItems.PILL_HEAL, 1) to 0.6, ItemStack(MItems.PILL_HEAL, 1) to 0.6,
ItemStack(MItems.PILL_HEAL, 1) to 0.6, ItemStack(MItems.PILL_HEAL, 1) to 0.6,
ItemStack(MItems.PILL_HEAL, 1) to 0.6, ItemStack(MItems.PILL_HEAL, 1) to 0.6,
ItemStack(MItems.PILL_NOT_NORMAL, 4) to 0.25,
)) ))
it.add("shipwreck_supply_nutrient_paste", PlainLootAppender( it.add("shipwreck_supply_nutrient_paste", PlainLootAppender(
@ -189,6 +217,16 @@ fun addLootModifiers(it: LootModifiers) {
ItemStack(MItems.EXOPACK_PROBE) ItemStack(MItems.EXOPACK_PROBE)
)) ))
it.add("withered_skeleton_steel_drop", PlainLootAppender(
arrayOf(
LootTableIdCondition(EntityType.WITHER_SKELETON.defaultLootTable),
KilledByRealPlayerOrIndirectly
),
ItemStack(MItems.WITHERED_STEEL, 1) to 0.15,
ItemStack(MItems.WITHERED_STEEL, 2) to 0.1
))
it.add("wither_exosuit_upgrades", BasicLootAppender( it.add("wither_exosuit_upgrades", BasicLootAppender(
arrayOf( arrayOf(
LootTableIdCondition(EntityType.WITHER.defaultLootTable), LootTableIdCondition(EntityType.WITHER.defaultLootTable),
@ -204,4 +242,29 @@ fun addLootModifiers(it: LootModifiers) {
), ),
ItemStack(MItems.ExopackUpgrades.INVENTORY_UPGRADE_ENDER_DRAGON), ItemStack(MItems.ExopackUpgrades.INVENTORY_UPGRADE_ENDER_DRAGON),
)) ))
it.add("trials/matter_dust", AddTableLootModifier(
arrayOf(LootTableIdCondition(BuiltInLootTables.TRIAL_CHAMBERS_REWARD)),
modLootTable("trials/matter_dust")
))
it.add("trials/pill", AddTableLootModifier(
arrayOf(LootTableIdCondition(BuiltInLootTables.TRIAL_CHAMBERS_REWARD)),
modLootTable("trials/pill")
))
it.add("trials/exosuit", AddTableLootModifier(
arrayOf(LootTableIdCondition(BuiltInLootTables.TRIAL_CHAMBERS_REWARD)),
modLootTable("trials/exosuit")
))
it.add("trials/battery", AddTableLootModifier(
arrayOf(LootTableIdCondition(BuiltInLootTables.TRIAL_CHAMBERS_REWARD)),
modLootTable("trials/battery")
))
it.add("trials/zpm_battery", AddTableLootModifier(
arrayOf(LootTableIdCondition(BuiltInLootTables.TRIAL_CHAMBERS_REWARD_OMINOUS)),
modLootTable("trials/zpm_battery")
))
} }

View File

@ -6,10 +6,12 @@ package ru.dbotthepony.mc.otm.datagen.loot
import it.unimi.dsi.fastutil.objects.Reference2ObjectArrayMap import it.unimi.dsi.fastutil.objects.Reference2ObjectArrayMap
import it.unimi.dsi.fastutil.objects.Reference2ObjectFunction import it.unimi.dsi.fastutil.objects.Reference2ObjectFunction
import net.minecraft.advancements.critereon.StatePropertiesPredicate import net.minecraft.advancements.critereon.StatePropertiesPredicate
import net.minecraft.data.DataGenerator import net.minecraft.core.HolderLookup
import net.minecraft.core.WritableRegistry
import net.minecraft.data.loot.LootTableProvider import net.minecraft.data.loot.LootTableProvider
import net.minecraft.data.loot.LootTableSubProvider import net.minecraft.data.loot.LootTableSubProvider
import net.minecraft.resources.ResourceLocation import net.minecraft.resources.ResourceKey
import net.minecraft.util.ProblemReporter
import net.minecraft.world.level.ItemLike import net.minecraft.world.level.ItemLike
import net.minecraft.world.level.block.Block import net.minecraft.world.level.block.Block
import net.minecraft.world.level.block.SlabBlock import net.minecraft.world.level.block.SlabBlock
@ -19,54 +21,31 @@ import net.minecraft.world.level.storage.loot.LootTable
import net.minecraft.world.level.storage.loot.ValidationContext import net.minecraft.world.level.storage.loot.ValidationContext
import net.minecraft.world.level.storage.loot.entries.LootItem import net.minecraft.world.level.storage.loot.entries.LootItem
import net.minecraft.world.level.storage.loot.entries.LootPoolSingletonContainer import net.minecraft.world.level.storage.loot.entries.LootPoolSingletonContainer
import net.minecraft.world.level.storage.loot.functions.CopyNbtFunction
import net.minecraft.world.level.storage.loot.functions.SetItemCountFunction import net.minecraft.world.level.storage.loot.functions.SetItemCountFunction
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSet import net.minecraft.world.level.storage.loot.parameters.LootContextParamSet
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets
import net.minecraft.world.level.storage.loot.predicates.LootItemBlockStatePropertyCondition import net.minecraft.world.level.storage.loot.predicates.LootItemBlockStatePropertyCondition
import net.minecraft.world.level.storage.loot.providers.number.ConstantValue import net.minecraft.world.level.storage.loot.providers.number.ConstantValue
import ru.dbotthepony.mc.otm.block.entity.MatteryBlockEntity import net.neoforged.neoforge.data.event.GatherDataEvent
import ru.dbotthepony.mc.otm.block.entity.MatteryWorkerBlockEntity import ru.dbotthepony.kommons.collect.stream
import ru.dbotthepony.mc.otm.core.stream
import ru.dbotthepony.mc.otm.data.loot.CopyTileNbtFunction import ru.dbotthepony.mc.otm.data.loot.CopyTileNbtFunction
import java.util.concurrent.CompletableFuture
data class NbtCopy(val source: String, val destination: String, val strategy: CopyNbtFunction.MergeStrategy = CopyNbtFunction.MergeStrategy.REPLACE) class LootTables(generator: GatherDataEvent) : LootTableProvider(generator.generator.packOutput, setOf() /* because we don't fucking validate you fuck */, listOf() /* because we attach everything after class is constructed duh */, generator.lookupProvider) {
private val providersTable = Reference2ObjectArrayMap<LootContextParamSet, HashMap<ResourceKey<LootTable>, () -> LootTable.Builder>>()
val registry: CompletableFuture<HolderLookup.Provider> = generator.lookupProvider
fun TileNbtCopy(source: String, strategy: CopyNbtFunction.MergeStrategy = CopyNbtFunction.MergeStrategy.REPLACE): NbtCopy { fun builder(context: LootContextParamSet, id: ResourceKey<LootTable>, provider: LootTable.Builder.() -> Unit) {
return NbtCopy(source, "BlockEntityTag.$source", strategy)
}
private val basicTags = arrayOf(
TileNbtCopy(MatteryBlockEntity.REDSTONE_CONTROL_KEY),
)
private val poweredTags = arrayOf(
*basicTags,
TileNbtCopy(MatteryBlockEntity.ENERGY_KEY),
TileNbtCopy(MatteryBlockEntity.BATTERY_KEY),
)
private val workerTags = arrayOf(
*poweredTags,
TileNbtCopy(MatteryWorkerBlockEntity.JOB_KEY),
TileNbtCopy(MatteryWorkerBlockEntity.WORK_TICKS_KEY),
)
private val poweredMatterWorker = arrayOf(
*workerTags,
TileNbtCopy(MatteryBlockEntity.MATTER_STORAGE_KEY),
)
class LootTables(generator: DataGenerator) : LootTableProvider(generator.packOutput, setOf() /* because we don't fucking validate you fuck */, listOf() /* because we attach everything after class is constructed duh */) {
private val providersTable = Reference2ObjectArrayMap<LootContextParamSet, HashMap<ResourceLocation, () -> LootTable.Builder>>()
fun builder(context: LootContextParamSet, id: ResourceLocation, provider: LootTable.Builder.() -> Unit) {
provider(context, id) { provider(context, id) {
LootTable.lootTable().also(provider) LootTable.lootTable().also(provider)
} }
} }
fun provider(context: LootContextParamSet, id: ResourceLocation, provider: () -> LootTable.Builder) { fun builder(block: Block, provider: LootPool.Builder.() -> Unit) {
singleLootPool(LootContextParamSets.BLOCK, block.lootTable, provider)
}
fun provider(context: LootContextParamSet, id: ResourceKey<LootTable>, provider: () -> LootTable.Builder) {
check(providersTable check(providersTable
.computeIfAbsent(context, Reference2ObjectFunction { HashMap() }) .computeIfAbsent(context, Reference2ObjectFunction { HashMap() })
.put(id, provider) == null) { "Duplicate loot pool entry for $id" } .put(id, provider) == null) { "Duplicate loot pool entry for $id" }
@ -84,7 +63,11 @@ class LootTables(generator: DataGenerator) : LootTableProvider(generator.packOut
}.toList() }.toList()
} }
override fun validate(map: MutableMap<ResourceLocation, LootTable>, validationtracker: ValidationContext) {} override fun validate(
writableregistry: WritableRegistry<LootTable>,
validationtracker: ValidationContext,
`problemreporter$collector`: ProblemReporter.Collector
) {}
fun createSlabItemTable(block: Block, configurator: LootPoolSingletonContainer.Builder<*>.() -> Unit = {}) { fun createSlabItemTable(block: Block, configurator: LootPoolSingletonContainer.Builder<*>.() -> Unit = {}) {
builder(LootContextParamSets.BLOCK, block.lootTable) { builder(LootContextParamSets.BLOCK, block.lootTable) {
@ -121,9 +104,10 @@ class LootTables(generator: DataGenerator) : LootTableProvider(generator.packOut
} }
} }
fun singleLootPool(context: LootContextParamSet, id: ResourceLocation, block: LootPool.Builder.() -> Unit) { fun singleLootPool(context: LootContextParamSet, id: ResourceKey<LootTable>, block: LootPool.Builder.() -> Unit) {
builder(context, id) { builder(context, id) {
withPool(LootPool.lootPool().also(block)) withPool(LootPool.lootPool().also(block))
setRandomSequence(id.location())
} }
} }
@ -162,4 +146,14 @@ class LootTables(generator: DataGenerator) : LootTableProvider(generator.packOut
}) })
} }
} }
fun tile(blocks: Collection<Block>, vararg filterTags: String) {
for (block in blocks) {
singleLootPool(LootContextParamSets.BLOCK, block.lootTable) {
add(LootItem.lootTableItem(block).also {
it.apply(CopyTileNbtFunction(filterTags.stream()))
})
}
}
}
} }

View File

@ -1,14 +1,18 @@
package ru.dbotthepony.mc.otm.datagen.loot package ru.dbotthepony.mc.otm.datagen.loot
import net.minecraft.util.valueproviders.UniformInt
import net.minecraft.world.item.Items import net.minecraft.world.item.Items
import net.minecraft.world.level.storage.loot.entries.LootItem
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets
import net.minecraft.world.level.storage.loot.providers.number.ConstantValue import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.datagen.modLocation import ru.dbotthepony.mc.otm.data.world.UniformDecimal
import ru.dbotthepony.mc.otm.registry.MItems import ru.dbotthepony.mc.otm.datagen.modLootTable
import ru.dbotthepony.mc.otm.item.ProceduralBatteryItem
import ru.dbotthepony.mc.otm.item.exopack.ProceduralExopackSlotUpgradeItem
import ru.dbotthepony.mc.otm.item.matter.MatterDustItem
import ru.dbotthepony.mc.otm.registry.game.MItems
fun addChestLootTables(loot: LootTables) { fun addChestLootTables(loot: LootTables) {
loot.builder(LootContextParamSets.CHEST, modLocation("food_box")) { loot.builder(LootContextParamSets.CHEST, modLootTable("food_box")) {
lootPool { lootPool {
item(Items.PACKED_ICE) { setCount(minimal = 1, maximal = 3) } item(Items.PACKED_ICE) { setCount(minimal = 1, maximal = 3) }
item(MItems.NUTRIENT_PASTE) { setCount(minimal = 1, maximal = 2) } item(MItems.NUTRIENT_PASTE) { setCount(minimal = 1, maximal = 2) }
@ -17,4 +21,106 @@ fun addChestLootTables(loot: LootTables) {
setRolls(3) setRolls(3)
} }
} }
loot.builder(LootContextParamSets.CHEST, modLootTable("salvage_crate")) {
lootPool {
item(MItems.MECHANICAL_PARTS) { setCount(minimal = 2, maximal = 3) }
item(MItems.IRON_PLATE) { setCount(minimal = 2, maximal = 3) }
item(MItems.ELECTRIC_PARTS) { setCount(minimal = 2, maximal = 3) }
item(MItems.MECHANICAL_PARTS) { setCount(minimal = 2, maximal = 3) }
item(MItems.CIRCUIT_PLATING) { setCount(minimal = 1, maximal = 3) }
item(MItems.METAL_JUNK) { setCount(minimal = 3, maximal = 5) }
item(Items.COPPER_INGOT) { setCount(minimal = 1, maximal = 3) }
item(Items.EXPOSED_COPPER) { setCount(minimal = 1, maximal = 2) }
item(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) {
chanceCondition(0.1)
setWeight(1)
apply(ProceduralExopackSlotUpgradeItem.Randomizer(UniformInt.of(1, 9), UniformInt.of(0, 3)))
}
setRolls(7)
}
}
loot.builder(LootContextParamSets.CHEST, modLootTable("frigate_cargo")) {
lootPool {
item(Items.IRON_INGOT) {
setCount(minimal = 1, maximal = 3)
setWeight(3)
}
item(Items.GOLD_INGOT) { setCount(minimal = 1, maximal = 3) }
item(Items.EMERALD) { setCount(minimal = 1, maximal = 3) }
item(MItems.TRITANIUM_INGOT) { setCount(minimal = 1, maximal = 3) }
item(MItems.MECHANICAL_PARTS) {
setCount(minimal = 2, maximal = 3)
setWeight(2)
}
item(MItems.CIRCUIT_PLATING) { setCount(minimal = 2, maximal = 3) }
item(MItems.ENERGY_BUS) { setCount(minimal = 0, maximal = 2) }
item(MItems.ROFLITE_ALLOY_INGOT) { setCount(minimal = 0, maximal = 3) }
item(MItems.WITHERED_STEEL) { setCount(minimal = 0, maximal = 3) }
item(Items.SADDLE) { setCount(minimal = 0, maximal = 1) }
item(Items.DIAMOND) { setCount(minimal = 0, maximal = 3) }
item(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) {
chanceCondition(0.2)
setWeight(3)
apply(ProceduralExopackSlotUpgradeItem.Randomizer(UniformInt.of(1, 9), UniformInt.of(0, 3)))
}
item(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) {
chanceCondition(0.1)
setWeight(2)
apply(ProceduralExopackSlotUpgradeItem.Randomizer(UniformInt.of(9, 18), UniformInt.of(0, 3)))
}
item(MItems.PROCEDURAL_BATTERY) {
chanceCondition(0.05)
setWeight(1)
apply(
ProceduralBatteryItem.Randomizer(
maxBatteryLevel = UniformDecimal(Decimal(10_000_000), Decimal(50_000_000)),
batteryLevel = UniformDecimal(Decimal(0), Decimal(25_000_000)),
maxInput = UniformDecimal(Decimal(1_000), Decimal(5_000)),
))
}
item(MItems.ZPM_BATTERY) {
chanceCondition(0.001)
setWeight(1)
}
item(MItems.MATTER_DUST) {
chanceCondition(0.1)
setWeight(4)
apply(MatterDustItem.Randomizer(UniformDecimal(Decimal(100), Decimal(2_500))))
}
setRolls(12)
}
}
loot.builder(LootContextParamSets.CHEST, modLootTable("laboratory/supply")) {
lootPool {
item(Items.BREAD) { setCount(minimal = 2, maximal = 3) }
item(Items.HONEY_BOTTLE) { setCount(minimal = 1, maximal = 2) }
item(MItems.NUTRIENT_PASTE) { setCount(minimal = 2, maximal = 3) }
item(Items.SNOWBALL) { setCount(minimal = 1, maximal = 5) }
item(Items.PACKED_ICE) { setCount(minimal = 2, maximal = 3) }
setRolls(7)
}
}
loot.builder(LootContextParamSets.CHEST, modLootTable("laboratory/reward")) {
lootPool {
item(MItems.NUTRIENT_PASTE) { setCount(minimal = 2, maximal = 3) }
setRolls(5)
}
}
} }

View File

@ -1,159 +1,61 @@
package ru.dbotthepony.mc.otm.datagen.loot package ru.dbotthepony.mc.otm.datagen.loot
import net.minecraft.world.item.Items import net.minecraft.advancements.critereon.EnchantmentPredicate
import net.minecraft.world.level.block.state.properties.BlockStateProperties import net.minecraft.advancements.critereon.ItemEnchantmentsPredicate
import net.minecraft.world.level.block.state.properties.DoubleBlockHalf import net.minecraft.advancements.critereon.ItemPredicate
import net.minecraft.advancements.critereon.ItemSubPredicates
import net.minecraft.advancements.critereon.MinMaxBounds
import net.minecraft.util.valueproviders.UniformInt
import net.minecraft.world.item.enchantment.Enchantments
import net.minecraft.world.level.ItemLike
import net.minecraft.world.level.block.Block
import net.minecraft.world.level.storage.loot.entries.AlternativesEntry
import net.minecraft.world.level.storage.loot.entries.LootItem import net.minecraft.world.level.storage.loot.entries.LootItem
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets import net.minecraft.world.level.storage.loot.functions.ApplyBonusCount
import net.minecraft.world.level.storage.loot.functions.SetItemCountFunction
import net.minecraft.world.level.storage.loot.predicates.ExplosionCondition import net.minecraft.world.level.storage.loot.predicates.ExplosionCondition
import ru.dbotthepony.mc.otm.datagen.modLocation import net.minecraft.world.level.storage.loot.predicates.MatchTool
import ru.dbotthepony.mc.otm.registry.MBlocks import ru.dbotthepony.mc.otm.util.lookupOrThrow
import ru.dbotthepony.mc.otm.registry.MItems import ru.dbotthepony.mc.otm.data.loot.Int2NumberProvider
import ru.dbotthepony.mc.otm.registry.MRegistry import ru.dbotthepony.mc.otm.registry.game.MBlocks
import ru.dbotthepony.mc.otm.registry.game.MItems
private fun ore(lootTables: LootTables, ore: Block, clump: ItemLike, count: Int = 1) {
lootTables.builder(ore) {
add(AlternativesEntry.alternatives(
LootItem.lootTableItem(ore).also {
it.condition(MatchTool.toolMatches(
ItemPredicate.Builder.item().withSubPredicate(
ItemSubPredicates.ENCHANTMENTS,
ItemEnchantmentsPredicate.enchantments(listOf(EnchantmentPredicate(
lootTables.registry.get().lookupOrThrow(Enchantments.SILK_TOUCH), MinMaxBounds.Ints.atLeast(1)
)))
)
))
},
LootItem.lootTableItem(clump).also {
if (count != 1)
it.apply(SetItemCountFunction.setCount(Int2NumberProvider(UniformInt.of(1, count))))
it.apply(ApplyBonusCount.addOreBonusCount(lootTables.registry.get().lookupOrThrow(Enchantments.FORTUNE)))
it.condition(ExplosionCondition.survivesExplosion())
}
))
}
}
fun addLootTables(lootTables: LootTables) { fun addLootTables(lootTables: LootTables) {
lootTables.dropsSelf(MRegistry.DECORATIVE_CRATE.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MRegistry.CARGO_CRATES.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MRegistry.INDUSTRIAL_GLASS.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MRegistry.INDUSTRIAL_GLASS_PANE.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MRegistry.TRITANIUM_BLOCK.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MRegistry.TRITANIUM_WALL.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MRegistry.TRITANIUM_STAIRS.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.createSlabItemTable(MRegistry.TRITANIUM_SLAB.allBlocks.values)
lootTables.dropsSelf(MRegistry.VENT.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MRegistry.VENT_ALTERNATIVE.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MRegistry.FLOOR_TILES.blocks.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MRegistry.UNREFINED_FLOOR_TILES.blocks.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MRegistry.TRITANIUM_STRIPED_BLOCK.flatBlocks) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MRegistry.TRITANIUM_STRIPED_STAIRS.flatBlocks) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MRegistry.TRITANIUM_STRIPED_WALL.flatBlocks) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.createSlabItemTable(MRegistry.TRITANIUM_STRIPED_SLAB.flatBlocks) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MRegistry.FLOOR_TILES_STAIRS.blocks.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.createSlabItemTable(MRegistry.FLOOR_TILES_SLAB.blocks.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.CARBON_FIBRE_BLOCK) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.TRITANIUM_RAW_BLOCK) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.TRITANIUM_STRIPED_BLOCK) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.TRITANIUM_STRIPED_WALL) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.TRITANIUM_STRIPED_STAIRS) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.createSlabItemTable(MBlocks.TRITANIUM_STRIPED_SLAB) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.MATTER_CABLE) { condition(ExplosionCondition.survivesExplosion()) } lootTables.dropsSelf(MBlocks.MATTER_CABLE) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.ENERGY_CABLES.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.GRAVITATION_STABILIZER) lootTables.dropsSelf(MBlocks.GRAVITATION_STABILIZER)
lootTables.dropsOther(MBlocks.GRAVITATION_STABILIZER_LENS, MBlocks.GRAVITATION_STABILIZER) lootTables.dropsOther(MBlocks.GRAVITATION_STABILIZER_LENS, MBlocks.GRAVITATION_STABILIZER)
lootTables.dropsSelf(MBlocks.LABORATORY_LAMP) { condition(ExplosionCondition.survivesExplosion()) } ore(lootTables, MBlocks.TRITANIUM_ORE, MItems.TRITANIUM_ORE_CLUMP)
lootTables.dropsSelf(MBlocks.LABORATORY_LAMP_INVERTED) { condition(ExplosionCondition.survivesExplosion()) } ore(lootTables, MBlocks.DEEPSLATE_TRITANIUM_ORE, MItems.TRITANIUM_ORE_CLUMP)
lootTables.dropsSelf(MBlocks.DANGER_STRIPE_BLOCK) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.METAL_BEAM) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.TRITANIUM_INGOT_BLOCK) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.TRITANIUM_BARS) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MBlocks.ENGINE) { condition(ExplosionCondition.survivesExplosion()) } ore(lootTables, MBlocks.DILITHIUM_ORE, MItems.DILITHIUM_CRYSTAL, 2)
ore(lootTables, MBlocks.DEEPSLATE_DILITHIUM_ORE, MItems.DILITHIUM_CRYSTAL, 2)
for (block in MBlocks.TRITANIUM_ANVIL)
lootTables.dropsSelf(block) { condition(ExplosionCondition.survivesExplosion()) }
for (door in MBlocks.TRITANIUM_TRAPDOOR.values)
lootTables.dropsSelf(door) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.dropsSelf(MRegistry.TRITANIUM_PRESSURE_PLATE.allBlocks.values) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.block(MBlocks.PHANTOM_ATTRACTOR) {
item(MBlocks.PHANTOM_ATTRACTOR) {
blockStateCondition(MBlocks.PHANTOM_ATTRACTOR) {
this[BlockStateProperties.DOUBLE_BLOCK_HALF] = DoubleBlockHalf.LOWER
}
}
condition(ExplosionCondition.survivesExplosion())
}
for (door in MBlocks.TRITANIUM_DOOR.values) {
lootTables.block(door) {
item(door) {
blockStateCondition(door) {
this[BlockStateProperties.DOUBLE_BLOCK_HALF] = DoubleBlockHalf.LOWER
}
}
condition(ExplosionCondition.survivesExplosion())
}
}
lootTables.builder(LootContextParamSets.ADVANCEMENT_ENTITY, modLocation("research_all_android")) {
lootPool {
add(LootItem.lootTableItem(MItems.ExopackUpgrades.INVENTORY_UPGRADE_HUGE))
}
}
lootTables.builder(LootContextParamSets.ADVANCEMENT_ENTITY, modLocation("tritanium_block3")) {
lootPool { item(Items.WHITE_DYE) { setCount(8) } }
lootPool { item(Items.ORANGE_DYE) { setCount(8) } }
lootPool { item(Items.MAGENTA_DYE) { setCount(8) } }
lootPool { item(Items.LIGHT_BLUE_DYE) { setCount(8) } }
lootPool { item(Items.YELLOW_DYE) { setCount(8) } }
lootPool { item(Items.LIME_DYE) { setCount(8) } }
lootPool { item(Items.PINK_DYE) { setCount(8) } }
lootPool { item(Items.GRAY_DYE) { setCount(8) } }
lootPool { item(Items.LIGHT_GRAY_DYE) { setCount(8) } }
lootPool { item(Items.CYAN_DYE) { setCount(8) } }
lootPool { item(Items.PURPLE_DYE) { setCount(8) } }
lootPool { item(Items.BLUE_DYE) { setCount(8) } }
lootPool { item(Items.BROWN_DYE) { setCount(8) } }
lootPool { item(Items.GREEN_DYE) { setCount(8) } }
lootPool { item(Items.RED_DYE) { setCount(8) } }
lootPool { item(Items.BLACK_DYE) { setCount(8) } }
}
lootTables.builder(LootContextParamSets.ADVANCEMENT_ENTITY, modLocation("tritanium_block4")) {
lootPool { item(Items.WHITE_DYE) { setCount(64) } }
lootPool { item(Items.ORANGE_DYE) { setCount(64) } }
lootPool { item(Items.MAGENTA_DYE) { setCount(64) } }
lootPool { item(Items.LIGHT_BLUE_DYE) { setCount(64) } }
lootPool { item(Items.YELLOW_DYE) { setCount(64) } }
lootPool { item(Items.LIME_DYE) { setCount(64) } }
lootPool { item(Items.PINK_DYE) { setCount(64) } }
lootPool { item(Items.GRAY_DYE) { setCount(64) } }
lootPool { item(Items.LIGHT_GRAY_DYE) { setCount(64) } }
lootPool { item(Items.CYAN_DYE) { setCount(64) } }
lootPool { item(Items.PURPLE_DYE) { setCount(64) } }
lootPool { item(Items.BLUE_DYE) { setCount(64) } }
lootPool { item(Items.BROWN_DYE) { setCount(64) } }
lootPool { item(Items.GREEN_DYE) { setCount(64) } }
lootPool { item(Items.RED_DYE) { setCount(64) } }
lootPool { item(Items.BLACK_DYE) { setCount(64) } }
}
lootTables.tile(MBlocks.COBBLESTONE_GENERATOR)
lootTables.tile(MBlocks.ESSENCE_STORAGE)
lootTables.tile(MBlocks.MATTER_RECONSTRUCTOR)
lootTables.tile(MBlocks.FLUID_TANK)
lootTables.tile(MBlocks.ENERGY_SERVO)
lootTables.tile(MBlocks.ENERGY_COUNTER)
lootTables.tile(MBlocks.CHEMICAL_GENERATOR)
lootTables.tile(MBlocks.HOLO_SIGN, "isLocked")
lootTables.tile(MBlocks.STORAGE_CABLE)
lootTables.tile(MBlocks.ANDROID_STATION)
lootTables.tile(MBlocks.BATTERY_BANK)
lootTables.tile(MBlocks.DRIVE_VIEWER)
lootTables.tile(MBlocks.STORAGE_BUS)
lootTables.tile(MBlocks.STORAGE_IMPORTER)
lootTables.tile(MBlocks.STORAGE_EXPORTER)
lootTables.tile(MBlocks.STORAGE_POWER_SUPPLIER)
lootTables.tile(MBlocks.DRIVE_RACK)
lootTables.tile(MBlocks.MATTER_DECOMPOSER)
lootTables.tile(MBlocks.MATTER_REPLICATOR)
lootTables.tile(MBlocks.MATTER_RECYCLER)
lootTables.tile(MBlocks.MATTER_SCANNER)
lootTables.tile(MBlocks.PLATE_PRESS)
lootTables.tile(MBlocks.MATTER_PANEL)
lootTables.tile(MBlocks.PATTERN_STORAGE)
lootTables.tile(MBlocks.MATTER_CAPACITOR_BANK)
lootTables.tile(MBlocks.MATTER_BOTTLER)
} }

View File

@ -0,0 +1,82 @@
package ru.dbotthepony.mc.otm.datagen.loot
import net.minecraft.world.level.block.state.properties.BlockStateProperties
import net.minecraft.world.level.block.state.properties.DoubleBlockHalf
import net.minecraft.world.level.storage.loot.predicates.ExplosionCondition
import ru.dbotthepony.mc.otm.registry.game.MBlocks
fun addMachineLoot(lootTables: LootTables) {
lootTables.block(MBlocks.PHANTOM_ATTRACTOR) {
item(MBlocks.PHANTOM_ATTRACTOR) {
blockStateCondition(MBlocks.PHANTOM_ATTRACTOR) {
this[BlockStateProperties.DOUBLE_BLOCK_HALF] = DoubleBlockHalf.LOWER
}
}
condition(ExplosionCondition.survivesExplosion())
}
lootTables.dropsSelf(MBlocks.INFINITE_WATER_SOURCE) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.tile(MBlocks.COBBLESTONE_GENERATOR.values)
lootTables.tile(MBlocks.ESSENCE_STORAGE.values)
lootTables.tile(MBlocks.MATTER_RECONSTRUCTOR.values)
lootTables.tile(MBlocks.FLUID_TANK)
lootTables.tile(MBlocks.PAINTER)
lootTables.tile(MBlocks.MATTER_ENTANGLER)
lootTables.tile(MBlocks.GRILL.values)
lootTables.tile(MBlocks.ENERGY_SERVO.values)
lootTables.tile(MBlocks.ENERGY_COUNTER.values)
lootTables.tile(MBlocks.CHEMICAL_GENERATOR.values)
lootTables.tile(MBlocks.HOLO_SIGN, "isLocked")
lootTables.tile(MBlocks.STORAGE_CABLE)
lootTables.tile(MBlocks.ANDROID_STATION.values)
lootTables.tile(MBlocks.ANDROID_CHARGER.values)
lootTables.tile(MBlocks.BATTERY_BANK.values)
lootTables.tile(MBlocks.DRIVE_VIEWER.values)
lootTables.tile(MBlocks.STORAGE_BUS)
lootTables.tile(MBlocks.STORAGE_IMPORTER)
lootTables.tile(MBlocks.STORAGE_EXPORTER)
lootTables.tile(MBlocks.STORAGE_POWER_SUPPLIER.values)
lootTables.tile(MBlocks.DRIVE_RACK)
lootTables.tile(MBlocks.MATTER_DECOMPOSER.values)
lootTables.tile(MBlocks.MATTER_REPLICATOR.values)
lootTables.tile(MBlocks.MATTER_RECYCLER.values)
lootTables.tile(MBlocks.MATTER_SCANNER.values)
lootTables.tile(MBlocks.PLATE_PRESS.values)
lootTables.tile(MBlocks.TWIN_PLATE_PRESS.values)
lootTables.tile(MBlocks.POWERED_FURNACE.values)
lootTables.tile(MBlocks.POWERED_SMOKER.values)
lootTables.tile(MBlocks.POWERED_BLAST_FURNACE.values)
lootTables.tile(MBlocks.MATTER_PANEL.values)
lootTables.tile(MBlocks.PATTERN_STORAGE)
lootTables.tile(MBlocks.MATTER_CAPACITOR_BANK.values)
lootTables.tile(MBlocks.MATTER_BOTTLER.values)
lootTables.tile(MBlocks.BLACK_HOLE_GENERATOR)
lootTables.tile(MBlocks.FLYWHEEL_BATTERY)
lootTables.dropsSelf(listOf(
MBlocks.MATTER_INJECTOR,
MBlocks.ANTIMATTER_INJECTOR,
MBlocks.HIGH_ENERGY_PARTICLE_COLLECTOR
)) { condition(ExplosionCondition.survivesExplosion()) }
lootTables.tile(MBlocks.ITEM_INPUT_HATCH)
lootTables.tile(MBlocks.ITEM_OUTPUT_HATCH)
lootTables.tile(MBlocks.ENERGY_INPUT_HATCH)
lootTables.tile(MBlocks.ENERGY_OUTPUT_HATCH)
lootTables.tile(MBlocks.MATTER_INPUT_HATCH)
lootTables.tile(MBlocks.MATTER_OUTPUT_HATCH)
lootTables.tile(MBlocks.ENERGY_INPUT_INTERFACE)
lootTables.tile(MBlocks.ENERGY_OUTPUT_INTERFACE)
}

View File

@ -0,0 +1,70 @@
package ru.dbotthepony.mc.otm.datagen.loot
import net.minecraft.util.valueproviders.UniformInt
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets
import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.data.world.UniformDecimal
import ru.dbotthepony.mc.otm.datagen.modLootTable
import ru.dbotthepony.mc.otm.item.ProceduralBatteryItem
import ru.dbotthepony.mc.otm.item.exopack.ProceduralExopackSlotUpgradeItem
import ru.dbotthepony.mc.otm.item.matter.MatterDustItem
import ru.dbotthepony.mc.otm.registry.game.MItems
fun addVaultLoot(lootTables: LootTables) {
lootTables.builder(LootContextParamSets.VAULT, modLootTable("trials/matter_dust")) {
lootPool { item(MItems.MATTER_DUST) {
chanceCondition(0.2)
setWeight(4)
apply(MatterDustItem.Randomizer(UniformDecimal(Decimal(100), Decimal(2_500))))
} }
}
lootTables.builder(LootContextParamSets.VAULT, modLootTable("trials/pill")) {
lootPool { item(MItems.PILL_ANDROID) {
chanceCondition(0.1)
setWeight(1)
} }
lootPool { item(MItems.PILL_HEAL) {
chanceCondition(0.5)
setWeight(2)
setCount(2, 5)
} }
}
lootTables.builder(LootContextParamSets.VAULT, modLootTable("trials/exosuit")) {
lootPool { item(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) {
chanceCondition(0.2)
setWeight(2)
apply(ProceduralExopackSlotUpgradeItem.Randomizer(UniformInt.of(1, 9), UniformInt.of(0, 3)))
} }
lootPool { item(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) {
chanceCondition(0.1)
setWeight(1)
apply(ProceduralExopackSlotUpgradeItem.Randomizer(UniformInt.of(9, 18), UniformInt.of(0, 3)))
} }
}
lootTables.builder(LootContextParamSets.VAULT, modLootTable("trials/battery")) {
lootPool { item(MItems.PROCEDURAL_BATTERY) {
chanceCondition(0.05)
setWeight(1)
apply(
ProceduralBatteryItem.Randomizer(
maxBatteryLevel = UniformDecimal(Decimal(10_000_000), Decimal(50_000_000)),
batteryLevel = UniformDecimal(Decimal(0), Decimal(25_000_000)),
maxInput = UniformDecimal(Decimal(1_000), Decimal(5_000)),
))
} }
}
lootTables.builder(LootContextParamSets.VAULT, modLootTable("trials/zpm_battery")) {
lootPool { item(MItems.ZPM_BATTERY) {
chanceCondition(0.001)
setWeight(1)
} }
}
}

View File

@ -1,13 +0,0 @@
package ru.dbotthepony.mc.otm.datagen.models
import net.minecraft.resources.ResourceLocation
import ru.dbotthepony.mc.otm.registry.MBlocks
fun addBlockModels(provider: MatteryBlockModelProvider) {
with(provider) {
resourceCubeAll(MBlocks.TRITANIUM_ORE)
resourceCubeAll(MBlocks.TRITANIUM_RAW_BLOCK)
resourceCubeAll(MBlocks.DEEPSLATE_TRITANIUM_ORE)
resourceCubeAll(MBlocks.TRITANIUM_INGOT_BLOCK)
}
}

View File

@ -1,10 +1,12 @@
package ru.dbotthepony.mc.otm.datagen.models package ru.dbotthepony.mc.otm.datagen.models
import net.minecraft.world.item.DyeColor
import net.minecraft.world.level.block.Block import net.minecraft.world.level.block.Block
import net.minecraftforge.client.model.generators.BlockModelProvider import net.minecraft.world.level.block.WaterloggedTransparentBlock
import net.minecraftforge.data.event.GatherDataEvent import net.neoforged.neoforge.client.model.generators.BlockModelProvider
import net.neoforged.neoforge.data.event.GatherDataEvent
import ru.dbotthepony.mc.otm.datagen.DataGen import ru.dbotthepony.mc.otm.datagen.DataGen
import ru.dbotthepony.mc.otm.core.registryName import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.datagen.modLocation import ru.dbotthepony.mc.otm.datagen.modLocation
import java.util.LinkedList import java.util.LinkedList
@ -25,6 +27,30 @@ class MatteryBlockModelProvider(event: GatherDataEvent) : BlockModelProvider(eve
return "Block Models: $modid" return "Block Models: $modid"
} }
fun cubeAll(vararg blocks: Block) {
for (block in blocks) {
exec {
cubeAll(block.registryName!!.path, modLocation("block/${block.registryName!!.path}"))
}
}
}
fun cubeAllCutout(vararg blocks: Block) {
for (block in blocks) {
exec {
cubeAll(block.registryName!!.path, modLocation("block/${block.registryName!!.path}")).renderType("cutout_mipped")
}
}
}
fun cubeAllFramed(modelName: String, textureName: String) {
exec {
withExistingParent(modelName, modLocation("block/frame_block"))
.texture("texture", textureName)
.renderType("cutout_mipped")
}
}
fun decorativeGlassAll(blocks: Collection<Block>) { fun decorativeGlassAll(blocks: Collection<Block>) {
for (block in blocks) { for (block in blocks) {
exec { exec {
@ -49,6 +75,13 @@ class MatteryBlockModelProvider(event: GatherDataEvent) : BlockModelProvider(eve
} }
} }
fun decorativeCubeAllCutout(vararg blocks: Block) {
for (block in blocks) {
exec {
cubeAll(block.registryName!!.path, modLocation("block/decorative/${block.registryName!!.path}")).renderType("cutout_mipped")
}
}
}
fun decorativeCubeAll(subdir: String, vararg blocks: Block) { fun decorativeCubeAll(subdir: String, vararg blocks: Block) {
for (block in blocks) { for (block in blocks) {
exec { exec {
@ -79,14 +112,20 @@ class MatteryBlockModelProvider(event: GatherDataEvent) : BlockModelProvider(eve
} }
} }
fun column(block: Block, end: String, side: String) { fun column(block: Block, side: String, end: String) {
exec { exec {
cubeColumn(block.registryName!!.path, modLocation(end), modLocation(side)) cubeColumn(block.registryName!!.path, modLocation(side), modLocation(end))
} }
} }
fun decorativeColumn(it: Block, end: String, side: String) { fun orientable(block: Block, side: String, front: String) {
column(it, "block/decorative/$end", "block/decorative/$side") exec {
orientable(block.registryName!!.path, modLocation(side), modLocation(front), modLocation(side))
}
}
fun decorativeColumn(it: Block, side: String, end: String) {
column(it, "block/decorative/$side", "block/decorative/$end")
} }
fun resourceCubeAll(vararg blocks: Block) { fun resourceCubeAll(vararg blocks: Block) {
@ -96,4 +135,74 @@ class MatteryBlockModelProvider(event: GatherDataEvent) : BlockModelProvider(eve
} }
} }
} }
fun colored(modelName: String, suffix: String, textureKeys: Map<String, String>) {
for (color in DyeColor.entries) {
exec {
val model = withExistingParent(modelName + "_${color.name.lowercase()}$suffix", modLocation(modelName + suffix))
for ((key, value) in textureKeys) {
model.texture(key, modLocation("block/$value/${color.name.lowercase()}"))
}
}
}
}
fun colored(blocks: Map<DyeColor?, Block>, textureKeys: Collection<String>) {
val base = blocks[null]!!.registryName!!.path
colored(base, textureKeys.associateWith { base })
}
fun colored(modelName: String, textureKeys: Map<String, String>) {
return colored(modelName, "", textureKeys)
}
fun colored(modelName: String, textureKeys: Collection<String>, textureName: String) {
return colored(modelName, "", textureKeys.associateWith { textureName })
}
fun colored(modelName: String, textureKeys: Collection<String>) {
return colored(modelName, "", textureKeys.associateWith { modelName })
}
fun colored(modelName: String, suffix: String, textureKeys: Collection<String>) {
return colored(modelName, suffix, textureKeys.associateWith { modelName })
}
fun coloredMachineCombined(modelName: String, textureName: String, textureKeys: Collection<String>) {
for (state in listOf("_idle", "_error", "_working")) {
colored(modelName, state, textureKeys.associateWith { textureName })
}
}
fun coloredMachineCombined(modelName: String, textureKeys: Collection<String>) {
for (state in listOf("_idle", "_error", "_working")) {
colored(modelName, state, textureKeys.associateWith { modelName })
}
}
fun cable(modelName: String, textureName: String, thin: Boolean = false, powered: Boolean = false) {
val baseName = if (thin) "base_cable_thin" else "base_cable"
exec {
withExistingParent("block/${modelName}_core", modLocation("block/${baseName}_core"))
.texture("0", textureName)
withExistingParent("block/${modelName}_connection", modLocation("block/${baseName}_connection"))
.texture("0", textureName)
withExistingParent("item/${modelName}", modLocation("item/${baseName}"))
.texture("0", textureName)
}
if (powered && !thin) {
exec {
withExistingParent("block/${modelName}_core_powered", modLocation("block/${baseName}_core_powered"))
.texture("0", textureName)
withExistingParent("block/${modelName}_connection_powered", modLocation("block/${baseName}_connection_powered"))
.texture("0", textureName)
}
}
}
} }

View File

@ -1,39 +0,0 @@
package ru.dbotthepony.mc.otm.datagen.recipes
import com.google.common.collect.Lists
import net.minecraft.data.recipes.FinishedRecipe
import net.minecraft.data.recipes.RecipeCategory
import net.minecraft.data.recipes.SimpleCookingRecipeBuilder
import net.minecraft.world.item.Item
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.crafting.Ingredient
import net.minecraft.world.level.ItemLike
import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.MItems
import java.util.*
import java.util.function.Consumer
private fun Consumer<FinishedRecipe>.addRecyclingRecipe(inputs: Collection<ItemLike>, result: Item, name: String) {
val inputStacks = inputs.map(::ItemStack)
SimpleCookingRecipeBuilder.smelting(
Ingredient.of(inputStacks.stream()),
RecipeCategory.MISC, result, 0f, 200
).also { r -> inputs.forEach { r.unlockedBy(it) } }.save(this, modLocation("smelting/${name}"))
SimpleCookingRecipeBuilder.blasting(
Ingredient.of(inputStacks.stream()),
RecipeCategory.MISC, result, 0f, 100
).also { r -> inputs.forEach { r.unlockedBy(it) } }.save(this, modLocation("blasting/${name}"))
}
fun addBlastingRecipes(consumer: Consumer<FinishedRecipe>) {
SimpleCookingRecipeBuilder.blasting(Ingredient.of(MItems.MIRROR_COMPOUND), RecipeCategory.MISC, MItems.MIRROR, 0.1f, 100).unlockedBy(MItems.MIRROR_COMPOUND).save(consumer)
SimpleCookingRecipeBuilder.smelting(Ingredient.of(MItemTags.TRITANIUM_PLATES), RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 0f, 100).unlockedBy(MItemTags.TRITANIUM_PLATES).save(consumer, modLocation("tritanium_ingot_from_plates"))
SimpleCookingRecipeBuilder.blasting(Ingredient.of(MItemTags.TRITANIUM_PLATES), RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 0f, 50).unlockedBy(MItemTags.TRITANIUM_PLATES).save(consumer, modLocation("tritanium_ingot_from_plates_blasting"))
consumer.addRecyclingRecipe(MItems.TRITANIUM_TOOLS, MItems.TRITANIUM_NUGGET, "tritanium_nugget_from_tools")
consumer.addRecyclingRecipe(MItems.SIMPLE_TRITANIUM_ARMOR, MItems.TRITANIUM_NUGGET, "tritanium_nugger_from_armor")
}

View File

@ -0,0 +1,109 @@
package ru.dbotthepony.mc.otm.datagen.recipes
import net.minecraft.data.recipes.RecipeCategory
import net.minecraft.data.recipes.RecipeOutput
import net.minecraft.tags.ItemTags
import net.neoforged.neoforge.common.Tags
import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.game.MItems
fun addComponentRecipes(consumer: RecipeOutput) {
// Обычный рецепт
MatteryRecipe(MItems.BASIC_CONTROL_CIRCUIT, count = 3, category = RecipeCategory.MISC)
.row(MItemTags.COPPER_WIRES, Tags.Items.DUSTS_REDSTONE, MItemTags.COPPER_WIRES)
.row(MItems.CIRCUIT_PLATING, MItems.CIRCUIT_PLATING, MItems.CIRCUIT_PLATING)
.unlockedBy(MItemTags.COPPER_WIRES)
.build(consumer)
// ручной рецепт
MatteryRecipe(MItems.BASIC_CONTROL_CIRCUIT, category = RecipeCategory.MISC)
.rowB(Tags.Items.DUSTS_REDSTONE)
.rowB(MItemTags.COPPER_WIRES)
.rowB(ItemTags.WOODEN_SLABS)
.unlockedBy(MItemTags.COPPER_WIRES)
.unlockedBy(Tags.Items.DUSTS_REDSTONE)
.build(consumer, "alt")
MatteryRecipe(MItems.ADVANCED_CONTROL_CIRCUIT, count = 3, category = RecipeCategory.MISC)
.row(MItemTags.COPPER_WIRES, Tags.Items.GEMS_QUARTZ, MItemTags.COPPER_WIRES)
.row(MItemTags.GOLD_WIRES, Tags.Items.DUSTS_REDSTONE, MItemTags.GOLD_WIRES)
.row(MItems.CIRCUIT_PLATING, MItems.CIRCUIT_PLATING, MItems.CIRCUIT_PLATING)
.unlockedBy(MItemTags.GOLD_WIRES)
.build(consumer)
MatteryRecipe(MItems.MACHINE_FRAME, category = RecipeCategory.MISC)
.row(MItemTags.HARDENED_GLASS, MItemTags.BASIC_CIRCUIT, MItemTags.HARDENED_GLASS)
.row(MItems.ELECTRIC_PARTS, MItemTags.TRITANIUM_PLATES, MItems.ELECTRIC_PARTS)
.rowAC(MItemTags.TRITANIUM_PLATES, MItemTags.TRITANIUM_PLATES)
.unlockedBy(MItemTags.BASIC_CIRCUIT)
.unlockedBy(MItemTags.HARDENED_GLASS)
.unlockedBy(MItems.ELECTRIC_PARTS)
.build(consumer)
MatteryRecipe(MItems.GOLD_WIRING, count = 8, category = RecipeCategory.MISC)
.rowB(Tags.Items.INGOTS_GOLD)
.row(Tags.Items.INGOTS_GOLD, Tags.Items.RODS_WOODEN, Tags.Items.INGOTS_GOLD)
.rowB(Tags.Items.INGOTS_GOLD)
.unlockedBy(Tags.Items.INGOTS_GOLD)
.build(consumer)
MatteryRecipe(MItems.COPPER_WIRING, count = 8, category = RecipeCategory.MISC)
.rowB(Tags.Items.INGOTS_COPPER)
.row(Tags.Items.INGOTS_COPPER, Tags.Items.RODS_WOODEN, Tags.Items.INGOTS_COPPER)
.rowB(Tags.Items.INGOTS_COPPER)
.unlockedBy(Tags.Items.INGOTS_COPPER)
.build(consumer)
MatteryRecipe(MItems.ENERGY_BUS, count = 2, category = RecipeCategory.MISC)
.rowAB(Tags.Items.DUSTS_REDSTONE, MItems.ELECTRIC_PARTS)
.row(MItemTags.COPPER_WIRES, MItemTags.COPPER_WIRES, MItemTags.COPPER_WIRES)
.rowBC(MItems.ELECTRIC_PARTS, Tags.Items.DUSTS_REDSTONE)
.unlockedBy(MItems.ELECTRIC_PARTS)
.unlockedBy(MItemTags.COPPER_WIRES)
.unlockedBy(Tags.Items.DUSTS_REDSTONE)
.build(consumer)
MatteryRecipe(MItems.MATTER_IO_PORT, category = RecipeCategory.MISC)
.rowB(MItems.MATTER_CABLE)
.row(MItemTags.TRITANIUM_PLATES, MItemTags.BASIC_CIRCUIT, MItemTags.TRITANIUM_PLATES)
.rowB(MItems.MATTER_CABLE)
.unlockedBy(MItems.MATTER_CABLE)
.build(consumer)
MatteryRecipe(MItems.MATTER_TRANSFORM_MATRIX, category = RecipeCategory.MISC)
.row(MItemTags.DILITHIUM_GEMS, MItems.MATTER_CABLE, MItemTags.DILITHIUM_GEMS)
.row(MItemTags.TRITANIUM_PLATES, MItemTags.ADVANCED_CIRCUIT, MItemTags.TRITANIUM_PLATES)
.rowB(MItems.MATTER_CABLE)
.unlockedBy(MItems.MATTER_CABLE)
.build(consumer)
MatteryRecipe(MItems.MATTER_CAPACITOR_PARTS, count = 3, category = RecipeCategory.MISC)
.row(MItemTags.IRON_PLATES, MItemTags.HARDENED_GLASS_PANES, MItemTags.IRON_PLATES)
.row(MItemTags.TRITANIUM_PLATES, MItemTags.HARDENED_GLASS_PANES, MItemTags.TRITANIUM_PLATES)
.rowB(MItemTags.HARDENED_GLASS_PANES)
.unlockedBy(MItems.MATTER_CABLE)
.build(consumer)
MatteryRecipe(MItems.ELECTRIC_PARTS, count = 4, category = RecipeCategory.MISC)
.row(Tags.Items.DUSTS_REDSTONE, MItemTags.COPPER_WIRES, Tags.Items.DUSTS_REDSTONE)
.row(Tags.Items.NUGGETS_GOLD, Tags.Items.NUGGETS_IRON, Tags.Items.NUGGETS_GOLD)
.row(Tags.Items.DUSTS_REDSTONE, MItemTags.COPPER_WIRES, Tags.Items.DUSTS_REDSTONE)
.build(consumer)
MatteryRecipe(MItems.MECHANICAL_PARTS, count = 4, category = RecipeCategory.MISC)
.row(MItemTags.TRITANIUM_INGOTS, Tags.Items.INGOTS_IRON, MItemTags.TRITANIUM_INGOTS)
.build(consumer)
MatteryRecipe(MItems.ELECTROMOTOR, category = RecipeCategory.MISC)
.rowB(MItems.ELECTRIC_PARTS)
.row(MItems.ELECTROMAGNET, MItems.MECHANICAL_PARTS, MItems.ELECTROMAGNET)
.row(MItemTags.COPPER_WIRES, MItems.MECHANICAL_PARTS, MItemTags.COPPER_WIRES)
.unlockedBy(MItems.ELECTROMAGNET)
.build(consumer)
MatteryRecipe(MItems.DISPLAY_SCREEN, 3)
.row(MItemTags.IRON_PLATES, Tags.Items.DUSTS_GLOWSTONE, Tags.Items.GLASS_PANES_COLORLESS)
.row(MItemTags.IRON_PLATES, Tags.Items.DUSTS_REDSTONE, Tags.Items.GLASS_PANES_COLORLESS)
.row(MItemTags.IRON_PLATES, Tags.Items.DUSTS_GLOWSTONE, Tags.Items.GLASS_PANES_COLORLESS)
.build(consumer)
}

View File

@ -0,0 +1,61 @@
package ru.dbotthepony.mc.otm.datagen.recipes
import net.minecraft.data.recipes.RecipeCategory
import net.minecraft.data.recipes.RecipeOutput
import net.minecraft.data.recipes.SimpleCookingRecipeBuilder
import net.minecraft.util.valueproviders.ConstantFloat
import net.minecraft.world.item.Item
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.crafting.Ingredient
import net.minecraft.world.level.ItemLike
import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.game.MItems
private fun RecipeOutput.addRecyclingRecipe(inputs: Collection<ItemLike>, result: Item, name: String) {
val inputStacks = inputs.map(::ItemStack)
SimpleCookingRecipeBuilder.smelting(
Ingredient.of(inputStacks.stream()),
RecipeCategory.MISC, result, 0f, 200
).also { r -> inputs.forEach { r.unlockedBy(it) } }.save(this, modLocation("smelting/${name}"))
SimpleCookingRecipeBuilder.blasting(
Ingredient.of(inputStacks.stream()),
RecipeCategory.MISC, result, 0f, 100
).also { r -> inputs.forEach { r.unlockedBy(it) } }.save(this, modLocation("blasting/${name}"))
}
fun addBlastingRecipes(consumer: RecipeOutput) {
SimpleCookingRecipeBuilder.blasting(Ingredient.of(MItems.MIRROR_COMPOUND), RecipeCategory.MISC, MItems.MIRROR, 0.1f, 100).unlockedBy(
MItems.MIRROR_COMPOUND).save(consumer)
SimpleCookingRecipeBuilder.smelting(Ingredient.of(MItemTags.TRITANIUM_PLATES), RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 0f, 100).unlockedBy(
MItemTags.TRITANIUM_PLATES).save(consumer, modLocation("tritanium_ingot_from_plates"))
SimpleCookingRecipeBuilder.blasting(Ingredient.of(MItemTags.TRITANIUM_PLATES), RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 0f, 50).unlockedBy(
MItemTags.TRITANIUM_PLATES).save(consumer, modLocation("tritanium_ingot_from_plates_blasting"))
consumer.addRecyclingRecipe(MItems.TRITANIUM_TOOLS, MItems.TRITANIUM_NUGGET, "tritanium_nugget_from_tools")
consumer.addRecyclingRecipe(MItems.SIMPLE_TRITANIUM_ARMOR, MItems.TRITANIUM_NUGGET, "tritanium_nugger_from_armor")
}
fun addOreSmeltingRecipes(consumer: RecipeOutput) {
SimpleCookingRecipeBuilder.smelting(Ingredient.of(MItemTags.TRITANIUM_ORES), RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 1f, 200).unlockedBy(MItemTags.TRITANIUM_ORES).save(consumer, modLocation("smelting/tritanium_ingot_from_ore_block"))
SimpleCookingRecipeBuilder.blasting(Ingredient.of(MItemTags.TRITANIUM_ORES), RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 1f, 100).unlockedBy(MItemTags.TRITANIUM_ORES).save(consumer, modLocation("blasting/tritanium_ingot_from_ore_block"))
SimpleCookingRecipeBuilder.smelting(Ingredient.of(MItemTags.TRITANIUM_ORE_CLUMPS), RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 1f, 200).unlockedBy(MItemTags.TRITANIUM_ORE_CLUMPS).save(consumer, modLocation("smelting/tritanium_ingot_from_raw_ore"))
SimpleCookingRecipeBuilder.blasting(Ingredient.of(MItemTags.TRITANIUM_ORE_CLUMPS), RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 1f, 100).unlockedBy(MItemTags.TRITANIUM_ORE_CLUMPS).save(consumer, modLocation("blasting/tritanium_ingot_from_raw_ore"))
SimpleCookingRecipeBuilder.smelting(Ingredient.of(MItemTags.TRITANIUM_DUSTS), RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 0f, 200).unlockedBy(MItemTags.TRITANIUM_DUSTS).save(consumer, modLocation("smelting/tritanium_ingot_from_dust"))
SimpleCookingRecipeBuilder.blasting(Ingredient.of(MItemTags.TRITANIUM_DUSTS), RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 0f, 100).unlockedBy(MItemTags.TRITANIUM_DUSTS).save(consumer, modLocation("blasting/tritanium_ingot_from_dust"))
}
fun addMicrowaveRecipes(provider: MatteryRecipeProvider) {
for (drive in listOf(MItems.PATTERN_DRIVE_NORMAL, MItems.PATTERN_DRIVE_DOUBLE, MItems.PATTERN_DRIVE_TRIPLE, MItems.PATTERN_DRIVE_QUAD)) {
provider.microwave("${drive.registryName!!.path}_erase", Ingredient.of(drive), Ingredient.of(drive), workTicks = 30 * 20, experience = ConstantFloat.of(0f))
}
}

View File

@ -1,29 +1,32 @@
package ru.dbotthepony.mc.otm.datagen.recipes package ru.dbotthepony.mc.otm.datagen.recipes
import net.minecraft.data.recipes.FinishedRecipe import net.minecraft.core.component.DataComponents
import net.minecraft.data.recipes.RecipeCategory import net.minecraft.data.recipes.RecipeCategory
import net.minecraft.data.recipes.RecipeOutput
import net.minecraft.data.recipes.ShapelessRecipeBuilder import net.minecraft.data.recipes.ShapelessRecipeBuilder
import net.minecraft.tags.ItemTags import net.minecraft.tags.ItemTags
import net.minecraft.world.item.ItemStack import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.Items import net.minecraft.world.item.Items
import net.minecraft.world.item.crafting.Ingredient import net.minecraft.world.item.crafting.Ingredient
import net.minecraftforge.common.Tags import net.neoforged.neoforge.common.Tags
import net.neoforged.neoforge.common.conditions.NotCondition
import net.neoforged.neoforge.common.conditions.TagEmptyCondition
import ru.dbotthepony.mc.otm.block.entity.MatteryBlockEntity import ru.dbotthepony.mc.otm.block.entity.MatteryBlockEntity
import ru.dbotthepony.mc.otm.registry.MBlocks import ru.dbotthepony.mc.otm.config.CablesConfig
import ru.dbotthepony.mc.otm.util.ResourceLocation
import ru.dbotthepony.mc.otm.registry.game.MBlocks
import ru.dbotthepony.mc.otm.registry.MItemTags import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.MItems import ru.dbotthepony.mc.otm.registry.game.MItems
import ru.dbotthepony.mc.otm.registry.MRegistry import ru.dbotthepony.mc.otm.registry.MRegistry
import ru.dbotthepony.mc.otm.core.registryName import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.datagen.modLocation import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.recipe.ExplosiveHammerPrimingRecipe
import ru.dbotthepony.mc.otm.recipe.UpgradeRecipe import ru.dbotthepony.mc.otm.recipe.UpgradeRecipe
import java.util.function.Consumer
fun addCraftingTableRecipes(consumer: Consumer<FinishedRecipe>) { fun addCraftingTableRecipes(consumer: RecipeOutput) {
val machinesCategory = RecipeCategory.DECORATIONS val machinesCategory = RecipeCategory.DECORATIONS
MatteryRecipe(MRegistry.CARGO_CRATES.item, category = RecipeCategory.DECORATIONS) MatteryRecipe(MRegistry.CARGO_CRATES.item, category = RecipeCategory.DECORATIONS)
.row(MItemTags.TRITANIUM_PLATES, Tags.Items.CHESTS, MItemTags.TRITANIUM_PLATES) .row(MItemTags.TRITANIUM_PLATES, multiIngredient(Tags.Items.CHESTS_WOODEN, Tags.Items.BARRELS_WOODEN), MItemTags.TRITANIUM_PLATES)
.unlockedBy(MItemTags.TRITANIUM_PLATES) .unlockedBy(MItemTags.TRITANIUM_PLATES)
.unlockedBy(Tags.Items.CHESTS) .unlockedBy(Tags.Items.CHESTS)
.build(consumer) .build(consumer)
@ -36,50 +39,138 @@ fun addCraftingTableRecipes(consumer: Consumer<FinishedRecipe>) {
.save(consumer, "${crate.registryName}_alt") .save(consumer, "${crate.registryName}_alt")
} }
ShapelessRecipeBuilder(RecipeCategory.BUILDING_BLOCKS, MItems.TRITANIUM_INGOT_BLOCK, 1) MItems.ENERGY_COUNTER.values.forEach {
.requires(Ingredient.of(MItemTags.TRITANIUM_INGOTS), 9) ShapelessRecipeBuilder(machinesCategory, it, 1)
.unlockedBy(MItemTags.TRITANIUM_INGOTS) .requires(it)
.save(consumer) .unlockedBy(it)
.save(consumer, modLocation("${it.registryName!!.path}_reset"))
ShapelessRecipeBuilder(RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 9) }
.requires(Ingredient.of(MItemTags.TRITANIUM_INGOTS_STORAGE))
.unlockedBy(MItemTags.TRITANIUM_INGOTS_STORAGE)
.save(consumer, modLocation("tritanium_ingot_from_storage"))
ShapelessRecipeBuilder(machinesCategory, MItems.ENERGY_COUNTER, 1)
.requires(MItems.ENERGY_COUNTER)
.unlockedBy(MItems.ENERGY_COUNTER)
.save(consumer, modLocation("energy_counter_reset"))
ShapelessRecipeBuilder(machinesCategory, MItems.HOLO_SIGN, 1) ShapelessRecipeBuilder(machinesCategory, MItems.HOLO_SIGN, 1)
.requires(MItems.HOLO_SIGN) .requires(MItems.HOLO_SIGN)
.unlockedBy(MItems.HOLO_SIGN) .unlockedBy(MItems.HOLO_SIGN)
.save(consumer, modLocation("holo_sign_reset")) .save(consumer, modLocation("holo_sign_reset"))
MatteryRecipe(MBlocks.PLATE_PRESS, category = machinesCategory) MatteryRecipe(MBlocks.DRIVE_VIEWER[null]!!, category = machinesCategory)
.row(MItems.ELECTRIC_PARTS, MItems.ENERGY_BUS, MItems.ELECTRIC_PARTS) .rowBC(MItems.DISPLAY_SCREEN, Tags.Items.GLASS_PANES)
.row(MItemTags.TRITANIUM_INGOTS, Items.BLAST_FURNACE, MItemTags.TRITANIUM_INGOTS) .row(MItemTags.IRON_PLATES, MItems.MACHINE_FRAME, MItemTags.IRON_PLATES)
.row(MItemTags.PISTONS, MItemTags.TRITANIUM_INGOTS, MItemTags.PISTONS) .row(MItemTags.BASIC_CIRCUIT, MItems.MATTER_IO_PORT, MItemTags.BASIC_CIRCUIT)
.unlockedBy(MItemTags.TRITANIUM_INGOTS) .unlockedBy(MItems.MATTER_IO_PORT)
.unlockedBy(MItems.ELECTRIC_PARTS)
.build(consumer) .build(consumer)
MatteryRecipe(MBlocks.PLATE_PRESS, category = machinesCategory) MatteryRecipe(MBlocks.MATTER_BOTTLER[null]!!, category = machinesCategory)
.rowB(MItems.MACHINE_FRAME) .row(MItems.MATTER_CAPACITOR_PARTS, MItems.MATTER_IO_PORT, MItems.MATTER_CAPACITOR_PARTS)
.rowAC(MItemTags.PISTONS, MItemTags.PISTONS) .row(Tags.Items.GLASS_BLOCKS, MItems.MACHINE_FRAME, Tags.Items.GLASS_BLOCKS)
.rowAC(MItems.MATTER_CABLE, MItems.MATTER_CABLE)
.unlockedBy(MItems.MATTER_CAPACITOR_PARTS)
.unlockedBy(MItems.MATTER_IO_PORT)
.build(consumer)
MatteryRecipe(MBlocks.MATTER_DECOMPOSER[null]!!, category = machinesCategory)
.row(MItems.MATTER_TRANSFORM_MATRIX, MItemTags.BASIC_CIRCUIT, MItems.MATTER_IO_PORT)
.row(MItemTags.TRITANIUM_PLATES, MItems.MACHINE_FRAME, MItemTags.TRITANIUM_PLATES)
.row(MItems.MATTER_CABLE, MItems.MATTER_CAPACITOR_PARTS, MItems.MATTER_CABLE)
.unlockedBy(MItems.MATTER_CAPACITOR_PARTS)
.unlockedBy(MItems.MATTER_IO_PORT)
.build(consumer)
MatteryRecipe(MBlocks.MATTER_PANEL[null]!!, category = machinesCategory)
.row(MItems.ELECTRIC_PARTS, MItemTags.TRITANIUM_PLATES, Tags.Items.GLASS_PANES)
.row(MItems.MATTER_CABLE, MItems.DISPLAY_SCREEN, Tags.Items.GLASS_PANES)
.row(MItemTags.ADVANCED_CIRCUIT, MItemTags.TRITANIUM_PLATES, Tags.Items.GLASS_PANES)
.unlockedBy(Tags.Items.GLASS_BLOCKS)
.build(consumer)
MatteryRecipe(MBlocks.MATTER_REPLICATOR[null]!!, category = machinesCategory)
.row(MItems.MATTER_IO_PORT, MItemTags.ADVANCED_CIRCUIT, MItems.MATTER_TRANSFORM_MATRIX)
.row(Tags.Items.GEMS_DIAMOND, MItems.MACHINE_FRAME, Tags.Items.GEMS_DIAMOND)
.row(MItems.MATTER_CABLE, MItems.MATTER_CAPACITOR_PARTS, MItems.MATTER_CABLE)
.unlockedBy(MItems.MATTER_CAPACITOR_PARTS)
.unlockedBy(MItems.MATTER_IO_PORT)
.unlockedBy(MItems.MATTER_TRANSFORM_MATRIX)
.build(consumer)
MatteryRecipe(MBlocks.PATTERN_STORAGE, category = machinesCategory)
.row(Tags.Items.GLASS_BLOCKS, Tags.Items.GLASS_BLOCKS, Tags.Items.GLASS_BLOCKS)
.row(MItemTags.IRON_PLATES, MItems.MACHINE_FRAME, MItemTags.IRON_PLATES)
.row(MItems.MATTER_CABLE, MItemTags.BASIC_CIRCUIT, MItems.MATTER_CABLE)
.unlockedBy(MItemTags.IRON_PLATES)
.build(consumer)
MatteryRecipe(MBlocks.ENERGY_COUNTER[null]!!, category = machinesCategory)
.row(MItemTags.TRITANIUM_PLATES, MItems.ENERGY_BUS, MItemTags.TRITANIUM_PLATES)
.row(MItemTags.BASIC_CIRCUIT, MItems.DISPLAY_SCREEN, MItemTags.HARDENED_GLASS_PANES)
.row(MItemTags.TRITANIUM_PLATES, MItems.ENERGY_BUS, MItemTags.TRITANIUM_PLATES)
.unlockedBy(MItems.ENERGY_BUS)
.build(consumer)
MatteryRecipe(MBlocks.TWIN_PLATE_PRESS[null]!!, category = machinesCategory)
.rowAC(MItems.ELECTROMOTOR, MItems.ELECTROMOTOR)
.row(MItemTags.PISTONS, MItems.MACHINE_FRAME, MItemTags.PISTONS)
.unlockedBy(MItemTags.TRITANIUM_INGOTS) .unlockedBy(MItemTags.TRITANIUM_INGOTS)
.unlockedBy(MItems.ELECTRIC_PARTS) .unlockedBy(MItems.MACHINE_FRAME)
.build(consumer, "advanced") .build(consumer)
for ((color, item) in MItems.PLATE_PRESS) {
MatteryRecipe(MBlocks.TWIN_PLATE_PRESS[color]!!, category = machinesCategory)
.setUpgradeSource(item)
.addUpgradeOps(UpgradeRecipe.CopyAllComponents)
.rowA(item)
.build(consumer, "plate_press_migration/${color?.name?.lowercase() ?: "default"}")
}
MatteryRecipe(MBlocks.CHEMICAL_GENERATOR[null]!!, category = machinesCategory)
.rowB(MItems.ENERGY_BUS)
.row(MItemTags.TRITANIUM_INGOTS, MItemTags.FURNACES, MItemTags.TRITANIUM_INGOTS)
.rowAC(MItems.ELECTRIC_PARTS, MItems.ELECTRIC_PARTS)
.unlockedBy(MItemTags.FURNACES)
.unlockedBy(MItems.ENERGY_BUS)
.build(consumer)
MatteryRecipe(MItems.PATTERN_DRIVE_NORMAL, category = machinesCategory) MatteryRecipe(MItems.PATTERN_DRIVE_NORMAL, category = machinesCategory)
.rowAC(MItemTags.ADVANCED_CIRCUIT, MItemTags.ADVANCED_CIRCUIT) .row(Tags.Items.DUSTS_GLOWSTONE, MItemTags.CARBON_PLATES, Tags.Items.DUSTS_GLOWSTONE)
.row(MItemTags.ADVANCED_CIRCUIT, MItemTags.TRITANIUM_PLATES, MItemTags.ADVANCED_CIRCUIT) .row(MItemTags.DILITHIUM_GEMS, MItemTags.ADVANCED_CIRCUIT, MItemTags.DILITHIUM_GEMS)
.rowAC(MItemTags.ADVANCED_CIRCUIT, MItemTags.ADVANCED_CIRCUIT) .row(Tags.Items.DUSTS_GLOWSTONE, Tags.Items.GEMS_DIAMOND, Tags.Items.DUSTS_GLOWSTONE)
.unlockedBy(MItemTags.ADVANCED_CIRCUIT) .unlockedBy(MItemTags.DILITHIUM_GEMS)
.build(consumer)
MatteryRecipe(MItems.PATTERN_DRIVE_DOUBLE, category = machinesCategory)
.setUpgradeSource(MItems.PATTERN_DRIVE_NORMAL)
.addUpgradeOps(UpgradeRecipe.MergePatterns)
.rowB(MItemTags.DILITHIUM_GEMS)
.row(MItems.PATTERN_DRIVE_NORMAL, MItemTags.ADVANCED_CIRCUIT, MItems.PATTERN_DRIVE_NORMAL)
.rowB(MItemTags.DILITHIUM_GEMS)
.unlockedBy(MItems.PATTERN_DRIVE_NORMAL)
.build(consumer)
MatteryRecipe(MItems.PATTERN_DRIVE_TRIPLE, category = machinesCategory)
.setUpgradeSource(MItems.PATTERN_DRIVE_DOUBLE)
.addUpgradeOps(UpgradeRecipe.MergePatterns)
.row(Tags.Items.DUSTS_GLOWSTONE, MItemTags.DILITHIUM_GEMS, Tags.Items.DUSTS_GLOWSTONE)
.row(MItems.PATTERN_DRIVE_DOUBLE, MItemTags.ADVANCED_CIRCUIT, MItems.PATTERN_DRIVE_DOUBLE)
.row(Tags.Items.DUSTS_GLOWSTONE, MItemTags.DILITHIUM_GEMS, Tags.Items.DUSTS_GLOWSTONE)
.unlockedBy(MItems.PATTERN_DRIVE_DOUBLE)
.build(consumer)
MatteryRecipe(MItems.PATTERN_DRIVE_QUAD, category = machinesCategory)
.setUpgradeSource(MItems.PATTERN_DRIVE_TRIPLE)
.addUpgradeOps(UpgradeRecipe.MergePatterns)
.row(MItemTags.DILITHIUM_GEMS, MItemTags.REINFORCED_TRITANIUM_PLATES, MItemTags.DILITHIUM_GEMS)
.row(MItems.PATTERN_DRIVE_TRIPLE, MItemTags.ADVANCED_CIRCUIT, MItems.PATTERN_DRIVE_TRIPLE)
.row(MItemTags.DILITHIUM_GEMS, MItemTags.REINFORCED_TRITANIUM_PLATES, MItemTags.DILITHIUM_GEMS)
.unlockedBy(MItems.PATTERN_DRIVE_TRIPLE)
.build(consumer)
MatteryRecipe(MItems.MATTER_CABLE, count = 16, category = machinesCategory)
.row(MItemTags.TRITANIUM_PLATES, MItemTags.TRITANIUM_PLATES, MItemTags.TRITANIUM_PLATES)
.row(Items.REDSTONE, MItemTags.COPPER_WIRES, Items.REDSTONE)
.row(MItemTags.TRITANIUM_PLATES, MItemTags.TRITANIUM_PLATES, MItemTags.TRITANIUM_PLATES)
.unlockedBy(MItemTags.TRITANIUM_PLATES)
.unlockedBy(MItemTags.COPPER_WIRES)
.build(consumer) .build(consumer)
// Машины // Машины
MatteryRecipe(MItems.MATTER_RECYCLER, category = machinesCategory) MatteryRecipe(MItems.MATTER_RECYCLER[null]!!, category = machinesCategory)
.row(MItems.MATTER_CAPACITOR_PARTS, Items.HOPPER, MItemTags.BASIC_CIRCUIT) .row(MItems.MATTER_CAPACITOR_PARTS, Items.HOPPER, MItemTags.BASIC_CIRCUIT)
.row(MItemTags.TRITANIUM_PLATES, MItems.MACHINE_FRAME, MItemTags.TRITANIUM_PLATES) .row(MItemTags.TRITANIUM_PLATES, MItems.MACHINE_FRAME, MItemTags.TRITANIUM_PLATES)
.row(MItems.MATTER_CABLE, MItems.MATTER_IO_PORT, MItems.MATTER_CABLE) .row(MItems.MATTER_CABLE, MItems.MATTER_IO_PORT, MItems.MATTER_CABLE)
@ -87,15 +178,15 @@ fun addCraftingTableRecipes(consumer: Consumer<FinishedRecipe>) {
.build(consumer) .build(consumer)
// Блоки // Блоки
MatteryRecipe(MItems.MATTER_CAPACITOR_BANK, category = machinesCategory) MatteryRecipe(MItems.MATTER_CAPACITOR_BANK[null]!!, category = machinesCategory)
.row(Tags.Items.GLASS, MItemTags.IRON_PLATES, Tags.Items.GLASS) .row(Tags.Items.GLASS_BLOCKS, MItemTags.IRON_PLATES, Tags.Items.GLASS_BLOCKS)
.row(MItemTags.IRON_PLATES, MItems.MACHINE_FRAME, MItemTags.IRON_PLATES) .row(MItemTags.IRON_PLATES, MItems.MACHINE_FRAME, MItemTags.IRON_PLATES)
.row(MItems.MATTER_CABLE, MItems.MATTER_IO_PORT, MItems.MATTER_CABLE) .row(MItems.MATTER_CABLE, MItems.MATTER_IO_PORT, MItems.MATTER_CABLE)
.unlockedBy(MItems.MATTER_CABLE) .unlockedBy(MItems.MATTER_CABLE)
.build(consumer) .build(consumer)
MatteryRecipe(MItems.BATTERY_BANK, category = machinesCategory) MatteryRecipe(MItems.BATTERY_BANK[null]!!, category = machinesCategory)
.row(Tags.Items.GLASS, MItemTags.IRON_PLATES, Tags.Items.GLASS) .row(Tags.Items.GLASS_BLOCKS, MItemTags.IRON_PLATES, Tags.Items.GLASS_BLOCKS)
.row(MItemTags.IRON_PLATES, MItems.MACHINE_FRAME, MItemTags.IRON_PLATES) .row(MItemTags.IRON_PLATES, MItems.MACHINE_FRAME, MItemTags.IRON_PLATES)
.row(MItems.ELECTRIC_PARTS, MItems.ENERGY_BUS, MItems.ELECTRIC_PARTS) .row(MItems.ELECTRIC_PARTS, MItems.ENERGY_BUS, MItems.ELECTRIC_PARTS)
.unlockedBy(MItems.ENERGY_BUS) .unlockedBy(MItems.ENERGY_BUS)
@ -132,14 +223,14 @@ fun addCraftingTableRecipes(consumer: Consumer<FinishedRecipe>) {
.build(consumer) .build(consumer)
MatteryRecipe(MItems.BLACK_HOLE_SCANNER, category = RecipeCategory.TOOLS) MatteryRecipe(MItems.BLACK_HOLE_SCANNER, category = RecipeCategory.TOOLS)
.row(MItemTags.IRON_PLATES, Tags.Items.GLASS_PANES_COLORLESS, MItemTags.IRON_PLATES) .row(MItemTags.IRON_PLATES, MItems.DISPLAY_SCREEN, MItemTags.IRON_PLATES)
.row(MItemTags.GOLD_WIRES, MItems.GRAVITATION_FIELD_SENSOR, MItemTags.ADVANCED_CIRCUIT) .row(MItemTags.GOLD_WIRES, MItems.GRAVITATION_FIELD_SENSOR, MItemTags.ADVANCED_CIRCUIT)
.rowAC(Tags.Items.DUSTS_GLOWSTONE, MItemTags.TRITANIUM_PLATES) .rowAC(Tags.Items.DUSTS_GLOWSTONE, MItemTags.TRITANIUM_PLATES)
.unlockedBy(MItems.GRAVITATION_FIELD_SENSOR) .unlockedBy(MItems.GRAVITATION_FIELD_SENSOR)
.build(consumer) .build(consumer)
MatteryRecipe(MItems.PHANTOM_ATTRACTOR, category = machinesCategory) MatteryRecipe(MItems.PHANTOM_ATTRACTOR, category = machinesCategory)
.row(Tags.Items.DUSTS_REDSTONE, Tags.Items.GLASS_COLORLESS, Tags.Items.DUSTS_REDSTONE) .row(Tags.Items.DUSTS_REDSTONE, Tags.Items.GLASS_BLOCKS_COLORLESS, Tags.Items.DUSTS_REDSTONE)
.row(MItemTags.TRITANIUM_PLATES, MItems.QUANTUM_TRANSCEIVER, MItemTags.TRITANIUM_PLATES) .row(MItemTags.TRITANIUM_PLATES, MItems.QUANTUM_TRANSCEIVER, MItemTags.TRITANIUM_PLATES)
.row(MItemTags.TRITANIUM_PLATES, ItemTags.BEDS, MItemTags.TRITANIUM_PLATES) .row(MItemTags.TRITANIUM_PLATES, ItemTags.BEDS, MItemTags.TRITANIUM_PLATES)
.unlockedBy(MItems.QUANTUM_TRANSCEIVER) .unlockedBy(MItems.QUANTUM_TRANSCEIVER)
@ -154,10 +245,10 @@ fun addCraftingTableRecipes(consumer: Consumer<FinishedRecipe>) {
MatteryRecipe(MItems.ELECTROMAGNET, category = RecipeCategory.MISC) MatteryRecipe(MItems.ELECTROMAGNET, category = RecipeCategory.MISC)
.row(MItemTags.COPPER_WIRES, Tags.Items.INGOTS_IRON, MItemTags.COPPER_WIRES) .row(MItemTags.COPPER_WIRES, Tags.Items.INGOTS_IRON, MItemTags.COPPER_WIRES)
.unlockedBy(Tags.Items.ENDER_PEARLS) .unlockedBy(Tags.Items.INGOTS_IRON)
.build(consumer) .build(consumer)
MatteryRecipe(MItems.ENERGY_SERVO, category = RecipeCategory.MISC) MatteryRecipe(MItems.ENERGY_SERVO[null]!!, category = RecipeCategory.MISC)
.row(MItemTags.TRITANIUM_PLATES, MItems.MACHINE_FRAME, MItemTags.TRITANIUM_PLATES) .row(MItemTags.TRITANIUM_PLATES, MItems.MACHINE_FRAME, MItemTags.TRITANIUM_PLATES)
.row(MItemTags.TRITANIUM_PLATES, MItems.ENERGY_BUS, MItemTags.TRITANIUM_PLATES) .row(MItemTags.TRITANIUM_PLATES, MItems.ENERGY_BUS, MItemTags.TRITANIUM_PLATES)
.unlockedBy(MItems.ENERGY_BUS) .unlockedBy(MItems.ENERGY_BUS)
@ -171,11 +262,26 @@ fun addCraftingTableRecipes(consumer: Consumer<FinishedRecipe>) {
.build(consumer) .build(consumer)
MatteryRecipe(MItems.REINFORCED_TRITANIUM_PLATE, category = RecipeCategory.MISC) MatteryRecipe(MItems.REINFORCED_TRITANIUM_PLATE, category = RecipeCategory.MISC)
.rowB(MItemTags.CARBON_PLATES) .rowB(MItemTags.CARBON_PLATES)
.row(MItemTags.CARBON_PLATES, MItemTags.TRITANIUM_PLATES, MItemTags.CARBON_PLATES) .row(MItemTags.CARBON_PLATES, MItemTags.TRITANIUM_PLATES, MItemTags.CARBON_PLATES)
.rowB(MItemTags.CARBON_PLATES) .rowB(MItemTags.CARBON_PLATES)
.unlockedBy(MItemTags.TRITANIUM_PLATES) .unlockedBy(MItemTags.TRITANIUM_PLATES)
.build(consumer) .build(consumer)
MatteryRecipe(MItems.REINFORCED_IRON_PLATE, category = RecipeCategory.MISC)
.rowB(MItemTags.CARBON_PLATES)
.row(MItemTags.CARBON_PLATES, MItemTags.IRON_PLATES, MItemTags.CARBON_PLATES)
.rowB(MItemTags.CARBON_PLATES)
.unlockedBy(MItemTags.IRON_PLATES)
.build(consumer)
MatteryRecipe(MItems.ARMOR_ASSEMBLY, category = RecipeCategory.MISC)
.row(MItemTags.CARBON_PLATES, MItemTags.IRON_PLATES, MItemTags.CARBON_PLATES)
.row(MItemTags.IRON_PLATES, Items.DIAMOND, MItemTags.IRON_PLATES)
.row(MItemTags.CARBON_PLATES, MItemTags.IRON_PLATES, MItemTags.CARBON_PLATES)
.unlockedBy(MItemTags.IRON_PLATES)
.unlockedBy(MItemTags.CARBON_PLATES)
.build(consumer)
MatteryRecipe(MItems.CARBON_FIBRE_BLOCK, category = RecipeCategory.BUILDING_BLOCKS) MatteryRecipe(MItems.CARBON_FIBRE_BLOCK, category = RecipeCategory.BUILDING_BLOCKS)
.rowAB(MItemTags.CARBON_PLATES, MItemTags.CARBON_PLATES) .rowAB(MItemTags.CARBON_PLATES, MItemTags.CARBON_PLATES)
@ -191,28 +297,40 @@ fun addCraftingTableRecipes(consumer: Consumer<FinishedRecipe>) {
// броня // броня
MatteryRecipe(MItems.TRITANIUM_HELMET, category = RecipeCategory.COMBAT) MatteryRecipe(MItems.TRITANIUM_HELMET, category = RecipeCategory.COMBAT)
.row(MItemTags.REINFORCED_TRITANIUM_PLATES, MItemTags.REINFORCED_TRITANIUM_PLATES, MItemTags.REINFORCED_TRITANIUM_PLATES) .setUpgradeSource(Items.LEATHER_HELMET)
.addUpgradeOps(UpgradeRecipe.CopyEnchantments)
.addUpgradeOps(UpgradeRecipe.CopyComponent(DataComponents.CUSTOM_NAME))
.row(MItemTags.REINFORCED_TRITANIUM_PLATES, MItems.ARMOR_ASSEMBLY, MItemTags.REINFORCED_TRITANIUM_PLATES)
.row(MItemTags.REINFORCED_TRITANIUM_PLATES, Items.LEATHER_HELMET, MItemTags.REINFORCED_TRITANIUM_PLATES) .row(MItemTags.REINFORCED_TRITANIUM_PLATES, Items.LEATHER_HELMET, MItemTags.REINFORCED_TRITANIUM_PLATES)
.unlockedBy(MItemTags.REINFORCED_TRITANIUM_PLATES) .unlockedBy(MItemTags.REINFORCED_TRITANIUM_PLATES)
.build(consumer) .build(consumer)
MatteryRecipe(MItems.TRITANIUM_PANTS, category = RecipeCategory.COMBAT) MatteryRecipe(MItems.TRITANIUM_PANTS, category = RecipeCategory.COMBAT)
.row(MItemTags.REINFORCED_TRITANIUM_PLATES, MItemTags.REINFORCED_TRITANIUM_PLATES, MItemTags.REINFORCED_TRITANIUM_PLATES) .setUpgradeSource(Items.LEATHER_LEGGINGS)
.addUpgradeOps(UpgradeRecipe.CopyEnchantments)
.addUpgradeOps(UpgradeRecipe.CopyComponent(DataComponents.CUSTOM_NAME))
.row(MItemTags.REINFORCED_TRITANIUM_PLATES, MItems.ARMOR_ASSEMBLY, MItemTags.REINFORCED_TRITANIUM_PLATES)
.row(MItemTags.REINFORCED_TRITANIUM_PLATES, Items.LEATHER_LEGGINGS, MItemTags.REINFORCED_TRITANIUM_PLATES) .row(MItemTags.REINFORCED_TRITANIUM_PLATES, Items.LEATHER_LEGGINGS, MItemTags.REINFORCED_TRITANIUM_PLATES)
.rowAC(MItemTags.REINFORCED_TRITANIUM_PLATES, MItemTags.REINFORCED_TRITANIUM_PLATES) .rowAC(MItemTags.REINFORCED_TRITANIUM_PLATES, MItemTags.REINFORCED_TRITANIUM_PLATES)
.unlockedBy(MItemTags.REINFORCED_TRITANIUM_PLATES) .unlockedBy(MItemTags.REINFORCED_TRITANIUM_PLATES)
.build(consumer) .build(consumer)
MatteryRecipe(MItems.TRITANIUM_CHESTPLATE, category = RecipeCategory.COMBAT) MatteryRecipe(MItems.TRITANIUM_CHESTPLATE, category = RecipeCategory.COMBAT)
.setUpgradeSource(Items.LEATHER_CHESTPLATE)
.addUpgradeOps(UpgradeRecipe.CopyEnchantments)
.addUpgradeOps(UpgradeRecipe.CopyComponent(DataComponents.CUSTOM_NAME))
.row(MItemTags.REINFORCED_TRITANIUM_PLATES, Items.LEATHER_CHESTPLATE, MItemTags.REINFORCED_TRITANIUM_PLATES) .row(MItemTags.REINFORCED_TRITANIUM_PLATES, Items.LEATHER_CHESTPLATE, MItemTags.REINFORCED_TRITANIUM_PLATES)
.row(MItemTags.REINFORCED_TRITANIUM_PLATES, MItemTags.REINFORCED_TRITANIUM_PLATES, MItemTags.REINFORCED_TRITANIUM_PLATES) .row(MItemTags.REINFORCED_TRITANIUM_PLATES, MItems.ARMOR_ASSEMBLY, MItemTags.REINFORCED_TRITANIUM_PLATES)
.row(MItemTags.REINFORCED_TRITANIUM_PLATES, MItemTags.REINFORCED_TRITANIUM_PLATES, MItemTags.REINFORCED_TRITANIUM_PLATES) .row(MItemTags.REINFORCED_TRITANIUM_PLATES, MItemTags.REINFORCED_TRITANIUM_PLATES, MItemTags.REINFORCED_TRITANIUM_PLATES)
.unlockedBy(MItemTags.REINFORCED_TRITANIUM_PLATES) .unlockedBy(MItemTags.REINFORCED_TRITANIUM_PLATES)
.build(consumer) .build(consumer)
MatteryRecipe(MItems.TRITANIUM_BOOTS, category = RecipeCategory.COMBAT) MatteryRecipe(MItems.TRITANIUM_BOOTS, category = RecipeCategory.COMBAT)
.setUpgradeSource(Items.LEATHER_BOOTS)
.addUpgradeOps(UpgradeRecipe.CopyEnchantments)
.addUpgradeOps(UpgradeRecipe.CopyComponent(DataComponents.CUSTOM_NAME))
.row(MItemTags.REINFORCED_TRITANIUM_PLATES, Items.LEATHER_BOOTS, MItemTags.REINFORCED_TRITANIUM_PLATES) .row(MItemTags.REINFORCED_TRITANIUM_PLATES, Items.LEATHER_BOOTS, MItemTags.REINFORCED_TRITANIUM_PLATES)
.rowAC(MItemTags.REINFORCED_TRITANIUM_PLATES, MItemTags.REINFORCED_TRITANIUM_PLATES) .row(MItemTags.REINFORCED_TRITANIUM_PLATES, MItems.ARMOR_ASSEMBLY, MItemTags.REINFORCED_TRITANIUM_PLATES)
.unlockedBy(MItemTags.REINFORCED_TRITANIUM_PLATES) .unlockedBy(MItemTags.REINFORCED_TRITANIUM_PLATES)
.build(consumer) .build(consumer)
@ -243,58 +361,19 @@ fun addCraftingTableRecipes(consumer: Consumer<FinishedRecipe>) {
.unlockedBy(MItemTags.TRITANIUM_INGOTS) .unlockedBy(MItemTags.TRITANIUM_INGOTS)
.build(consumer) .build(consumer)
// простые батарейки
MatteryRecipe(MItems.BATTERY_CRUDE, category = RecipeCategory.MISC)
.rowB(Tags.Items.DUSTS_REDSTONE)
.rowB(Tags.Items.CROPS_POTATO)
.rowB(Tags.Items.INGOTS_IRON)
.build(consumer)
MatteryRecipe(MItems.BATTERY_BASIC, category = RecipeCategory.MISC)
.rowAC(Tags.Items.DUSTS_REDSTONE, Tags.Items.DUSTS_REDSTONE)
.rowB(MItems.ELECTRIC_PARTS)
.rowB(MItemTags.IRON_PLATES)
.build(consumer)
MatteryRecipe(MItems.BATTERY_NORMAL, category = RecipeCategory.MISC)
.rowB(MItems.ELECTRIC_PARTS)
.row(MItemTags.COPPER_WIRES, MItemTags.IRON_PLATES, MItemTags.COPPER_WIRES)
.row(Tags.Items.DUSTS_REDSTONE, Tags.Items.DUSTS_REDSTONE, Tags.Items.DUSTS_REDSTONE)
.build(consumer)
MatteryRecipe(MItems.BATTERY_DENSE, category = RecipeCategory.MISC)
.row(Tags.Items.DUSTS_REDSTONE, MItems.ENERGY_BUS, Tags.Items.DUSTS_REDSTONE)
.row(MItemTags.GOLD_WIRES, MItemTags.TRITANIUM_PLATES, MItemTags.GOLD_WIRES)
.row(Tags.Items.DUSTS_REDSTONE, Tags.Items.DUSTS_REDSTONE, Tags.Items.DUSTS_REDSTONE)
.build(consumer)
MatteryRecipe(MItems.BATTERY_CAPACITOR, category = RecipeCategory.MISC)
.row(Tags.Items.DUSTS_REDSTONE, MItems.ENERGY_BUS, Tags.Items.DUSTS_REDSTONE)
.row(MItemTags.GOLD_WIRES, MItemTags.TRITANIUM_PLATES, MItemTags.GOLD_WIRES)
.row(MItemTags.GOLD_WIRES, Tags.Items.DUSTS_REDSTONE, MItemTags.GOLD_WIRES)
.build(consumer)
// накопители материи
MatteryRecipe(MItems.MATTER_CAPACITOR_DENSE, category = RecipeCategory.MISC)
.row(MItems.MATTER_CAPACITOR_PARTS, Tags.Items.GLASS, MItems.MATTER_CAPACITOR_PARTS)
.row(MItemTags.TRITANIUM_PLATES, Tags.Items.ENDER_PEARLS, MItemTags.TRITANIUM_PLATES)
.rowAC(Tags.Items.GEMS_DIAMOND, Tags.Items.GEMS_DIAMOND)
.build(consumer)
// станция андроида // станция андроида
MatteryRecipe(MItems.ANDROID_STATION, category = machinesCategory) MatteryRecipe(MItems.ANDROID_STATION[null]!!, category = machinesCategory)
.row(MItems.ELECTRIC_PARTS, MItemTags.ADVANCED_CIRCUIT, MItems.ELECTRIC_PARTS) .row(MItems.ELECTRIC_PARTS, MItems.QUANTUM_TRANSCEIVER, MItems.ELECTRIC_PARTS)
.row(MItemTags.TRITANIUM_PLATES, MItems.MACHINE_FRAME, MItemTags.TRITANIUM_PLATES) .row(MItemTags.TRITANIUM_PLATES, MItems.MACHINE_FRAME, MItemTags.TRITANIUM_PLATES)
.row(MItemTags.TRITANIUM_PLATES, MItems.ELECTRIC_PARTS, MItemTags.TRITANIUM_PLATES) .row(MItemTags.TRITANIUM_PLATES, MItems.ELECTRIC_PARTS, MItemTags.TRITANIUM_PLATES)
.build(consumer) .build(consumer)
// Энерго меч // беспроводной зарядник андроидов
MatteryRecipe(MItems.ENERGY_SWORD, category = RecipeCategory.COMBAT) MatteryRecipe(MItems.ANDROID_CHARGER[null]!!, category = machinesCategory)
.rowBC(MItemTags.TRITANIUM_PLATES, MItemTags.GOLD_WIRES) .row(MItems.ELECTRIC_PARTS, MItems.QUANTUM_TRANSCEIVER, MItems.ELECTRIC_PARTS)
.rowBC(MItemTags.TRITANIUM_PLATES, MItemTags.GOLD_WIRES) .row(MItemTags.TRITANIUM_PLATES, MItems.MACHINE_FRAME, MItemTags.TRITANIUM_PLATES)
.row(MItems.BATTERY_CAPACITOR, MItems.TRITANIUM_SWORD, MItemTags.ADVANCED_CIRCUIT) .row(MItemTags.TRITANIUM_PLATES, MItems.MACHINE_FRAME, MItemTags.TRITANIUM_PLATES)
.unlockedBy(MItems.BATTERY_CAPACITOR) .build(consumer)
.buildEnergetic(consumer)
// апгрейд на сетку крафта // апгрейд на сетку крафта
MatteryRecipe(MItems.ExopackUpgrades.CRAFTING_UPGRADE, category = RecipeCategory.TOOLS) MatteryRecipe(MItems.ExopackUpgrades.CRAFTING_UPGRADE, category = RecipeCategory.TOOLS)
@ -303,8 +382,22 @@ fun addCraftingTableRecipes(consumer: Consumer<FinishedRecipe>) {
.row(MItemTags.TRITANIUM_PLATES, MItemTags.TRITANIUM_PLATES, MItemTags.TRITANIUM_PLATES) .row(MItemTags.TRITANIUM_PLATES, MItemTags.TRITANIUM_PLATES, MItemTags.TRITANIUM_PLATES)
.build(consumer) .build(consumer)
// апгрейд на переплавку
MatteryRecipe(MItems.ExopackUpgrades.SMELTING_UPGRADE, category = RecipeCategory.TOOLS)
.row(MItemTags.ADVANCED_CIRCUIT, MItemTags.ADVANCED_CIRCUIT, MItemTags.ADVANCED_CIRCUIT)
.row(Items.FURNACE, MItems.QUANTUM_TRANSCEIVER, Items.FURNACE)
.row(MItemTags.TRITANIUM_PLATES, Items.FURNACE, MItemTags.TRITANIUM_PLATES)
.build(consumer)
// апгрейд на эндер сундук
MatteryRecipe(MItems.ExopackUpgrades.ENDER_UPGRADE, category = RecipeCategory.TOOLS)
.row(MItemTags.ADVANCED_CIRCUIT, MItems.ELECTROMAGNET, MItemTags.ADVANCED_CIRCUIT)
.row(MItems.ELECTROMAGNET, Items.ENDER_CHEST, MItems.ELECTROMAGNET)
.row(MItemTags.TRITANIUM_PLATES, MItems.ELECTROMAGNET, MItemTags.TRITANIUM_PLATES)
.build(consumer)
// генератор коблы // генератор коблы
MatteryRecipe(MItems.COBBLESTONE_GENERATOR, category = machinesCategory) MatteryRecipe(MItems.COBBLESTONE_GENERATOR[null]!!, category = machinesCategory)
.row(MItemTags.HARDENED_GLASS_COLORLESS, MItems.TRITANIUM_PICKAXE, MItemTags.HARDENED_GLASS_COLORLESS) .row(MItemTags.HARDENED_GLASS_COLORLESS, MItems.TRITANIUM_PICKAXE, MItemTags.HARDENED_GLASS_COLORLESS)
.row(Items.LAVA_BUCKET, Items.HOPPER, Items.WATER_BUCKET) .row(Items.LAVA_BUCKET, Items.HOPPER, Items.WATER_BUCKET)
.rowB(Tags.Items.CHESTS) .rowB(Tags.Items.CHESTS)
@ -321,19 +414,7 @@ fun addCraftingTableRecipes(consumer: Consumer<FinishedRecipe>) {
.rowB(MItemTags.REINFORCED_TRITANIUM_PLATES) .rowB(MItemTags.REINFORCED_TRITANIUM_PLATES)
.build(consumer) .build(consumer)
ShapelessRecipeBuilder(RecipeCategory.MISC, MItems.TRITANIUM_NUGGET, 9) MatteryRecipe(MItems.ESSENCE_STORAGE[null]!!, category = machinesCategory)
.requires(MItemTags.TRITANIUM_INGOTS)
.unlockedBy(MItemTags.TRITANIUM_INGOTS)
.unlockedBy(MItemTags.TRITANIUM_NUGGETS)
.save(consumer)
ShapelessRecipeBuilder(RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 1)
.requires(Ingredient.of(MItemTags.TRITANIUM_NUGGETS), 9)
.unlockedBy(MItemTags.TRITANIUM_INGOTS)
.unlockedBy(MItemTags.TRITANIUM_NUGGETS)
.save(consumer, modLocation("ingot_from_nuggets"))
MatteryRecipe(MItems.ESSENCE_STORAGE, category = machinesCategory)
.row(MItems.MATTER_CAPACITOR_PARTS, Items.ENDER_EYE, MItemTags.ADVANCED_CIRCUIT) .row(MItems.MATTER_CAPACITOR_PARTS, Items.ENDER_EYE, MItemTags.ADVANCED_CIRCUIT)
.row(MItemTags.TRITANIUM_PLATES, MItems.MACHINE_FRAME, MItemTags.TRITANIUM_PLATES) .row(MItemTags.TRITANIUM_PLATES, MItems.MACHINE_FRAME, MItemTags.TRITANIUM_PLATES)
.row(MItemTags.GOLD_WIRES, MItemTags.HARDENED_GLASS, MItemTags.HARDENED_GLASS) .row(MItemTags.GOLD_WIRES, MItemTags.HARDENED_GLASS, MItemTags.HARDENED_GLASS)
@ -345,15 +426,23 @@ fun addCraftingTableRecipes(consumer: Consumer<FinishedRecipe>) {
.rowB(Tags.Items.RODS_WOODEN) .rowB(Tags.Items.RODS_WOODEN)
.build(consumer) .build(consumer)
MatteryRecipe(MItems.MATTER_RECONSTRUCTOR, category = machinesCategory) for ((dye, item) in MItems.MATTER_REPLICATOR) {
.setUpgradeSource(MItems.MATTER_REPLICATOR) MatteryRecipe(MItems.MATTER_RECONSTRUCTOR[dye]!!, category = machinesCategory)
.addUpgradeOps( .setUpgradeSource(item)
UpgradeRecipe.Indirect("BlockEntityTag.${MatteryBlockEntity.ENERGY_KEY}", "BlockEntityTag.energy"), .addUpgradeOps(
UpgradeRecipe.Indirect("BlockEntityTag.${MatteryBlockEntity.MATTER_STORAGE_KEY}", "BlockEntityTag.matter"), UpgradeRecipe.CopyTileComponent(MatteryBlockEntity.ENERGY_KEY, "energy"),
) UpgradeRecipe.CopyTileComponent(MatteryBlockEntity.MATTER_STORAGE_KEY, "matter"),
.row(MItemTags.ADVANCED_CIRCUIT, Tags.Items.GEMS_EMERALD, MItemTags.ADVANCED_CIRCUIT) )
.row(MItems.ELECTRIC_PARTS, MItems.MATTER_REPLICATOR, MItems.ELECTRIC_PARTS) .row(MItemTags.ADVANCED_CIRCUIT, Tags.Items.GEMS_EMERALD, MItemTags.ADVANCED_CIRCUIT)
.row(MItems.ELECTROMAGNET, MItems.ELECTROMAGNET, MItems.ELECTROMAGNET) .row(MItems.ELECTRIC_PARTS, item, MItems.ELECTRIC_PARTS)
.row(MItems.ELECTROMAGNET, MItems.ELECTROMAGNET, MItems.ELECTROMAGNET)
.build(consumer)
}
MatteryRecipe(MItems.MATTER_SCANNER[null]!!, category = machinesCategory)
.row(MItems.MIRROR, MItems.MATTER_TRANSFORM_MATRIX, MItems.MIRROR)
.row(MItemTags.HARDENED_GLASS_COLORLESS, MItems.MACHINE_FRAME, MItemTags.HARDENED_GLASS_COLORLESS)
.row(MItems.MATTER_CABLE, MItemTags.ADVANCED_CIRCUIT, MItems.MATTER_CABLE)
.build(consumer) .build(consumer)
MatteryRecipe(MItems.FLUID_CAPSULE, category = RecipeCategory.TOOLS, count = 8) MatteryRecipe(MItems.FLUID_CAPSULE, category = RecipeCategory.TOOLS, count = 8)
@ -372,12 +461,136 @@ fun addCraftingTableRecipes(consumer: Consumer<FinishedRecipe>) {
.unlockedBy(MItemTags.TRITANIUM_INGOTS) .unlockedBy(MItemTags.TRITANIUM_INGOTS)
.build(consumer) .build(consumer)
consumer.accept(ExplosiveHammerPrimingRecipe(modLocation("hammer_priming"), Ingredient.of(Tags.Items.NUGGETS_IRON)).finishedRecipe)
MatteryRecipe(MItems.EXPLOSIVE_HAMMER, category = RecipeCategory.COMBAT) MatteryRecipe(MItems.EXPLOSIVE_HAMMER, category = RecipeCategory.COMBAT)
.rowB(Tags.Items.INGOTS_IRON) .rowB(Tags.Items.INGOTS_IRON)
.rowAB(Tags.Items.INGOTS_IRON, Tags.Items.RODS_WOODEN) .rowAB(Tags.Items.INGOTS_IRON, Tags.Items.RODS_WOODEN)
.rowB(Tags.Items.RODS_WOODEN) .rowB(Tags.Items.RODS_WOODEN)
.unlockedBy(Items.FLINT_AND_STEEL) .unlockedBy(Items.FLINT_AND_STEEL)
.build(consumer) .build(consumer)
MatteryRecipe(MItems.POWERED_FURNACE[null]!!, category = machinesCategory)
.row(Items.FURNACE, MItems.MACHINE_FRAME, Items.FURNACE)
.unlockedBy(MItems.MACHINE_FRAME)
.build(consumer)
MatteryRecipe(MItems.POWERED_SMOKER[null]!!, category = machinesCategory)
.rowAC(Items.FURNACE, Items.FURNACE)
.row(MItems.ELECTROMAGNET, MItems.MACHINE_FRAME, MItems.ELECTROMAGNET)
.unlockedBy(MItems.MACHINE_FRAME)
.build(consumer)
MatteryRecipe(MItems.POWERED_BLAST_FURNACE[null]!!, category = machinesCategory)
.row(MItems.ELECTROMAGNET, Items.FURNACE, MItems.ELECTROMAGNET)
.row(MItems.ELECTROMAGNET, MItems.MACHINE_FRAME, MItems.ELECTROMAGNET)
.row(MItems.ELECTROMAGNET, Items.FURNACE, MItems.ELECTROMAGNET)
.unlockedBy(MItems.MACHINE_FRAME)
.build(consumer)
MatteryRecipe(MItems.INFINITE_WATER_SOURCE, category = machinesCategory)
.row(MItemTags.IRON_PLATES, MItemTags.IRON_PLATES, MItemTags.IRON_PLATES)
.rowAC(Items.WATER_BUCKET, Items.WATER_BUCKET)
.row(MItemTags.IRON_PLATES, MItemTags.IRON_PLATES, MItemTags.IRON_PLATES)
.unlockedBy(Items.WATER_BUCKET)
.build(consumer)
MatteryRecipe(MItems.PAINTER, category = machinesCategory)
.row(Items.BRUSH, Items.BUCKET, Items.BUCKET)
.row(MItemTags.IRON_PLATES, Items.BUCKET, MItemTags.IRON_PLATES)
.row(MItemTags.IRON_PLATES, MItemTags.CRAFTING_TABLES, MItemTags.IRON_PLATES)
.unlockedBy(Tags.Items.DYES)
.build(consumer)
MatteryRecipe(MItems.MATTER_ENTANGLER, category = machinesCategory)
.row(MItemTags.ADVANCED_CIRCUIT, MItems.MATTER_TRANSFORM_MATRIX, MItemTags.ADVANCED_CIRCUIT)
.row(MItems.MATTER_CAPACITOR_PARTS, MItems.MACHINE_FRAME, MItems.MATTER_IO_PORT)
.row(MItemTags.DILITHIUM_GEMS, MItems.ANTIMATTER_TRANSFORM_MATRIX, MItemTags.DILITHIUM_GEMS)
.unlockedBy(MItems.ANTIMATTER_TRANSFORM_MATRIX)
.build(consumer)
MatteryRecipe(MItems.CHEST_UPGRADER, category = RecipeCategory.TOOLS)
.rowAC(Items.REDSTONE, Items.REDSTONE)
.row(MItemTags.TRITANIUM_PLATES, Items.ENDER_PEARL, MItemTags.TRITANIUM_PLATES)
.rowB(ItemTags.STONE_BUTTONS)
.unlockedBy(Tags.Items.CHESTS_WOODEN)
.unlockedBy(Tags.Items.BARRELS_WOODEN)
.unlockedBy(MItemTags.CARGO_CRATES)
.build(consumer)
MatteryRecipe(MItems.ENERGY_CABLES[CablesConfig.E.CRUDE]!!, category = machinesCategory, count = 8)
.row(Tags.Items.INGOTS_IRON, Items.REDSTONE, Tags.Items.INGOTS_IRON)
.unlockedBy(Items.REDSTONE)
.build(consumer)
MatteryRecipe(MItems.ENERGY_CABLES[CablesConfig.E.REGULAR]!!, category = machinesCategory, count = 16)
.row(MItemTags.COPPER_WIRES, MItemTags.COPPER_WIRES, MItemTags.COPPER_WIRES)
.row(MItemTags.IRON_PLATES, Items.REDSTONE, MItemTags.IRON_PLATES)
.row(MItemTags.COPPER_WIRES, MItemTags.COPPER_WIRES, MItemTags.COPPER_WIRES)
.build(consumer)
MatteryRecipe(MItems.ENERGY_CABLES[CablesConfig.E.ADVANCED]!!, category = machinesCategory, count = 16)
.row(MItemTags.GOLD_WIRES, MItemTags.COPPER_WIRES, MItemTags.GOLD_WIRES)
.row(MItemTags.TRITANIUM_PLATES, Items.REDSTONE, MItemTags.TRITANIUM_PLATES)
.row(MItemTags.GOLD_WIRES, MItemTags.COPPER_WIRES, MItemTags.GOLD_WIRES)
.build(consumer)
MatteryRecipe(MItems.ENERGY_CABLES[CablesConfig.E.SUPERCONDUCTOR]!!, category = machinesCategory)
.row(MItemTags.REINFORCED_TRITANIUM_PLATES, MItems.ELECTROMAGNET, MItemTags.REINFORCED_TRITANIUM_PLATES)
.row(Tags.Items.INGOTS_GOLD, Tags.Items.INGOTS_GOLD, Tags.Items.INGOTS_GOLD)
.row(MItemTags.REINFORCED_TRITANIUM_PLATES, Items.BLUE_ICE, MItemTags.REINFORCED_TRITANIUM_PLATES)
.build(consumer)
val ironRod = ItemTags.create(ResourceLocation("c", "rods/iron"))
var condConsumer = consumer.withConditions(NotCondition(TagEmptyCondition(ironRod)))
for ((color, item) in MItems.GRILL) {
MatteryRecipe(item, category = RecipeCategory.DECORATIONS)
.rowB(color?.tag)
.row(Tags.Items.INGOTS_IRON, Tags.Items.INGOTS_IRON, Tags.Items.INGOTS_IRON)
.rowAC(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
.build(consumer)
MatteryRecipe(item, category = RecipeCategory.DECORATIONS)
.rowB(color?.tag)
.row(ironRod, ironRod, ironRod)
.rowAC(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
.build(condConsumer, "grill_alt_a/${color?.name?.lowercase() ?: "default"}")
MatteryRecipe(item, category = RecipeCategory.DECORATIONS)
.rowB(color?.tag)
.row(ironRod, ironRod, ironRod)
.rowB(MItemTags.TRITANIUM_PLATES)
.build(condConsumer, "grill_alt_b/${color?.name?.lowercase() ?: "default"}")
MatteryRecipe(item, category = RecipeCategory.DECORATIONS)
.rowB(color?.tag)
.row(Tags.Items.INGOTS_IRON, Tags.Items.INGOTS_IRON, Tags.Items.INGOTS_IRON)
.rowB(MItemTags.TRITANIUM_PLATES)
.build(consumer, "grill_alt_c/${color?.name?.lowercase() ?: "default"}")
}
MatteryRecipe(MItems.REDSTONE_INTERACTOR, category = RecipeCategory.TOOLS)
.rowAB(Items.LEVER, Tags.Items.NUGGETS_IRON)
.rowB(Tags.Items.DUSTS_REDSTONE)
.unlockedBy(Tags.Items.DUSTS_REDSTONE)
.build(consumer)
ShapelessRecipeBuilder.shapeless(RecipeCategory.BUILDING_BLOCKS, ItemStack(MItems.DILITHIUM_CRYSTAL_BLOCK))
.requires(MItems.DILITHIUM_CRYSTAL, 9)
.unlockedBy(MItems.DILITHIUM_CRYSTAL)
.unlockedBy(MItems.DILITHIUM_CRYSTAL_BLOCK)
.save(consumer, modLocation("dilithium_crystal/to_block"))
ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ItemStack(MItems.DILITHIUM_CRYSTAL, 9))
.requires(MItems.DILITHIUM_CRYSTAL_BLOCK)
.unlockedBy(MItems.DILITHIUM_CRYSTAL)
.unlockedBy(MItems.DILITHIUM_CRYSTAL_BLOCK)
.save(consumer, modLocation("dilithium_crystal/from_block"))
MatteryRecipe(MItems.CONFIGURATOR, category = RecipeCategory.TOOLS)
.rowA(MItemTags.IRON_PLATES)
.row(Tags.Items.GLASS_PANES, Tags.Items.DUSTS_REDSTONE, MItems.DISPLAY_SCREEN)
.row(MItemTags.IRON_PLATES, MItemTags.BASIC_CIRCUIT, MItems.DILITHIUM_CRYSTAL)
.unlockedBy(MItems.DILITHIUM_CRYSTAL)
.unlockedBy(MItems.DISPLAY_SCREEN)
.build(consumer)
} }

View File

@ -1,21 +1,21 @@
package ru.dbotthepony.mc.otm.datagen.recipes package ru.dbotthepony.mc.otm.datagen.recipes
import net.minecraft.data.recipes.* import net.minecraft.data.recipes.*
import net.minecraft.tags.ItemTags
import net.minecraft.world.item.DyeColor import net.minecraft.world.item.DyeColor
import net.minecraft.world.item.ItemStack import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.Items import net.minecraft.world.item.Items
import net.minecraft.world.item.crafting.Ingredient import net.minecraft.world.item.crafting.Ingredient
import net.minecraft.world.level.ItemLike import net.minecraft.world.level.ItemLike
import net.minecraftforge.common.Tags import net.neoforged.neoforge.common.Tags
import ru.dbotthepony.mc.otm.core.registryName import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.datagen.modLocation import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.registry.MBlocks import ru.dbotthepony.mc.otm.registry.game.MBlocks
import ru.dbotthepony.mc.otm.registry.MItemTags import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.MItems import ru.dbotthepony.mc.otm.registry.game.MItems
import ru.dbotthepony.mc.otm.registry.MRegistry import ru.dbotthepony.mc.otm.registry.MRegistry
import java.util.function.Consumer
private fun stairs(base: ItemLike, result: ItemLike, consumer: Consumer<FinishedRecipe>) { private fun stairs(base: ItemLike, result: ItemLike, consumer: RecipeOutput) {
MatteryRecipe(result, 4, category = RecipeCategory.BUILDING_BLOCKS) MatteryRecipe(result, 4, category = RecipeCategory.BUILDING_BLOCKS)
.rowA(base) .rowA(base)
.rowAB(base, base) .rowAB(base, base)
@ -24,14 +24,14 @@ private fun stairs(base: ItemLike, result: ItemLike, consumer: Consumer<Finished
.build(consumer, modLocation("decorative/stairs/${base.asItem().registryName!!.path}")) .build(consumer, modLocation("decorative/stairs/${base.asItem().registryName!!.path}"))
} }
private fun slab(base: ItemLike, result: ItemLike, consumer: Consumer<FinishedRecipe>) { private fun slab(base: ItemLike, result: ItemLike, consumer: RecipeOutput) {
MatteryRecipe(result, 6, category = RecipeCategory.BUILDING_BLOCKS) MatteryRecipe(result, 6, category = RecipeCategory.BUILDING_BLOCKS)
.row(base, base, base) .row(base, base, base)
.unlockedBy(base) .unlockedBy(base)
.build(consumer, modLocation("decorative/slabs/${base.asItem().registryName!!.path}")) .build(consumer, modLocation("decorative/slabs/${base.asItem().registryName!!.path}"))
} }
private fun wall(base: ItemLike, result: ItemLike, consumer: Consumer<FinishedRecipe>) { private fun wall(base: ItemLike, result: ItemLike, consumer: RecipeOutput) {
MatteryRecipe(result, 6, category = RecipeCategory.BUILDING_BLOCKS) MatteryRecipe(result, 6, category = RecipeCategory.BUILDING_BLOCKS)
.row(base, base, base) .row(base, base, base)
.row(base, base, base) .row(base, base, base)
@ -39,29 +39,29 @@ private fun wall(base: ItemLike, result: ItemLike, consumer: Consumer<FinishedRe
.build(consumer, modLocation("decorative/walls/${base.asItem().registryName!!.path}")) .build(consumer, modLocation("decorative/walls/${base.asItem().registryName!!.path}"))
} }
private fun cut(base: ItemLike, result: ItemLike, amount: Int, consumer: Consumer<FinishedRecipe>) { private fun cut(base: ItemLike, result: ItemLike, amount: Int, consumer: RecipeOutput) {
SingleItemRecipeBuilder SingleItemRecipeBuilder
.stonecutting(Ingredient.of(base), RecipeCategory.BUILDING_BLOCKS, result, amount) .stonecutting(Ingredient.of(base), RecipeCategory.BUILDING_BLOCKS, result, amount)
.unlockedBy(base) .unlockedBy(base)
.save(consumer, modLocation("stonecutting/${result.asItem().registryName!!.path}_from_${base.asItem().registryName!!.path}")) .save(consumer, modLocation("stonecutting/${result.asItem().registryName!!.path}_from_${base.asItem().registryName!!.path}"))
} }
private fun stairsWithCut(base: ItemLike, result: ItemLike, consumer: Consumer<FinishedRecipe>) { private fun stairsWithCut(base: ItemLike, result: ItemLike, consumer: RecipeOutput) {
stairs(base, result, consumer) stairs(base, result, consumer)
cut(base, result, 1, consumer) cut(base, result, 1, consumer)
} }
private fun slabWithCut(base: ItemLike, result: ItemLike, consumer: Consumer<FinishedRecipe>) { private fun slabWithCut(base: ItemLike, result: ItemLike, consumer: RecipeOutput) {
slab(base, result, consumer) slab(base, result, consumer)
cut(base, result, 2, consumer) cut(base, result, 2, consumer)
} }
private fun wallWithCut(base: ItemLike, result: ItemLike, consumer: Consumer<FinishedRecipe>) { private fun wallWithCut(base: ItemLike, result: ItemLike, consumer: RecipeOutput) {
wall(base, result, consumer) wall(base, result, consumer)
cut(base, result, 1, consumer) cut(base, result, 1, consumer)
} }
fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: Consumer<FinishedRecipe>) { fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: RecipeOutput) {
// Напольная плитка // Напольная плитка
for ((color, unrefinedItem) in MRegistry.UNREFINED_FLOOR_TILES.items) { for ((color, unrefinedItem) in MRegistry.UNREFINED_FLOOR_TILES.items) {
MatteryRecipe(unrefinedItem, 24) MatteryRecipe(unrefinedItem, 24)
@ -110,9 +110,11 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: Consumer<Fi
wallWithCut(item, MRegistry.TRITANIUM_STRIPED_WALL.getItem(a, b), consumer) wallWithCut(item, MRegistry.TRITANIUM_STRIPED_WALL.getItem(a, b), consumer)
} }
stairsWithCut(MItems.TRITANIUM_STRIPED_BLOCK, MItems.TRITANIUM_STRIPED_STAIRS, consumer) for (color in DyeColor.entries) {
slabWithCut(MItems.TRITANIUM_STRIPED_BLOCK, MItems.TRITANIUM_STRIPED_SLAB, consumer) stairsWithCut(MItems.TRITANIUM_STRIPED_BLOCK[color]!!, MItems.TRITANIUM_STRIPED_STAIRS[color]!!, consumer)
wallWithCut(MItems.TRITANIUM_STRIPED_BLOCK, MItems.TRITANIUM_STRIPED_WALL, consumer) slabWithCut(MItems.TRITANIUM_STRIPED_BLOCK[color]!!, MItems.TRITANIUM_STRIPED_SLAB[color]!!, consumer)
wallWithCut(MItems.TRITANIUM_STRIPED_BLOCK[color]!!, MItems.TRITANIUM_STRIPED_WALL[color]!!, consumer)
}
for ((color, item) in MRegistry.FLOOR_TILES.items) { for ((color, item) in MRegistry.FLOOR_TILES.items) {
stairsWithCut(item, MRegistry.FLOOR_TILES_STAIRS.items[color]!!, consumer) stairsWithCut(item, MRegistry.FLOOR_TILES_STAIRS.items[color]!!, consumer)
@ -134,7 +136,7 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: Consumer<Fi
MatteryRecipe(MItems.DANGER_STRIPE_BLOCK, 24, category = RecipeCategory.BUILDING_BLOCKS) MatteryRecipe(MItems.DANGER_STRIPE_BLOCK, 24, category = RecipeCategory.BUILDING_BLOCKS)
.rowAB(Tags.Items.DYES_YELLOW, Tags.Items.INGOTS_IRON) .rowAB(Tags.Items.DYES_YELLOW, Tags.Items.INGOTS_IRON)
.row(Tags.Items.INGOTS_IRON, Tags.Items.COBBLESTONE, Tags.Items.INGOTS_IRON) .row(Tags.Items.INGOTS_IRON, Tags.Items.COBBLESTONES, Tags.Items.INGOTS_IRON)
.rowBC(Tags.Items.INGOTS_IRON, Tags.Items.DYES_BLACK) .rowBC(Tags.Items.INGOTS_IRON, Tags.Items.DYES_BLACK)
.unlockedBy(Tags.Items.INGOTS_IRON) .unlockedBy(Tags.Items.INGOTS_IRON)
.unlockedBy(Tags.Items.DYES_BLACK) .unlockedBy(Tags.Items.DYES_BLACK)
@ -142,7 +144,7 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: Consumer<Fi
MatteryRecipe(MItems.METAL_BEAM, 24, category = RecipeCategory.BUILDING_BLOCKS) MatteryRecipe(MItems.METAL_BEAM, 24, category = RecipeCategory.BUILDING_BLOCKS)
.rowB(Tags.Items.INGOTS_IRON) .rowB(Tags.Items.INGOTS_IRON)
.row(MItemTags.TRITANIUM_INGOTS, Tags.Items.COBBLESTONE, MItemTags.TRITANIUM_INGOTS) .row(MItemTags.TRITANIUM_INGOTS, Tags.Items.COBBLESTONES, MItemTags.TRITANIUM_INGOTS)
.rowB(Tags.Items.INGOTS_IRON) .rowB(Tags.Items.INGOTS_IRON)
.build(consumer, modLocation("decorative/metal_beam")) .build(consumer, modLocation("decorative/metal_beam"))
@ -175,9 +177,14 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: Consumer<Fi
.save(consumer, modLocation("decorative/vent/from_alt/${color?.name?.lowercase() ?: "default"}")) .save(consumer, modLocation("decorative/vent/from_alt/${color?.name?.lowercase() ?: "default"}"))
} }
ShapelessRecipeBuilder(RecipeCategory.BUILDING_BLOCKS, MItems.METAL_BEAM_CENTER, 1).requires(MItems.METAL_BEAM)
.unlockedBy(MItems.METAL_BEAM)
ShapelessRecipeBuilder(RecipeCategory.BUILDING_BLOCKS, MItems.METAL_BEAM, 1).requires(MItems.METAL_BEAM_CENTER)
.unlockedBy(MItems.METAL_BEAM_CENTER)
MatteryRecipe(MRegistry.DECORATIVE_CRATE.item, 24, category = RecipeCategory.BUILDING_BLOCKS) MatteryRecipe(MRegistry.DECORATIVE_CRATE.item, 24, category = RecipeCategory.BUILDING_BLOCKS)
.rowB(Tags.Items.INGOTS_IRON) .rowB(Tags.Items.INGOTS_IRON)
.row(Tags.Items.INGOTS_IRON, Tags.Items.COBBLESTONE, Tags.Items.INGOTS_IRON) .row(Tags.Items.INGOTS_IRON, Tags.Items.COBBLESTONES, Tags.Items.INGOTS_IRON)
.rowB(Tags.Items.INGOTS_IRON) .rowB(Tags.Items.INGOTS_IRON)
.unlockedBy(Tags.Items.INGOTS_IRON) .unlockedBy(Tags.Items.INGOTS_IRON)
.build(consumer, modLocation("decorative/crate/rusty")) .build(consumer, modLocation("decorative/crate/rusty"))
@ -233,7 +240,7 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: Consumer<Fi
DyeColor.BLACK to Items.BLACK_STAINED_GLASS, DyeColor.BLACK to Items.BLACK_STAINED_GLASS,
) )
for (color in DyeColor.values()) { for (color in DyeColor.entries) {
val item = MRegistry.INDUSTRIAL_GLASS.items[color]!! val item = MRegistry.INDUSTRIAL_GLASS.items[color]!!
val paneItem = MRegistry.INDUSTRIAL_GLASS_PANE.items[color]!! val paneItem = MRegistry.INDUSTRIAL_GLASS_PANE.items[color]!!
val mappedVanilla = mappingUpgradeVanilla[color]!! val mappedVanilla = mappingUpgradeVanilla[color]!!
@ -266,6 +273,42 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: Consumer<Fi
.save(consumer, modLocation("decorative/industrial_glass_pane/recolor/${color.name.lowercase()}")) .save(consumer, modLocation("decorative/industrial_glass_pane/recolor/${color.name.lowercase()}"))
} }
ShapelessRecipeBuilder(RecipeCategory.REDSTONE, MItems.REDSTONE_LAMP_INVERTED, 1)
.requires(Items.REDSTONE_LAMP)
.unlockedBy(Items.REDSTONE_LAMP)
.save(consumer, modLocation("decorative/inverted_redstone_lamp"))
ShapelessRecipeBuilder(RecipeCategory.REDSTONE, Items.REDSTONE_LAMP, 1)
.requires(MItems.REDSTONE_LAMP_INVERTED)
.unlockedBy(MItems.REDSTONE_LAMP_INVERTED)
.save(consumer, modLocation("decorative/inverted_redstone_lamp2"))
MatteryRecipe(MItems.REINFORCED_REDSTONE_LAMP, category = RecipeCategory.REDSTONE)
.row(MItemTags.TRITANIUM_PLATES, Items.REDSTONE_LAMP, MItemTags.TRITANIUM_PLATES)
.build(consumer, modLocation("decorative/reinforced_redstone_lamp"))
MatteryRecipe(MItems.REINFORCED_REDSTONE_LAMP_INVERTED, category = RecipeCategory.REDSTONE)
.row(MItemTags.TRITANIUM_PLATES, MItems.REDSTONE_LAMP_INVERTED, MItemTags.TRITANIUM_PLATES)
.build(consumer, modLocation("decorative/reinforced_redstone_lamp_inverted"))
MatteryRecipe(MItems.LABORATORY_LAMP, category = RecipeCategory.REDSTONE)
.row(MItemTags.IRON_PLATES, MItemTags.HARDENED_GLASS_PANES_COLORLESS, MItemTags.IRON_PLATES)
.row(MItems.MIRROR, Items.REDSTONE_LAMP, MItems.MIRROR)
.row(MItemTags.TRITANIUM_PLATES, Tags.Items.DUSTS_REDSTONE, MItemTags.TRITANIUM_PLATES)
.build(consumer, modLocation("decorative/lab_lamp"))
MatteryRecipe(MItems.LABORATORY_LAMP, category = RecipeCategory.REDSTONE)
.row(MItemTags.IRON_PLATES, MItemTags.HARDENED_GLASS_PANES_COLORLESS, MItemTags.IRON_PLATES)
.row(MItems.MIRROR, MItems.REINFORCED_REDSTONE_LAMP, MItems.MIRROR)
.rowB(Tags.Items.DUSTS_REDSTONE)
.build(consumer, modLocation("decorative/lab_lamp_alt"))
MatteryRecipe(MItems.LABORATORY_LAMP_INVERTED, category = RecipeCategory.REDSTONE)
.row(MItemTags.IRON_PLATES, MItemTags.HARDENED_GLASS_PANES_COLORLESS, MItemTags.IRON_PLATES)
.row(MItems.MIRROR, MItems.REINFORCED_REDSTONE_LAMP_INVERTED, MItems.MIRROR)
.rowB(Tags.Items.DUSTS_REDSTONE)
.build(consumer, modLocation("decorative/lab_lamp_inv_alt"))
ShapelessRecipeBuilder(RecipeCategory.REDSTONE, MItems.LABORATORY_LAMP, 1) ShapelessRecipeBuilder(RecipeCategory.REDSTONE, MItems.LABORATORY_LAMP, 1)
.requires(MItems.LABORATORY_LAMP_INVERTED) .requires(MItems.LABORATORY_LAMP_INVERTED)
.unlockedBy(MItems.LABORATORY_LAMP_INVERTED) .unlockedBy(MItems.LABORATORY_LAMP_INVERTED)
@ -276,17 +319,29 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: Consumer<Fi
.unlockedBy(MItems.LABORATORY_LAMP) .unlockedBy(MItems.LABORATORY_LAMP)
.save(consumer, MItems.LABORATORY_LAMP_INVERTED.registryName!!.toString() + "_inv") .save(consumer, MItems.LABORATORY_LAMP_INVERTED.registryName!!.toString() + "_inv")
MatteryRecipe(MBlocks.TRITANIUM_STRIPED_BLOCK, 24, category = RecipeCategory.BUILDING_BLOCKS) ShapelessRecipeBuilder(RecipeCategory.REDSTONE, MItems.REINFORCED_REDSTONE_LAMP, 1)
.rowB(MItemTags.TRITANIUM_INGOTS) .requires(MItems.REINFORCED_REDSTONE_LAMP_INVERTED)
.row(MItemTags.TRITANIUM_INGOTS, Tags.Items.COBBLESTONE, MItemTags.TRITANIUM_INGOTS) .unlockedBy(MItems.REINFORCED_REDSTONE_LAMP_INVERTED)
.rowAB(Tags.Items.DYES_YELLOW, MItemTags.TRITANIUM_INGOTS) .save(consumer, MItems.REINFORCED_REDSTONE_LAMP_INVERTED.registryName!!.toString() + "_inv")
.unlockedBy(MItemTags.TRITANIUM_INGOTS)
.unlockedBy(Tags.Items.DYES_YELLOW) ShapelessRecipeBuilder(RecipeCategory.REDSTONE, MItems.REINFORCED_REDSTONE_LAMP_INVERTED, 1)
.build(consumer, modLocation("decorative/blocks/striped_default")) .requires(MItems.REINFORCED_REDSTONE_LAMP)
.unlockedBy(MItems.REINFORCED_REDSTONE_LAMP)
.save(consumer, MItems.REINFORCED_REDSTONE_LAMP.registryName!!.toString() + "_inv")
for (color in DyeColor.entries) {
MatteryRecipe(MBlocks.TRITANIUM_STRIPED_BLOCK[color]!!, 24, category = RecipeCategory.BUILDING_BLOCKS)
.rowB(MItemTags.TRITANIUM_INGOTS)
.row(MItemTags.TRITANIUM_INGOTS, Tags.Items.COBBLESTONES, MItemTags.TRITANIUM_INGOTS)
.rowAB(color.tag, MItemTags.TRITANIUM_INGOTS)
.unlockedBy(MItemTags.TRITANIUM_INGOTS)
.unlockedBy(color.tag)
.build(consumer, modLocation("decorative/blocks/striped_default_${color.name.lowercase()}"))
}
MatteryRecipe(MRegistry.TRITANIUM_BLOCK.item, 24, category = RecipeCategory.BUILDING_BLOCKS) MatteryRecipe(MRegistry.TRITANIUM_BLOCK.item, 24, category = RecipeCategory.BUILDING_BLOCKS)
.rowB(MItemTags.TRITANIUM_INGOTS) .rowB(MItemTags.TRITANIUM_INGOTS)
.row(MItemTags.TRITANIUM_INGOTS, Tags.Items.COBBLESTONE, MItemTags.TRITANIUM_INGOTS) .row(MItemTags.TRITANIUM_INGOTS, Tags.Items.COBBLESTONES, MItemTags.TRITANIUM_INGOTS)
.rowB(MItemTags.TRITANIUM_INGOTS) .rowB(MItemTags.TRITANIUM_INGOTS)
.unlockedBy(MItemTags.TRITANIUM_INGOTS) .unlockedBy(MItemTags.TRITANIUM_INGOTS)
.build(consumer, modLocation("decorative/blocks/default")) .build(consumer, modLocation("decorative/blocks/default"))
@ -298,7 +353,7 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: Consumer<Fi
.unlockedBy(MItemTags.TRITANIUM_INGOTS) .unlockedBy(MItemTags.TRITANIUM_INGOTS)
.build(consumer, modLocation("decorative/doors/default")) .build(consumer, modLocation("decorative/doors/default"))
for (color in DyeColor.values()) { for (color in DyeColor.entries) {
ShapelessRecipeBuilder.shapeless(RecipeCategory.REDSTONE, MItems.TRITANIUM_DOOR[color]!!, 1) ShapelessRecipeBuilder.shapeless(RecipeCategory.REDSTONE, MItems.TRITANIUM_DOOR[color]!!, 1)
.requires(Ingredient.of(MItems.TRITANIUM_DOOR.entries.stream().filter { it.key != color }.map { ItemStack(it.value) })) .requires(Ingredient.of(MItems.TRITANIUM_DOOR.entries.stream().filter { it.key != color }.map { ItemStack(it.value) }))
.requires(color.tag) .requires(color.tag)
@ -312,7 +367,7 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: Consumer<Fi
.unlockedBy(MItemTags.TRITANIUM_INGOTS) .unlockedBy(MItemTags.TRITANIUM_INGOTS)
.build(consumer, modLocation("decorative/trapdoors/default")) .build(consumer, modLocation("decorative/trapdoors/default"))
for (color in DyeColor.values()) { for (color in DyeColor.entries) {
ShapelessRecipeBuilder.shapeless(RecipeCategory.REDSTONE, MItems.TRITANIUM_TRAPDOOR[color]!!, 1) ShapelessRecipeBuilder.shapeless(RecipeCategory.REDSTONE, MItems.TRITANIUM_TRAPDOOR[color]!!, 1)
.requires(Ingredient.of(MItems.TRITANIUM_TRAPDOOR.entries.stream().filter { it.key != color }.map { ItemStack(it.value) })) .requires(Ingredient.of(MItems.TRITANIUM_TRAPDOOR.entries.stream().filter { it.key != color }.map { ItemStack(it.value) }))
.requires(color.tag) .requires(color.tag)
@ -325,7 +380,7 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: Consumer<Fi
.unlockedBy(MItemTags.TRITANIUM_PLATES) .unlockedBy(MItemTags.TRITANIUM_PLATES)
.build(consumer, modLocation("pressure_plates/default")) .build(consumer, modLocation("pressure_plates/default"))
for (dye in DyeColor.values()) { for (dye in DyeColor.entries) {
ShapelessRecipeBuilder(RecipeCategory.REDSTONE, MRegistry.TRITANIUM_PRESSURE_PLATE.getItem(dye), 1) ShapelessRecipeBuilder(RecipeCategory.REDSTONE, MRegistry.TRITANIUM_PRESSURE_PLATE.getItem(dye), 1)
.requires(Ingredient.of(MRegistry.TRITANIUM_PRESSURE_PLATE.allItems.entries.stream().filter { it.key != dye }.map { ItemStack(it.value) })) .requires(Ingredient.of(MRegistry.TRITANIUM_PRESSURE_PLATE.allItems.entries.stream().filter { it.key != dye }.map { ItemStack(it.value) }))
.requires(dye.tag) .requires(dye.tag)
@ -349,12 +404,13 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: Consumer<Fi
.unlockedBy(Items.IRON_BARS) .unlockedBy(Items.IRON_BARS)
.build(consumer, modLocation("decorative/metal_mesh")) .build(consumer, modLocation("decorative/metal_mesh"))
// лампа MatteryRecipe(MItems.METAL_RAILING, count = 16, category = RecipeCategory.BUILDING_BLOCKS)
MatteryRecipe(MItems.LABORATORY_LAMP, category = RecipeCategory.REDSTONE) .row(MItems.METAL_MESH, MItems.METAL_MESH, MItems.METAL_MESH)
.row(MItemTags.IRON_PLATES, MItemTags.HARDENED_GLASS_PANES_COLORLESS, MItemTags.IRON_PLATES) .row(MItems.METAL_MESH, MItems.METAL_MESH, MItems.METAL_MESH)
.row(MItems.MIRROR, Items.GLOWSTONE, MItems.MIRROR) .unlockedBy(Items.IRON_BARS)
.row(MItemTags.TRITANIUM_PLATES, Tags.Items.DUSTS_REDSTONE, MItemTags.TRITANIUM_PLATES) .unlockedBy(Tags.Items.NUGGETS_IRON)
.build(consumer, modLocation("decorative/lamp")) .unlockedBy(MItems.METAL_MESH)
.build(consumer, modLocation("decorative/metal_railing"))
// Голо табличка // Голо табличка
MatteryRecipe(MItems.HOLO_SIGN, category = RecipeCategory.DECORATIONS) MatteryRecipe(MItems.HOLO_SIGN, category = RecipeCategory.DECORATIONS)
@ -368,9 +424,29 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: Consumer<Fi
.row(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS) .row(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
.build(consumer, modLocation("decorative/tritanium_bars")) .build(consumer, modLocation("decorative/tritanium_bars"))
MatteryRecipe(MItems.TRITANIUM_ANVIL[0], category = RecipeCategory.DECORATIONS) MatteryRecipe(MItems.TRITANIUM_ANVIL[null]!![0], category = RecipeCategory.DECORATIONS)
.row(MItemTags.TRITANIUM_INGOTS_STORAGE, MItemTags.TRITANIUM_INGOTS_STORAGE, MItemTags.TRITANIUM_INGOTS_STORAGE) .row(MItemTags.TRITANIUM_INGOTS_STORAGE, MItemTags.TRITANIUM_INGOTS_STORAGE, MItemTags.TRITANIUM_INGOTS_STORAGE)
.rowB(MItemTags.TRITANIUM_INGOTS) .rowB(MItemTags.TRITANIUM_INGOTS)
.row(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS) .row(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
.build(consumer) .build(consumer)
for ((color, item) in MRegistry.COMPUTER_TERMINAL.allItems) {
val builder = MatteryRecipe(item, category = RecipeCategory.DECORATIONS)
if (color != null) {
builder.rowB(color.tag)
}
builder.row(MItemTags.TRITANIUM_PLATES, MItems.DISPLAY_SCREEN, MItemTags.HARDENED_GLASS_PANES_COLORLESS)
builder.rowB(MItemTags.BASIC_CIRCUIT)
builder.build(consumer)
}
for ((color, item) in MRegistry.STAR_CHAIR.allItems) {
MatteryRecipe(item, category = RecipeCategory.DECORATIONS)
.rowB(color?.tag)
.row(MItemTags.TRITANIUM_PLATES, ItemTags.WOOL, MItemTags.TRITANIUM_PLATES)
.row(MItemTags.TRITANIUM_PLATES, MItemTags.CARBON_PLATES, MItemTags.TRITANIUM_PLATES)
.build(consumer)
}
} }

View File

@ -0,0 +1,120 @@
package ru.dbotthepony.mc.otm.datagen.recipes
import net.minecraft.data.recipes.RecipeOutput
import net.minecraft.world.item.Item
import net.minecraft.world.item.Items
import net.neoforged.neoforge.common.Tags
import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.game.MItems
private fun makeNormalRecipe(element: Item, result: Item): MatteryRecipe {
return MatteryRecipe(result, 1)
.row(MItemTags.COPPER_WIRES, Items.REDSTONE, MItemTags.COPPER_WIRES)
.row(MItemTags.CARBON_PLATES, element, MItemTags.CARBON_PLATES)
.rowB(MItems.ELECTRIC_PARTS)
.unlockedBy(MItemTags.IRON_PLATES)
.unlockedBy(MItems.ELECTRIC_PARTS)
.unlockedBy(element)
}
private fun makeAdvancedRecipe(element: Item, result: Item): MatteryRecipe {
return MatteryRecipe(result, 1)
.row(MItemTags.GOLD_WIRES, MItemTags.DILITHIUM_GEMS, MItemTags.GOLD_WIRES)
.row(MItemTags.TRITANIUM_PLATES, element, MItemTags.TRITANIUM_PLATES)
.row(MItems.ELECTRIC_PARTS, MItemTags.DILITHIUM_GEMS, MItems.ELECTRIC_PARTS)
.unlockedBy(MItemTags.TRITANIUM_PLATES)
.unlockedBy(MItems.ELECTRIC_PARTS)
.unlockedBy(element)
}
fun addMachineUpgradeRecipes(consumer: RecipeOutput) {
MatteryRecipe(MItems.MachineUpgrades.Basic.BLANK)
.rowB(Items.REDSTONE)
.rowAC(MItemTags.IRON_PLATES, MItemTags.IRON_PLATES)
.rowB(MItems.ELECTRIC_PARTS)
.unlockedBy(MItemTags.IRON_PLATES)
.unlockedBy(MItems.ELECTRIC_PARTS)
.build(consumer)
makeNormalRecipe(MItems.MachineUpgrades.Basic.BLANK, MItems.MachineUpgrades.Normal.BLANK)
.build(consumer)
makeAdvancedRecipe(MItems.MachineUpgrades.Normal.BLANK, MItems.MachineUpgrades.Advanced.BLANK)
.build(consumer)
makeNormalRecipe(MItems.MachineUpgrades.Basic.SPEED, MItems.MachineUpgrades.Normal.SPEED)
.build(consumer, "upgrade")
makeNormalRecipe(MItems.MachineUpgrades.Basic.ENERGY_CONSUMPTION, MItems.MachineUpgrades.Normal.ENERGY_CONSUMPTION)
.build(consumer, "upgrade")
makeNormalRecipe(MItems.MachineUpgrades.Basic.FAILSAFE, MItems.MachineUpgrades.Normal.FAILSAFE)
.build(consumer, "upgrade")
makeNormalRecipe(MItems.MachineUpgrades.Basic.ENERGY_STORAGE, MItems.MachineUpgrades.Normal.ENERGY_STORAGE)
.build(consumer, "upgrade")
makeNormalRecipe(MItems.MachineUpgrades.Basic.MATTER_STORAGE, MItems.MachineUpgrades.Normal.MATTER_STORAGE)
.build(consumer, "upgrade")
makeNormalRecipe(MItems.MachineUpgrades.Basic.PROCESSING_ITEMS, MItems.MachineUpgrades.Normal.PROCESSING_ITEMS)
.build(consumer, "upgrade")
makeAdvancedRecipe(MItems.MachineUpgrades.Normal.SPEED, MItems.MachineUpgrades.Advanced.SPEED)
.build(consumer, "upgrade")
makeAdvancedRecipe(MItems.MachineUpgrades.Normal.ENERGY_CONSUMPTION, MItems.MachineUpgrades.Advanced.ENERGY_CONSUMPTION)
.build(consumer, "upgrade")
makeAdvancedRecipe(MItems.MachineUpgrades.Normal.FAILSAFE, MItems.MachineUpgrades.Advanced.FAILSAFE)
.build(consumer, "upgrade")
makeAdvancedRecipe(MItems.MachineUpgrades.Normal.ENERGY_STORAGE, MItems.MachineUpgrades.Advanced.ENERGY_STORAGE)
.build(consumer, "upgrade")
makeAdvancedRecipe(MItems.MachineUpgrades.Normal.MATTER_STORAGE, MItems.MachineUpgrades.Advanced.MATTER_STORAGE)
.build(consumer, "upgrade")
makeAdvancedRecipe(MItems.MachineUpgrades.Normal.PROCESSING_ITEMS, MItems.MachineUpgrades.Advanced.PROCESSING_ITEMS)
.build(consumer, "upgrade")
for (tier in MItems.MachineUpgrades.CRAFTABLE_TIERS) {
MatteryRecipe(tier.SPEED, 1)
.rowB(Items.REDSTONE)
.row(Items.SUGAR, MItemTags.COPPER_WIRES, Items.SUGAR)
.row(MItems.MECHANICAL_PARTS, tier.BLANK, MItems.MECHANICAL_PARTS)
.unlockedBy(tier.BLANK)
.unlockedBy(MItemTags.COPPER_WIRES)
.build(consumer)
MatteryRecipe(tier.ENERGY_CONSUMPTION, 1)
.rowB(Items.REDSTONE)
.row(MItemTags.COPPER_WIRES, MItemTags.GOLD_WIRES, MItemTags.COPPER_WIRES)
.row(MItems.ELECTRIC_PARTS, tier.BLANK, MItems.ELECTRIC_PARTS)
.unlockedBy(tier.BLANK)
.unlockedBy(MItemTags.GOLD_WIRES)
.build(consumer)
MatteryRecipe(tier.FAILSAFE, 1)
.rowB(MItems.ELECTRIC_PARTS)
.row(MItemTags.COPPER_WIRES, MItems.QUANTUM_TRANSCEIVER, MItemTags.COPPER_WIRES)
.row(Tags.Items.DUSTS_GLOWSTONE, tier.BLANK, Tags.Items.DUSTS_GLOWSTONE)
.unlockedBy(tier.BLANK)
.unlockedBy(MItems.QUANTUM_TRANSCEIVER)
.build(consumer)
MatteryRecipe(tier.ENERGY_STORAGE, 1)
.rowB(Items.REDSTONE)
.row(Items.REDSTONE, MItems.ENERGY_BUS, Items.REDSTONE)
.row(MItems.ELECTRIC_PARTS, tier.BLANK, MItems.ELECTRIC_PARTS)
.unlockedBy(tier.BLANK)
.unlockedBy(MItems.ENERGY_BUS)
.build(consumer)
MatteryRecipe(tier.MATTER_STORAGE, 1)
.rowB(MItemTags.HARDENED_GLASS)
.row(MItemTags.HARDENED_GLASS, MItems.MATTER_CAPACITOR_PARTS, MItemTags.HARDENED_GLASS)
.row(MItems.MATTER_CAPACITOR_PARTS, tier.BLANK, MItems.MATTER_CAPACITOR_PARTS)
.unlockedBy(tier.BLANK)
.unlockedBy(MItems.MATTER_CAPACITOR_PARTS)
.build(consumer)
MatteryRecipe(tier.PROCESSING_ITEMS, 1)
.rowB(MItems.MECHANICAL_PARTS)
.row(MItems.ELECTROMAGNET, MItemTags.TRITANIUM_PLATES, MItems.ELECTROMAGNET)
.row(Tags.Items.ENDER_PEARLS, tier.BLANK, Tags.Items.ENDER_PEARLS)
.unlockedBy(tier.BLANK)
.unlockedBy(MItems.ELECTROMAGNET)
.build(consumer)
}
}

View File

@ -0,0 +1,85 @@
package ru.dbotthepony.mc.otm.datagen.recipes
import net.minecraft.core.NonNullList
import net.minecraft.data.recipes.RecipeOutput
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.crafting.Ingredient
import net.minecraft.world.item.crafting.ShapedRecipePattern
import net.neoforged.neoforge.common.Tags
import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.recipe.MatterEntanglerRecipe
import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.game.MItems
import java.util.*
private fun pattern(
c00: Ingredient, c10: Ingredient, c20: Ingredient,
c01: Ingredient, c11: Ingredient, c21: Ingredient,
c02: Ingredient, c12: Ingredient, c22: Ingredient,
): ShapedRecipePattern {
val patternMap = linkedMapOf(
'A' to c00, 'B' to c10, 'C' to c20,
'D' to c01, 'E' to c11, 'F' to c21,
'G' to c02, 'K' to c12, 'M' to c22,
)
val pattern = listOf(
"ABC",
"DEF",
"GKM",
)
return ShapedRecipePattern(
3, 3,
NonNullList.copyOf(patternMap.values),
Optional.of(ShapedRecipePattern.Data(patternMap, pattern))
)
}
fun addMatterEntanglerRecipes(consumer: RecipeOutput) {
consumer.accept(
modLocation("quantum_capacitor"),
MatterEntanglerRecipe(
pattern(
Ingredient.of(MItems.ELECTRIC_PARTS), Ingredient.of(MItemTags.GOLD_WIRES), Ingredient.of(MItems.ELECTRIC_PARTS),
Ingredient.of(MItems.BATTERY_CAPACITOR), Ingredient.of(MItems.QUANTUM_TRANSCEIVER), Ingredient.of(MItems.BATTERY_CAPACITOR),
Ingredient.of(MItemTags.TRITANIUM_PLATES), Ingredient.of(MItemTags.TRITANIUM_PLATES), Ingredient.of(MItemTags.TRITANIUM_PLATES),
),
Decimal(40),
400.0,
ItemStack(MItems.QUANTUM_CAPACITOR, 2),
experience = 15f
).energetic()
)
consumer.accept(
modLocation("quantum_battery"),
MatterEntanglerRecipe(
pattern(
Ingredient.of(Tags.Items.STORAGE_BLOCKS_REDSTONE), Ingredient.of(MItemTags.GOLD_WIRES), Ingredient.of(Tags.Items.STORAGE_BLOCKS_REDSTONE),
Ingredient.of(MItems.BATTERY_DENSE), Ingredient.of(MItems.QUANTUM_TRANSCEIVER), Ingredient.of(MItems.BATTERY_DENSE),
Ingredient.of(MItemTags.TRITANIUM_PLATES), Ingredient.of(MItemTags.TRITANIUM_PLATES), Ingredient.of(MItemTags.TRITANIUM_PLATES),
),
Decimal(120),
600.0,
ItemStack(MItems.QUANTUM_BATTERY, 2),
experience = 20f
).energetic()
)
consumer.accept(
modLocation("antimatter_transform_matrix"),
MatterEntanglerRecipe(
ingredients = pattern(
Ingredient.of(Tags.Items.ENDER_PEARLS), Ingredient.of(MItemTags.DILITHIUM_GEMS), Ingredient.of(Tags.Items.ENDER_PEARLS),
Ingredient.of(Tags.Items.DUSTS_REDSTONE), Ingredient.of(MItems.MATTER_TRANSFORM_MATRIX), Ingredient.of(Tags.Items.DUSTS_REDSTONE),
Ingredient.of(Tags.Items.DUSTS_GLOWSTONE), Ingredient.of(MItemTags.DILITHIUM_GEMS), Ingredient.of(Tags.Items.DUSTS_GLOWSTONE),
),
matter = Decimal(600),
ticks = 2000.0,
result = ItemStack(MItems.ANTIMATTER_TRANSFORM_MATRIX, 1),
experience = 20f
).energetic()
)
}

View File

@ -1,25 +1,25 @@
package ru.dbotthepony.mc.otm.datagen.recipes package ru.dbotthepony.mc.otm.datagen.recipes
import com.google.gson.JsonObject import net.minecraft.advancements.Advancement
import net.minecraft.advancements.CriterionTriggerInstance import net.minecraft.advancements.AdvancementHolder
import net.minecraft.data.recipes.FinishedRecipe import net.minecraft.advancements.Criterion
import net.minecraft.data.recipes.RecipeCategory import net.minecraft.data.recipes.RecipeCategory
import net.minecraft.data.recipes.RecipeOutput
import net.minecraft.data.recipes.ShapedRecipeBuilder import net.minecraft.data.recipes.ShapedRecipeBuilder
import net.minecraft.resources.ResourceLocation import net.minecraft.resources.ResourceLocation
import net.minecraft.tags.TagKey import net.minecraft.tags.TagKey
import net.minecraft.world.item.Item import net.minecraft.world.item.Item
import net.minecraft.world.item.crafting.Ingredient import net.minecraft.world.item.crafting.Ingredient
import net.minecraft.world.item.crafting.Recipe
import net.minecraft.world.item.crafting.RecipeSerializer import net.minecraft.world.item.crafting.RecipeSerializer
import net.minecraft.world.item.crafting.ShapedRecipe
import net.minecraft.world.level.ItemLike import net.minecraft.world.level.ItemLike
import net.neoforged.neoforge.common.conditions.ICondition
import ru.dbotthepony.mc.otm.OverdriveThatMatters import ru.dbotthepony.mc.otm.OverdriveThatMatters
import ru.dbotthepony.mc.otm.core.collect.JsonArrayCollector import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.core.registryName
import ru.dbotthepony.mc.otm.core.set
import ru.dbotthepony.mc.otm.datagen.modLocation import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.recipe.EnergyContainerRecipe
import ru.dbotthepony.mc.otm.recipe.UpgradeRecipe import ru.dbotthepony.mc.otm.recipe.UpgradeRecipe
import java.util.function.Consumer
private interface RecipeCell { private interface RecipeCell {
val value: Ingredient val value: Ingredient
@ -62,11 +62,11 @@ class MatteryRecipe(val result: ItemLike, val count: Int = 1, val category: Reci
private val rows = arrayOfNulls<RecipeRow>(3) private val rows = arrayOfNulls<RecipeRow>(3)
private var index = 0 private var index = 0
private val unlockedBy = ArrayList<Pair<String, CriterionTriggerInstance>>().also { private val unlockedBy = ArrayList<Pair<String, Criterion<*>>>().also {
it.add("has_result" to has(result)) it.add("has_result" to has(result))
} }
fun unlockedBy(name: String, trigger: CriterionTriggerInstance): MatteryRecipe { fun unlockedBy(name: String, trigger: Criterion<*>): MatteryRecipe {
unlockedBy.add(name to trigger) unlockedBy.add(name to trigger)
return this return this
} }
@ -76,6 +76,11 @@ class MatteryRecipe(val result: ItemLike, val count: Int = 1, val category: Reci
return unlockedBy("has_${location.namespace}_${location.path}", has(item)) return unlockedBy("has_${location.namespace}_${location.path}", has(item))
} }
fun unlockedBy(item: Collection<ItemLike>): MatteryRecipe {
item.forEach { unlockedBy(it) }
return this
}
fun unlockedBy(item: TagKey<Item>): MatteryRecipe { fun unlockedBy(item: TagKey<Item>): MatteryRecipe {
return unlockedBy("has_${item.location.namespace}_${item.location.path}", has(item)) return unlockedBy("has_${item.location.namespace}_${item.location.path}", has(item))
} }
@ -163,56 +168,35 @@ class MatteryRecipe(val result: ItemLike, val count: Int = 1, val category: Reci
return this return this
} }
private fun filter(consumer: Consumer<FinishedRecipe>): Consumer<FinishedRecipe> { private fun filter(): (ShapedRecipe) -> ShapedRecipe {
if (upgradeSource != null) { if (upgradeSource != null) {
check(copyPaths.isNotEmpty()) { "Defined upgrade recipe without nbt migration operations" } check(copyPaths.isNotEmpty()) { "Defined upgrade recipe without nbt migration operations" }
return Consumer { return {
consumer.accept(object : FinishedRecipe by it { UpgradeRecipe(it, copyPaths.map { upgradeSource!! to it })
override fun serializeRecipeData(pJson: JsonObject) {
it.serializeRecipeData(pJson)
pJson["copyPaths"] = copyPaths.stream().map { it.serialize() }.collect(JsonArrayCollector)
pJson["source"] = upgradeSource!!.toString()
}
override fun getType(): RecipeSerializer<*> {
return UpgradeRecipe.Companion
}
})
} }
} }
return consumer return { it }
} }
fun build(consumer: Consumer<FinishedRecipe>, name: String? = null) { fun build(consumer: RecipeOutput, name: String? = null) {
val builder = buildRegular() val builder = buildRegular()
if (name != null) { if (name != null) {
builder.save(filter(consumer), modLocation( builder.save(consumer.map(filter()), modLocation(
if (result.asItem().registryName!!.namespace == OverdriveThatMatters.MOD_ID) if (result.asItem().registryName!!.namespace == OverdriveThatMatters.MOD_ID)
"${result.asItem().registryName!!.path}_$name" "${result.asItem().registryName!!.path}_$name"
else else
"${result.asItem().registryName!!.namespace}_${result.asItem().registryName!!.path}_$name" "${result.asItem().registryName!!.namespace}_${result.asItem().registryName!!.path}_$name"
)) ))
} else { } else {
builder.save(filter(consumer)) builder.save(consumer.map(filter()))
} }
} }
fun build(consumer: Consumer<FinishedRecipe>, name: ResourceLocation) { fun build(consumer: RecipeOutput, name: ResourceLocation) {
buildRegular().save(filter(consumer), name) buildRegular().save(consumer.map(filter()), name)
}
fun buildEnergetic(consumer: Consumer<FinishedRecipe>, name: String? = null) {
build({
consumer.accept(object : FinishedRecipe by it {
override fun getType(): RecipeSerializer<*> {
return EnergyContainerRecipe.Companion
}
})
}, name)
} }
fun row(): MatteryRecipe { fun row(): MatteryRecipe {

View File

@ -1,50 +1,71 @@
package ru.dbotthepony.mc.otm.datagen.recipes package ru.dbotthepony.mc.otm.datagen.recipes
import net.minecraft.advancements.critereon.ContextAwarePredicate import com.google.common.collect.ImmutableList
import net.minecraft.advancements.critereon.EntityPredicate import net.minecraft.advancements.Advancement
import net.minecraft.advancements.AdvancementHolder
import net.minecraft.advancements.CriteriaTriggers
import net.minecraft.advancements.Criterion
import net.minecraft.advancements.critereon.InventoryChangeTrigger import net.minecraft.advancements.critereon.InventoryChangeTrigger
import net.minecraft.advancements.critereon.ItemPredicate import net.minecraft.advancements.critereon.ItemPredicate
import net.minecraft.advancements.critereon.MinMaxBounds import net.minecraft.advancements.critereon.MinMaxBounds
import net.minecraft.data.DataGenerator
import net.minecraft.data.recipes.FinishedRecipe
import net.minecraft.data.recipes.RecipeBuilder import net.minecraft.data.recipes.RecipeBuilder
import net.minecraft.data.recipes.RecipeOutput
import net.minecraft.data.recipes.RecipeProvider import net.minecraft.data.recipes.RecipeProvider
import net.minecraft.resources.ResourceLocation import net.minecraft.resources.ResourceLocation
import net.minecraft.tags.ItemTags
import net.minecraft.tags.TagKey import net.minecraft.tags.TagKey
import net.minecraft.util.valueproviders.ConstantFloat import net.minecraft.util.valueproviders.ConstantFloat
import net.minecraft.util.valueproviders.FloatProvider import net.minecraft.util.valueproviders.FloatProvider
import net.minecraft.world.item.Item import net.minecraft.world.item.Item
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.crafting.Ingredient import net.minecraft.world.item.crafting.Ingredient
import net.minecraft.world.item.crafting.Recipe
import net.minecraft.world.item.crafting.ShapedRecipePattern
import net.minecraft.world.level.ItemLike import net.minecraft.world.level.ItemLike
import ru.dbotthepony.mc.otm.core.registryName import net.neoforged.neoforge.common.conditions.ICondition
import net.neoforged.neoforge.data.event.GatherDataEvent
import ru.dbotthepony.mc.otm.util.ResourceLocation
import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.datagen.modLocation import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.recipe.MicrowaveRecipe
import ru.dbotthepony.mc.otm.recipe.PlatePressRecipe import ru.dbotthepony.mc.otm.recipe.PlatePressRecipe
import java.util.LinkedList import java.util.*
import java.util.function.Consumer
import java.util.stream.Stream import java.util.stream.Stream
private typealias RecipeBuilderCallback = (MatteryRecipeProvider, consumer: Consumer<FinishedRecipe>) -> Unit private typealias RecipeBuilderCallback = (MatteryRecipeProvider, consumer: RecipeOutput) -> Unit
fun has(p_176521_: MinMaxBounds.Ints, p_176522_: ItemLike): InventoryChangeTrigger.TriggerInstance { fun has(p_176521_: MinMaxBounds.Ints, p_176522_: ItemLike): Criterion<InventoryChangeTrigger.TriggerInstance> {
return inventoryTrigger(ItemPredicate.Builder.item().of(p_176522_).withCount(p_176521_).build()) return inventoryTrigger(ItemPredicate.Builder.item().of(p_176522_).withCount(p_176521_).build())
} }
fun has(p_125978_: ItemLike): InventoryChangeTrigger.TriggerInstance { fun has(p_125978_: ItemLike): Criterion<InventoryChangeTrigger.TriggerInstance> {
return inventoryTrigger(ItemPredicate.Builder.item().of(p_125978_).build()) return inventoryTrigger(ItemPredicate.Builder.item().of(p_125978_).build())
} }
fun has(p_125976_: TagKey<Item>): InventoryChangeTrigger.TriggerInstance { fun has(p_125976_: TagKey<Item>): Criterion<InventoryChangeTrigger.TriggerInstance> {
return inventoryTrigger(ItemPredicate.Builder.item().of(p_125976_).build()) return inventoryTrigger(ItemPredicate.Builder.item().of(p_125976_).build())
} }
fun inventoryTrigger(vararg p_126012_: ItemPredicate): InventoryChangeTrigger.TriggerInstance { fun inventoryTrigger(vararg p_126012_: ItemPredicate): Criterion<InventoryChangeTrigger.TriggerInstance> {
return InventoryChangeTrigger.TriggerInstance( return CriteriaTriggers.INVENTORY_CHANGED.createCriterion(InventoryChangeTrigger.TriggerInstance(
ContextAwarePredicate.ANY, Optional.empty(),
MinMaxBounds.Ints.ANY, InventoryChangeTrigger.TriggerInstance.Slots.ANY,
MinMaxBounds.Ints.ANY, ImmutableList.copyOf(p_126012_)
MinMaxBounds.Ints.ANY, ))
p_126012_ }
)
fun multiIngredient(vararg items: Any) : Ingredient {
val values = arrayListOf<Ingredient.Value>()
for (item in items) {
if (item is ItemStack) {
values.add(Ingredient.ItemValue(item))
} else if (item is TagKey<*>) {
values.add(Ingredient.TagValue(item as TagKey<Item>))
}
}
return Ingredient.fromValues(values.stream())
} }
fun <T : RecipeBuilder> T.unlockedBy(item: ItemLike): T { fun <T : RecipeBuilder> T.unlockedBy(item: ItemLike): T {
@ -66,7 +87,28 @@ fun <T : RecipeBuilder> T.unlockedBy(item: TagKey<Item>): T {
return this return this
} }
class MatteryRecipeProvider(generatorIn: DataGenerator) : RecipeProvider(generatorIn.packOutput) { fun <IN : Recipe<*>> RecipeOutput.map(mapper: (IN) -> Recipe<*>): RecipeOutput {
return object : RecipeOutput {
override fun advancement(): Advancement.Builder {
return this@map.advancement()
}
override fun accept(
id: ResourceLocation,
recipe: Recipe<*>,
advancement: AdvancementHolder?,
vararg conditions: ICondition?
) {
this@map.accept(id, mapper(recipe as IN), advancement, *conditions)
}
}
}
fun RecipeOutput.accept(id: ResourceLocation, recipe: Recipe<*>) {
accept(id, recipe, null)
}
class MatteryRecipeProvider(generatorIn: GatherDataEvent) : RecipeProvider(generatorIn.generator.packOutput, generatorIn.lookupProvider) {
private val callbacks = LinkedList<RecipeBuilderCallback>() private val callbacks = LinkedList<RecipeBuilderCallback>()
fun exec(callback: RecipeBuilderCallback): MatteryRecipeProvider { fun exec(callback: RecipeBuilderCallback): MatteryRecipeProvider {
@ -74,7 +116,7 @@ class MatteryRecipeProvider(generatorIn: DataGenerator) : RecipeProvider(generat
return this return this
} }
override fun buildRecipes(callback: Consumer<FinishedRecipe>) { override fun buildRecipes(callback: RecipeOutput) {
for (lambda in callbacks) { for (lambda in callbacks) {
lambda(this, callback) lambda(this, callback)
} }
@ -82,10 +124,9 @@ class MatteryRecipeProvider(generatorIn: DataGenerator) : RecipeProvider(generat
fun plate(id: String, count: Int = 1, workTicks: Int = 200, experience: FloatProvider = ConstantFloat.ZERO) { fun plate(id: String, count: Int = 1, workTicks: Int = 200, experience: FloatProvider = ConstantFloat.ZERO) {
exec { _, consumer -> exec { _, consumer ->
consumer.accept(PlatePressShallowFinishedRecipe( consumer.accept(modLocation("plates/$id"), PlatePressRecipe(
modLocation("plates/$id"), Ingredient.of(ItemTags.create(ResourceLocation("c", "ingots/$id"))),
ResourceLocation("forge", "ingots/$id"), Ingredient.of(ItemTags.create(ResourceLocation("c", "plates/$id"))),
ResourceLocation("forge", "plates/$id"),
count, count,
workTicks, workTicks,
experience = experience experience = experience
@ -95,7 +136,13 @@ class MatteryRecipeProvider(generatorIn: DataGenerator) : RecipeProvider(generat
fun plate(id: String, ingredient: Ingredient, result: Ingredient, count: Int = 1, workTicks: Int = 200, experience: FloatProvider = ConstantFloat.ZERO) { fun plate(id: String, ingredient: Ingredient, result: Ingredient, count: Int = 1, workTicks: Int = 200, experience: FloatProvider = ConstantFloat.ZERO) {
exec { it, callback -> exec { it, callback ->
callback.accept(PlatePressFinishedRecipe(PlatePressRecipe(modLocation("plate_$id"), ingredient, result, count, workTicks, experience = experience))) callback.accept(modLocation("plate_$id"), PlatePressRecipe(ingredient, result, count, workTicks, experience = experience))
}
}
fun microwave(id: String, ingredient: Ingredient, result: Ingredient, count: Int = 1, workTicks: Int = 200, experience: FloatProvider = ConstantFloat.ZERO) {
exec { it, callback ->
callback.accept(modLocation("microwave/$id"), MicrowaveRecipe(ingredient, result, count, workTicks, experience = experience))
} }
} }
} }

View File

@ -0,0 +1,187 @@
package ru.dbotthepony.mc.otm.datagen.recipes
import net.minecraft.data.recipes.RecipeCategory
import net.minecraft.data.recipes.RecipeOutput
import net.minecraft.data.recipes.ShapelessRecipeBuilder
import net.minecraft.world.item.ItemStack
import net.neoforged.neoforge.common.Tags
import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.recipe.UpgradeRecipe
import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.game.MItems
fun addMultiblockRecipes(consumer: RecipeOutput) {
val machinesCategory = RecipeCategory.DECORATIONS
// energy interface
MatteryRecipe(MItems.ENERGY_INPUT_INTERFACE, category = machinesCategory)
.rowB(MItems.ENERGY_BUS)
.row(MItems.ELECTRIC_PARTS, MItems.MACHINE_FRAME, MItems.ELECTRIC_PARTS)
.build(consumer)
ShapelessRecipeBuilder.shapeless(machinesCategory, ItemStack(MItems.ENERGY_INPUT_INTERFACE))
.requires(MItems.ENERGY_OUTPUT_INTERFACE)
.unlockedBy(MItems.ENERGY_OUTPUT_INTERFACE)
.unlockedBy(MItems.ENERGY_INPUT_INTERFACE)
.save(consumer, modLocation("energy_interface_to_input"))
MatteryRecipe(MItems.ENERGY_OUTPUT_INTERFACE, category = machinesCategory)
.row(MItems.ELECTRIC_PARTS, MItems.MACHINE_FRAME, MItems.ELECTRIC_PARTS)
.rowB(MItems.ENERGY_BUS)
.build(consumer)
ShapelessRecipeBuilder.shapeless(machinesCategory, ItemStack(MItems.ENERGY_OUTPUT_INTERFACE))
.requires(MItems.ENERGY_INPUT_INTERFACE)
.unlockedBy(MItems.ENERGY_OUTPUT_INTERFACE)
.unlockedBy(MItems.ENERGY_INPUT_INTERFACE)
.save(consumer, modLocation("energy_interface_to_output"))
// energy hatch
MatteryRecipe(MItems.ENERGY_INPUT_HATCH, category = machinesCategory)
.rowAC(MItemTags.GOLD_WIRES, MItemTags.GOLD_WIRES)
.row(MItems.ELECTRIC_PARTS, MItems.ENERGY_INPUT_INTERFACE, MItems.ELECTRIC_PARTS)
.row(Tags.Items.DUSTS_REDSTONE, MItemTags.DILITHIUM_GEMS, Tags.Items.DUSTS_REDSTONE)
.build(consumer)
MatteryRecipe(MItems.ENERGY_OUTPUT_HATCH, category = machinesCategory)
.row(Tags.Items.DUSTS_REDSTONE, MItemTags.DILITHIUM_GEMS, Tags.Items.DUSTS_REDSTONE)
.row(MItems.ELECTRIC_PARTS, MItems.ENERGY_OUTPUT_INTERFACE, MItems.ELECTRIC_PARTS)
.rowAC(MItemTags.GOLD_WIRES, MItemTags.GOLD_WIRES)
.build(consumer)
MatteryRecipe(MItems.ENERGY_INPUT_HATCH, category = machinesCategory)
.rowB(MItems.ENERGY_OUTPUT_HATCH)
.setUpgradeSource(MItems.ENERGY_OUTPUT_HATCH)
.addUpgradeOps(UpgradeRecipe.CopyAllComponents)
.build(consumer, "from_output")
MatteryRecipe(MItems.ENERGY_OUTPUT_HATCH, category = machinesCategory)
.rowB(MItems.ENERGY_INPUT_HATCH)
.setUpgradeSource(MItems.ENERGY_INPUT_HATCH)
.addUpgradeOps(UpgradeRecipe.CopyAllComponents)
.build(consumer, "from_input")
// item hatch
MatteryRecipe(MItems.ITEM_INPUT_HATCH, category = machinesCategory)
.rowB(MItemTags.BASIC_CIRCUIT)
.row(MItems.MECHANICAL_PARTS, MItemTags.CARGO_CRATES, MItems.MECHANICAL_PARTS)
.build(consumer)
MatteryRecipe(MItems.ITEM_OUTPUT_HATCH, category = machinesCategory)
.row(MItems.MECHANICAL_PARTS, MItemTags.CARGO_CRATES, MItems.MECHANICAL_PARTS)
.rowB(MItemTags.BASIC_CIRCUIT)
.build(consumer)
ShapelessRecipeBuilder.shapeless(machinesCategory, ItemStack(MItems.ITEM_INPUT_HATCH))
.requires(MItems.ITEM_OUTPUT_HATCH)
.unlockedBy(MItems.ITEM_INPUT_HATCH)
.unlockedBy(MItems.ITEM_OUTPUT_HATCH)
.save(consumer, modLocation("item_hatch_to_input"))
ShapelessRecipeBuilder.shapeless(machinesCategory, ItemStack(MItems.ITEM_OUTPUT_HATCH))
.requires(MItems.ITEM_INPUT_HATCH)
.unlockedBy(MItems.ITEM_INPUT_HATCH)
.unlockedBy(MItems.ITEM_OUTPUT_HATCH)
.save(consumer, modLocation("item_hatch_to_output"))
// matter hatch
MatteryRecipe(MItems.MATTER_INPUT_HATCH, category = machinesCategory)
.rowB(MItems.MATTER_IO_PORT)
.row(MItems.MECHANICAL_PARTS, MItems.MACHINE_FRAME, MItems.ELECTRIC_PARTS)
.rowAC(MItems.MATTER_CAPACITOR_PARTS, MItems.MATTER_CAPACITOR_PARTS)
.build(consumer)
MatteryRecipe(MItems.MATTER_OUTPUT_HATCH, category = machinesCategory)
.rowAC(MItems.MATTER_CAPACITOR_PARTS, MItems.MATTER_CAPACITOR_PARTS)
.row(MItems.MECHANICAL_PARTS, MItems.MACHINE_FRAME, MItems.ELECTRIC_PARTS)
.rowB(MItems.MATTER_IO_PORT)
.build(consumer)
MatteryRecipe(MItems.MATTER_INPUT_HATCH, category = machinesCategory)
.rowB(MItems.MATTER_OUTPUT_HATCH)
.setUpgradeSource(MItems.MATTER_OUTPUT_HATCH)
.addUpgradeOps(UpgradeRecipe.CopyAllComponents)
.build(consumer, "from_output")
MatteryRecipe(MItems.MATTER_OUTPUT_HATCH, category = machinesCategory)
.rowB(MItems.MATTER_INPUT_HATCH)
.setUpgradeSource(MItems.MATTER_INPUT_HATCH)
.addUpgradeOps(UpgradeRecipe.CopyAllComponents)
.build(consumer, "from_input")
// misc
MatteryRecipe(MItems.GENERATOR_BLOCK, category = machinesCategory)
.row(MItems.ELECTRIC_PARTS, MItems.ELECTROMOTOR, MItems.ELECTRIC_PARTS)
.row(MItems.ELECTROMOTOR, MItems.MACHINE_FRAME, MItems.ELECTROMOTOR)
.row(MItems.ELECTRIC_PARTS, MItems.ELECTROMOTOR, MItems.ELECTRIC_PARTS)
.build(consumer)
MatteryRecipe(MItems.MODULAR_FRAME, count = 4, category = machinesCategory)
.row(MItemTags.IRON_PLATES, Tags.Items.INGOTS_IRON, MItemTags.IRON_PLATES)
.rowAC(Tags.Items.INGOTS_IRON, Tags.Items.INGOTS_IRON)
.row(MItemTags.IRON_PLATES, Tags.Items.INGOTS_IRON, MItemTags.IRON_PLATES)
.unlockedBy(MItemTags.IRON_PLATES)
.build(consumer)
MatteryRecipe(MItems.HEAVY_MODULAR_FRAME, count = 2, category = machinesCategory)
.row(MItems.WITHERED_STEEL, MItems.REINFORCED_IRON_PLATE, MItems.WITHERED_STEEL,)
.row(MItems.REINFORCED_IRON_PLATE, MItems.MODULAR_FRAME, MItems.REINFORCED_IRON_PLATE)
.row(MItems.WITHERED_STEEL, MItems.REINFORCED_IRON_PLATE, MItems.WITHERED_STEEL,)
.unlockedBy(MItems.MODULAR_FRAME)
.build(consumer)
// blackhole generator
MatteryRecipe(MItems.BLACK_HOLE_GENERATOR, category = machinesCategory)
.row(MItemTags.ADVANCED_CIRCUIT, MItems.BLACK_HOLE_SCANNER, MItemTags.ADVANCED_CIRCUIT)
.row(MItemTags.DILITHIUM_GEMS, MItems.MACHINE_FRAME, MItemTags.DILITHIUM_GEMS)
.row(MItems.MATTER_CAPACITOR_PARTS, Tags.Items.GEMS_DIAMOND, MItems.MATTER_CAPACITOR_PARTS)
.build(consumer)
MatteryRecipe(MItems.TRITANIUM_HULL, count = 2, category = machinesCategory)
.row(MItemTags.TRITANIUM_PLATES, MItemTags.IRON_PLATES, MItemTags.TRITANIUM_PLATES)
.row(MItemTags.IRON_PLATES, MItems.MODULAR_FRAME, MItemTags.IRON_PLATES)
.row(MItemTags.TRITANIUM_PLATES, MItemTags.IRON_PLATES, MItemTags.TRITANIUM_PLATES)
.build(consumer)
MatteryRecipe(MItems.MATTER_INJECTOR, category = machinesCategory)
.row(MItemTags.ADVANCED_CIRCUIT, MItems.MATTER_TRANSFORM_MATRIX, MItemTags.ADVANCED_CIRCUIT)
.row(MItemTags.DILITHIUM_GEMS, MItems.MACHINE_FRAME, MItemTags.DILITHIUM_GEMS)
.row(MItems.MATTER_IO_PORT, MItems.GRAVITATION_FIELD_SENSOR, MItems.MATTER_IO_PORT)
.build(consumer)
MatteryRecipe(MItems.ANTIMATTER_INJECTOR, category = machinesCategory)
.row(MItemTags.ADVANCED_CIRCUIT, MItems.ANTIMATTER_TRANSFORM_MATRIX, MItemTags.ADVANCED_CIRCUIT)
.row(MItemTags.DILITHIUM_GEMS, MItems.MACHINE_FRAME, MItemTags.DILITHIUM_GEMS)
.row(MItems.MATTER_IO_PORT, MItems.GRAVITATION_FIELD_SENSOR, MItems.MATTER_IO_PORT)
.build(consumer)
MatteryRecipe(MItems.HIGH_ENERGY_PARTICLE_COLLECTOR, category = machinesCategory)
.row(MItemTags.ADVANCED_CIRCUIT, MItems.MECHANICAL_PARTS, MItemTags.ADVANCED_CIRCUIT)
.row(Tags.Items.GEMS_QUARTZ, MItems.MACHINE_FRAME, Tags.Items.GEMS_QUARTZ)
.row(MItemTags.DILITHIUM_GEMS, MItems.GRAVITATION_FIELD_LIMITER, MItemTags.DILITHIUM_GEMS)
.build(consumer)
// flywheel
MatteryRecipe(MItems.FLYWHEEL_SHAFT, category = machinesCategory)
.row(MItemTags.TRITANIUM_PLATES, MItems.MECHANICAL_PARTS, MItemTags.TRITANIUM_PLATES)
.row(MItemTags.TRITANIUM_PLATES, MItems.MECHANICAL_PARTS, MItemTags.TRITANIUM_PLATES)
.row(MItemTags.TRITANIUM_PLATES, MItems.MECHANICAL_PARTS, MItemTags.TRITANIUM_PLATES)
.build(consumer)
MatteryRecipe(MItems.FLYWHEEL_BEARING, category = machinesCategory)
.row(MItemTags.TRITANIUM_PLATES, MItems.MECHANICAL_PARTS, MItemTags.TRITANIUM_PLATES)
.row(MItems.MECHANICAL_PARTS, MItems.MECHANICAL_PARTS, MItems.MECHANICAL_PARTS)
.row(MItemTags.TRITANIUM_PLATES, MItems.MECHANICAL_PARTS, MItemTags.TRITANIUM_PLATES)
.build(consumer)
MatteryRecipe(MItems.FLYWHEEL_HOUSING, count = 4, category = machinesCategory)
.row(MItemTags.CARBON_PLATES, MItemTags.TRITANIUM_PLATES, MItemTags.CARBON_PLATES)
.row(MItemTags.TRITANIUM_PLATES, MItems.ELECTRIC_PARTS, MItemTags.TRITANIUM_PLATES)
.row(MItemTags.CARBON_PLATES, MItemTags.TRITANIUM_PLATES, MItemTags.CARBON_PLATES)
.build(consumer)
MatteryRecipe(MItems.FLYWHEEL_BATTERY, category = machinesCategory)
.row(MItemTags.ADVANCED_CIRCUIT, MItems.FLYWHEEL_HOUSING, MItemTags.ADVANCED_CIRCUIT)
.row(MItemTags.GOLD_WIRES, MItemTags.COPPER_WIRES, MItemTags.GOLD_WIRES)
.build(consumer)
}

View File

@ -1,21 +0,0 @@
package ru.dbotthepony.mc.otm.datagen.recipes
import net.minecraft.data.recipes.FinishedRecipe
import net.minecraft.data.recipes.RecipeCategory
import net.minecraft.data.recipes.SimpleCookingRecipeBuilder
import net.minecraft.world.item.crafting.Ingredient
import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.MItems
import java.util.function.Consumer
fun addOreSmeltingRecipes(consumer: Consumer<FinishedRecipe>) {
SimpleCookingRecipeBuilder.smelting(Ingredient.of(MItemTags.TRITANIUM_ORES), RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 1f, 200).unlockedBy(MItemTags.TRITANIUM_ORES).save(consumer, modLocation("smelting/tritanium_ingot_from_ore_block"))
SimpleCookingRecipeBuilder.blasting(Ingredient.of(MItemTags.TRITANIUM_ORES), RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 1f, 100).unlockedBy(MItemTags.TRITANIUM_ORES).save(consumer, modLocation("blasting/tritanium_ingot_from_ore_block"))
SimpleCookingRecipeBuilder.smelting(Ingredient.of(MItemTags.TRITANIUM_ORE_CLUMPS), RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 1f, 200).unlockedBy(MItemTags.TRITANIUM_ORE_CLUMPS).save(consumer, modLocation("smelting/tritanium_ingot_from_raw_ore"))
SimpleCookingRecipeBuilder.blasting(Ingredient.of(MItemTags.TRITANIUM_ORE_CLUMPS), RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 1f, 100).unlockedBy(MItemTags.TRITANIUM_ORE_CLUMPS).save(consumer, modLocation("blasting/tritanium_ingot_from_raw_ore"))
SimpleCookingRecipeBuilder.smelting(Ingredient.of(MItemTags.TRITANIUM_DUSTS), RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 0f, 200).unlockedBy(MItemTags.TRITANIUM_DUSTS).save(consumer, modLocation("smelting/tritanium_ingot_from_dust"))
SimpleCookingRecipeBuilder.blasting(Ingredient.of(MItemTags.TRITANIUM_DUSTS), RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 0f, 100).unlockedBy(MItemTags.TRITANIUM_DUSTS).save(consumer, modLocation("blasting/tritanium_ingot_from_dust"))
}

View File

@ -0,0 +1,424 @@
package ru.dbotthepony.mc.otm.datagen.recipes
import mekanism.api.recipes.basic.BasicPaintingRecipe
import mekanism.api.recipes.ingredients.creator.IngredientCreatorAccess
import mekanism.api.text.EnumColor
import mekanism.common.registries.MekanismChemicals
import net.minecraft.data.recipes.RecipeOutput
import net.minecraft.resources.ResourceLocation
import net.minecraft.world.item.DyeColor
import net.minecraft.world.item.Item
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.Items
import net.minecraft.world.item.crafting.Ingredient
import net.neoforged.fml.ModList
import net.neoforged.neoforge.common.conditions.ModLoadedCondition
import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.recipe.PainterArmorDyeRecipe
import ru.dbotthepony.mc.otm.recipe.PainterRecipe
import ru.dbotthepony.mc.otm.registry.game.MItems
import ru.dbotthepony.mc.otm.registry.MRegistry
import ru.dbotthepony.mc.otm.registry.game.MBlocks
private val Item.recipeName get() = registryName!!.namespace + "/" + registryName!!.path
private val isMekanismLoaded by lazy {
ModList.get().isLoaded("mekanism")
}
private fun generate(consumer: RecipeOutput, items: Map<out DyeColor?, Item>, amount: Int = 1) {
for ((targetColor, targetItem) in items) {
if (targetColor == null) continue
consumer.accept(modLocation("painter/" + targetItem.recipeName), PainterRecipe(
Ingredient.of(items.entries.stream().filter { it.key != null && it.key != targetColor }.map { ItemStack(it.value) }),
ItemStack(targetItem),
mapOf(targetColor to amount, null to 15)
))
if (isMekanismLoaded) {
addMekanismPaintRecipe(consumer,
modLocation("mekanism/painter/" + targetItem.recipeName),
Ingredient.of(items.entries.stream().filter { it.key != null && it.key != targetColor }.map { ItemStack(it.value) }),
ItemStack(targetItem),
targetColor,
amount
)
}
}
}
private fun generate(consumer: RecipeOutput, default: Item, items: Map<out DyeColor?, Item>, amount: Int = 1, cleaning: Boolean = true) {
generate(consumer, items)
if (cleaning)
cleaning(consumer, default, items)
for ((k1, v1) in items) {
if (k1 == null) continue
consumer.accept(modLocation("painter/" + default.recipeName + "/" + v1.recipeName), PainterRecipe(
Ingredient.of(default),
ItemStack(v1),
mapOf(k1 to amount)
))
if (isMekanismLoaded) {
addMekanismPaintRecipe(consumer,
modLocation("mekanism/painter/" + default.recipeName + "/" + v1.recipeName),
Ingredient.of(default),
ItemStack(v1),
k1,
amount
)
}
}
}
private fun cleaning(consumer: RecipeOutput, to: Item, from: Map<out DyeColor?, Item>, suffix: String = "") {
cleaning(consumer, to, from.entries.stream().filter { it.key != null }.map { it.value }.toList(), suffix)
}
private fun cleaning(consumer: RecipeOutput, to: Item, from: Collection<Item>, suffix: String = "") {
consumer.accept(modLocation("painter/cleaning/" + to.recipeName + suffix), PainterRecipe(
Ingredient.of(from.stream().map { ItemStack(it) }),
ItemStack(to),
mapOf(null to 15)
))
}
private fun striped(consumer: RecipeOutput, name: String, items: List<Pair<Item, Pair<DyeColor, DyeColor>>>, base: Map<DyeColor, Item>) {
for ((stripeItem, colors) in items) {
val (baseColor, stripe) = colors
consumer.accept(modLocation("painter/stripes_$name/${baseColor.getName()}/${stripe.getName()}"), PainterRecipe(
Ingredient.of(base[baseColor]),
ItemStack(stripeItem),
setOf(stripe)
))
if (isMekanismLoaded) {
addMekanismPaintRecipe(consumer,
modLocation("mekanism/painter/stripes_$name/${baseColor.getName()}/${stripe.getName()}"),
Ingredient.of(base[baseColor]),
ItemStack(stripeItem),
stripe
)
}
}
}
private fun addMekanismPaintRecipe(consumer: RecipeOutput, location: ResourceLocation, input: Ingredient, output: ItemStack, dye: DyeColor, amount: Int = 1, dyeMul: Float = 0.125F) {
if (output.item.registryName?.namespace == "minecraft") return // mekanism already has painting recipes for vanilla
val color = EnumColor.entries.find{it.dyeColor == dye} ?: return
val pigment = MekanismChemicals.PIGMENT_COLOR_LOOKUP.get(color) ?: return
consumer.accept(location, BasicPaintingRecipe(
IngredientCreatorAccess.item().from(input),
IngredientCreatorAccess.chemicalStack().from(pigment, (256L * amount * dyeMul).toLong()),
output.copy(),
false
), null, ModLoadedCondition("mekanism"))
}
fun addPainterRecipes(consumer: RecipeOutput) {
generate(consumer, mapOf(
DyeColor.WHITE to Items.WHITE_WOOL,
DyeColor.ORANGE to Items.ORANGE_WOOL,
DyeColor.MAGENTA to Items.MAGENTA_WOOL,
DyeColor.LIGHT_BLUE to Items.LIGHT_BLUE_WOOL,
DyeColor.YELLOW to Items.YELLOW_WOOL,
DyeColor.LIME to Items.LIME_WOOL,
DyeColor.PINK to Items.PINK_WOOL,
DyeColor.GRAY to Items.GRAY_WOOL,
DyeColor.LIGHT_GRAY to Items.LIGHT_GRAY_WOOL,
DyeColor.CYAN to Items.CYAN_WOOL,
DyeColor.PURPLE to Items.PURPLE_WOOL,
DyeColor.BLUE to Items.BLUE_WOOL,
DyeColor.BROWN to Items.BROWN_WOOL,
DyeColor.GREEN to Items.GREEN_WOOL,
DyeColor.RED to Items.RED_WOOL,
DyeColor.BLACK to Items.BLACK_WOOL,
))
generate(consumer, mapOf(
DyeColor.WHITE to Items.WHITE_CARPET,
DyeColor.ORANGE to Items.ORANGE_CARPET,
DyeColor.MAGENTA to Items.MAGENTA_CARPET,
DyeColor.LIGHT_BLUE to Items.LIGHT_BLUE_CARPET,
DyeColor.YELLOW to Items.YELLOW_CARPET,
DyeColor.LIME to Items.LIME_CARPET,
DyeColor.PINK to Items.PINK_CARPET,
DyeColor.GRAY to Items.GRAY_CARPET,
DyeColor.LIGHT_GRAY to Items.LIGHT_GRAY_CARPET,
DyeColor.CYAN to Items.CYAN_CARPET,
DyeColor.PURPLE to Items.PURPLE_CARPET,
DyeColor.BLUE to Items.BLUE_CARPET,
DyeColor.BROWN to Items.BROWN_CARPET,
DyeColor.GREEN to Items.GREEN_CARPET,
DyeColor.RED to Items.RED_CARPET,
DyeColor.BLACK to Items.BLACK_CARPET,
))
generate(consumer, mapOf(
DyeColor.WHITE to Items.WHITE_BED,
DyeColor.ORANGE to Items.ORANGE_BED,
DyeColor.MAGENTA to Items.MAGENTA_BED,
DyeColor.LIGHT_BLUE to Items.LIGHT_BLUE_BED,
DyeColor.YELLOW to Items.YELLOW_BED,
DyeColor.LIME to Items.LIME_BED,
DyeColor.PINK to Items.PINK_BED,
DyeColor.GRAY to Items.GRAY_BED,
DyeColor.LIGHT_GRAY to Items.LIGHT_GRAY_BED,
DyeColor.CYAN to Items.CYAN_BED,
DyeColor.PURPLE to Items.PURPLE_BED,
DyeColor.BLUE to Items.BLUE_BED,
DyeColor.BROWN to Items.BROWN_BED,
DyeColor.GREEN to Items.GREEN_BED,
DyeColor.RED to Items.RED_BED,
DyeColor.BLACK to Items.BLACK_BED,
), 3)
generate(consumer, mapOf(
DyeColor.WHITE to Items.WHITE_CANDLE,
DyeColor.ORANGE to Items.ORANGE_CANDLE,
DyeColor.MAGENTA to Items.MAGENTA_CANDLE,
DyeColor.LIGHT_BLUE to Items.LIGHT_BLUE_CANDLE,
DyeColor.YELLOW to Items.YELLOW_CANDLE,
DyeColor.LIME to Items.LIME_CANDLE,
DyeColor.PINK to Items.PINK_CANDLE,
DyeColor.GRAY to Items.GRAY_CANDLE,
DyeColor.LIGHT_GRAY to Items.LIGHT_GRAY_CANDLE,
DyeColor.CYAN to Items.CYAN_CANDLE,
DyeColor.PURPLE to Items.PURPLE_CANDLE,
DyeColor.BLUE to Items.BLUE_CANDLE,
DyeColor.BROWN to Items.BROWN_CANDLE,
DyeColor.GREEN to Items.GREEN_CANDLE,
DyeColor.RED to Items.RED_CANDLE,
DyeColor.BLACK to Items.BLACK_CANDLE,
))
generate(consumer, mapOf(
DyeColor.WHITE to Items.WHITE_CONCRETE,
DyeColor.ORANGE to Items.ORANGE_CONCRETE,
DyeColor.MAGENTA to Items.MAGENTA_CONCRETE,
DyeColor.LIGHT_BLUE to Items.LIGHT_BLUE_CONCRETE,
DyeColor.YELLOW to Items.YELLOW_CONCRETE,
DyeColor.LIME to Items.LIME_CONCRETE,
DyeColor.PINK to Items.PINK_CONCRETE,
DyeColor.GRAY to Items.GRAY_CONCRETE,
DyeColor.LIGHT_GRAY to Items.LIGHT_GRAY_CONCRETE,
DyeColor.CYAN to Items.CYAN_CONCRETE,
DyeColor.PURPLE to Items.PURPLE_CONCRETE,
DyeColor.BLUE to Items.BLUE_CONCRETE,
DyeColor.BROWN to Items.BROWN_CONCRETE,
DyeColor.GREEN to Items.GREEN_CONCRETE,
DyeColor.RED to Items.RED_CONCRETE,
DyeColor.BLACK to Items.BLACK_CONCRETE,
))
generate(consumer, mapOf(
DyeColor.WHITE to Items.WHITE_CONCRETE_POWDER,
DyeColor.ORANGE to Items.ORANGE_CONCRETE_POWDER,
DyeColor.MAGENTA to Items.MAGENTA_CONCRETE_POWDER,
DyeColor.LIGHT_BLUE to Items.LIGHT_BLUE_CONCRETE_POWDER,
DyeColor.YELLOW to Items.YELLOW_CONCRETE_POWDER,
DyeColor.LIME to Items.LIME_CONCRETE_POWDER,
DyeColor.PINK to Items.PINK_CONCRETE_POWDER,
DyeColor.GRAY to Items.GRAY_CONCRETE_POWDER,
DyeColor.LIGHT_GRAY to Items.LIGHT_GRAY_CONCRETE_POWDER,
DyeColor.CYAN to Items.CYAN_CONCRETE_POWDER,
DyeColor.PURPLE to Items.PURPLE_CONCRETE_POWDER,
DyeColor.BLUE to Items.BLUE_CONCRETE_POWDER,
DyeColor.BROWN to Items.BROWN_CONCRETE_POWDER,
DyeColor.GREEN to Items.GREEN_CONCRETE_POWDER,
DyeColor.RED to Items.RED_CONCRETE_POWDER,
DyeColor.BLACK to Items.BLACK_CONCRETE_POWDER,
))
generate(consumer, MRegistry.CARGO_CRATES.item, MRegistry.CARGO_CRATES.items)
generate(consumer, MRegistry.TRITANIUM_BLOCK.item, MRegistry.TRITANIUM_BLOCK.items)
generate(consumer, MRegistry.TRITANIUM_STAIRS.item, MRegistry.TRITANIUM_STAIRS.items)
generate(consumer, MRegistry.TRITANIUM_SLAB.item, MRegistry.TRITANIUM_SLAB.items)
generate(consumer, MRegistry.TRITANIUM_WALL.item, MRegistry.TRITANIUM_WALL.items)
generate(consumer, Items.TERRACOTTA, mapOf(
DyeColor.WHITE to Items.WHITE_TERRACOTTA,
DyeColor.ORANGE to Items.ORANGE_TERRACOTTA,
DyeColor.MAGENTA to Items.MAGENTA_TERRACOTTA,
DyeColor.LIGHT_BLUE to Items.LIGHT_BLUE_TERRACOTTA,
DyeColor.YELLOW to Items.YELLOW_TERRACOTTA,
DyeColor.LIME to Items.LIME_TERRACOTTA,
DyeColor.PINK to Items.PINK_TERRACOTTA,
DyeColor.GRAY to Items.GRAY_TERRACOTTA,
DyeColor.LIGHT_GRAY to Items.LIGHT_GRAY_TERRACOTTA,
DyeColor.CYAN to Items.CYAN_TERRACOTTA,
DyeColor.PURPLE to Items.PURPLE_TERRACOTTA,
DyeColor.BLUE to Items.BLUE_TERRACOTTA,
DyeColor.BROWN to Items.BROWN_TERRACOTTA,
DyeColor.GREEN to Items.GREEN_TERRACOTTA,
DyeColor.RED to Items.RED_TERRACOTTA,
DyeColor.BLACK to Items.BLACK_TERRACOTTA,
), cleaning = false)
generate(consumer, Items.SHULKER_BOX, mapOf(
DyeColor.WHITE to Items.WHITE_SHULKER_BOX,
DyeColor.ORANGE to Items.ORANGE_SHULKER_BOX,
DyeColor.MAGENTA to Items.MAGENTA_SHULKER_BOX,
DyeColor.LIGHT_BLUE to Items.LIGHT_BLUE_SHULKER_BOX,
DyeColor.YELLOW to Items.YELLOW_SHULKER_BOX,
DyeColor.LIME to Items.LIME_SHULKER_BOX,
DyeColor.PINK to Items.PINK_SHULKER_BOX,
DyeColor.GRAY to Items.GRAY_SHULKER_BOX,
DyeColor.LIGHT_GRAY to Items.LIGHT_GRAY_SHULKER_BOX,
DyeColor.CYAN to Items.CYAN_SHULKER_BOX,
DyeColor.PURPLE to Items.PURPLE_SHULKER_BOX,
DyeColor.BLUE to Items.BLUE_SHULKER_BOX,
DyeColor.BROWN to Items.BROWN_SHULKER_BOX,
DyeColor.GREEN to Items.GREEN_SHULKER_BOX,
DyeColor.RED to Items.RED_SHULKER_BOX,
DyeColor.BLACK to Items.BLACK_SHULKER_BOX,
))
generate(consumer, Items.GLASS, mapOf(
DyeColor.WHITE to Items.WHITE_STAINED_GLASS,
DyeColor.ORANGE to Items.ORANGE_STAINED_GLASS,
DyeColor.MAGENTA to Items.MAGENTA_STAINED_GLASS,
DyeColor.LIGHT_BLUE to Items.LIGHT_BLUE_STAINED_GLASS,
DyeColor.YELLOW to Items.YELLOW_STAINED_GLASS,
DyeColor.LIME to Items.LIME_STAINED_GLASS,
DyeColor.PINK to Items.PINK_STAINED_GLASS,
DyeColor.GRAY to Items.GRAY_STAINED_GLASS,
DyeColor.LIGHT_GRAY to Items.LIGHT_GRAY_STAINED_GLASS,
DyeColor.CYAN to Items.CYAN_STAINED_GLASS,
DyeColor.PURPLE to Items.PURPLE_STAINED_GLASS,
DyeColor.BLUE to Items.BLUE_STAINED_GLASS,
DyeColor.BROWN to Items.BROWN_STAINED_GLASS,
DyeColor.GREEN to Items.GREEN_STAINED_GLASS,
DyeColor.RED to Items.RED_STAINED_GLASS,
DyeColor.BLACK to Items.BLACK_STAINED_GLASS,
))
generate(consumer, Items.GLASS_PANE, mapOf(
DyeColor.WHITE to Items.WHITE_STAINED_GLASS_PANE,
DyeColor.ORANGE to Items.ORANGE_STAINED_GLASS_PANE,
DyeColor.MAGENTA to Items.MAGENTA_STAINED_GLASS_PANE,
DyeColor.LIGHT_BLUE to Items.LIGHT_BLUE_STAINED_GLASS_PANE,
DyeColor.YELLOW to Items.YELLOW_STAINED_GLASS_PANE,
DyeColor.LIME to Items.LIME_STAINED_GLASS_PANE,
DyeColor.PINK to Items.PINK_STAINED_GLASS_PANE,
DyeColor.GRAY to Items.GRAY_STAINED_GLASS_PANE,
DyeColor.LIGHT_GRAY to Items.LIGHT_GRAY_STAINED_GLASS_PANE,
DyeColor.CYAN to Items.CYAN_STAINED_GLASS_PANE,
DyeColor.PURPLE to Items.PURPLE_STAINED_GLASS_PANE,
DyeColor.BLUE to Items.BLUE_STAINED_GLASS_PANE,
DyeColor.BROWN to Items.BROWN_STAINED_GLASS_PANE,
DyeColor.GREEN to Items.GREEN_STAINED_GLASS_PANE,
DyeColor.RED to Items.RED_STAINED_GLASS_PANE,
DyeColor.BLACK to Items.BLACK_STAINED_GLASS_PANE,
))
generate(consumer, MRegistry.INDUSTRIAL_GLASS.item, MRegistry.INDUSTRIAL_GLASS.items)
generate(consumer, MRegistry.INDUSTRIAL_GLASS_PANE.item, MRegistry.INDUSTRIAL_GLASS_PANE.items)
generate(consumer, MRegistry.DECORATIVE_CRATE.item, MRegistry.DECORATIVE_CRATE.items)
generate(consumer, MRegistry.TRITANIUM_PRESSURE_PLATE.item, MRegistry.TRITANIUM_PRESSURE_PLATE.items)
generate(consumer, MItems.TRITANIUM_DOOR[null]!!, MItems.TRITANIUM_DOOR)
generate(consumer, MItems.TRITANIUM_TRAPDOOR[null]!!, MItems.TRITANIUM_TRAPDOOR)
val blocks = listOf(
MItems.COBBLESTONE_GENERATOR,
MItems.ESSENCE_STORAGE,
MItems.TWIN_PLATE_PRESS,
MItems.ITEM_MONITOR,
MItems.MATTER_BOTTLER,
MItems.MATTER_RECONSTRUCTOR,
MItems.MATTER_REPLICATOR,
MItems.MATTER_SCANNER,
MItems.MATTER_CAPACITOR_BANK,
MItems.BATTERY_BANK,
MItems.MATTER_DECOMPOSER,
MItems.POWERED_SMOKER,
MItems.POWERED_FURNACE,
MItems.POWERED_BLAST_FURNACE,
MItems.MATTER_RECYCLER,
MItems.ANDROID_STATION,
MItems.STORAGE_POWER_SUPPLIER,
MItems.DRIVE_VIEWER,
MItems.ANDROID_CHARGER,
MItems.MATTER_PANEL,
MItems.ENERGY_SERVO,
MItems.ENERGY_COUNTER,
MItems.CHEMICAL_GENERATOR,
)
for (list in blocks) {
generate(consumer, list[null]!!,list)
}
for (i in 0 until MBlocks.TRITANIUM_ANVIL_VARIANTS) {
generate(consumer, MItems.TRITANIUM_ANVIL[null]!![i], DyeColor.entries.associateWith { MItems.TRITANIUM_ANVIL[it]!![i] })
}
generate(consumer, MRegistry.COMPUTER_TERMINAL.item, MRegistry.COMPUTER_TERMINAL.items)
generate(consumer, MRegistry.STAR_CHAIR.item, MRegistry.STAR_CHAIR.items)
generate(consumer, MRegistry.VENT.item, MRegistry.VENT.items)
generate(consumer, MRegistry.VENT_ALTERNATIVE.item, MRegistry.VENT_ALTERNATIVE.items)
generate(consumer, MItems.CARGO_CRATE_MINECARTS[null]!!, MItems.CARGO_CRATE_MINECARTS)
generate(consumer, MRegistry.UNREFINED_FLOOR_TILES.items)
generate(consumer, MRegistry.FLOOR_TILES.items)
generate(consumer, MRegistry.FLOOR_TILES_SLAB.items)
generate(consumer, MRegistry.FLOOR_TILES_STAIRS.items)
striped(consumer, "full", MRegistry.TRITANIUM_STRIPED_BLOCK.itemsWithColor, MRegistry.TRITANIUM_BLOCK.items)
striped(consumer, "stairs", MRegistry.TRITANIUM_STRIPED_STAIRS.itemsWithColor, MRegistry.TRITANIUM_STAIRS.items)
striped(consumer, "walls", MRegistry.TRITANIUM_STRIPED_WALL.itemsWithColor, MRegistry.TRITANIUM_WALL.items)
striped(consumer, "slabs", MRegistry.TRITANIUM_STRIPED_SLAB.itemsWithColor, MRegistry.TRITANIUM_SLAB.items)
for (color in DyeColor.entries) {
consumer.accept(modLocation("painter/armor_dye_" + color.getName().lowercase()), PainterArmorDyeRecipe(mapOf(color to 1)))
}
consumer.accept(modLocation("painter/armor_clear_dye"), PainterArmorDyeRecipe(mapOf(null to 15)))
generate(consumer, MItems.TRITANIUM_STRIPED_BLOCK)
generate(consumer, MItems.TRITANIUM_STRIPED_STAIRS)
generate(consumer, MItems.TRITANIUM_STRIPED_SLAB)
generate(consumer, MItems.TRITANIUM_STRIPED_WALL)
cleaning(consumer, MRegistry.TRITANIUM_BLOCK.item, MItems.TRITANIUM_STRIPED_BLOCK.values, "_from_striped")
cleaning(consumer, MRegistry.TRITANIUM_STAIRS.item, MItems.TRITANIUM_STRIPED_STAIRS.values, "_from_striped")
cleaning(consumer, MRegistry.TRITANIUM_SLAB.item, MItems.TRITANIUM_STRIPED_SLAB.values, "_from_striped")
cleaning(consumer, MRegistry.TRITANIUM_WALL.item, MItems.TRITANIUM_STRIPED_WALL.values, "_from_striped")
for (color in DyeColor.entries) {
consumer.accept(modLocation("painter/tritanium_${color.name.lowercase()}_stripe"), PainterRecipe(
Ingredient.of(MRegistry.TRITANIUM_BLOCK.item),
ItemStack(MItems.TRITANIUM_STRIPED_BLOCK[color]!!),
mapOf(color to 1)
))
consumer.accept(modLocation("painter/tritanium_${color.name.lowercase()}_stripe_stairs"), PainterRecipe(
Ingredient.of(MRegistry.TRITANIUM_STAIRS.item),
ItemStack(MItems.TRITANIUM_STRIPED_STAIRS[color]!!),
mapOf(color to 1)
))
consumer.accept(modLocation("painter/tritanium_${color.name.lowercase()}_stripe_slab"), PainterRecipe(
Ingredient.of(MRegistry.TRITANIUM_SLAB.item),
ItemStack(MItems.TRITANIUM_STRIPED_SLAB[color]!!),
mapOf(color to 1)
))
consumer.accept(modLocation("painter/tritanium_${color.name.lowercase()}_stripe_wall"), PainterRecipe(
Ingredient.of(MRegistry.TRITANIUM_WALL.item),
ItemStack(MItems.TRITANIUM_STRIPED_WALL[color]!!),
mapOf(color to 1)
))
}
generate(consumer, MItems.GRILL[null]!!, MItems.GRILL)
}

View File

@ -1,87 +0,0 @@
package ru.dbotthepony.mc.otm.datagen.recipes
import com.google.gson.JsonObject
import com.google.gson.JsonPrimitive
import com.mojang.serialization.JsonOps
import net.minecraft.data.recipes.FinishedRecipe
import net.minecraft.resources.ResourceLocation
import net.minecraft.util.valueproviders.ConstantFloat
import net.minecraft.util.valueproviders.FloatProvider
import net.minecraft.util.valueproviders.UniformFloat
import net.minecraft.world.item.crafting.RecipeSerializer
import ru.dbotthepony.mc.otm.recipe.PlatePressRecipe
import ru.dbotthepony.mc.otm.recipe.PlatePressRecipeFactory
import ru.dbotthepony.mc.otm.core.set
import ru.dbotthepony.mc.otm.core.toJsonStrict
import ru.dbotthepony.mc.otm.data.getOrNull
class PlatePressFinishedRecipe(private val recipe: PlatePressRecipe) : FinishedRecipe {
override fun serializeRecipeData(it: JsonObject) {
it["input"] = recipe.input.toJson()
it["result"] = recipe.output.toJson().also {
if (it is JsonObject && recipe.count != 1)
it["count"] = JsonPrimitive(recipe.count)
}
it["work_time"] = JsonPrimitive(recipe.workTime)
it["experience"] = FloatProvider.CODEC.toJsonStrict(recipe.experience)
}
override fun getId(): ResourceLocation {
return recipe.id
}
override fun getType(): RecipeSerializer<*> {
return PlatePressRecipeFactory
}
override fun serializeAdvancement(): JsonObject? {
return null
}
override fun getAdvancementId(): ResourceLocation? {
return null
}
}
class PlatePressShallowFinishedRecipe(
private val id: ResourceLocation,
private val input: ResourceLocation,
private val output: ResourceLocation,
private val count: Int = 1,
private val workTime: Int = 200,
private val experience: FloatProvider = ConstantFloat.ZERO,
) : FinishedRecipe {
override fun serializeRecipeData(it: JsonObject) {
it["input"] = JsonObject().also {
it["tag"] = JsonPrimitive(input.toString())
}
it["result"] = JsonObject().also {
it["tag"] = JsonPrimitive(output.toString())
if (count != 1)
it["count"] = JsonPrimitive(count)
}
it["work_time"] = JsonPrimitive(workTime)
it["experience"] = FloatProvider.CODEC.toJsonStrict(experience)
}
override fun getId(): ResourceLocation {
return id
}
override fun getType(): RecipeSerializer<*> {
return PlatePressRecipeFactory
}
override fun serializeAdvancement(): JsonObject? {
return null
}
override fun getAdvancementId(): ResourceLocation? {
return null
}
}

View File

@ -3,10 +3,12 @@ package ru.dbotthepony.mc.otm.datagen.recipes
import net.minecraft.util.valueproviders.ConstantFloat import net.minecraft.util.valueproviders.ConstantFloat
import net.minecraft.world.item.Items import net.minecraft.world.item.Items
import net.minecraft.world.item.crafting.Ingredient import net.minecraft.world.item.crafting.Ingredient
import net.neoforged.neoforge.common.Tags
import ru.dbotthepony.mc.otm.registry.MItemTags import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.game.MItems
fun addPlatePressRecipes(provider: MatteryRecipeProvider) { fun addPlatePressRecipes(provider: MatteryRecipeProvider) {
val baselineMetals = arrayOf("iron" to 0.2f, "silver" to 0.3f, "bronze" to 0.3f, "lead" to 0.3f, "constantan" to 0.4f, "brass" to 0.3f) val baselineMetals = arrayOf("iron" to 0.2f, "silver" to 0.3f, "bronze" to 0.3f, "lead" to 0.3f, "constantan" to 0.4f, "brass" to 0.3f, "nickel" to 0.5f)
val softMetals = arrayOf("gold" to 0.4f, "aluminum" to 0.3f, "aluminium" to 0.3f, "copper" to 0.2f, "electrum" to 0.4f, "zinc" to 0.3f) val softMetals = arrayOf("gold" to 0.4f, "aluminum" to 0.3f, "aluminium" to 0.3f, "copper" to 0.2f, "electrum" to 0.4f, "zinc" to 0.3f)
val hardMetals = arrayOf("tritanium" to 0.5f, "steel" to 0.5f, "tungsten" to 0.55f, "uranium" to 0.5f) val hardMetals = arrayOf("tritanium" to 0.5f, "steel" to 0.5f, "tungsten" to 0.55f, "uranium" to 0.5f)
@ -23,4 +25,5 @@ fun addPlatePressRecipes(provider: MatteryRecipeProvider) {
} }
provider.plate("carbon", result = Ingredient.of(MItemTags.CARBON_PLATES), ingredient = Ingredient.of(Items.COAL), workTicks = 140, experience = ConstantFloat.of(0.3f)) provider.plate("carbon", result = Ingredient.of(MItemTags.CARBON_PLATES), ingredient = Ingredient.of(Items.COAL), workTicks = 140, experience = ConstantFloat.of(0.3f))
provider.plate("circuit_plating", result = Ingredient.of(MItems.CIRCUIT_PLATING), ingredient = Ingredient.of(Tags.Items.SANDS), workTicks = 120, experience = ConstantFloat.of(0.2f))
} }

View File

@ -1,21 +1,42 @@
package ru.dbotthepony.mc.otm.datagen.recipes package ru.dbotthepony.mc.otm.datagen.recipes
import net.minecraft.data.recipes.FinishedRecipe
import net.minecraft.data.recipes.RecipeCategory import net.minecraft.data.recipes.RecipeCategory
import net.minecraft.data.recipes.RecipeOutput
import net.minecraft.data.recipes.ShapelessRecipeBuilder import net.minecraft.data.recipes.ShapelessRecipeBuilder
import net.minecraft.tags.TagKey
import net.minecraft.world.item.DyeColor import net.minecraft.world.item.DyeColor
import net.minecraft.world.item.Item
import net.minecraft.world.item.ItemStack import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.Items import net.minecraft.world.item.Items
import net.minecraft.world.item.crafting.Ingredient import net.minecraft.world.item.crafting.Ingredient
import ru.dbotthepony.mc.otm.core.registryName import net.minecraft.world.level.ItemLike
import net.neoforged.neoforge.common.Tags
import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.datagen.modLocation import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.registry.MItemTags import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.MItems import ru.dbotthepony.mc.otm.registry.game.MItems
import ru.dbotthepony.mc.otm.registry.MRegistry import ru.dbotthepony.mc.otm.registry.MRegistry
import java.util.function.Consumer
fun addShapelessRecipes(consumer: Consumer<FinishedRecipe>) { fun hammerRecipe(output: ItemLike, input: ItemLike, consumer: RecipeOutput) {
for (color in DyeColor.values()) { ShapelessRecipeBuilder(RecipeCategory.MISC, output, 1)
.requires(MItemTags.TOOLS_HAMMERS)
.requires(input)
.unlockedBy(MItemTags.TOOLS_HAMMERS)
.unlockedBy(input)
.save(consumer)
}
fun hammerRecipe(output: ItemLike, input: TagKey<Item>, consumer: RecipeOutput) {
ShapelessRecipeBuilder(RecipeCategory.MISC, output, 1)
.requires(MItemTags.TOOLS_HAMMERS)
.requires(input)
.unlockedBy(MItemTags.TOOLS_HAMMERS)
.unlockedBy(input)
.save(consumer)
}
fun addShapelessRecipes(consumer: RecipeOutput) {
for (color in DyeColor.entries) {
ShapelessRecipeBuilder(RecipeCategory.TRANSPORTATION, MItems.CARGO_CRATE_MINECARTS[color]!!, 1) ShapelessRecipeBuilder(RecipeCategory.TRANSPORTATION, MItems.CARGO_CRATE_MINECARTS[color]!!, 1)
.requires(Items.MINECART) .requires(Items.MINECART)
.requires(MRegistry.CARGO_CRATES.items[color]!!) .requires(MRegistry.CARGO_CRATES.items[color]!!)
@ -36,4 +57,60 @@ fun addShapelessRecipes(consumer: Consumer<FinishedRecipe>) {
.unlockedBy(Items.MINECART) .unlockedBy(Items.MINECART)
.unlockedBy(MRegistry.CARGO_CRATES.item) .unlockedBy(MRegistry.CARGO_CRATES.item)
.save(consumer) .save(consumer)
ShapelessRecipeBuilder(RecipeCategory.BUILDING_BLOCKS, MItems.TRITANIUM_INGOT_BLOCK, 1)
.requires(Ingredient.of(MItemTags.TRITANIUM_INGOTS), 9)
.unlockedBy(MItemTags.TRITANIUM_INGOTS)
.save(consumer)
ShapelessRecipeBuilder(RecipeCategory.BUILDING_BLOCKS, MItems.TRITANIUM_RAW_BLOCK, 1)
.requires(Ingredient.of(MItemTags.TRITANIUM_ORE_CLUMPS), 9)
.unlockedBy(MItemTags.TRITANIUM_ORE_CLUMPS)
.save(consumer)
ShapelessRecipeBuilder(RecipeCategory.MISC, MItems.TRITANIUM_ORE_CLUMP, 9)
.requires(Ingredient.of(MItemTags.RAW_TRITANIUM_STORAGE))
.unlockedBy(MItemTags.RAW_TRITANIUM_STORAGE)
.save(consumer, modLocation("raw_tritanium_from_storage"))
ShapelessRecipeBuilder(RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 9)
.requires(Ingredient.of(MItemTags.TRITANIUM_INGOTS_STORAGE))
.unlockedBy(MItemTags.TRITANIUM_INGOTS_STORAGE)
.save(consumer, modLocation("tritanium_ingot_from_storage"))
ShapelessRecipeBuilder(RecipeCategory.MISC, MItems.TRITANIUM_NUGGET, 9)
.requires(MItemTags.TRITANIUM_INGOTS)
.unlockedBy(MItemTags.TRITANIUM_INGOTS)
.unlockedBy(MItemTags.TRITANIUM_NUGGETS)
.save(consumer)
ShapelessRecipeBuilder(RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 1)
.requires(Ingredient.of(MItemTags.TRITANIUM_NUGGETS), 9)
.unlockedBy(MItemTags.TRITANIUM_INGOTS)
.unlockedBy(MItemTags.TRITANIUM_NUGGETS)
.save(consumer, modLocation("ingot_from_nuggets"))
hammerRecipe(MItems.TRITANIUM_PLATE, MItemTags.TRITANIUM_INGOTS, consumer)
hammerRecipe(MItems.IRON_PLATE, Tags.Items.INGOTS_IRON, consumer)
hammerRecipe(MItems.GOLD_PLATE, Tags.Items.INGOTS_GOLD, consumer)
ShapelessRecipeBuilder(RecipeCategory.BUILDING_BLOCKS, MItems.WITHERED_STEEL_BLOCK, 1)
.requires(Ingredient.of(MItems.WITHERED_STEEL), 9)
.unlockedBy(MItems.WITHERED_STEEL)
.save(consumer)
ShapelessRecipeBuilder(RecipeCategory.MISC, MItems.WITHERED_STEEL, 9)
.requires(Ingredient.of(MItems.WITHERED_STEEL_BLOCK))
.unlockedBy(MItems.WITHERED_STEEL_BLOCK)
.save(consumer)
ShapelessRecipeBuilder(RecipeCategory.BUILDING_BLOCKS, MItems.ROFLITE_ALLOY_BLOCK, 1)
.requires(Ingredient.of(MItems.ROFLITE_ALLOY_INGOT), 9)
.unlockedBy(MItems.ROFLITE_ALLOY_INGOT)
.save(consumer)
ShapelessRecipeBuilder(RecipeCategory.MISC, MItems.ROFLITE_ALLOY_INGOT, 9)
.requires(Ingredient.of(MItems.ROFLITE_ALLOY_BLOCK))
.unlockedBy(MItems.ROFLITE_ALLOY_BLOCK)
.save(consumer)
} }

View File

@ -0,0 +1,74 @@
package ru.dbotthepony.mc.otm.datagen.recipes
import net.minecraft.data.recipes.RecipeCategory
import net.minecraft.data.recipes.RecipeOutput
import net.neoforged.neoforge.common.Tags
import ru.dbotthepony.mc.otm.recipe.UpgradeRecipe
import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.game.MItems
fun addStorageItemRecipes(consumer: RecipeOutput) {
// простые батарейки
MatteryRecipe(MItems.BATTERY_CRUDE, category = RecipeCategory.MISC)
.rowB(Tags.Items.DUSTS_REDSTONE)
.rowB(Tags.Items.CROPS_POTATO)
.rowB(Tags.Items.INGOTS_IRON)
.unlockedBy(Tags.Items.CROPS_POTATO)
.build(consumer)
MatteryRecipe(MItems.BATTERY_BASIC, category = RecipeCategory.MISC)
.rowAC(Tags.Items.DUSTS_REDSTONE, Tags.Items.DUSTS_REDSTONE)
.rowB(MItems.ELECTRIC_PARTS)
.rowB(MItemTags.IRON_PLATES)
.unlockedBy(Tags.Items.DUSTS_REDSTONE)
.unlockedBy(MItems.ELECTRIC_PARTS)
.build(consumer)
MatteryRecipe(MItems.BATTERY_NORMAL, category = RecipeCategory.MISC)
.setUpgradeSource(MItems.BATTERY_BASIC)
.addUpgradeOps(UpgradeRecipe.CopyAllComponents)
.rowB(MItems.ELECTRIC_PARTS)
.row(MItemTags.COPPER_WIRES, MItems.BATTERY_BASIC, MItemTags.COPPER_WIRES)
.row(Tags.Items.DUSTS_REDSTONE, Tags.Items.DUSTS_REDSTONE, Tags.Items.DUSTS_REDSTONE)
.build(consumer)
MatteryRecipe(MItems.BATTERY_DENSE, category = RecipeCategory.MISC)
.setUpgradeSource(MItems.BATTERY_NORMAL)
.addUpgradeOps(UpgradeRecipe.CopyAllComponents)
.row(Tags.Items.DUSTS_REDSTONE, MItems.ENERGY_BUS, Tags.Items.DUSTS_REDSTONE)
.row(MItemTags.GOLD_WIRES, MItems.BATTERY_NORMAL, MItemTags.GOLD_WIRES)
.row(Tags.Items.DUSTS_REDSTONE, Tags.Items.DUSTS_REDSTONE, Tags.Items.DUSTS_REDSTONE)
.build(consumer)
MatteryRecipe(MItems.BATTERY_CAPACITOR, category = RecipeCategory.MISC)
.setUpgradeSource(MItems.BATTERY_NORMAL)
.addUpgradeOps(UpgradeRecipe.CopyAllComponents)
.row(Tags.Items.DUSTS_REDSTONE, MItems.ENERGY_BUS, Tags.Items.DUSTS_REDSTONE)
.row(MItemTags.GOLD_WIRES, MItems.BATTERY_NORMAL, MItemTags.GOLD_WIRES)
.row(MItemTags.GOLD_WIRES, Tags.Items.DUSTS_REDSTONE, MItemTags.GOLD_WIRES)
.build(consumer)
// накопители материи
MatteryRecipe(MItems.MATTER_CAPACITOR_BASIC, category = RecipeCategory.MISC)
.row(MItemTags.IRON_PLATES, MItems.MATTER_CAPACITOR_PARTS, MItemTags.HARDENED_GLASS)
.unlockedBy(MItems.MATTER_CAPACITOR_PARTS)
.build(consumer)
MatteryRecipe(MItems.MATTER_CAPACITOR_NORMAL, category = RecipeCategory.MISC)
.setUpgradeSource(MItems.MATTER_CAPACITOR_BASIC)
.addUpgradeOps(UpgradeRecipe.CopyAllComponents)
.rowB(MItems.MATTER_CAPACITOR_PARTS)
.row(MItemTags.TRITANIUM_PLATES, MItems.MATTER_CAPACITOR_BASIC, MItemTags.TRITANIUM_PLATES)
.rowB(Tags.Items.GEMS_DIAMOND)
.unlockedBy(MItems.MATTER_CAPACITOR_BASIC)
.build(consumer)
MatteryRecipe(MItems.MATTER_CAPACITOR_DENSE, category = RecipeCategory.MISC)
.setUpgradeSource(MItems.MATTER_CAPACITOR_NORMAL)
.addUpgradeOps(UpgradeRecipe.CopyAllComponents)
.row(MItems.MATTER_CAPACITOR_PARTS, MItemTags.HARDENED_GLASS, MItems.MATTER_CAPACITOR_PARTS)
.row(MItemTags.TRITANIUM_PLATES, MItems.MATTER_CAPACITOR_NORMAL, MItemTags.TRITANIUM_PLATES)
.rowAC(Tags.Items.ENDER_PEARLS, Tags.Items.ENDER_PEARLS)
.unlockedBy(MItems.MATTER_CAPACITOR_NORMAL)
.build(consumer)
}

View File

@ -0,0 +1,54 @@
package ru.dbotthepony.mc.otm.datagen.recipes
import net.minecraft.data.recipes.RecipeCategory
import net.minecraft.data.recipes.RecipeOutput
import net.minecraft.data.recipes.ShapelessRecipeBuilder
import net.minecraft.data.recipes.SimpleCookingRecipeBuilder
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.crafting.Ingredient
import net.neoforged.neoforge.common.Tags
import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.registry.game.MItems
fun addSuspiciousRecipes(consumer: RecipeOutput) {
for (item in MItems.SUSPICIOUS_FOODS.ITEMS) {
if (item.defaultMaxStackSize == 1) {
ShapelessRecipeBuilder.shapeless(RecipeCategory.FOOD, ItemStack(item))
.requires(item.mimicking())
.unlockedBy(MItems.PILL_NOT_NORMAL)
.requires(MItems.PILL_NOT_NORMAL)
.save(consumer)
} else {
ShapelessRecipeBuilder.shapeless(RecipeCategory.FOOD, ItemStack(item, 8))
.requires(item.mimicking(), 8)
.unlockedBy(MItems.PILL_NOT_NORMAL)
.requires(MItems.PILL_NOT_NORMAL)
.save(consumer)
}
}
MatteryRecipe(MItems.SUSPICIOUS_FOODS.GOLDEN_CARROT, 8, RecipeCategory.FOOD)
.row(MItems.SUSPICIOUS_FOODS.CARROT, MItems.SUSPICIOUS_FOODS.CARROT, MItems.SUSPICIOUS_FOODS.CARROT)
.row(MItems.SUSPICIOUS_FOODS.CARROT, Tags.Items.NUGGETS_GOLD, MItems.SUSPICIOUS_FOODS.CARROT)
.row(MItems.SUSPICIOUS_FOODS.CARROT, MItems.SUSPICIOUS_FOODS.CARROT, MItems.SUSPICIOUS_FOODS.CARROT)
.unlockedBy(MItems.SUSPICIOUS_FOODS.CARROT)
.build(consumer, "upgrade")
val cooking = listOf(
MItems.SUSPICIOUS_FOODS.POTATO to MItems.SUSPICIOUS_FOODS.BAKED_POTATO,
MItems.SUSPICIOUS_FOODS.BEEF to MItems.SUSPICIOUS_FOODS.COOKED_BEEF,
MItems.SUSPICIOUS_FOODS.CHICKEN to MItems.SUSPICIOUS_FOODS.COOKED_CHICKEN,
MItems.SUSPICIOUS_FOODS.COD to MItems.SUSPICIOUS_FOODS.COOKED_COD,
MItems.SUSPICIOUS_FOODS.MUTTON to MItems.SUSPICIOUS_FOODS.COOKED_MUTTON,
MItems.SUSPICIOUS_FOODS.PORKCHOP to MItems.SUSPICIOUS_FOODS.COOKED_PORKCHOP,
MItems.SUSPICIOUS_FOODS.RABBIT to MItems.SUSPICIOUS_FOODS.COOKED_RABBIT,
MItems.SUSPICIOUS_FOODS.SALMON to MItems.SUSPICIOUS_FOODS.COOKED_SALMON,
)
for ((source, target) in cooking) {
SimpleCookingRecipeBuilder.smelting(Ingredient.of(source), RecipeCategory.FOOD, target, 0.1f, 200).unlockedBy(source).save(consumer, modLocation("cooking_${source.registryName!!.path}"))
SimpleCookingRecipeBuilder.smoking(Ingredient.of(source), RecipeCategory.FOOD, target, 0.1f, 100).unlockedBy(source).save(consumer, modLocation("smoking_${source.registryName!!.path}"))
SimpleCookingRecipeBuilder.campfireCooking(Ingredient.of(source), RecipeCategory.FOOD, target, 0.1f, 600).unlockedBy(source).save(consumer, modLocation("campfire_cooking_${source.registryName!!.path}"))
}
}

View File

@ -0,0 +1,68 @@
package ru.dbotthepony.mc.otm.datagen.recipes
import net.minecraft.data.recipes.RecipeCategory
import net.minecraft.data.recipes.RecipeOutput
import net.neoforged.neoforge.common.Tags
import ru.dbotthepony.mc.otm.recipe.UpgradeRecipe
import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.game.MItems
fun addToolsRecipes(consumer: RecipeOutput) {
MatteryRecipe(MItems.ENERGY_SWORD, category = RecipeCategory.COMBAT)
.row(MItemTags.CARBON_PLATES, MItemTags.TRITANIUM_PLATES, MItemTags.GOLD_WIRES)
.row(MItemTags.CARBON_PLATES, MItemTags.TRITANIUM_PLATES, MItemTags.GOLD_WIRES)
.row(MItems.BATTERY_CAPACITOR, MItems.TRITANIUM_SWORD, MItemTags.ADVANCED_CIRCUIT)
.unlockedBy(MItems.BATTERY_CAPACITOR)
.addUpgradeOps(UpgradeRecipe.CopyEnergyCharge)
.addUpgradeOps(UpgradeRecipe.CopyEnchantments)
.build(consumer)
MatteryRecipe(MItems.TRITANIUM_SWORD, category = RecipeCategory.COMBAT)
.rowB(MItemTags.TRITANIUM_INGOTS)
.rowB(MItemTags.TRITANIUM_INGOTS)
.rowB(Tags.Items.RODS_WOODEN)
.unlockedBy(MItemTags.TRITANIUM_INGOTS)
.build(consumer)
MatteryRecipe(MItems.TRITANIUM_SHOVEL, category = RecipeCategory.TOOLS)
.rowB(MItemTags.TRITANIUM_INGOTS)
.rowB(Tags.Items.RODS_WOODEN)
.rowB(Tags.Items.RODS_WOODEN)
.unlockedBy(MItemTags.TRITANIUM_INGOTS)
.build(consumer)
MatteryRecipe(MItems.TRITANIUM_PICKAXE, category = RecipeCategory.TOOLS)
.row(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
.rowB(Tags.Items.RODS_WOODEN)
.rowB(Tags.Items.RODS_WOODEN)
.unlockedBy(MItemTags.TRITANIUM_INGOTS)
.build(consumer)
MatteryRecipe(MItems.TRITANIUM_AXE, category = RecipeCategory.TOOLS)
.rowAB(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
.rowAB(MItemTags.TRITANIUM_INGOTS, Tags.Items.RODS_WOODEN)
.rowB(Tags.Items.RODS_WOODEN)
.unlockedBy(MItemTags.TRITANIUM_INGOTS)
.build(consumer)
MatteryRecipe(MItems.TRITANIUM_AXE, category = RecipeCategory.TOOLS)
.rowBC(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
.rowBC(Tags.Items.RODS_WOODEN, MItemTags.TRITANIUM_INGOTS)
.rowB(Tags.Items.RODS_WOODEN)
.unlockedBy(MItemTags.TRITANIUM_INGOTS)
.build(consumer, "alt")
MatteryRecipe(MItems.TRITANIUM_HOE, category = RecipeCategory.TOOLS)
.rowBC(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
.rowB(Tags.Items.RODS_WOODEN)
.rowB(Tags.Items.RODS_WOODEN)
.unlockedBy(MItemTags.TRITANIUM_INGOTS)
.build(consumer)
MatteryRecipe(MItems.WITHERED_STEEL_SWORD, category = RecipeCategory.COMBAT)
.rowB(MItems.WITHERED_STEEL)
.rowB(MItems.WITHERED_STEEL)
.rowB(Tags.Items.RODS_WOODEN)
.unlockedBy(MItems.WITHERED_STEEL)
.build(consumer)
}

View File

@ -0,0 +1,110 @@
package ru.dbotthepony.mc.otm.datagen.tags
import net.minecraft.tags.BlockTags
import net.minecraft.tags.ItemTags
import net.minecraft.world.item.Items
import net.minecraft.world.level.block.Blocks
import ru.dbotthepony.mc.otm.registry.MBlockTags
import ru.dbotthepony.mc.otm.registry.game.MBlocks
import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.game.MItems
import ru.dbotthepony.mc.otm.registry.MRegistry
fun addConstructionTags(tagsProvider: TagsProvider) {
tagsProvider.blocks.Appender(BlockTags.BEACON_BASE_BLOCKS)
.add(MBlocks.TRITANIUM_INGOT_BLOCK)
.add(MBlocks.DILITHIUM_CRYSTAL_BLOCK)
.add(MBlocks.WITHERED_STEEL_BLOCK)
.add(MBlocks.ROFLITE_ALLOY_BLOCK)
tagsProvider.blocks.Appender(MBlockTags.MULTIBLOCK_STRUCTURE)
.add(MBlockTags.MULTIBLOCK_HARD_STRUCTURE, MBlockTags.MULTIBLOCK_SOFT_STRUCTURE)
tagsProvider.blocks.Appender(MBlockTags.MULTIBLOCK_SOFT_STRUCTURE)
.add(MBlockTags.HARDENED_GLASS)
tagsProvider.blocks.Appender(MBlockTags.MULTIBLOCK_HARD_STRUCTURE)
.add(MRegistry.VENT.allBlocks.values)
.add(MRegistry.VENT_ALTERNATIVE.allBlocks.values)
.add(MRegistry.TRITANIUM_BLOCK.allBlocks.values)
.add(MRegistry.TRITANIUM_STRIPED_BLOCK.blocks.values.stream().flatMap { it.values.stream() })
tagsProvider.items.Appender(MItemTags.CRAFTING_TABLES).add(Items.CRAFTING_TABLE)
tagsProvider.items.Appender(MItemTags.WORKBENCHES).add(Items.CRAFTING_TABLE)
tagsProvider.items.Appender(MItemTags.WORKBENCH).add(Items.CRAFTING_TABLE)
tagsProvider.items.Appender(MItemTags.FURNACES).add(Items.FURNACE)
tagsProvider.blocks.Appender(MBlockTags.CRAFTING_TABLES).add(Blocks.CRAFTING_TABLE)
tagsProvider.blocks.Appender(MBlockTags.WORKBENCHES).add(Blocks.CRAFTING_TABLE)
tagsProvider.blocks.Appender(MBlockTags.WORKBENCH).add(Blocks.CRAFTING_TABLE)
tagsProvider.items.forge("hardened_glass").add(MRegistry.INDUSTRIAL_GLASS.allItems.values)
tagsProvider.items.forge("hardened_glass/colorless").add(MRegistry.INDUSTRIAL_GLASS.item)
tagsProvider.items.forge("hardened_glass/tinted").add(MRegistry.INDUSTRIAL_GLASS.items.values)
tagsProvider.items.forge("hardened_glass_panes").add(MRegistry.INDUSTRIAL_GLASS_PANE.allItems.values)
tagsProvider.items.forge("hardened_glass_panes/colorless").add(MRegistry.INDUSTRIAL_GLASS_PANE.item)
tagsProvider.items.forge("hardened_glass_panes/tinted").add(MRegistry.INDUSTRIAL_GLASS_PANE.items.values)
tagsProvider.blocks.forge("hardened_glass").add(MRegistry.INDUSTRIAL_GLASS.allBlocks.values)
tagsProvider.blocks.forge("hardened_glass/colorless").add(MRegistry.INDUSTRIAL_GLASS.block)
tagsProvider.blocks.forge("hardened_glass/tinted").add(MRegistry.INDUSTRIAL_GLASS.blocks.values)
tagsProvider.blocks.forge("hardened_glass_panes").add(MRegistry.INDUSTRIAL_GLASS_PANE.allBlocks.values)
tagsProvider.blocks.forge("hardened_glass_panes/colorless").add(MRegistry.INDUSTRIAL_GLASS_PANE.block)
tagsProvider.blocks.forge("hardened_glass_panes/tinted").add(MRegistry.INDUSTRIAL_GLASS_PANE.blocks.values)
MRegistry.INDUSTRIAL_GLASS.forEachItem { s, _, item -> tagsProvider.items.forge("hardened_glass/$s").add(item) }
MRegistry.INDUSTRIAL_GLASS_PANE.forEachItem { s, _, item -> tagsProvider.items.forge("hardened_glass_panes/$s").add(item) }
MRegistry.INDUSTRIAL_GLASS.forEachBlock { s, _, block -> tagsProvider.blocks.forge("hardened_glass/$s").add(block) }
MRegistry.INDUSTRIAL_GLASS_PANE.forEachBlock { s, _, block -> tagsProvider.blocks.forge("hardened_glass_panes/$s").add(block) }
tagsProvider.items.Appender(MItemTags.INDUSTRIAL_GLASS).add(MRegistry.INDUSTRIAL_GLASS.allItems.values)
tagsProvider.blocks.Appender(MBlockTags.INDUSTRIAL_GLASS).add(MRegistry.INDUSTRIAL_GLASS.allBlocks.values)
tagsProvider.items.Appender(MItemTags.CARGO_CRATES).add(MRegistry.CARGO_CRATES.allItems.values)
tagsProvider.blocks.Appender(MBlockTags.CARGO_CRATES).add(MRegistry.CARGO_CRATES.allBlocks.values)
tagsProvider.items.Appender(ItemTags.DOORS).add(MItems.TRITANIUM_DOOR.values)
tagsProvider.blocks.Appender(BlockTags.DOORS).add(MBlocks.TRITANIUM_DOOR.values)
tagsProvider.items.Appender(ItemTags.TRAPDOORS).add(MItems.TRITANIUM_TRAPDOOR.values)
tagsProvider.blocks.Appender(BlockTags.TRAPDOORS).add(MBlocks.TRITANIUM_TRAPDOOR.values)
tagsProvider.blocks.Appender(BlockTags.PRESSURE_PLATES).add(MRegistry.TRITANIUM_PRESSURE_PLATE.allBlocks.values)
tagsProvider.blocks.Appender(BlockTags.STAIRS)
.add(MRegistry.FLOOR_TILES_STAIRS.blocks.values)
.add(MRegistry.TRITANIUM_STAIRS.allBlocks.values)
.add(MRegistry.TRITANIUM_STRIPED_STAIRS.flatBlocks)
.add(MBlocks.TRITANIUM_STRIPED_STAIRS.values)
tagsProvider.blocks.Appender(BlockTags.SLABS)
.add(MRegistry.TRITANIUM_SLAB.allBlocks.values)
.add(MRegistry.TRITANIUM_STRIPED_SLAB.flatBlocks)
.add(MRegistry.FLOOR_TILES_SLAB.blocks.values)
.add(MBlocks.TRITANIUM_STRIPED_SLAB.values)
tagsProvider.blocks.Appender(BlockTags.WALLS)
.add(MRegistry.TRITANIUM_WALL.allBlocks.values)
.add(MRegistry.TRITANIUM_STRIPED_WALL.flatBlocks)
.add(MBlocks.TRITANIUM_STRIPED_WALL.values)
tagsProvider.items.Appender(ItemTags.STAIRS)
.add(MRegistry.FLOOR_TILES_STAIRS.items.values)
.add(MRegistry.TRITANIUM_STAIRS.allItems.values)
.add(MRegistry.TRITANIUM_STRIPED_STAIRS.flatItems)
.add(MItems.TRITANIUM_STRIPED_STAIRS.values)
tagsProvider.items.Appender(ItemTags.SLABS)
.add(MRegistry.TRITANIUM_SLAB.allItems.values)
.add(MRegistry.TRITANIUM_STRIPED_SLAB.flatItems)
.add(MRegistry.FLOOR_TILES_SLAB.items.values)
.add(MItems.TRITANIUM_STRIPED_SLAB.values)
tagsProvider.items.Appender(ItemTags.WALLS)
.add(MRegistry.TRITANIUM_WALL.allItems.values)
.add(MRegistry.TRITANIUM_STRIPED_WALL.flatItems)
.add(MItems.TRITANIUM_STRIPED_WALL.values)
}

View File

@ -0,0 +1,54 @@
package ru.dbotthepony.mc.otm.datagen.tags
import ru.dbotthepony.mc.otm.registry.game.MItems
import ru.dbotthepony.mc.otm.registry.MRegistry
fun addDyeTags(tagsProvider: TagsProvider) {
tagsProvider.addToDyeTags(MRegistry.CARGO_CRATES.allItems)
tagsProvider.addToDyeTags(MRegistry.INDUSTRIAL_GLASS.allItems)
tagsProvider.addToDyeTags(MRegistry.INDUSTRIAL_GLASS_PANE.allItems)
tagsProvider.addToDyeTags(MRegistry.DECORATIVE_CRATE.items)
tagsProvider.addToDyeTags(MItems.TRITANIUM_DOOR)
tagsProvider.addToDyeTags(MItems.TRITANIUM_TRAPDOOR)
tagsProvider.addToDyeTags(MRegistry.TRITANIUM_PRESSURE_PLATE.allItems)
tagsProvider.addToDyeTags(MRegistry.FLOOR_TILES_STAIRS.items)
tagsProvider.addToDyeTags(MRegistry.TRITANIUM_STAIRS.items)
tagsProvider.addToDyeTags(MRegistry.TRITANIUM_SLAB.items)
tagsProvider.addToDyeTags(MRegistry.FLOOR_TILES_SLAB.items)
tagsProvider.addToDyeTags(MRegistry.UNREFINED_FLOOR_TILES.items)
tagsProvider.addToDyeTags(MRegistry.TRITANIUM_WALL.items)
tagsProvider.addToDyeTags(MItems.ANDROID_STATION)
tagsProvider.addToDyeTags(MItems.ENERGY_SERVO)
tagsProvider.addToDyeTags(MItems.MATTER_DECOMPOSER)
tagsProvider.addToDyeTags(MItems.MATTER_CAPACITOR_BANK)
tagsProvider.addToDyeTags(MItems.BATTERY_BANK)
tagsProvider.addToDyeTags(MItems.MATTER_SCANNER)
tagsProvider.addToDyeTags(MItems.MATTER_PANEL)
tagsProvider.addToDyeTags(MItems.MATTER_REPLICATOR)
tagsProvider.addToDyeTags(MItems.MATTER_BOTTLER)
tagsProvider.addToDyeTags(MItems.ENERGY_COUNTER)
tagsProvider.addToDyeTags(MItems.CHEMICAL_GENERATOR)
tagsProvider.addToDyeTags(MItems.PLATE_PRESS)
tagsProvider.addToDyeTags(MItems.TWIN_PLATE_PRESS)
tagsProvider.addToDyeTags(MItems.MATTER_RECYCLER)
tagsProvider.addToDyeTags(MItems.POWERED_FURNACE)
tagsProvider.addToDyeTags(MItems.POWERED_SMOKER)
tagsProvider.addToDyeTags(MItems.POWERED_BLAST_FURNACE)
tagsProvider.addToDyeTags(MItems.DRIVE_VIEWER)
tagsProvider.addToDyeTags(MItems.ITEM_MONITOR)
tagsProvider.addToDyeTags(MItems.STORAGE_POWER_SUPPLIER)
tagsProvider.addToDyeTags(MItems.COBBLESTONE_GENERATOR)
tagsProvider.addToDyeTags(MItems.ESSENCE_STORAGE)
tagsProvider.addToDyeTags(MItems.MATTER_RECONSTRUCTOR)
tagsProvider.addToDyeTags(MItems.ANDROID_CHARGER)
}

View File

@ -0,0 +1,67 @@
package ru.dbotthepony.mc.otm.datagen.tags
import net.minecraft.tags.ItemTags
import net.neoforged.neoforge.common.Tags
import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.game.MItems
fun addEquipmentTags(tagsProvider: TagsProvider) {
// TODO: is new tag appropriate for modded armors?
tagsProvider.items.Appender(Tags.Items.ARMORS)
.add(MItems.TRITANIUM_HELMET, MItems.SIMPLE_TRITANIUM_HELMET)
.add(MItems.TRITANIUM_CHESTPLATE, MItems.SIMPLE_TRITANIUM_CHESTPLATE, MItems.PORTABLE_GRAVITATION_STABILIZER)
.add(MItems.TRITANIUM_PANTS, MItems.SIMPLE_TRITANIUM_PANTS)
.add(MItems.TRITANIUM_BOOTS, MItems.SIMPLE_TRITANIUM_BOOTS)
tagsProvider.items.Appender(ItemTags.DYEABLE).add(MItems.TRITANIUM_ARMOR)
tagsProvider.items.Appender(ItemTags.TRIMMABLE_ARMOR).add(MItems.SIMPLE_TRITANIUM_ARMOR)
tagsProvider.items.Appender(ItemTags.FREEZE_IMMUNE_WEARABLES).add(MItems.TRITANIUM_ARMOR)
tagsProvider.items.Appender(ItemTags.HEAD_ARMOR)
.add(MItems.TRITANIUM_HELMET)
.add(MItems.SIMPLE_TRITANIUM_HELMET)
tagsProvider.items.Appender(ItemTags.CHEST_ARMOR)
.add(MItems.TRITANIUM_CHESTPLATE)
.add(MItems.SIMPLE_TRITANIUM_CHESTPLATE)
tagsProvider.items.Appender(ItemTags.LEG_ARMOR)
.add(MItems.TRITANIUM_PANTS)
.add(MItems.SIMPLE_TRITANIUM_PANTS)
tagsProvider.items.Appender(ItemTags.FOOT_ARMOR)
.add(MItems.TRITANIUM_BOOTS)
.add(MItems.SIMPLE_TRITANIUM_BOOTS)
tagsProvider.items.Appender(ItemTags.SWORDS)
.add(MItems.TRITANIUM_SWORD)
.add(MItems.ENERGY_SWORD)
.add(MItems.FALLING_SUN)
.add(MItems.WITHERED_STEEL_SWORD)
tagsProvider.items.Appender(ItemTags.AXES).add(MItems.TRITANIUM_AXE)
tagsProvider.items.Appender(ItemTags.PICKAXES).add(MItems.TRITANIUM_PICKAXE)
tagsProvider.items.Appender(ItemTags.SHOVELS).add(MItems.TRITANIUM_SHOVEL)
tagsProvider.items.Appender(ItemTags.HOES).add(MItems.TRITANIUM_HOE)
tagsProvider.items.Appender(Tags.Items.TOOLS_SHEAR).add(MItems.TRITANIUM_SHEARS)
tagsProvider.items.Appender(Tags.Items.TOOLS_SHIELD).add(MItems.TRITANIUM_SHIELD)
tagsProvider.items.Appender(MItemTags.TOOLS_HAMMERS).add(MItems.EXPLOSIVE_HAMMER)
tagsProvider.items.forge("tools").add(MItemTags.TOOLS_HAMMERS)
tagsProvider.items.Appender(ItemTags.DURABILITY_ENCHANTABLE)
.add(MItems.EXPLOSIVE_HAMMER)
.add(MItems.TRITANIUM_SHEARS)
.add(MItems.TRITANIUM_SHIELD)
tagsProvider.items.Appender(ItemTags.MINING_ENCHANTABLE)
.add(MItems.TRITANIUM_SHEARS)
tagsProvider.items.Appender(ItemTags.EQUIPPABLE_ENCHANTABLE)
.add(MItems.PORTABLE_GRAVITATION_STABILIZER)
tagsProvider.items.Appender(ItemTags.VANISHING_ENCHANTABLE)
.add(MItems.PORTABLE_GRAVITATION_STABILIZER)
}

View File

@ -0,0 +1,152 @@
package ru.dbotthepony.mc.otm.datagen.tags
import net.minecraft.world.item.Tiers
import net.minecraft.world.level.block.Block
import ru.dbotthepony.mc.otm.registry.game.MBlocks
import ru.dbotthepony.mc.otm.registry.MRegistry
fun addMineableTags(tagsProvider: TagsProvider) {
tagsProvider.requiresPickaxe(
MBlocks.MATTER_CABLE,
MBlocks.STORAGE_CABLE
)
tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_DOOR.values, Tiers.IRON)
tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_TRAPDOOR.values, Tiers.IRON)
tagsProvider.requiresPickaxe(MBlocks.PAINTER, Tiers.STONE)
tagsProvider.requiresPickaxe(MBlocks.ENERGY_CABLES.values, Tiers.STONE)
tagsProvider.requiresPickaxe(MBlocks.GRILL.values, Tiers.STONE)
tagsProvider.requiresPickaxe(listOf<Block>(
*MBlocks.ANDROID_STATION.values.toTypedArray(),
*MBlocks.BATTERY_BANK.values.toTypedArray(),
*MBlocks.MATTER_DECOMPOSER.values.toTypedArray(),
*MBlocks.MATTER_CAPACITOR_BANK.values.toTypedArray(),
MBlocks.PATTERN_STORAGE,
*MBlocks.MATTER_SCANNER.values.toTypedArray(),
*MBlocks.MATTER_PANEL.values.toTypedArray(),
*MBlocks.MATTER_REPLICATOR.values.toTypedArray(),
*MBlocks.MATTER_BOTTLER.values.toTypedArray(),
*MBlocks.ENERGY_COUNTER.values.toTypedArray(),
*MBlocks.CHEMICAL_GENERATOR.values.toTypedArray(),
*MBlocks.PLATE_PRESS.values.toTypedArray(),
*MBlocks.TWIN_PLATE_PRESS.values.toTypedArray(),
*MBlocks.MATTER_RECYCLER.values.toTypedArray(),
MBlocks.MATTER_ENTANGLER,
*MBlocks.POWERED_FURNACE.values.toTypedArray(),
*MBlocks.POWERED_SMOKER.values.toTypedArray(),
*MBlocks.POWERED_BLAST_FURNACE.values.toTypedArray(),
MBlocks.STORAGE_BUS,
MBlocks.STORAGE_IMPORTER,
MBlocks.STORAGE_EXPORTER,
*MBlocks.DRIVE_VIEWER.values.toTypedArray(),
MBlocks.DRIVE_RACK,
*MBlocks.ITEM_MONITOR.values.toTypedArray(),
*MBlocks.STORAGE_POWER_SUPPLIER.values.toTypedArray(),
MBlocks.PHANTOM_ATTRACTOR,
*MBlocks.ENERGY_SERVO.values.toTypedArray(),
MBlocks.TRITANIUM_INGOT_BLOCK,
MBlocks.WITHERED_STEEL_BLOCK,
MBlocks.METAL_JUNK,
MBlocks.METAL_MESH,
MBlocks.TRITANIUM_BARS,
MBlocks.METAL_RAILING,
MBlocks.ENGINE,
MBlocks.HOLO_SIGN,
*MBlocks.COBBLESTONE_GENERATOR.values.toTypedArray(),
*MBlocks.ESSENCE_STORAGE.values.toTypedArray(),
*MBlocks.MATTER_RECONSTRUCTOR.values.toTypedArray(),
MBlocks.FLUID_TANK,
*MBlocks.ANDROID_CHARGER.values.toTypedArray(),
MBlocks.TRITANIUM_HULL,
MBlocks.BLACK_HOLE_GENERATOR,
MBlocks.MATTER_INJECTOR,
MBlocks.ANTIMATTER_INJECTOR,
MBlocks.HIGH_ENERGY_PARTICLE_COLLECTOR,
MBlocks.ITEM_INPUT_HATCH,
MBlocks.ITEM_OUTPUT_HATCH,
MBlocks.ENERGY_INPUT_HATCH,
MBlocks.ENERGY_OUTPUT_HATCH,
MBlocks.MATTER_INPUT_HATCH,
MBlocks.MATTER_OUTPUT_HATCH,
MBlocks.ENERGY_INPUT_INTERFACE,
MBlocks.ENERGY_OUTPUT_INTERFACE,
MBlocks.FLYWHEEL_SHAFT,
MBlocks.FLYWHEEL_BEARING,
MBlocks.FLYWHEEL_HOUSING,
MBlocks.FLYWHEEL_BATTERY,
MBlocks.GENERATOR_BLOCK,
MBlocks.MODULAR_FRAME,
MBlocks.HEAVY_MODULAR_FRAME,
MBlocks.REINFORCED_REDSTONE_LAMP,
MBlocks.REINFORCED_REDSTONE_LAMP_INVERTED,
), Tiers.IRON)
tagsProvider.requiresPickaxe(listOf(
MBlocks.DILITHIUM_ORE,
MBlocks.DEEPSLATE_DILITHIUM_ORE,
MBlocks.DILITHIUM_CRYSTAL_BLOCK,
MBlocks.ROFLITE_ALLOY_BLOCK,
MBlocks.GRAVITATION_STABILIZER,
MBlocks.GRAVITATION_STABILIZER_LENS,
), Tiers.DIAMOND)
tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_ANVIL.values.stream().flatMap { it.stream() }, Tiers.IRON)
tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_ORE, Tiers.IRON)
tagsProvider.requiresPickaxe(MBlocks.DEEPSLATE_TRITANIUM_ORE, Tiers.IRON)
tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_RAW_BLOCK, Tiers.IRON)
tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_STRIPED_BLOCK.values, Tiers.IRON)
tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_STRIPED_STAIRS.values, Tiers.IRON)
tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_STRIPED_WALL.values, Tiers.IRON)
tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_STRIPED_SLAB.values, Tiers.IRON)
tagsProvider.requiresPickaxe(MBlocks.CARBON_FIBRE_BLOCK, Tiers.IRON)
tagsProvider.requiresPickaxe(MBlocks.INFINITE_WATER_SOURCE, Tiers.STONE)
tagsProvider.requiresPickaxe(MRegistry.CARGO_CRATES.allBlocks.values, Tiers.IRON)
tagsProvider.requiresPickaxe(MRegistry.VENT.allBlocks.values, Tiers.IRON)
tagsProvider.requiresPickaxe(MRegistry.VENT_ALTERNATIVE.allBlocks.values, Tiers.IRON)
tagsProvider.requiresPickaxe(MRegistry.TRITANIUM_BLOCK.allBlocks.values, Tiers.IRON)
tagsProvider.requiresPickaxe(MRegistry.COMPUTER_TERMINAL.allBlocks.values, Tiers.STONE)
tagsProvider.requiresPickaxe(MRegistry.STAR_CHAIR.allBlocks.values, Tiers.STONE)
tagsProvider.requiresPickaxe(MRegistry.TRITANIUM_SLAB.allBlocks.values, Tiers.IRON)
tagsProvider.requiresPickaxe(MRegistry.TRITANIUM_WALL.allBlocks.values, Tiers.IRON)
tagsProvider.requiresPickaxe(MRegistry.TRITANIUM_PRESSURE_PLATE.allBlocks.values, Tiers.IRON)
tagsProvider.requiresPickaxe(MRegistry.TRITANIUM_STAIRS.allBlocks.values, Tiers.IRON)
tagsProvider.requiresPickaxe(MRegistry.TRITANIUM_STRIPED_BLOCK.flatBlocks, Tiers.IRON)
tagsProvider.requiresPickaxe(MRegistry.TRITANIUM_STRIPED_STAIRS.flatBlocks, Tiers.IRON)
tagsProvider.requiresPickaxe(MRegistry.TRITANIUM_STRIPED_WALL.flatBlocks, Tiers.IRON)
tagsProvider.requiresPickaxe(MRegistry.TRITANIUM_STRIPED_SLAB.flatBlocks, Tiers.IRON)
tagsProvider.requiresPickaxe(MRegistry.FLOOR_TILES.blocks.values)
tagsProvider.requiresPickaxe(MRegistry.FLOOR_TILES_STAIRS.blocks.values)
tagsProvider.requiresPickaxe(MRegistry.FLOOR_TILES_SLAB.blocks.values)
tagsProvider.requiresShovel(MRegistry.UNREFINED_FLOOR_TILES.blocks.values)
tagsProvider.requiresPickaxe(MRegistry.INDUSTRIAL_GLASS.allBlocks.values, Tiers.STONE)
tagsProvider.requiresPickaxe(MRegistry.INDUSTRIAL_GLASS_PANE.allBlocks.values, Tiers.STONE)
tagsProvider.requiresPickaxe(MRegistry.DECORATIVE_CRATE.allBlocks.values, Tiers.STONE)
tagsProvider.requiresPickaxe(MBlocks.LABORATORY_LAMP, Tiers.IRON)
tagsProvider.requiresPickaxe(MBlocks.LABORATORY_LAMP_INVERTED, Tiers.IRON)
tagsProvider.requiresPickaxe(MBlocks.METAL_BEAM, Tiers.IRON)
tagsProvider.requiresPickaxe(MBlocks.METAL_BEAM_CENTER, Tiers.IRON)
tagsProvider.requiresPickaxe(MBlocks.DANGER_STRIPE_BLOCK)
}

View File

@ -0,0 +1,61 @@
package ru.dbotthepony.mc.otm.datagen.tags
import ru.dbotthepony.mc.otm.registry.game.MBlocks
import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.game.MItems
fun addResourceTags(tagsProvider: TagsProvider) {
tagsProvider.circuits.add("basic", MItems.BASIC_CONTROL_CIRCUIT)
tagsProvider.circuits.add("advanced", MItems.ADVANCED_CONTROL_CIRCUIT)
tagsProvider.stoneOre("tritanium", MBlocks.TRITANIUM_ORE)
tagsProvider.stoneOre("dilithium", MBlocks.DILITHIUM_ORE)
tagsProvider.deepslateOre("tritanium", MBlocks.DEEPSLATE_TRITANIUM_ORE)
tagsProvider.deepslateOre("dilithium", MBlocks.DEEPSLATE_DILITHIUM_ORE)
tagsProvider.plates.add("tritanium", MItems.TRITANIUM_PLATE)
tagsProvider.plates.add("iron", MItems.IRON_PLATE)
tagsProvider.plates.add("gold", MItems.GOLD_PLATE)
tagsProvider.plates.add("carbon", MItems.CARBON_MESH)
tagsProvider.dusts.add("tritanium", MItems.TRITANIUM_DUST)
tagsProvider.ingots.add("tritanium", MItems.TRITANIUM_INGOT)
tagsProvider.ingots.add("withered_steel", MItems.WITHERED_STEEL)
tagsProvider.ingots.add("roflite_alloy", MItems.ROFLITE_ALLOY_INGOT)
tagsProvider.wires.add("copper", MItems.COPPER_WIRING)
tagsProvider.wires.add("gold", MItems.GOLD_WIRING)
tagsProvider.items.Appender(MItemTags.TRITANIUM_NUGGETS).add(MItems.TRITANIUM_NUGGET)
tagsProvider.items.Appender(MItemTags.NUGGETS).add(MItems.TRITANIUM_NUGGET)
tagsProvider.items.forge("reinforced_tritanium").add(MItems.REINFORCED_TRITANIUM_PLATE)
tagsProvider.storageBlocksAsItem.add("tritanium", MItems.TRITANIUM_INGOT_BLOCK)
tagsProvider.storageBlocksAsBlock.add("tritanium", MBlocks.TRITANIUM_INGOT_BLOCK)
tagsProvider.storageBlocksAsItem.add("withered_steel", MItems.WITHERED_STEEL_BLOCK)
tagsProvider.storageBlocksAsBlock.add("withered_steel", MBlocks.WITHERED_STEEL_BLOCK)
tagsProvider.storageBlocksAsItem.add("roflite_alloy", MItems.ROFLITE_ALLOY_BLOCK)
tagsProvider.storageBlocksAsBlock.add("roflite_alloy", MBlocks.ROFLITE_ALLOY_BLOCK)
tagsProvider.singleDropOre(
MBlocks.TRITANIUM_ORE,
MBlocks.DEEPSLATE_TRITANIUM_ORE
)
tagsProvider.denseDropOre(
MBlocks.DILITHIUM_ORE,
MBlocks.DEEPSLATE_DILITHIUM_ORE,
)
tagsProvider.clump("tritanium", MItems.TRITANIUM_ORE_CLUMP, MBlocks.TRITANIUM_RAW_BLOCK)
tagsProvider.gems.add(MItems.DILITHIUM_CRYSTAL)
tagsProvider.storageBlocksAsItem.add("dilithium", MItems.DILITHIUM_CRYSTAL_BLOCK)
tagsProvider.storageBlocksAsBlock.add("dilithium", MBlocks.DILITHIUM_CRYSTAL_BLOCK)
tagsProvider.items.forge("gems/dilithium").add(MItems.DILITHIUM_CRYSTAL)
}

View File

@ -0,0 +1,14 @@
package ru.dbotthepony.mc.otm.datagen.tags
import ru.dbotthepony.mc.otm.registry.MStructureTags
import ru.dbotthepony.mc.otm.registry.game.MStructures
fun addStructureTags(tagsProvider: TagsProvider) {
tagsProvider.structures.Appender(MStructureTags.LABORATORIES).add(MStructures.LABORATORY)
tagsProvider.structures.Appender(MStructureTags.FIELD_RESEARCH_PODS)
.add(MStructures.FIELD_RESEARCH_POD)
.add(MStructures.FIELD_RESEARCH_POD_RUIN)
tagsProvider.structures.Appender(MStructureTags.WRECKAGES).add(MStructures.WRECKAGE)
}

View File

@ -0,0 +1,68 @@
package ru.dbotthepony.mc.otm.datagen.tags
import net.minecraft.tags.ItemTags
import net.minecraft.world.entity.EntityType
import net.minecraft.world.item.Items
import ru.dbotthepony.mc.otm.registry.game.MItems
fun addSuspiciousTags(tagsProvider: TagsProvider) {
tagsProvider.entityTypes.Appender(MItems.SUSPICIOUS_FOODS.OWNED_MEAT_CONSUMERS)
.add(MItems.SUSPICIOUS_FOODS.MEAT_CONSUMERS)
tagsProvider.entityTypes.Appender(MItems.SUSPICIOUS_FOODS.OWNED_FISH_CONSUMERS)
.add(MItems.SUSPICIOUS_FOODS.FISH_CONSUMERS)
tagsProvider.entityTypes.Appender(MItems.SUSPICIOUS_FOODS.OWNED_COOKIE_CONSUMERS)
.add(MItems.SUSPICIOUS_FOODS.COOKIE_CONSUMERS)
tagsProvider.entityTypes.Appender(MItems.SUSPICIOUS_FOODS.OWNED_CARROT_CONSUMERS)
.add(MItems.SUSPICIOUS_FOODS.CARROT_CONSUMERS)
tagsProvider.entityTypes.Appender(MItems.SUSPICIOUS_FOODS.CARROT_CONSUMERS)
.add(EntityType.RABBIT)
tagsProvider.items.Appender(ItemTags.RABBIT_FOOD)
.add(MItems.SUSPICIOUS_FOODS.CARROT)
tagsProvider.items.Appender(ItemTags.WOLF_FOOD)
.add(MItems.SUSPICIOUS_FOODS.MUTTON)
.add(MItems.SUSPICIOUS_FOODS.CHICKEN)
.add(MItems.SUSPICIOUS_FOODS.BEEF)
.add(MItems.SUSPICIOUS_FOODS.RABBIT)
.add(MItems.SUSPICIOUS_FOODS.PORKCHOP)
.add(MItems.SUSPICIOUS_FOODS.COOKED_MUTTON)
.add(MItems.SUSPICIOUS_FOODS.COOKED_BEEF)
.add(MItems.SUSPICIOUS_FOODS.COOKED_CHICKEN)
.add(MItems.SUSPICIOUS_FOODS.COOKED_RABBIT)
.add(MItems.SUSPICIOUS_FOODS.COOKED_PORKCHOP)
.add(MItems.SUSPICIOUS_FOODS.ROTTEN_FLESH)
tagsProvider.entityTypes.Appender(MItems.SUSPICIOUS_FOODS.MEAT_CONSUMERS)
.add(EntityType.WOLF)
tagsProvider.entityTypes.Appender(MItems.SUSPICIOUS_FOODS.FISH_CONSUMERS)
.add(EntityType.OCELOT)
.add(EntityType.CAT)
tagsProvider.entityTypes.Appender(MItems.SUSPICIOUS_FOODS.COOKIE_CONSUMERS)
.add(EntityType.PARROT)
// Cats easily can eat cooked food and a lot of cats even PREFER to eat fish cooked,
// literally begging for fish when they smell it being cooked (and ignoring it while it lays raw)
// What mojang were thinking?
tagsProvider.items.Appender(ItemTags.OCELOT_FOOD)
.add(Items.COOKED_COD)
.add(Items.COOKED_SALMON)
.add(MItems.SUSPICIOUS_FOODS.COD)
.add(MItems.SUSPICIOUS_FOODS.COOKED_COD)
.add(MItems.SUSPICIOUS_FOODS.SALMON)
.add(MItems.SUSPICIOUS_FOODS.COOKED_SALMON)
tagsProvider.items.Appender(ItemTags.CAT_FOOD)
.add(Items.COOKED_COD)
.add(Items.COOKED_SALMON)
.add(MItems.SUSPICIOUS_FOODS.COD)
.add(MItems.SUSPICIOUS_FOODS.COOKED_COD)
.add(MItems.SUSPICIOUS_FOODS.SALMON)
.add(MItems.SUSPICIOUS_FOODS.COOKED_SALMON)
}

View File

@ -4,227 +4,67 @@ import net.minecraft.tags.BlockTags
import net.minecraft.tags.ItemTags import net.minecraft.tags.ItemTags
import net.minecraft.world.effect.MobEffects import net.minecraft.world.effect.MobEffects
import net.minecraft.world.item.Items import net.minecraft.world.item.Items
import net.minecraft.world.item.Tiers import net.neoforged.neoforge.common.Tags
import net.minecraft.world.level.block.Blocks import ru.dbotthepony.kommons.collect.flatMap
import ru.dbotthepony.mc.otm.util.ResourceLocation
import ru.dbotthepony.mc.otm.registry.MBlockTags import ru.dbotthepony.mc.otm.registry.MBlockTags
import ru.dbotthepony.mc.otm.registry.MBlocks import ru.dbotthepony.mc.otm.registry.game.MBlocks
import ru.dbotthepony.mc.otm.registry.game.MFluids
import ru.dbotthepony.mc.otm.registry.MItemTags import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.MItems import ru.dbotthepony.mc.otm.registry.game.MItems
import ru.dbotthepony.mc.otm.registry.MRegistry import ru.dbotthepony.mc.otm.registry.MRegistry
fun addTags(tagsProvider: TagsProvider) { fun addTags(tagsProvider: TagsProvider) {
tagsProvider.items.forge("pistons").add(Items.PISTON) tagsProvider.items.forge("pistons").add(Items.PISTON)
tagsProvider.circuits.add("basic", MItems.BASIC_CONTROL_CIRCUIT)
tagsProvider.circuits.add("advanced", MItems.ADVANCED_CONTROL_CIRCUIT)
tagsProvider.dusts.add("tritanium", MItems.TRITANIUM_DUST) tagsProvider.items.Appender(ItemTags.BEACON_PAYMENT_ITEMS)
tagsProvider.ingots.add("tritanium", MItems.TRITANIUM_INGOT) .add(MItems.TRITANIUM_INGOT)
.add(MItems.DILITHIUM_CRYSTAL)
.add(MItems.WITHERED_STEEL)
.add(MItems.ROFLITE_ALLOY_INGOT)
tagsProvider.plates.add("tritanium", MItems.TRITANIUM_PLATE) tagsProvider.items.Appender(ItemTags.MEAT).add(MItems.NUTRIENT_PASTE)
tagsProvider.plates.add("iron", MItems.IRON_PLATE)
tagsProvider.plates.add("gold", MItems.GOLD_PLATE)
tagsProvider.plates.add("carbon", MItems.CARBON_MESH)
tagsProvider.items.forge("reinforced_tritanium").add(MItems.REINFORCED_TRITANIUM_PLATE) tagsProvider.fluids.forge("experience").add(MFluids.LIQUID_XP).add(MFluids.LIQUID_XP_FLOWING)
tagsProvider.fluidTypes.forge("experience").add(MFluids.LIQUID_XP_TYPE)
tagsProvider.storageBlocksAsItem.add("tritanium", MItems.TRITANIUM_INGOT_BLOCK) tagsProvider.items.Appender(MItemTags.CRAFTING_TABLES)
tagsProvider.storageBlocksAsBlock.add("tritanium", MBlocks.TRITANIUM_INGOT_BLOCK) .add(MItemTags.WORKBENCHES)
.add(MItemTags.WORKBENCH)
tagsProvider.stoneOre("tritanium", MBlocks.TRITANIUM_ORE) tagsProvider.blocks.Appender(MBlockTags.CRAFTING_TABLES)
tagsProvider.deepslateOre("tritanium", MBlocks.DEEPSLATE_TRITANIUM_ORE) .add(MBlockTags.WORKBENCHES)
tagsProvider.singleDropOre( .add(MBlockTags.WORKBENCH)
MBlocks.TRITANIUM_ORE,
MBlocks.DEEPSLATE_TRITANIUM_ORE
)
tagsProvider.clump("tritanium", MItems.TRITANIUM_ORE_CLUMP, MBlocks.TRITANIUM_RAW_BLOCK)
tagsProvider.wires.add("copper", MItems.COPPER_WIRING)
tagsProvider.wires.add("gold", MItems.GOLD_WIRING)
tagsProvider.requiresPickaxe(
MBlocks.MATTER_CABLE,
MBlocks.STORAGE_CABLE
)
tagsProvider.items.Appender(MItemTags.CRAFTING_TABLES).add(Items.CRAFTING_TABLE)
tagsProvider.blocks.Appender(MBlockTags.CRAFTING_TABLES).add(Blocks.CRAFTING_TABLE)
tagsProvider.items.Appender(MItemTags.MINECART_CARGO_CRATES).add(MItems.CARGO_CRATE_MINECARTS.values) tagsProvider.items.Appender(MItemTags.MINECART_CARGO_CRATES).add(MItems.CARGO_CRATE_MINECARTS.values)
tagsProvider.items.forge("hardened_glass").add(MRegistry.INDUSTRIAL_GLASS.allItems.values) tagsProvider.blocks.Appender(BlockTags.ANVIL).add(MBlocks.TRITANIUM_ANVIL.values.stream().flatMap { it.stream() })
tagsProvider.items.forge("hardened_glass/colorless").add(MRegistry.INDUSTRIAL_GLASS.item) tagsProvider.items.Appender(ItemTags.ANVIL).add(MItems.TRITANIUM_ANVIL.values.stream().flatMap { it.stream() })
tagsProvider.items.forge("hardened_glass/tinted").add(MRegistry.INDUSTRIAL_GLASS.items.values)
tagsProvider.items.forge("hardened_glass_panes").add(MRegistry.INDUSTRIAL_GLASS_PANE.allItems.values) tagsProvider.items.Appender(MItemTags.UPGRADES)
tagsProvider.items.forge("hardened_glass_panes/colorless").add(MRegistry.INDUSTRIAL_GLASS_PANE.item) .add(MItems.MachineUpgrades.Basic.LIST)
tagsProvider.items.forge("hardened_glass_panes/tinted").add(MRegistry.INDUSTRIAL_GLASS_PANE.items.values) .add(MItems.MachineUpgrades.Normal.LIST)
.add(MItems.MachineUpgrades.Advanced.LIST)
.add(MItems.MachineUpgrades.Creative.LIST)
MRegistry.INDUSTRIAL_GLASS.forEachItem { s, _, item -> tagsProvider.items.forge("hardened_glass/$s").add(item) } tagsProvider.items.Appender(MItemTags.NO_REPLICATION)
MRegistry.INDUSTRIAL_GLASS_PANE.forEachItem { s, _, item -> tagsProvider.items.forge("hardened_glass_panes/$s").add(item) } .add(MItemTags.DILITHIUM_GEMS)
.add(MItemTags.DILITHIUM_ORES)
tagsProvider.blocks.forge("hardened_glass").add(MRegistry.INDUSTRIAL_GLASS.allBlocks.values) .add(Items.WRITTEN_BOOK)
tagsProvider.blocks.forge("hardened_glass/colorless").add(MRegistry.INDUSTRIAL_GLASS.block) .add(Tags.Items.ORES)
tagsProvider.blocks.forge("hardened_glass/tinted").add(MRegistry.INDUSTRIAL_GLASS.blocks.values) .add(Tags.Items.RAW_MATERIALS)
.add(MItems.PILL_ANDROID)
tagsProvider.blocks.forge("hardened_glass_panes").add(MRegistry.INDUSTRIAL_GLASS_PANE.allBlocks.values) .add(MItems.PILL_HUMANE)
tagsProvider.blocks.forge("hardened_glass_panes/colorless").add(MRegistry.INDUSTRIAL_GLASS_PANE.block) .add(MItems.PILL_OBLIVION)
tagsProvider.blocks.forge("hardened_glass_panes/tinted").add(MRegistry.INDUSTRIAL_GLASS_PANE.blocks.values) .add(MItems.QUANTUM_BATTERY)
.add(MItems.QUANTUM_CAPACITOR)
MRegistry.INDUSTRIAL_GLASS.forEachBlock { s, _, block -> tagsProvider.blocks.forge("hardened_glass/$s").add(block) } .add(MItems.QUANTUM_BATTERY_CREATIVE)
MRegistry.INDUSTRIAL_GLASS_PANE.forEachBlock { s, _, block -> tagsProvider.blocks.forge("hardened_glass_panes/$s").add(block) } .add(MItems.ZPM_BATTERY)
.add(MItems.PROCEDURAL_BATTERY)
tagsProvider.items.Appender(MItemTags.INDUSTRIAL_GLASS).add(MRegistry.INDUSTRIAL_GLASS.allItems.values) .add(MItems.EXOPACK_PROBE)
tagsProvider.blocks.Appender(MBlockTags.INDUSTRIAL_GLASS).add(MRegistry.INDUSTRIAL_GLASS.allBlocks.values) .add(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL)
tagsProvider.blocks.Appender(MBlockTags.CARGO_CRATES).add(MRegistry.CARGO_CRATES.allBlocks.values) .add(MItems.ExopackUpgrades.INVENTORY_UPGRADE_WITHER)
.add(MItems.ExopackUpgrades.INVENTORY_UPGRADE_ENDER_DRAGON)
tagsProvider.items.Appender(ItemTags.DOORS).add(MItems.TRITANIUM_DOOR.values)
tagsProvider.blocks.Appender(BlockTags.DOORS).add(MBlocks.TRITANIUM_DOOR.values)
tagsProvider.items.Appender(ItemTags.TRAPDOORS).add(MItems.TRITANIUM_TRAPDOOR.values)
tagsProvider.blocks.Appender(BlockTags.TRAPDOORS).add(MBlocks.TRITANIUM_TRAPDOOR.values)
tagsProvider.blocks.Appender(BlockTags.PRESSURE_PLATES).add(MRegistry.TRITANIUM_PRESSURE_PLATE.allBlocks.values)
tagsProvider.items.Appender(MItemTags.MACHINES).add(MItems.MACHINES)
tagsProvider.blocks.Appender(MBlockTags.MACHINES).add(MItems.MACHINES.stream().map { it!!.block })
tagsProvider.blocks.Appender(BlockTags.ANVIL).add(MBlocks.TRITANIUM_ANVIL)
tagsProvider.items.Appender(MItemTags.TRITANIUM_NUGGETS).add(MItems.TRITANIUM_NUGGET)
tagsProvider.items.Appender(MItemTags.NUGGETS).add(MItems.TRITANIUM_NUGGET)
tagsProvider.items.forge("armors")
.add("helmets", MItems.TRITANIUM_HELMET)
.add("chestplates", MItems.TRITANIUM_CHESTPLATE)
.add("leggings", MItems.TRITANIUM_PANTS)
.add("boots", MItems.TRITANIUM_BOOTS)
.add("helmets", MItems.SIMPLE_TRITANIUM_HELMET)
.add("chestplates", MItems.SIMPLE_TRITANIUM_CHESTPLATE)
.add("leggings", MItems.SIMPLE_TRITANIUM_PANTS)
.add("boots", MItems.SIMPLE_TRITANIUM_BOOTS)
tagsProvider.items.minecraft("swords").add(MItems.TRITANIUM_SWORD)
tagsProvider.items.minecraft("axes").add(MItems.TRITANIUM_AXE)
tagsProvider.items.minecraft("pickaxes").add(MItems.TRITANIUM_PICKAXE)
tagsProvider.items.minecraft("shovels").add(MItems.TRITANIUM_SHOVEL)
tagsProvider.items.minecraft("hoes").add(MItems.TRITANIUM_HOE)
tagsProvider.items.forge("shears").add(MItems.TRITANIUM_SHEARS)
tagsProvider.items.forge("shields").add(MItems.TRITANIUM_SHIELD)
tagsProvider.blocks.Appender(BlockTags.STAIRS)
.add(MRegistry.FLOOR_TILES_STAIRS.blocks.values)
.add(MRegistry.TRITANIUM_STAIRS.allBlocks.values)
.add(MRegistry.TRITANIUM_STRIPED_STAIRS.flatBlocks)
.add(MBlocks.TRITANIUM_STRIPED_STAIRS)
tagsProvider.blocks.Appender(BlockTags.SLABS)
.add(MRegistry.TRITANIUM_SLAB.allBlocks.values)
.add(MRegistry.TRITANIUM_STRIPED_SLAB.flatBlocks)
.add(MRegistry.FLOOR_TILES_SLAB.blocks.values)
.add(MBlocks.TRITANIUM_STRIPED_SLAB)
tagsProvider.blocks.Appender(BlockTags.WALLS)
.add(MRegistry.TRITANIUM_WALL.allBlocks.values)
.add(MRegistry.TRITANIUM_STRIPED_WALL.flatBlocks)
.add(MBlocks.TRITANIUM_STRIPED_WALL)
tagsProvider.items.Appender(ItemTags.SLABS)
.add(MRegistry.TRITANIUM_SLAB.allItems.values)
.add(MRegistry.TRITANIUM_STRIPED_SLAB.flatItems)
.add(MRegistry.FLOOR_TILES_SLAB.items.values)
.add(MItems.TRITANIUM_STRIPED_SLAB)
tagsProvider.items.Appender(ItemTags.WALLS)
.add(MRegistry.TRITANIUM_WALL.allItems.values)
.add(MRegistry.TRITANIUM_STRIPED_WALL.flatItems)
.add(MItems.TRITANIUM_STRIPED_WALL)
tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_DOOR.values, Tiers.IRON)
tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_TRAPDOOR.values, Tiers.IRON)
tagsProvider.requiresPickaxe(listOf(
MBlocks.ANDROID_STATION,
MBlocks.BATTERY_BANK,
MBlocks.MATTER_DECOMPOSER,
MBlocks.MATTER_CAPACITOR_BANK,
MBlocks.PATTERN_STORAGE,
MBlocks.MATTER_SCANNER,
MBlocks.MATTER_PANEL,
MBlocks.MATTER_REPLICATOR,
MBlocks.MATTER_BOTTLER,
MBlocks.ENERGY_COUNTER,
MBlocks.CHEMICAL_GENERATOR,
MBlocks.PLATE_PRESS,
MBlocks.MATTER_RECYCLER,
MBlocks.STORAGE_BUS,
MBlocks.STORAGE_IMPORTER,
MBlocks.STORAGE_EXPORTER,
MBlocks.DRIVE_VIEWER,
MBlocks.DRIVE_RACK,
MBlocks.ITEM_MONITOR,
MBlocks.STORAGE_POWER_SUPPLIER,
MBlocks.PHANTOM_ATTRACTOR,
MBlocks.ENERGY_SERVO,
MBlocks.TRITANIUM_INGOT_BLOCK,
MBlocks.TRITANIUM_BARS,
MBlocks.ENGINE,
MBlocks.HOLO_SIGN,
MBlocks.COBBLESTONE_GENERATOR,
MBlocks.ESSENCE_STORAGE,
MBlocks.MATTER_RECONSTRUCTOR,
MBlocks.FLUID_TANK,
), Tiers.IRON)
tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_ANVIL, Tiers.IRON)
tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_ORE, Tiers.IRON)
tagsProvider.requiresPickaxe(MBlocks.DEEPSLATE_TRITANIUM_ORE, Tiers.IRON)
tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_RAW_BLOCK, Tiers.IRON)
tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_STRIPED_BLOCK, Tiers.IRON)
tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_STRIPED_STAIRS, Tiers.IRON)
tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_STRIPED_WALL, Tiers.IRON)
tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_STRIPED_SLAB, Tiers.IRON)
tagsProvider.requiresPickaxe(MBlocks.CARBON_FIBRE_BLOCK, Tiers.IRON)
tagsProvider.requiresPickaxe(MRegistry.CARGO_CRATES.allBlocks.values, Tiers.IRON)
tagsProvider.requiresPickaxe(MRegistry.VENT.allBlocks.values, Tiers.IRON)
tagsProvider.requiresPickaxe(MRegistry.VENT_ALTERNATIVE.allBlocks.values, Tiers.IRON)
tagsProvider.requiresPickaxe(MRegistry.TRITANIUM_BLOCK.allBlocks.values, Tiers.IRON)
tagsProvider.requiresPickaxe(MRegistry.TRITANIUM_SLAB.allBlocks.values, Tiers.IRON)
tagsProvider.requiresPickaxe(MRegistry.TRITANIUM_WALL.allBlocks.values, Tiers.IRON)
tagsProvider.requiresPickaxe(MRegistry.TRITANIUM_PRESSURE_PLATE.allBlocks.values, Tiers.IRON)
tagsProvider.requiresPickaxe(MRegistry.TRITANIUM_STAIRS.allBlocks.values, Tiers.IRON)
tagsProvider.requiresPickaxe(MRegistry.TRITANIUM_STRIPED_BLOCK.flatBlocks, Tiers.IRON)
tagsProvider.requiresPickaxe(MRegistry.TRITANIUM_STRIPED_STAIRS.flatBlocks, Tiers.IRON)
tagsProvider.requiresPickaxe(MRegistry.TRITANIUM_STRIPED_WALL.flatBlocks, Tiers.IRON)
tagsProvider.requiresPickaxe(MRegistry.TRITANIUM_STRIPED_SLAB.flatBlocks, Tiers.IRON)
tagsProvider.requiresPickaxe(MRegistry.FLOOR_TILES.blocks.values)
tagsProvider.requiresPickaxe(MRegistry.FLOOR_TILES_STAIRS.blocks.values)
tagsProvider.requiresPickaxe(MRegistry.FLOOR_TILES_SLAB.blocks.values)
tagsProvider.requiresShovel(MRegistry.UNREFINED_FLOOR_TILES.blocks.values)
tagsProvider.requiresPickaxe(MRegistry.INDUSTRIAL_GLASS.allBlocks.values, Tiers.STONE)
tagsProvider.requiresPickaxe(MRegistry.INDUSTRIAL_GLASS_PANE.allBlocks.values, Tiers.STONE)
tagsProvider.requiresPickaxe(MRegistry.DECORATIVE_CRATE.allBlocks.values, Tiers.STONE)
tagsProvider.requiresPickaxe(MBlocks.LABORATORY_LAMP, Tiers.IRON)
tagsProvider.requiresPickaxe(MBlocks.LABORATORY_LAMP_INVERTED, Tiers.IRON)
tagsProvider.requiresPickaxe(MBlocks.METAL_BEAM, Tiers.IRON)
tagsProvider.requiresPickaxe(MBlocks.DANGER_STRIPE_BLOCK)
tagsProvider.requiresPickaxe(listOf(
MBlocks.GRAVITATION_STABILIZER,
MBlocks.GRAVITATION_STABILIZER_LENS,
), Tiers.DIAMOND)
tagsProvider.dragonImmune.add( tagsProvider.dragonImmune.add(
MBlocks.BLACK_HOLE, MBlocks.BLACK_HOLE,
@ -236,6 +76,12 @@ fun addTags(tagsProvider: TagsProvider) {
MBlocks.BLACK_HOLE, MBlocks.BLACK_HOLE,
) )
tagsProvider.guardedByPiglins.add(
MBlockTags.CARGO_CRATES,
)
tagsProvider.impermeable.add(MRegistry.INDUSTRIAL_GLASS.allBlocks.values)
tagsProvider.androidImmuneEffects.add( tagsProvider.androidImmuneEffects.add(
MobEffects.CONDUIT_POWER, MobEffects.CONDUIT_POWER,
MobEffects.HEAL, MobEffects.HEAL,
@ -252,4 +98,9 @@ fun addTags(tagsProvider: TagsProvider) {
MobEffects.DOLPHINS_GRACE, MobEffects.DOLPHINS_GRACE,
MobEffects.CONFUSION, MobEffects.CONFUSION,
) )
tagsProvider.androidImmuneEffects.add(
ResourceLocation("rats", "plague"),
ResourceLocation("rats", "synesthesia"),
)
} }

View File

@ -1,6 +1,7 @@
package ru.dbotthepony.mc.otm.datagen.tags package ru.dbotthepony.mc.otm.datagen.tags
import it.unimi.dsi.fastutil.objects.ObjectArraySet import it.unimi.dsi.fastutil.objects.ObjectArraySet
import net.minecraft.core.Holder
import net.minecraft.core.HolderLookup import net.minecraft.core.HolderLookup
import net.minecraft.core.Registry import net.minecraft.core.Registry
import net.minecraft.core.registries.BuiltInRegistries import net.minecraft.core.registries.BuiltInRegistries
@ -10,15 +11,18 @@ import net.minecraft.resources.ResourceLocation
import net.minecraft.tags.BlockTags import net.minecraft.tags.BlockTags
import net.minecraft.tags.GameEventTags import net.minecraft.tags.GameEventTags
import net.minecraft.tags.TagKey import net.minecraft.tags.TagKey
import net.minecraft.world.item.DyeColor
import net.minecraft.world.item.Item import net.minecraft.world.item.Item
import net.minecraft.world.item.Tier import net.minecraft.world.item.Tier
import net.minecraft.world.item.Tiers import net.minecraft.world.item.Tiers
import net.minecraft.world.level.block.Block import net.minecraft.world.level.block.Block
import net.minecraftforge.data.event.GatherDataEvent import net.neoforged.neoforge.common.Tags
import net.minecraftforge.registries.ForgeRegistries import net.neoforged.neoforge.data.event.GatherDataEvent
import net.minecraftforge.registries.IForgeRegistry import net.neoforged.neoforge.registries.NeoForgeRegistries
import ru.dbotthepony.mc.otm.capability.MatteryPlayerCapability import ru.dbotthepony.mc.otm.player.MatteryPlayer
import ru.dbotthepony.mc.otm.util.ResourceLocation
import ru.dbotthepony.mc.otm.datagen.DataGen import ru.dbotthepony.mc.otm.datagen.DataGen
import java.util.EnumMap
import java.util.stream.Stream import java.util.stream.Stream
import net.minecraft.data.tags.TagsProvider as MinecraftTagsProvider import net.minecraft.data.tags.TagsProvider as MinecraftTagsProvider
@ -29,7 +33,7 @@ private fun <T : Any> vanillaLookup(key: ResourceKey<Registry<T>>): (T) -> Resou
class TagsProvider(private val event: GatherDataEvent) { class TagsProvider(private val event: GatherDataEvent) {
inner class Delegate<T : Any> private constructor(key: ResourceKey<Registry<T>>, val lookup: (T) -> ResourceLocation) : MinecraftTagsProvider<T>(event.generator.packOutput, key, event.lookupProvider, DataGen.MOD_ID, event.existingFileHelper) { inner class Delegate<T : Any> private constructor(key: ResourceKey<Registry<T>>, val lookup: (T) -> ResourceLocation) : MinecraftTagsProvider<T>(event.generator.packOutput, key, event.lookupProvider, DataGen.MOD_ID, event.existingFileHelper) {
constructor(registry: IForgeRegistry<T>) : this(registry.registryKey, { registry.getKey(it) ?: throw NoSuchElementException("Registry $registry does not contain $it") }) constructor(registry: Registry<T>) : this(registry.key() as ResourceKey<Registry<T>>, { registry.getKey(it) ?: throw NoSuchElementException("$it is not registered in $registry") })
constructor(key: ResourceKey<Registry<T>>) : this(key, vanillaLookup(key)) constructor(key: ResourceKey<Registry<T>>) : this(key, vanillaLookup(key))
init { init {
@ -91,6 +95,11 @@ class TagsProvider(private val event: GatherDataEvent) {
return this return this
} }
fun add(vararg values: Holder<T>): Appender {
for (value in values) add(value.key ?: throw IllegalArgumentException("Intrusive holder"))
return this
}
fun add(vararg values: TagKey<T>): Appender { fun add(vararg values: TagKey<T>): Appender {
for (value in values) add(value) for (value in values) add(value)
return this return this
@ -106,6 +115,11 @@ class TagsProvider(private val event: GatherDataEvent) {
return this return this
} }
fun add(values: Iterator<T>): Appender {
values.forEach { add(it) }
return this
}
fun leaf(name: String) = Appender(TagKey.create(tag.registry, ResourceLocation(tag.location.namespace, tag.location.path + "/$name"))) fun leaf(name: String) = Appender(TagKey.create(tag.registry, ResourceLocation(tag.location.namespace, tag.location.path + "/$name")))
fun add(leaf: String, value: T) = also { leaf(leaf).add(value) } fun add(leaf: String, value: T) = also { leaf(leaf).add(value) }
@ -119,7 +133,7 @@ class TagsProvider(private val event: GatherDataEvent) {
fun add(leaf: String, vararg value: ResourceLocation) = also { leaf(leaf).add(*value) } fun add(leaf: String, vararg value: ResourceLocation) = also { leaf(leaf).add(*value) }
} }
fun forge(path: String) = Appender(ResourceLocation("forge", path)) fun forge(path: String) = Appender(ResourceLocation("c", path))
fun minecraft(path: String) = Appender(ResourceLocation("minecraft", path)) fun minecraft(path: String) = Appender(ResourceLocation("minecraft", path))
override fun addTags(provider: HolderLookup.Provider) { override fun addTags(provider: HolderLookup.Provider) {
@ -143,7 +157,7 @@ class TagsProvider(private val event: GatherDataEvent) {
val appender = tag(tag) val appender = tag(tag)
for (value in values) { for (value in values) {
appender.addTag(value) appender.addOptionalTag(value)
} }
} }
} }
@ -164,12 +178,32 @@ class TagsProvider(private val event: GatherDataEvent) {
} }
} }
val blocks = Delegate(ForgeRegistries.BLOCKS) val blocks = Delegate(BuiltInRegistries.BLOCK)
val items = Delegate(ForgeRegistries.ITEMS) val items = Delegate(BuiltInRegistries.ITEM)
val mobEffects = Delegate(ForgeRegistries.MOB_EFFECTS) val fluids = Delegate(BuiltInRegistries.FLUID)
val fluidTypes = Delegate(NeoForgeRegistries.Keys.FLUID_TYPES)
val mobEffects = Delegate(BuiltInRegistries.MOB_EFFECT)
val entityTypes = Delegate(BuiltInRegistries.ENTITY_TYPE)
val damageTypes = Delegate(Registries.DAMAGE_TYPE) val damageTypes = Delegate(Registries.DAMAGE_TYPE)
val structures = Delegate(Registries.STRUCTURE)
val androidImmuneEffects = mobEffects.Appender(MatteryPlayerCapability.ANDROID_IMMUNE_EFFECTS) private val coloredItems = EnumMap<DyeColor, Delegate<Item>.Appender>(DyeColor::class.java)
init {
DyeColor.entries.forEach {
coloredItems[it] = items.Appender(it.dyedTag)
}
}
fun addToDyeTags(values: Map<out DyeColor?, Item>) {
for ((c, it) in values) {
if (c != null) {
coloredItems[c]!!.add(it)
}
}
}
val androidImmuneEffects = mobEffects.Appender(MatteryPlayer.ANDROID_IMMUNE_EFFECTS)
val requiresShovel = blocks.Appender(BlockTags.MINEABLE_WITH_SHOVEL) val requiresShovel = blocks.Appender(BlockTags.MINEABLE_WITH_SHOVEL)
val requiresAxe = blocks.Appender(BlockTags.MINEABLE_WITH_AXE) val requiresAxe = blocks.Appender(BlockTags.MINEABLE_WITH_AXE)
@ -182,6 +216,8 @@ class TagsProvider(private val event: GatherDataEvent) {
val witherImmune = blocks.Appender(BlockTags.WITHER_IMMUNE) val witherImmune = blocks.Appender(BlockTags.WITHER_IMMUNE)
val dragonImmune = blocks.Appender(BlockTags.DRAGON_IMMUNE) val dragonImmune = blocks.Appender(BlockTags.DRAGON_IMMUNE)
val guardedByPiglins = blocks.Appender(BlockTags.GUARDED_BY_PIGLINS)
val impermeable = blocks.Appender(BlockTags.IMPERMEABLE)
fun stoneOre(key: String, block: Block): TagsProvider { fun stoneOre(key: String, block: Block): TagsProvider {
ore(key, block) ore(key, block)
@ -210,8 +246,17 @@ class TagsProvider(private val event: GatherDataEvent) {
return this return this
} }
fun denseDropOre(vararg blocks: Block): TagsProvider {
for (block in blocks) {
itemOreRatesSingular.add(block.asItem())
blockOreRatesSingular.add(block)
}
return this
}
fun ore(key: String, block: Block): TagsProvider { fun ore(key: String, block: Block): TagsProvider {
val forgeKey = ResourceLocation("forge", "ores/$key") val forgeKey = ResourceLocation("c", "ores/$key")
val b = TagKey.create(Registries.BLOCK, forgeKey) val b = TagKey.create(Registries.BLOCK, forgeKey)
val i = TagKey.create(Registries.ITEM, forgeKey) val i = TagKey.create(Registries.ITEM, forgeKey)
@ -243,29 +288,30 @@ class TagsProvider(private val event: GatherDataEvent) {
} }
val circuits = items.forge("circuits") val circuits = items.forge("circuits")
val dusts = items.forge("dusts") val dusts = items.Appender(Tags.Items.DUSTS)
val ingots = items.forge("ingots") val ingots = items.Appender(Tags.Items.INGOTS)
val itemOres = items.forge("ores") val itemOres = items.Appender(Tags.Items.ORES)
val blockOres = blocks.forge("ores") val gems = items.Appender(Tags.Items.GEMS)
val blockOres = blocks.Appender(Tags.Blocks.ORES)
val plates = items.forge("plates") val plates = items.forge("plates")
val storageBlocksAsItem = items.forge("storage_blocks") val storageBlocksAsItem = items.Appender(Tags.Items.STORAGE_BLOCKS)
val storageBlocksAsBlock = blocks.forge("storage_blocks") val storageBlocksAsBlock = blocks.Appender(Tags.Blocks.STORAGE_BLOCKS)
val rawMaterials = items.forge("raw_materials") val rawMaterials = items.Appender(Tags.Items.RAW_MATERIALS)
val wires = items.forge("wires") val wires = items.forge("wires")
val blockGroundOresStone = blocks.forge("ores_in_ground/stone") val blockGroundOresStone = blocks.Appender(Tags.Blocks.ORES_IN_GROUND_STONE)
val blockGroundOresDeepslate = blocks.forge("ores_in_ground/deepslate") val blockGroundOresDeepslate = blocks.Appender(Tags.Blocks.ORES_IN_GROUND_DEEPSLATE)
// val blockGroundOresNetherrack = blocks.forge("ores_in_ground/netherrack") // val blockGroundOresNetherrack = blocks.forge("ores_in_ground/netherrack")
val itemGroundOresStone = items.forge("ores_in_ground/stone") val itemGroundOresStone = items.Appender(Tags.Items.ORES_IN_GROUND_STONE)
val itemGroundOresDeepslate = items.forge("ores_in_ground/deepslate") val itemGroundOresDeepslate = items.Appender(Tags.Items.ORES_IN_GROUND_DEEPSLATE)
// val itemGroundOresNetherrack = items.forge("ores_in_ground/netherrack") // val itemGroundOresNetherrack = items.forge("ores_in_ground/netherrack")
// val blockOreRatesSparse = blocks.forge("ore_rates/sparse") // val blockOreRatesSparse = blocks.forge("ore_rates/sparse")
val blockOreRatesSingular = blocks.forge("ore_rates/singular") val blockOreRatesSingular = blocks.Appender(Tags.Blocks.ORE_RATES_SINGULAR)
// val blockOreRatesDense = blocks.forge("ore_rates/dense") val blockOreRatesDense = blocks.forge("ore_rates/dense")
// val itemOreRatesSparse = items.forge("ore_rates/sparse") // val itemOreRatesSparse = items.forge("ore_rates/sparse")
val itemOreRatesSingular = items.forge("ore_rates/singular") val itemOreRatesSingular = items.Appender(Tags.Items.ORE_RATES_SINGULAR)
// val itemOreRatesDense = items.forge("ore_rates/dense") val itemOreRatesDense = items.forge("ore_rates/dense")
val gameEvents = Delegate(Registries.GAME_EVENT) val gameEvents = Delegate(Registries.GAME_EVENT)
val vibrations = gameEvents.Appender(GameEventTags.VIBRATIONS) val vibrations = gameEvents.Appender(GameEventTags.VIBRATIONS)
@ -287,6 +333,16 @@ class TagsProvider(private val event: GatherDataEvent) {
return this return this
} }
fun requiresPickaxe(blocks: Stream<Block>, tier: Tier? = null): TagsProvider {
for (block in blocks) requiresPickaxe(block, tier)
return this
}
fun requiresPickaxe(blocks: Iterator<Block>, tier: Tier? = null): TagsProvider {
for (block in blocks) requiresPickaxe(block, tier)
return this
}
fun requiresPickaxe(vararg blocks: Block, tier: Tier? = null): TagsProvider { fun requiresPickaxe(vararg blocks: Block, tier: Tier? = null): TagsProvider {
for (block in blocks) requiresPickaxe(block, tier) for (block in blocks) requiresPickaxe(block, tier)
return this return this

View File

@ -1,260 +0,0 @@
package ru.dbotthepony.mc.otm;
import kotlin.KotlinVersion;
import net.minecraft.MethodsReturnNonnullByDefault;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.eventbus.api.EventPriority;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.ModList;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import ru.dbotthepony.mc.otm.android.AndroidResearchManager;
import ru.dbotthepony.mc.otm.android.feature.EnderTeleporterFeature;
import ru.dbotthepony.mc.otm.block.entity.MatteryBlockEntity;
import ru.dbotthepony.mc.otm.block.entity.blackhole.ExplosionQueue;
import ru.dbotthepony.mc.otm.capability.MatteryCapability;
import ru.dbotthepony.mc.otm.capability.MatteryPlayerCapability;
import ru.dbotthepony.mc.otm.capability.drive.DrivePool;
import ru.dbotthepony.mc.otm.client.AndroidAbilityKeyMapping;
import ru.dbotthepony.mc.otm.client.AndroidMenuKeyMapping;
import ru.dbotthepony.mc.otm.client.ClientEventHandlerKt;
import ru.dbotthepony.mc.otm.client.ClientTickHandlerKt;
import ru.dbotthepony.mc.otm.client.MatteryGUI;
import ru.dbotthepony.mc.otm.client.model.ExosuitModel;
import ru.dbotthepony.mc.otm.client.model.GravitationStabilizerModel;
import ru.dbotthepony.mc.otm.client.model.TritaniumArmorModel;
import ru.dbotthepony.mc.otm.client.render.ShockwaveRenderer;
import ru.dbotthepony.mc.otm.client.render.blockentity.BatteryBankRenderer;
import ru.dbotthepony.mc.otm.client.render.blockentity.MatterBatteryBankRenderer;
import ru.dbotthepony.mc.otm.compat.adastra.AdAstraCompatKt;
import ru.dbotthepony.mc.otm.compat.curios.CuriosCompatKt;
import ru.dbotthepony.mc.otm.compat.mekanism.QIOKt;
import ru.dbotthepony.mc.otm.compat.mekanism.TooltipsKt;
import ru.dbotthepony.mc.otm.config.AndroidConfig;
import ru.dbotthepony.mc.otm.config.ClientConfig;
import ru.dbotthepony.mc.otm.config.ItemsConfig;
import ru.dbotthepony.mc.otm.config.MachinesConfig;
import ru.dbotthepony.mc.otm.config.ServerCompatConfig;
import ru.dbotthepony.mc.otm.config.ServerConfig;
import ru.dbotthepony.mc.otm.config.ToolsConfig;
import ru.dbotthepony.mc.otm.core.math.Decimal;
import ru.dbotthepony.mc.otm.item.tool.ExplosiveHammerItem;
import ru.dbotthepony.mc.otm.item.armor.TritaniumArmorItem;
import ru.dbotthepony.mc.otm.item.QuantumBatteryItem;
import ru.dbotthepony.mc.otm.item.weapon.AbstractWeaponItem;
import ru.dbotthepony.mc.otm.item.PortableCondensationDriveItem;
import ru.dbotthepony.mc.otm.matter.MatterManager;
import ru.dbotthepony.mc.otm.network.*;
import ru.dbotthepony.mc.otm.registry.*;
import ru.dbotthepony.mc.otm.storage.*;
import ru.dbotthepony.mc.otm.triggers.KillAsAndroidTrigger;
import top.theillusivec4.curios.api.CuriosApi;
import static net.minecraftforge.common.MinecraftForge.EVENT_BUS;
import javax.annotation.ParametersAreNonnullByDefault;
import java.util.Objects;
// The value here should match an entry in the META-INF/mods.toml file
@Mod(OverdriveThatMatters.MOD_ID)
@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
public final class OverdriveThatMatters {
// Directly reference a log4j logger.
public static final String MOD_ID = "overdrive_that_matters";
private static final Logger LOGGER = LogManager.getLogger();
public static OverdriveThatMatters INSTANCE;
private StorageStackType<ItemStackWrapper> ITEM_STORAGE;
@NotNull
public StorageStackType<ItemStackWrapper> ITEM_STORAGE() {
return Objects.requireNonNull(ITEM_STORAGE);
}
public static ResourceLocation loc(String path) {
return new ResourceLocation(MOD_ID, path);
}
private static void checkIfKotlinIsInstalled() {
if (!KotlinVersion.CURRENT.isAtLeast(1, 8, 0)) {
throw new UnsupportedClassVersionError("Installed kotlin version is " + KotlinVersion.CURRENT + ", when at least 1.8.0 is required.");
}
}
public OverdriveThatMatters() {
if (INSTANCE != null) {
throw new IllegalStateException("yo what the fuck");
}
try {
checkIfKotlinIsInstalled();
} catch (Throwable err) {
if (err instanceof NoClassDefFoundError) {
for (int i = 0; i < 16; i++)
LOGGER.fatal("Overdrive That Matters requires Kotlin to be installed, get Kotlin for Forge from https://github.com/thedarkcolour/KotlinForForge");
LOGGER.fatal("Overdrive That Matters requires Kotlin to be installed, get Kotlin for Forge from https://github.com/thedarkcolour/KotlinForForge", err);
throw new RuntimeException("Overdrive That Matters requires Kotlin to be installed, get Kotlin for Forge from https://github.com/thedarkcolour/KotlinForForge");
}
for (int i = 0; i < 16; i++)
LOGGER.fatal("Overdrive That Matters' Kotlin version is not satisfied, get newer Kotlin for Forge from https://github.com/thedarkcolour/KotlinForForge");
LOGGER.fatal("Overdrive That Matters' Kotlin version is not satisfied, get newer Kotlin for Forge from https://github.com/thedarkcolour/KotlinForForge", err);
throw err;
}
INSTANCE = this;
var modBus = FMLJavaModLoadingContext.get().getModEventBus();
MRegistry.INSTANCE.initialize(modBus);
MatterManager.INSTANCE.initialize(modBus);
modBus.addListener(EventPriority.HIGHEST, this::setup);
modBus.addListener(EventPriority.NORMAL, this::setupClient);
modBus.addListener(EventPriority.NORMAL, MatteryCapability::register);
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> {
modBus.addListener(EventPriority.NORMAL, AndroidMenuKeyMapping.INSTANCE::register);
modBus.addListener(EventPriority.NORMAL, AndroidAbilityKeyMapping.INSTANCE::register);
modBus.addListener(EventPriority.NORMAL, TritaniumArmorModel::register);
modBus.addListener(EventPriority.NORMAL, GravitationStabilizerModel::register);
modBus.addListener(EventPriority.NORMAL, MCreativeTabs.INSTANCE::register);
modBus.addListener(EventPriority.NORMAL, BatteryBankRenderer.Companion::onRegisterAdditionalModels);
modBus.addListener(EventPriority.NORMAL, MatterBatteryBankRenderer.Companion::onRegisterAdditionalModels);
});
ClientConfig.INSTANCE.register();
ServerConfig.INSTANCE.register();
ServerCompatConfig.INSTANCE.register();
AndroidConfig.INSTANCE.register();
ItemsConfig.INSTANCE.register();
MachinesConfig.INSTANCE.register();
ToolsConfig.INSTANCE.register();
}
private void setup(final FMLCommonSetupEvent event) {
EVENT_BUS.addListener(EventPriority.LOWEST, DrivePool.INSTANCE::onServerPostTick);
EVENT_BUS.addListener(EventPriority.HIGHEST, DrivePool.INSTANCE::serverStopEvent);
EVENT_BUS.addListener(EventPriority.LOWEST, DrivePool.INSTANCE::serverStartEvent);
EVENT_BUS.addListener(EventPriority.NORMAL, DrivePool.INSTANCE::onWorldSave);
EVENT_BUS.addListener(EventPriority.HIGHEST, GlobalEventHandlerKt::onServerStopped);
EVENT_BUS.addListener(EventPriority.HIGHEST, GlobalEventHandlerKt::onServerStopping);
EVENT_BUS.addListener(EventPriority.HIGHEST, GlobalEventHandlerKt::onServerStarting);
EVENT_BUS.addListener(EventPriority.LOWEST, GlobalEventHandlerKt::onWorldTick);
EVENT_BUS.addListener(EventPriority.LOWEST, GlobalEventHandlerKt::onServerTick);
EVENT_BUS.addListener(EventPriority.NORMAL, MatteryPlayerCapability.Companion::onPlayerTick);
EVENT_BUS.addListener(EventPriority.NORMAL, MatteryPlayerCapability.Companion::isMobEffectApplicable);
EVENT_BUS.addListener(EventPriority.LOW, MatteryPlayerCapability.Companion::onHurtEvent);
EVENT_BUS.addGenericListener(Entity.class, EventPriority.NORMAL, MatteryPlayerCapability.Companion::onAttachCapabilityEvent);
EVENT_BUS.addListener(EventPriority.NORMAL, MatteryPlayerCapability.Companion::onPlayerChangeDimensionEvent);
EVENT_BUS.addListener(EventPriority.LOWEST, MatteryPlayerCapability.Companion::onPlayerDeath);
EVENT_BUS.addListener(EventPriority.NORMAL, MatteryPlayerCapability.Companion::onPlayerCloneEvent);
EVENT_BUS.addListener(EventPriority.NORMAL, MatteryPlayerCapability.Companion::onStartTracking);
EVENT_BUS.addListener(EventPriority.NORMAL, MatteryPlayerCapability.Companion::onStopTracking);
EVENT_BUS.addListener(EventPriority.NORMAL, ExplosionQueue.Companion::onWorldTick);
EVENT_BUS.addListener(EventPriority.NORMAL, AbstractWeaponItem.Companion::tick);
EVENT_BUS.addListener(EventPriority.NORMAL, QuantumBatteryItem.Companion::tick);
EVENT_BUS.addListener(EventPriority.LOWEST, PortableCondensationDriveItem.Companion::onPickupEvent);
EVENT_BUS.addListener(EventPriority.NORMAL, AndroidResearchManager.INSTANCE::reloadEvent);
EVENT_BUS.addListener(EventPriority.NORMAL, AndroidResearchManager.INSTANCE::syncEvent);
EVENT_BUS.addListener(EventPriority.NORMAL, MatterManager.INSTANCE::reloadEvent);
EVENT_BUS.addListener(EventPriority.NORMAL, MatterManager.INSTANCE::onServerStarted);
EVENT_BUS.addListener(EventPriority.NORMAL, MatterManager.INSTANCE::onDataPackSync);
EVENT_BUS.addListener(EventPriority.NORMAL, MatterManager.INSTANCE::addCommands);
EVENT_BUS.addListener(EventPriority.NORMAL, MatteryBlockEntity.Companion::onServerStopping);
EVENT_BUS.addListener(EventPriority.NORMAL, MatteryBlockEntity.Companion::onLevelUnload);
EVENT_BUS.addListener(EventPriority.NORMAL, MatteryBlockEntity.Companion::onWatch);
EVENT_BUS.addListener(EventPriority.NORMAL, MatteryBlockEntity.Companion::onForget);
EVENT_BUS.addListener(EventPriority.NORMAL, MatteryBlockEntity.Companion::playerDisconnected);
EVENT_BUS.addListener(EventPriority.LOWEST, MatteryBlockEntity.Companion::postLevelTick);
EVENT_BUS.addListener(EventPriority.LOWEST, KillAsAndroidTrigger.INSTANCE::onKill);
EVENT_BUS.addListener(EventPriority.NORMAL, EnderTeleporterFeature.Companion::onEntityDeath);
EVENT_BUS.addListener(EventPriority.HIGH, TritaniumArmorItem.Companion::onHurt);
EVENT_BUS.addListener(EventPriority.NORMAL, ExplosiveHammerItem.Companion::onLeftClickBlock);
MatteryPlayerNetworkChannel.INSTANCE.register();
MenuNetworkChannel.INSTANCE.register();
WeaponNetworkChannel.INSTANCE.register();
RegistryNetworkChannel.INSTANCE.register();
WorldNetworkChannel.INSTANCE.register();
GenericNetworkChannel.INSTANCE.register();
ITEM_STORAGE = StorageRegistry.register(ItemStackWrapper.class, ItemStackWrapper.EMPTY, new Decimal("3.125"));
if (ModList.get().isLoaded("mekanism")) {
EVENT_BUS.addGenericListener(BlockEntity.class, EventPriority.NORMAL, QIOKt::attachCapabilities);
}
if (ModList.get().isLoaded(CuriosApi.MODID)) {
EVENT_BUS.addListener(EventPriority.NORMAL, CuriosCompatKt::onCuriosSlotModifiersUpdated);
}
if (AdAstraCompatKt.isAdAstraLoaded()) {
EVENT_BUS.addListener(EventPriority.NORMAL, AdAstraCompatKt::onDamageEvent);
EVENT_BUS.addListener(EventPriority.NORMAL, AdAstraCompatKt::onMatteryTick);
}
}
private void setupClient(final FMLClientSetupEvent event) {
EVENT_BUS.addListener(EventPriority.NORMAL, MatterManager.INSTANCE::tooltipEvent);
EVENT_BUS.addListener(EventPriority.NORMAL, AbstractWeaponItem.Companion::playerRenderHook);
EVENT_BUS.addListener(EventPriority.NORMAL, AbstractWeaponItem.Companion::fovHook);
EVENT_BUS.addListener(EventPriority.NORMAL, AbstractWeaponItem.Companion::clickHook);
EVENT_BUS.addListener(EventPriority.NORMAL, AbstractWeaponItem.Companion::renderViewModel);
EVENT_BUS.addListener(EventPriority.NORMAL, MatteryGUI.INSTANCE::onScreenRender);
EVENT_BUS.addListener(EventPriority.LOWEST, MatteryGUI.INSTANCE::onOpenGUIEvent);
EVENT_BUS.addListener(EventPriority.NORMAL, MatteryGUI.INSTANCE::onRenderGuiEvent);
EVENT_BUS.addListener(EventPriority.HIGH, MatteryGUI.INSTANCE::onLayerRenderEvent);
EVENT_BUS.addListener(EventPriority.NORMAL, ShockwaveRenderer.INSTANCE::onRender);
EVENT_BUS.addListener(EventPriority.NORMAL, ClientEventHandlerKt::onMovementInputUpdate);
EVENT_BUS.addListener(EventPriority.NORMAL, ClientEventHandlerKt::onScreenOpen);
EVENT_BUS.addListener(EventPriority.NORMAL, ClientEventHandlerKt::onPostScreenInit);
EVENT_BUS.addListener(EventPriority.NORMAL, ClientEventHandlerKt::onMouseDragged);
EVENT_BUS.addListener(EventPriority.NORMAL, ClientEventHandlerKt::onMouseScrolled);
EVENT_BUS.addListener(EventPriority.LOWEST, ClientTickHandlerKt::onClientTick);
EVENT_BUS.addListener(EventPriority.HIGHEST, ClientTickHandlerKt::onClientConnected);
EVENT_BUS.addListener(EventPriority.HIGHEST, ClientTickHandlerKt::onClientDisconnected);
EVENT_BUS.addListener(EventPriority.NORMAL, QuantumBatteryItem.Companion::clientDisconnect);
if (ModList.get().isLoaded("mekanism")) {
EVENT_BUS.addListener(EventPriority.NORMAL, TooltipsKt::tooltipEvent);
}
EVENT_BUS.addListener(EventPriority.NORMAL, AndroidMenuKeyMapping.INSTANCE::onRenderGuiEvent);
EVENT_BUS.addListener(EventPriority.NORMAL, AndroidMenuKeyMapping.INSTANCE::onMouseClick);
EVENT_BUS.addListener(EventPriority.NORMAL, AndroidAbilityKeyMapping.INSTANCE::onRenderGuiEvent);
EVENT_BUS.addListener(EventPriority.NORMAL, AndroidAbilityKeyMapping.INSTANCE::onRenderLevel);
EVENT_BUS.addListener(EventPriority.NORMAL, ExosuitModel::onPlayerRendered);
event.enqueueWork(GlobalEventHandlerKt::recordClientThread);
}
}

View File

@ -1,11 +1,13 @@
package ru.dbotthepony.mc.otm.capability; package ru.dbotthepony.mc.otm.capability;
import mekanism.api.energy.IStrictEnergyHandler; import net.minecraft.core.Direction;
import net.minecraftforge.common.capabilities.CapabilityManager; import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.common.capabilities.Capability; import net.neoforged.neoforge.capabilities.BlockCapability;
import net.minecraftforge.common.capabilities.CapabilityToken; import net.neoforged.neoforge.capabilities.ItemCapability;
import net.minecraftforge.common.capabilities.RegisterCapabilitiesEvent;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import ru.dbotthepony.mc.otm.OverdriveThatMatters;
import ru.dbotthepony.mc.otm.block.entity.cable.EnergyCableBlockEntity;
import ru.dbotthepony.mc.otm.capability.drive.IMatteryDrive; import ru.dbotthepony.mc.otm.capability.drive.IMatteryDrive;
import ru.dbotthepony.mc.otm.capability.energy.IMatteryEnergyStorage; import ru.dbotthepony.mc.otm.capability.energy.IMatteryEnergyStorage;
import ru.dbotthepony.mc.otm.capability.matter.IMatterStorage; import ru.dbotthepony.mc.otm.capability.matter.IMatterStorage;
@ -13,64 +15,62 @@ import ru.dbotthepony.mc.otm.capability.matter.IReplicationTaskProvider;
import ru.dbotthepony.mc.otm.capability.matter.IPatternStorage; import ru.dbotthepony.mc.otm.capability.matter.IPatternStorage;
import ru.dbotthepony.mc.otm.graph.matter.MatterNode; import ru.dbotthepony.mc.otm.graph.matter.MatterNode;
import ru.dbotthepony.mc.otm.graph.storage.StorageNode; import ru.dbotthepony.mc.otm.graph.storage.StorageNode;
import top.theillusivec4.curios.api.type.capability.ICurio;
import top.theillusivec4.curios.api.type.capability.ICuriosItemHandler;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
public class MatteryCapability { public class MatteryCapability {
@Nonnull @Nonnull
@NotNull @NotNull
public static final Capability<IMatteryEnergyStorage> ENERGY = CapabilityManager.get(new CapabilityToken<>() {}); public static final BlockCapability<IMatteryEnergyStorage, @Nullable Direction> BLOCK_ENERGY = BlockCapability.createSided(ResourceLocation.fromNamespaceAndPath(OverdriveThatMatters.MOD_ID, "energy"), IMatteryEnergyStorage.class);
@Nonnull @Nonnull
@NotNull @NotNull
public static final Capability<MatteryPlayerCapability> MATTERY_PLAYER = CapabilityManager.get(new CapabilityToken<>() {}); public static final ItemCapability<IMatteryEnergyStorage, Void> ITEM_ENERGY = ItemCapability.createVoid(ResourceLocation.fromNamespaceAndPath(OverdriveThatMatters.MOD_ID, "energy"), IMatteryEnergyStorage.class);
@Nonnull @Nonnull
@NotNull @NotNull
public static final Capability<IMatterStorage> MATTER = CapabilityManager.get(new CapabilityToken<>() {}); public static final ItemCapability<IMatterStorage, Void> MATTER_ITEM = ItemCapability.createVoid(ResourceLocation.fromNamespaceAndPath(OverdriveThatMatters.MOD_ID, "matter"), IMatterStorage.class);
@Nonnull @Nonnull
@NotNull @NotNull
public static final Capability<MatterNode> MATTER_NODE = CapabilityManager.get(new CapabilityToken<>() {}); public static final BlockCapability<IMatterStorage, @Nullable Direction> MATTER_BLOCK = BlockCapability.createSided(ResourceLocation.fromNamespaceAndPath(OverdriveThatMatters.MOD_ID, "matter"), IMatterStorage.class);
@Nonnull @Nonnull
@NotNull @NotNull
public static final Capability<IPatternStorage> PATTERN = CapabilityManager.get(new CapabilityToken<>() {}); public static final BlockCapability<MatterNode, @Nullable Direction> MATTER_NODE = BlockCapability.createSided(ResourceLocation.fromNamespaceAndPath(OverdriveThatMatters.MOD_ID, "matter_node"), MatterNode.class);
@Nonnull @Nonnull
@NotNull @NotNull
public static final Capability<IReplicationTaskProvider> TASK = CapabilityManager.get(new CapabilityToken<>() {}); public static final ItemCapability<IPatternStorage, Void> PATTERN_ITEM = ItemCapability.createVoid(ResourceLocation.fromNamespaceAndPath(OverdriveThatMatters.MOD_ID, "pattern"), IPatternStorage.class);
@Nonnull @Nonnull
@NotNull @NotNull
public static final Capability<IMatteryDrive> DRIVE = CapabilityManager.get(new CapabilityToken<>() {}); public static final BlockCapability<IPatternStorage, @Nullable Direction> PATTERN_BLOCK = BlockCapability.createSided(ResourceLocation.fromNamespaceAndPath(OverdriveThatMatters.MOD_ID, "pattern"), IPatternStorage.class);
@Nonnull @Nonnull
@NotNull @NotNull
public static final Capability<StorageNode> STORAGE_NODE = CapabilityManager.get(new CapabilityToken<>() {}); public static final BlockCapability<IReplicationTaskProvider, Void> REPLICATION_TASK = BlockCapability.createVoid(ResourceLocation.fromNamespaceAndPath(OverdriveThatMatters.MOD_ID, "replication_task"), IReplicationTaskProvider.class);
@Nonnull @Nonnull
@NotNull @NotNull
public static final Capability<IStrictEnergyHandler> MEKANISM_ENERGY = CapabilityManager.get(new CapabilityToken<>() {}); // this weird cast is required because otherwise IMatteryDrive gets incompatible lower-bound due to Java raw generic type
// and K2 compiler chokes and dies due to it
public static final ItemCapability<IMatteryDrive<?>, Void> CONDENSATION_DRIVE = (ItemCapability<IMatteryDrive<?>, Void>) (Object) ItemCapability.createVoid(ResourceLocation.fromNamespaceAndPath(OverdriveThatMatters.MOD_ID, "condensation_drive"), IMatteryDrive.class);
@Nonnull @Nonnull
@NotNull @NotNull
public static final Capability<ICuriosItemHandler> CURIOS_INVENTORY = CapabilityManager.get(new CapabilityToken<>() {}); public static final BlockCapability<StorageNode, @Nullable Direction> STORAGE_NODE = BlockCapability.createSided(ResourceLocation.fromNamespaceAndPath(OverdriveThatMatters.MOD_ID, "storage_node"), StorageNode.class);
// TODO: remove this
@Nonnull
@NotNull
public static final BlockCapability<EnergyCableBlockEntity.Node, Void> ENERGY_CABLE_NODE = BlockCapability.createVoid(ResourceLocation.fromNamespaceAndPath(OverdriveThatMatters.MOD_ID, "energy_cable_node"), EnergyCableBlockEntity.Node.class);
@Nonnull @Nonnull
@NotNull @NotNull
public static final Capability<ICurio> CURIOS_ITEM = CapabilityManager.get(new CapabilityToken<>() {}); public static final ItemCapability<IMatteryUpgrade, Void> UPGRADE = ItemCapability.createVoid(ResourceLocation.fromNamespaceAndPath(OverdriveThatMatters.MOD_ID, "machine_upgrade"), IMatteryUpgrade.class);
public static void register(RegisterCapabilitiesEvent event) { @Nonnull
event.register(IMatteryEnergyStorage.class); @NotNull
event.register(MatteryPlayerCapability.class); public static final BlockCapability<IQuickStackContainer, Void> QUICK_STACK_CONTAINER = BlockCapability.createVoid(ResourceLocation.fromNamespaceAndPath(OverdriveThatMatters.MOD_ID, "quick_stack_container"), IQuickStackContainer.class);
event.register(IMatterStorage.class);
event.register(MatterNode.class);
event.register(IPatternStorage.class);
event.register(IReplicationTaskProvider.class);
event.register(IMatteryDrive.class);
event.register(StorageNode.class);
}
} }

View File

@ -0,0 +1,77 @@
package ru.dbotthepony.mc.otm.client.animation;
import net.minecraft.client.animation.AnimationChannel;
import net.minecraft.client.animation.AnimationDefinition;
import net.minecraft.client.animation.Keyframe;
import net.minecraft.client.animation.KeyframeAnimations;
public class BreadMonsterAnimation {
public static final AnimationDefinition IDLE = AnimationDefinition.Builder.withLength(1.44F).looping()
.addAnimation("Body", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, -2.5F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.72F, KeyframeAnimations.degreeVec(0.0F, 3.33F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.44F, KeyframeAnimations.degreeVec(0.0F, -2.5F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("Ljaw", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(2.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.72F, KeyframeAnimations.degreeVec(5.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.44F, KeyframeAnimations.degreeVec(2.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("UJaw", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(-2.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.72F, KeyframeAnimations.degreeVec(-5.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.44F, KeyframeAnimations.degreeVec(-2.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("tail", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 5.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.72F, KeyframeAnimations.degreeVec(0.0F, -7.5F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.44F, KeyframeAnimations.degreeVec(0.0F, 5.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.build();
public static final AnimationDefinition MOVE = AnimationDefinition.Builder.withLength(1.44F).looping()
.addAnimation("root", new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0.0F, KeyframeAnimations.posVec(1.0F, 0.0F, 2.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.12F, KeyframeAnimations.posVec(0.0F, 5.0F, -1.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.24F, KeyframeAnimations.posVec(-1.0F, 0.0F, -1.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.72F, KeyframeAnimations.posVec(-2.0F, 0.0F, 2.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.84F, KeyframeAnimations.posVec(0.0F, 5.0F, -1.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.96F, KeyframeAnimations.posVec(1.0F, 0.0F, -1.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.44F, KeyframeAnimations.posVec(1.0F, 0.0F, 2.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("Body", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.12F, KeyframeAnimations.degreeVec(7.5283F, 4.9571F, 0.6543F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.2F, KeyframeAnimations.degreeVec(12.5094F, 1.6524F, 0.2181F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.24F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.72F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.84F, KeyframeAnimations.degreeVec(7.5283F, -4.9571F, -0.6543F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.92F, KeyframeAnimations.degreeVec(15.0189F, -3.3047F, -0.4362F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.96F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("Ljaw", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.12F, KeyframeAnimations.degreeVec(25.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.32F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.72F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.84F, KeyframeAnimations.degreeVec(25.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.04F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("UJaw", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.12F, KeyframeAnimations.degreeVec(-25.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.32F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.72F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.84F, KeyframeAnimations.degreeVec(-30.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(1.04F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("tail", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.12F, KeyframeAnimations.degreeVec(-10.0374F, -4.9238F, 0.8704F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.24F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.72F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.84F, KeyframeAnimations.degreeVec(-12.5462F, 4.8812F, -1.0848F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.96F, KeyframeAnimations.degreeVec(0.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.build();
}

View File

@ -0,0 +1,155 @@
package ru.dbotthepony.mc.otm.client.animation;
import net.minecraft.client.animation.AnimationChannel;
import net.minecraft.client.animation.AnimationDefinition;
import net.minecraft.client.animation.Keyframe;
import net.minecraft.client.animation.KeyframeAnimations;
public class LoaderAnimation {
public static final AnimationDefinition IDLE = AnimationDefinition.Builder.withLength(0.16F).looping()
.addAnimation("Body", new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0.0F, KeyframeAnimations.posVec(0F, 0F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.08F, KeyframeAnimations.posVec(0F, -0.1F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.16F, KeyframeAnimations.posVec(0F, 0F, 0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("Head", new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0.0F, KeyframeAnimations.posVec(0F, 0F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.08F, KeyframeAnimations.posVec(0F, -0.1F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.16F, KeyframeAnimations.posVec(0F, 0F, 0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("LeftArm", new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0.0F, KeyframeAnimations.posVec(0F, 0.1F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.12F, KeyframeAnimations.posVec(0F, -0.2F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.16F, KeyframeAnimations.posVec(0F, 0F, 0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("RightArm", new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0.0F, KeyframeAnimations.posVec(0F, 0.1F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.12F, KeyframeAnimations.posVec(0F, -0.2F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.16F, KeyframeAnimations.posVec(0F, 0F, 0F), AnimationChannel.Interpolations.LINEAR)
))
.build();
public static final AnimationDefinition MOVE = AnimationDefinition.Builder.withLength(0.48F).looping()
.addAnimation("Body", new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0.0F, KeyframeAnimations.posVec(0F, 0F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.12F, KeyframeAnimations.posVec(0F, 0.3F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.24F, KeyframeAnimations.posVec(0F, 0F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.36F, KeyframeAnimations.posVec(0F, 0.3F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.48F, KeyframeAnimations.posVec(0F, 0F, 0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("Head", new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0.0F, KeyframeAnimations.posVec(0F, 0F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.12F, KeyframeAnimations.posVec(0F, 0.3F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.24F, KeyframeAnimations.posVec(0F, 0F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.36F, KeyframeAnimations.posVec(0F, 0.3F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.48F, KeyframeAnimations.posVec(0F, 0F, 0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("LeftLeg", new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0.0F, KeyframeAnimations.posVec(0F, 0F, -2F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.12F, KeyframeAnimations.posVec(0F, 0F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.24F, KeyframeAnimations.posVec(0F, 1F, 1F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.36F, KeyframeAnimations.posVec(0F, 2F, -2F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.48F, KeyframeAnimations.posVec(0F, 0F, -2F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("LeftLeg", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(-22.5F, 0F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.24F, KeyframeAnimations.degreeVec(22.5F, 0F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.48F, KeyframeAnimations.degreeVec(-22.5F, 0F, 0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("RightLeg", new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0.0F, KeyframeAnimations.posVec(0F, 0F, 2F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.12F, KeyframeAnimations.posVec(0F, 2F, -2F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.24F, KeyframeAnimations.posVec(0F, 0F, -2F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.36F, KeyframeAnimations.posVec(0F, 0F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.48F, KeyframeAnimations.posVec(0F, 0F, 2F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("RightLeg", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(22.5F, 0F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.24F, KeyframeAnimations.degreeVec(-22.5F, 0F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.48F, KeyframeAnimations.degreeVec(22.5F, 0F, 0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("LeftArm", new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0.0F, KeyframeAnimations.posVec(0F, 0F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.12F, KeyframeAnimations.posVec(0F, 0.2F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.24F, KeyframeAnimations.posVec(0F, 0F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.36F, KeyframeAnimations.posVec(0F, 0.2F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.48F, KeyframeAnimations.posVec(0F, 0F, 0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("LeftArm", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(6F, 0F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.24F, KeyframeAnimations.degreeVec(-6F, 0F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.48F, KeyframeAnimations.degreeVec(6F, 0F, 0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("ElbowR", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(-30F, 0F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.24F, KeyframeAnimations.degreeVec(-19.5F, 0F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.48F, KeyframeAnimations.degreeVec(-30F, 0F, 0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("RightArm", new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0.0F, KeyframeAnimations.posVec(0F, 0F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.12F, KeyframeAnimations.posVec(0F, 0.2F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.24F, KeyframeAnimations.posVec(0F, 0F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.36F, KeyframeAnimations.posVec(0F, 0.2F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.48F, KeyframeAnimations.posVec(0F, 0F, 0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("RightArm", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(-6F, 0F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.24F, KeyframeAnimations.degreeVec(6F, 0F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.48F, KeyframeAnimations.degreeVec(-6F, 0F, 0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("ElbowL", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(-16.5F, 0F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.24F, KeyframeAnimations.degreeVec(-25.5F, 0F, 0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.48F, KeyframeAnimations.degreeVec(-16.5F, 0F, 0F), AnimationChannel.Interpolations.LINEAR)
))
.build();
public static final AnimationDefinition ATTACK = AnimationDefinition.Builder.withLength(0.48F).looping()
.addAnimation("LeftArm", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(19.27F, 2.7545F, -11.804F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.16F, KeyframeAnimations.degreeVec(25.4138F, -37.1586F, -16.0129F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("LeftArm", new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0.0F, KeyframeAnimations.posVec(0.0F, 0.0F, -1.1F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.16F, KeyframeAnimations.posVec(-4.0F, -1.0F, 6.9F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.48F, KeyframeAnimations.posVec(-1.0F, 0.0F, 0.9F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("ElbowR", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(-15.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.16F, KeyframeAnimations.degreeVec(-22.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.32F, KeyframeAnimations.degreeVec(-75.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.48F, KeyframeAnimations.degreeVec(-20.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("RightArm", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(2.0031F, 14.8687F, 7.7614F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.32F, KeyframeAnimations.degreeVec(-105.5693F, -6.858F, 48.036F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.48F, KeyframeAnimations.degreeVec(-4.4119F, -9.6204F, 22.9232F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("RightArm", new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0.0F, KeyframeAnimations.posVec(0.0F, 0.0F, 1.4F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.16F, KeyframeAnimations.posVec(3.0F, 3.0F, -9.6F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.48F, KeyframeAnimations.posVec(0.0F, 2.0F, -2.6F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("ElbowL", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(-32.5F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.2F, KeyframeAnimations.degreeVec(-60.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.48F, KeyframeAnimations.degreeVec(-25.0F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("Head", new AnimationChannel(AnimationChannel.Targets.POSITION,
new Keyframe(0.0F, KeyframeAnimations.posVec(-0.6F, 0.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.16F, KeyframeAnimations.posVec(3.0F, 0.0F, -2.6F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.48F, KeyframeAnimations.posVec(1.0F, 0.0F, -1.6F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("Body", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(0.0F, 7.5F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.16F, KeyframeAnimations.degreeVec(0.0F, -35.0F, 0.0F), AnimationChannel.Interpolations.LINEAR),
new Keyframe(0.48F, KeyframeAnimations.degreeVec(0.0F, -12.5F, 0.0F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("LeftLeg", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(-4.9953F, -0.2178F, -2.4905F), AnimationChannel.Interpolations.LINEAR)
))
.addAnimation("RightLeg", new AnimationChannel(AnimationChannel.Targets.ROTATION,
new Keyframe(0.0F, KeyframeAnimations.degreeVec(7.4929F, -0.3262F, 2.4786F), AnimationChannel.Interpolations.LINEAR)
))
.build();
}

View File

@ -18,9 +18,9 @@ import net.minecraft.client.renderer.entity.RenderLayerParent;
import net.minecraft.client.renderer.entity.layers.RenderLayer; import net.minecraft.client.renderer.entity.layers.RenderLayer;
import net.minecraft.client.renderer.entity.player.PlayerRenderer; import net.minecraft.client.renderer.entity.player.PlayerRenderer;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.client.event.RenderPlayerEvent; import net.neoforged.neoforge.client.event.RenderPlayerEvent;
import ru.dbotthepony.mc.otm.OverdriveThatMatters; import ru.dbotthepony.mc.otm.OverdriveThatMatters;
import ru.dbotthepony.mc.otm.capability.MatteryCapability; import ru.dbotthepony.mc.otm.player.IMatteryPlayer;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import java.util.Set; import java.util.Set;
@ -31,7 +31,8 @@ public final class ExosuitModel {
public static final HumanoidModel<AbstractClientPlayer> modelNormal; public static final HumanoidModel<AbstractClientPlayer> modelNormal;
public static final HumanoidModel<AbstractClientPlayer> modelGlow; public static final HumanoidModel<AbstractClientPlayer> modelGlow;
public static final ResourceLocation texture = new ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/models/armor/exosuit.png"); public static final ResourceLocation texture = ResourceLocation.fromNamespaceAndPath(OverdriveThatMatters.MOD_ID, "textures/models/armor/exosuit.png");
public static final ResourceLocation textureColor = ResourceLocation.fromNamespaceAndPath(OverdriveThatMatters.MOD_ID, "textures/models/armor/exosuit_color.png");
static { static {
MeshDefinition meshdefinition = new MeshDefinition(); MeshDefinition meshdefinition = new MeshDefinition();
@ -102,7 +103,6 @@ public final class ExosuitModel {
super(p_117346_); super(p_117346_);
} }
@SuppressWarnings("OptionalGetWithoutIsPresent")
@Override @Override
public void render( public void render(
@Nonnull PoseStack poseStack, @Nonnull PoseStack poseStack,
@ -116,13 +116,12 @@ public final class ExosuitModel {
float p_117357_, float p_117357_,
float p_117358_ float p_117358_
) { ) {
var cap = player.getCapability(MatteryCapability.MATTERY_PLAYER); if (player.isInvisible())
if (!cap.isPresent()) {
return; return;
}
if (cap.resolve().get().getHasExoPack() && cap.resolve().get().getDisplayExoPack()) { var mattery = ((IMatteryPlayer) player).getOtmPlayer();
if (mattery.getHasExopack() && mattery.isExopackVisible()) {
var model = getParentModel(); var model = getParentModel();
model.copyPropertiesTo(modelNormal); model.copyPropertiesTo(modelNormal);
model.copyPropertiesTo(modelGlow); model.copyPropertiesTo(modelGlow);
@ -135,17 +134,41 @@ public final class ExosuitModel {
packedLight, packedLight,
overlayCoords, overlayCoords,
// rgba // rgba
1f, 1f, 1f, 1f -1
); );
modelGlow.renderToBuffer( var color = mattery.getExopackColor();
poseStack,
bufferSource.getBuffer(RenderType.entityTranslucentEmissive(texture)), if (color != null) {
packedLight, modelNormal.renderToBuffer(
overlayCoords, poseStack,
// rgba bufferSource.getBuffer(RenderType.entityCutoutNoCull(textureColor)),
1f, 1f, 1f, 1f packedLight,
); overlayCoords,
color.toBGRA()
);
}
if (mattery.getExopackGlows()) {
modelGlow.renderToBuffer(
poseStack,
bufferSource.getBuffer(RenderType.entityTranslucentEmissive(texture)),
packedLight,
overlayCoords,
-1
);
} else {
modelGlow.renderToBuffer(
poseStack,
bufferSource.getBuffer(RenderType.entityCutoutNoCull(texture)),
packedLight,
overlayCoords,
// rgba
-1
);
}
mattery.makeSmokeParticles(poseStack, model);
} }
} }
} }

View File

@ -4,8 +4,7 @@ import net.minecraft.client.model.HumanoidModel;
import net.minecraft.client.model.geom.ModelLayerLocation; import net.minecraft.client.model.geom.ModelLayerLocation;
import net.minecraft.client.model.geom.PartPose; import net.minecraft.client.model.geom.PartPose;
import net.minecraft.client.model.geom.builders.*; import net.minecraft.client.model.geom.builders.*;
import net.minecraftforge.client.ForgeHooksClient; import net.neoforged.neoforge.client.event.EntityRenderersEvent;
import net.minecraftforge.client.event.EntityRenderersEvent;
import ru.dbotthepony.mc.otm.OverdriveThatMatters; import ru.dbotthepony.mc.otm.OverdriveThatMatters;
import ru.dbotthepony.mc.otm.registry.MNames; import ru.dbotthepony.mc.otm.registry.MNames;

View File

@ -11,8 +11,7 @@ import net.minecraft.client.model.geom.ModelLayerLocation;
import net.minecraft.client.model.geom.ModelLayers; import net.minecraft.client.model.geom.ModelLayers;
import net.minecraft.client.model.geom.PartPose; import net.minecraft.client.model.geom.PartPose;
import net.minecraft.client.model.geom.builders.*; import net.minecraft.client.model.geom.builders.*;
import net.minecraftforge.client.ForgeHooksClient; import net.neoforged.neoforge.client.event.EntityRenderersEvent;
import net.minecraftforge.client.event.EntityRenderersEvent;
import javax.annotation.ParametersAreNonnullByDefault; import javax.annotation.ParametersAreNonnullByDefault;

View File

@ -0,0 +1,73 @@
package ru.dbotthepony.mc.otm.client.model.entity;
import net.minecraft.client.model.HierarchicalModel;
import net.minecraft.client.model.geom.ModelLayerLocation;
import net.minecraft.client.model.geom.ModelPart;
import net.minecraft.client.model.geom.PartPose;
import net.minecraft.client.model.geom.builders.CubeDeformation;
import net.minecraft.client.model.geom.builders.CubeListBuilder;
import net.minecraft.client.model.geom.builders.LayerDefinition;
import net.minecraft.client.model.geom.builders.MeshDefinition;
import net.minecraft.client.model.geom.builders.PartDefinition;
import net.neoforged.neoforge.client.event.EntityRenderersEvent;
import org.jetbrains.annotations.NotNull;
import ru.dbotthepony.mc.otm.client.animation.BreadMonsterAnimation;
import ru.dbotthepony.mc.otm.entity.BreadMonster;
import ru.dbotthepony.mc.otm.registry.MNames;
import static ru.dbotthepony.mc.otm.OverdriveThatMatters.loc;
public class BreadMonsterModel {
public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation(loc(MNames.BREAD_MONSTER), "main");
private static HierarchicalModel<BreadMonster> model;
private static LayerDefinition def;
public static HierarchicalModel<BreadMonster> getModel() {
if (model == null) {
return model = new BreadMonsterHierarchicalModel<>(def.bakeRoot());
}
return model;
}
public static LayerDefinition createBodyLayer() {
MeshDefinition meshdefinition = new MeshDefinition();
PartDefinition partdefinition = meshdefinition.getRoot();
PartDefinition root = partdefinition.addOrReplaceChild("root", CubeListBuilder.create(), PartPose.offset(0.0F, 24.0F, 0.0F));
PartDefinition Body = root.addOrReplaceChild("Body", CubeListBuilder.create().texOffs(0, 0).addBox(-4.0F, -3.0F, -5.0F, 8.0F, 6.0F, 6.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, -3.0F, 0.0F));
PartDefinition Ljaw = Body.addOrReplaceChild("Ljaw", CubeListBuilder.create().texOffs(26, 24).addBox(-4.0F, -2.0F, -4.0F, 8.0F, 3.0F, 4.0F, new CubeDeformation(0.1F)), PartPose.offset(0.0F, 2.0F, -3.0F));
PartDefinition UJaw = Body.addOrReplaceChild("UJaw", CubeListBuilder.create().texOffs(0, 24).addBox(-4.0F, -2.0F, -4.0F, 8.0F, 3.0F, 5.0F, new CubeDeformation(0.1F)), PartPose.offset(0.0F, -1.0F, -3.0F));
PartDefinition tail = Body.addOrReplaceChild("tail", CubeListBuilder.create().texOffs(0, 12).addBox(-4.0F, -3.0F, -0.1F, 8.0F, 6.0F, 6.0F, new CubeDeformation(-0.1F)), PartPose.offset(0.0F, 0.0F, 1.0F));
model = null;
return def = LayerDefinition.create(meshdefinition, 64, 32);
}
private static class BreadMonsterHierarchicalModel<T extends BreadMonster> extends HierarchicalModel<T> {
private final ModelPart root;
public BreadMonsterHierarchicalModel(ModelPart root) {
this.root = root.getChild("root");
}
@Override
public void setupAnim(@NotNull T entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {
this.root().getAllParts().forEach(ModelPart::resetPose);
// this.applyStatic(BreadMonsterAnimation.IDLE);
this.animate(entity.getIdleState(), BreadMonsterAnimation.IDLE, ageInTicks, 1.0F);
this.animateWalk(BreadMonsterAnimation.MOVE, limbSwing, limbSwingAmount, 1.0F, 2.5F);
}
@Override
public @NotNull ModelPart root() {
return this.root;
}
}
public static void register(EntityRenderersEvent.RegisterLayerDefinitions event) {
event.registerLayerDefinition(LAYER_LOCATION, BreadMonsterModel::createBodyLayer);
}
}

View File

@ -0,0 +1,100 @@
package ru.dbotthepony.mc.otm.client.model.entity;
import net.minecraft.client.model.HierarchicalModel;
import net.minecraft.client.model.geom.ModelLayerLocation;
import net.minecraft.client.model.geom.ModelPart;
import net.minecraft.client.model.geom.PartPose;
import net.minecraft.client.model.geom.builders.*;
import net.neoforged.neoforge.client.event.EntityRenderersEvent;
import org.jetbrains.annotations.NotNull;
import ru.dbotthepony.mc.otm.client.animation.LoaderAnimation;
import ru.dbotthepony.mc.otm.entity.Loader;
import ru.dbotthepony.mc.otm.registry.MNames;
import static ru.dbotthepony.mc.otm.OverdriveThatMatters.loc;
public class LoaderModel {
public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation(loc(MNames.LOADER), "main");
private static HierarchicalModel<Loader> model;
private static LayerDefinition def;
public static HierarchicalModel<Loader> getModel() {
if (def == null) {
def = createBodyLayer(); // Ensure def is created before using it
}
if (model == null) {
return model = new LoaderHierarchicalModel<>(def.bakeRoot());
}
return model;
}
public static LayerDefinition createBodyLayer() {
MeshDefinition meshdefinition = new MeshDefinition();
PartDefinition partdefinition = meshdefinition.getRoot();
PartDefinition root = partdefinition.addOrReplaceChild("root", CubeListBuilder.create(), PartPose.offset(0.0F, 24.0F, 0.0F));
PartDefinition Head = root.addOrReplaceChild("Head", CubeListBuilder.create().texOffs(48, 23).addBox(-3.0F, -1.0F, -2.0F, 6.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offset(-4.0F, -32.0F, -5.0F));
PartDefinition Body = root.addOrReplaceChild("Body", CubeListBuilder.create().texOffs(0, 0).addBox(-10.0F, -16.0F, -5.0F, 20.0F, 10.0F, 13.0F, new CubeDeformation(0.0F))
.texOffs(0, 50).addBox(-3.0F, -3.0F, -4.0F, 6.0F, 5.0F, 8.0F, new CubeDeformation(0.0F))
.texOffs(112, 52).addBox(10.0F, -13.0F, 0.0F, 2.0F, 6.0F, 6.0F, new CubeDeformation(0.0F))
.texOffs(96, 52).addBox(-12.0F, -13.0F, -1.0F, 2.0F, 6.0F, 6.0F, new CubeDeformation(0.0F))
.texOffs(53, 0).addBox(-5.0F, -1.0F, 4.0F, 10.0F, 4.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, -26.0F, -1.0F));
PartDefinition antenna_r1 = Body.addOrReplaceChild("antenna_r1", CubeListBuilder.create().texOffs(76, 6).addBox(0.0F, -7.0F, -1.0F, 0.0F, 14.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(8.0F, -22.0F, 8.0F, -0.2618F, 0.0F, 0.0F));
PartDefinition waist_r1 = Body.addOrReplaceChild("waist_r1", CubeListBuilder.create().texOffs(28, 50).addBox(-2.0F, -5.0F, -4.0F, 4.0F, 7.0F, 7.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -3.0F, 2.0F, -0.2618F, 0.0F, 0.0F));
PartDefinition LeftLeg = root.addOrReplaceChild("LeftLeg", CubeListBuilder.create().texOffs(106, 24).addBox(0.0F, 10.0F, -2.0F, 4.0F, 16.0F, 7.0F, new CubeDeformation(0.0F))
.texOffs(66, 46).addBox(-1.0F, -2.0F, -3.0F, 6.0F, 12.0F, 6.0F, new CubeDeformation(0.0F)), PartPose.offset(4.0F, -26.0F, -1.0F));
PartDefinition RightLeg = root.addOrReplaceChild("RightLeg", CubeListBuilder.create().texOffs(84, 24).addBox(-4.0F, 10.0F, -2.0F, 4.0F, 16.0F, 7.0F, new CubeDeformation(0.0F))
.texOffs(48, 34).addBox(-5.0F, -2.0F, -3.0F, 6.0F, 12.0F, 6.0F, new CubeDeformation(0.0F)), PartPose.offset(-4.0F, -26.0F, -1.0F));
PartDefinition LeftArm = root.addOrReplaceChild("LeftArm", CubeListBuilder.create().texOffs(104, 0).addBox(-1.0F, -7.0F, -4.0F, 4.0F, 16.0F, 8.0F, new CubeDeformation(0.0F)), PartPose.offset(13.0F, -36.0F, 2.0F));
PartDefinition ElbowL = LeftArm.addOrReplaceChild("ElbowL", CubeListBuilder.create().texOffs(24, 23).addBox(-2.0F, -0.2F, -2.0F, 4.0F, 19.0F, 8.0F, new CubeDeformation(-0.1F)), PartPose.offset(1.0F, 9.0F, -1.0F));
PartDefinition RightArm = root.addOrReplaceChild("RightArm", CubeListBuilder.create().texOffs(80, 0).addBox(-3.0F, -7.0F, -4.0F, 4.0F, 16.0F, 8.0F, new CubeDeformation(0.0F)), PartPose.offset(-13.0F, -36.0F, 1.0F));
PartDefinition ElbowR = RightArm.addOrReplaceChild("ElbowR", CubeListBuilder.create().texOffs(0, 23).addBox(-2.0F, -0.2F, -2.0F, 4.0F, 19.0F, 8.0F, new CubeDeformation(-0.1F)), PartPose.offset(-1.0F, 9.0F, -1.0F));
model = null;
return def = LayerDefinition.create(meshdefinition, 128, 64);
}
private static class LoaderHierarchicalModel<T extends Loader> extends HierarchicalModel<T> {
private final ModelPart root;
public LoaderHierarchicalModel(ModelPart root) {
this.root = root.getChild("root");
}
@Override
public void setupAnim(@NotNull T entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {
this.root().getAllParts().forEach(ModelPart::resetPose);
this.root.getChild("Head").yRot = netHeadYaw * ((float) Math.PI / 180F);
this.root.getChild("Head").xRot = headPitch * ((float) Math.PI / 180F);
if (entity.getAttackAnimationTick() > 0) {
this.animate(entity.getIdleState(), LoaderAnimation.ATTACK, ageInTicks, 1.0F);
}
this.animateWalk(LoaderAnimation.MOVE, limbSwing, limbSwingAmount, 0.8F, 2.5F);
this.animate(entity.getIdleState(), LoaderAnimation.IDLE, ageInTicks, 1.0F);
}
public ModelPart getHead() {
return this.root.getChild("Head");
}
@Override
public @NotNull ModelPart root() {
return this.root;
}
}
public static void register(EntityRenderersEvent.RegisterLayerDefinitions event) {
event.registerLayerDefinition(LAYER_LOCATION, LoaderModel::createBodyLayer);
}
}

View File

@ -1,191 +0,0 @@
package ru.dbotthepony.mc.otm.client.screen.panels;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
import ru.dbotthepony.mc.otm.client.screen.MatteryScreen;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class FlexGridPanel<S extends Screen> extends EditablePanel<S> {
public enum FlexAlign {
TOP_LEFT,
TOP_CENTER,
TOP_RIGHT,
MIDDLE_LEFT,
MIDDLE_CENTER,
MIDDLE_RIGHT,
BOTTOM_LEFT,
BOTTOM_CENTER,
BOTTOM_RIGHT
}
protected FlexAlign align = FlexAlign.MIDDLE_CENTER;
public int panels_per_row = 1;
public FlexGridPanel(@Nonnull S screen, @Nullable EditablePanel<?> parent, float x, float y, float width, float height) {
super(screen, parent, x, y, width, height);
}
public FlexGridPanel(@Nonnull S screen, @Nullable EditablePanel<?> parent, float x, float y) {
super(screen, parent, x, y);
}
public FlexGridPanel(@Nonnull S screen, @Nullable EditablePanel<?> parent) {
super(screen, parent);
}
public FlexAlign getAlign() {
return align;
}
public FlexGridPanel<S> setAlign(FlexAlign align) {
this.align = align;
return this;
}
@Override
public void performLayout() {
if (align == FlexAlign.MIDDLE_CENTER) {
// список потомков
var children = getUndockedVisibleChildren();
if (children.size() == 0) {
return;
}
// хранит общую ширину всех потомков в ряд
// а так же ограничитель ширины ряда после
// определения количества рядов
float desired_width = 0;
// минимально допустимая ширина одного ряда
float min_width = getWidth();
// "финальная" ширина этой панели
float this_width = getWidth() - getDockPadding().left() - getDockPadding().right();
if (this_width <= 0) {
return;
}
for (var child : children) {
min_width = Math.min(min_width, child.getWidth() + child.getDockMargin().left() + child.getDockMargin().right());
desired_width += child.getWidth() + child.getDockMargin().left() + child.getDockMargin().right();
}
int rows = 1;
// если общая ширина больше чем ширина панели, делим пополам пока не найдем нужную ширину и количество рядов
while (desired_width > this_width && desired_width > min_width) {
desired_width /= 2;
rows++;
}
if (desired_width < min_width) {
desired_width = min_width;
}
int index;
// определение высоты всех рядов вместе
float total_height = 0;
// утютю никаких goto
// зато код чище некуда!
while (desired_width <= this_width) {
index = 0;
total_height = 0;
panels_per_row = 0;
boolean calculate_row_width = true;
for (int row = 0; row < rows; row++) {
float max_height = 0;
float total_width = 0;
for (int i = index; i < children.size(); i++) {
var child = children.get(i);
var gain_width = child.getWidth() + child.getDockMargin().left() + child.getDockMargin().right();
index = i;
if (gain_width + total_width > desired_width) {
if (calculate_row_width) {
panels_per_row = i + 1;
calculate_row_width = false;
}
break;
}
max_height = Math.max(max_height, child.getHeight() + child.getDockMargin().top() + child.getDockMargin().bottom());
total_width += gain_width;
}
total_height += max_height;
}
if (index + 1 < children.size() && desired_width != this_width) {
// не все панели уместились. ну чтож
desired_width = Math.min(desired_width + min_width, this_width);
} else {
break;
}
}
index = 0;
// ширину на середину для позиционирования по центру
this_width /= 2;
// определение точки по середине по высоте
float h_middle = (getHeight() - getDockPadding().bottom() - getDockPadding().top() - total_height) / 2;
// OverdriveThatMatters.LOGGER.info("Общая высота {}, рядов {}, середина {}", total_height, rows, h_middle);
for (int row = 0; row < rows; row++) {
float max_height = 0;
float total_width = 0;
int until = index;
for (int i = index; i < children.size(); i++) {
var child = children.get(i);
var gain_width = child.getWidth() + child.getDockMargin().left() + child.getDockMargin().right();
until = i;
if (gain_width + total_width > desired_width) {
break;
}
max_height = Math.max(max_height, child.getHeight() + child.getDockMargin().top() + child.getDockMargin().bottom());
total_width += gain_width;
}
total_width /= 2;
max_height /= 2;
// OverdriveThatMatters.LOGGER.info("Ряд {}, общая ширина {}, максимальная высота {}, позиция {}, c {} до {}", row, total_width * 2, max_height * 2, h_middle, index, until);
float accumulate_width = 0;
for (int i = index; i <= until; i++) {
var child = children.get(i);
child.setPos((int) (this_width - total_width + accumulate_width + child.getDockMargin().left()), (int) (h_middle + max_height - child.getHeight() / 2));
accumulate_width += child.getWidth() + child.getDockMargin().left() + child.getDockMargin().right();
}
h_middle += max_height * 2;
index = until;
}
}
super.performLayout();
}
}

View File

@ -0,0 +1,25 @@
package ru.dbotthepony.mc.otm.mixin;
import net.minecraft.world.level.block.entity.BlockEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import ru.dbotthepony.mc.otm.multiblock.GlobalBlockEntityRemovalListener;
// because i know
// someone
// somewhere
// will try to break the system
// either on purpose or accidentally because of other mod
@Mixin(BlockEntity.class)
public abstract class BlockEntityMixin {
@Inject(
at = @At("TAIL"),
method = "setRemoved()V",
remap = false
)
public void setRemovedListener(CallbackInfo ci) {
GlobalBlockEntityRemovalListener.Companion.onBlockEntityInvalidated((BlockEntity) (Object) this);
}
}

View File

@ -0,0 +1,36 @@
package ru.dbotthepony.mc.otm.mixin;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import ru.dbotthepony.mc.otm.item.tool.RedstoneInteractorItem;
@Mixin(BlockBehaviour.BlockStateBase.class)
public abstract class BlockStateBaseMixin {
@Shadow
protected abstract BlockState asState();
@Inject(
method = "getSignal(Lnet/minecraft/world/level/BlockGetter;Lnet/minecraft/core/BlockPos;Lnet/minecraft/core/Direction;)I",
at = @At("HEAD"),
cancellable = true,
remap = false
)
public void getSignal(BlockGetter p_60747_, BlockPos p_60748_, Direction p_60749_, CallbackInfoReturnable<Integer> info) {
if (p_60747_ instanceof Level level) {
int hookResult = RedstoneInteractorItem.Companion.getSignalHook(level, this.asState(), p_60748_, p_60749_);
if (hookResult != -1) {
info.setReturnValue(hookResult);
}
}
}
}

View File

@ -0,0 +1,16 @@
package ru.dbotthepony.mc.otm.mixin;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.level.block.entity.DispenserBlockEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import ru.dbotthepony.mc.otm.compat.vanilla.MatteryChestMenu;
@Mixin(DispenserBlockEntity.class)
public abstract class DispenserBlockEntityMixin {
@Overwrite(remap = false)
public AbstractContainerMenu createMenu(int p_59312_, Inventory p_59313_) {
return MatteryChestMenu.c3x3(p_59312_, p_59313_, (DispenserBlockEntity) (Object) this);
}
}

View File

@ -1,24 +0,0 @@
package ru.dbotthepony.mc.otm.mixin;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.enchantment.EnchantmentHelper;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import ru.dbotthepony.mc.otm.item.weapon.EnergySwordItem;
@Mixin(EnchantmentHelper.class)
public class EnchantmentHelperMixin {
@Inject(
method = "getSweepingDamageRatio(Lnet/minecraft/world/entity/LivingEntity;)F",
at = @At("HEAD"),
cancellable = true)
private static void getSweepingDamageRatio(LivingEntity p_44822_, CallbackInfoReturnable<Float> info) {
var result = EnergySwordItem.getSweepingDamageRatioHook(p_44822_);
if (result != null) {
info.setReturnValue(result);
}
}
}

View File

@ -0,0 +1,25 @@
package ru.dbotthepony.mc.otm.mixin;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import static ru.dbotthepony.mc.otm.client.render.RenderHelperKt.popScissorRect;
import static ru.dbotthepony.mc.otm.client.render.RenderHelperKt.pushScissorRect;
// because scissor stack fucking sucks.
// mostly because it is not a stack at all.
@Mixin(GuiGraphics.class)
public abstract class GuiGraphicsMixin {
@Overwrite(remap = false)
public void enableScissor(int x0, int y0, int x1, int y1) {
double scale = Minecraft.getInstance().getWindow().getGuiScale();
pushScissorRect((int) (scale * x0), (int) (scale * y0), (int) (scale * (x1 - x0)), (int) (scale * (y1 - y0)));
}
@Overwrite(remap = false)
public void disableScissor() {
popScissorRect();
}
}

View File

@ -0,0 +1,16 @@
package ru.dbotthepony.mc.otm.mixin;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.level.block.entity.HopperBlockEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import ru.dbotthepony.mc.otm.compat.vanilla.MatteryChestMenu;
@Mixin(HopperBlockEntity.class)
public abstract class HopperBlockEntityMixin {
@Overwrite(remap = false)
public AbstractContainerMenu createMenu(int p_59312_, Inventory p_59313_) {
return MatteryChestMenu.hopper(p_59312_, p_59313_, (HopperBlockEntity) (Object) this);
}
}

Some files were not shown because too many files have changed in this diff Show More