-
Notifications
You must be signed in to change notification settings - Fork 18
/
Config.java
951 lines (821 loc) · 36 KB
/
Config.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
package knightminer.inspirations.common;
import knightminer.inspirations.Inspirations;
import knightminer.inspirations.library.InspirationsRegistry;
import knightminer.inspirations.library.util.RecipeUtil;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.ForgeConfigSpec;
import slimeknights.mantle.pulsar.config.PulsarConfig;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import static net.minecraftforge.common.ForgeConfigSpec.BooleanValue;
import static net.minecraftforge.common.ForgeConfigSpec.Builder;
import static net.minecraftforge.common.ForgeConfigSpec.ConfigValue;
import static net.minecraftforge.common.ForgeConfigSpec.DoubleValue;
import static net.minecraftforge.common.ForgeConfigSpec.EnumValue;
import static net.minecraftforge.common.ForgeConfigSpec.IntValue;
@SuppressWarnings("WeakerAccess")
public class Config {
public static PulsarConfig pulseConfig = new PulsarConfig("inspirationsModules", "Modules");
public static Builder BUILDER;
public static ForgeConfigSpec SPEC;
public static Builder BUILDER_OVERRIDE;
public static ForgeConfigSpec SPEC_OVERRIDE;
// general
public static BooleanValue showAllVariants;
// building
public static BooleanValue enableRope;
private static BooleanValue enableRopeLadder;
public static boolean enableRopeLadder() { return enableRopeLadder.get() && enableRope.get(); }
public static BooleanValue enableGlassDoor;
public static BooleanValue enableMulch;
public static BooleanValue enablePath;
public static BooleanValue enableFlowers;
public static BooleanValue enableEnlightenedBush;
public static BooleanValue enableBookshelf;
private static BooleanValue enableColoredBooks;
public static BooleanValue bookshelvesBoostEnchanting;
public static DoubleValue defaultEnchantingPower;
public static boolean enableColoredBooks() {
return enableColoredBooks.get() && enableBookshelf.get();
}
public static ConfigValue<String> bookKeywords;
private static String bookKeywordsDefault = "almanac, atlas, book, catalogue, concordance, dictionary, directory, encyclopedia, guide, journal, lexicon, manual, thesaurus, tome";
public static ConfigValue<List<String>> bookOverrides;
private static List<String> bookOverridesDefault = Arrays.asList(
"defiledlands:book_wyrm_raw->false",
"defiledlands:book_wyrm_cooked->false",
"defiledlands:book_wyrm_scale->false",
"defiledlands:book_wyrm_scale_golden->false",
"defiledlands:book_wyrm_analyzer->false",
"minecraft:enchanted_book->2.5",
"quark:ancient_tome->3.0",
"theoneprobe:probenote->1.0"
);
// utility
public static BooleanValue enableTorchLever;
public static BooleanValue enableRedstoneTorchLever;
private static BooleanValue enableRedstoneBook;
public static BooleanValue enableBricksButton;
public static BooleanValue enableRedstoneBarrel;
public static BooleanValue enableCarpetedTrapdoor;
public static BooleanValue enableCarpetedPressurePlate;
public static BooleanValue enableCollector;
public static BooleanValue enablePipe;
public static BooleanValue pipeUpwards;
public static BooleanValue enableDispenserFluidTanks;
public static BooleanValue milkSquids;
public static IntValue milkSquidCooldown;
public static boolean enableRedstoneBook() { return enableRedstoneBook.get() && enableBookshelf.get(); }
// recipes
// cauldron - extended
private static BooleanValue replaceCauldron;
private static BooleanValue enableCauldronRecipes;
public static boolean enableCauldronRecipes() {
return enableCauldronRecipes.get();
}
public static boolean enableExtendedCauldron() {
return replaceCauldron.get() && replaceCauldron.get();
}
// cauldron - extended options
private static BooleanValue enableBiggerCauldron;
private static BooleanValue fasterCauldronRain;
public static boolean enableBiggerCauldron() { return enableBiggerCauldron.get() && enableExtendedCauldron(); }
public static boolean fasterCauldronRain() { return fasterCauldronRain.get() && enableExtendedCauldron(); }
private enum SpongeEmptyCauldron {
DISABLED, // No emptying.
ANY, // For any amount of liquid.
FULL // Allowed, but only full cauldrons.
}
private static EnumValue<SpongeEmptyCauldron> spongeEmptyCauldron;
public static boolean canSpongeEmptyCauldron() {
return spongeEmptyCauldron.get() != SpongeEmptyCauldron.DISABLED;
}
public static boolean canSpongeEmptyFullOnly() {
return spongeEmptyCauldron.get() == SpongeEmptyCauldron.FULL;
}
public static BooleanValue cauldronObsidian;
public static BooleanValue dropCauldronContents;
public static boolean dropCauldronContents() {
return dropCauldronContents.get() && enableExtendedCauldron();
}
// cauldron - fluids
private static BooleanValue enableCauldronFluids;
private static BooleanValue enableMilk;
public static boolean enableCauldronFluids() {
return enableCauldronFluids.get() && enableExtendedCauldron();
}
public static boolean enableMilk() {
return enableMilk.get() && enableExtendedCauldron();
}
// cauldron - dyeing
private static BooleanValue enableCauldronDyeing;
private static BooleanValue patchVanillaDyeRecipes;
private static BooleanValue extraBottleRecipes;
public static boolean enableCauldronDyeing() {
return enableCauldronDyeing.get() && enableExtendedCauldron();
}
public static boolean patchVanillaDyeRecipes() {
return patchVanillaDyeRecipes.get() && enableCauldronDyeing();
}
public static boolean extraBottleRecipes() {
return extraBottleRecipes.get() && enableCauldronDyeing();
}
// cauldron - potions
private static BooleanValue enableCauldronPotions;
private static BooleanValue enableCauldronBrewing;
private static BooleanValue expensiveCauldronBrewing;
private static BooleanValue cauldronTipArrows;
public static boolean enableCauldronPotions() {
return enableCauldronPotions.get() && enableExtendedCauldron();
}
public static boolean enableCauldronBrewing() {
return enableCauldronBrewing.get() && enableCauldronPotions();
}
public static boolean expensiveCauldronBrewing() {
return expensiveCauldronBrewing.get() && enableCauldronPotions();
}
public static boolean cauldronTipArrows() {
return cauldronTipArrows.get() && enableCauldronPotions();
}
// cauldron - recipes
private static String[] cauldronRecipes = {
"minecraft:sticky_piston->minecraft:piston"
};
// cauldron - fluid containers
private static BooleanValue enableCauldronDispenser;
public static boolean enableCauldronDispenser() {
return enableCauldronDispenser.get() && enableCauldronPotions();
}
// anvil smashing
public static BooleanValue enableAnvilSmashing;
private static String[] anvilSmashing = {
"# Stone",
"minecraft:stone:0->minecraft:cobblestone",
"minecraft:stonebrick->minecraft:cobblestone",
"minecraft:stonebrick:1->minecraft:mossy_cobblestone",
"minecraft:cobblestone->minecraft:gravel",
"minecraft:stone:2->minecraft:stone:1",
"minecraft:stone:4->minecraft:stone:3",
"minecraft:stone:6->minecraft:stone:5",
"# Sandstone",
"minecraft:sandstone->minecraft:sand:0",
"minecraft:red_sandstone->minecraft:sand:1",
"# Ice",
"minecraft:packed_ice->minecraft:ice",
"minecraft:ice",
"minecraft:frosted_ice",
"# Plants",
"minecraft:brown_mushroom_block",
"minecraft:red_mushroom_block",
"minecraft:leaves",
"minecraft:leaves2",
"minecraft:melon_block",
"minecraft:pumpkin",
"minecraft:lit_pumpkin",
"# Concrete",
"minecraft:concrete:0->minecraft:concrete_powder:0",
"minecraft:concrete:1->minecraft:concrete_powder:1",
"minecraft:concrete:2->minecraft:concrete_powder:2",
"minecraft:concrete:3->minecraft:concrete_powder:3",
"minecraft:concrete:4->minecraft:concrete_powder:4",
"minecraft:concrete:5->minecraft:concrete_powder:5",
"minecraft:concrete:6->minecraft:concrete_powder:6",
"minecraft:concrete:7->minecraft:concrete_powder:7",
"minecraft:concrete:8->minecraft:concrete_powder:8",
"minecraft:concrete:9->minecraft:concrete_powder:9",
"minecraft:concrete:10->minecraft:concrete_powder:10",
"minecraft:concrete:11->minecraft:concrete_powder:11",
"minecraft:concrete:12->minecraft:concrete_powder:12",
"minecraft:concrete:13->minecraft:concrete_powder:13",
"minecraft:concrete:14->minecraft:concrete_powder:14",
"minecraft:concrete:15->minecraft:concrete_powder:15",
"# Misc",
"minecraft:planks->inspirations:mulch:0",
"minecraft:prismarine:1->minecraft:prismarine:0",
"minecraft:end_bricks->minecraft:end_stone",
"minecraft:monster_egg"
};
// tools
public static BooleanValue enableLock;
public static BooleanValue enableRedstoneCharge;
public static BooleanValue enableChargedArrow;
public static BooleanValue harvestHangingVines;
public static BooleanValue shearsReclaimMelons;
public static BooleanValue enableNorthCompass;
public static BooleanValue renameVanillaCompass;
public static BooleanValue enableBarometer;
public static BooleanValue enablePhotometer;
// waypoint compass
public static BooleanValue enableWaypointCompass;
private static BooleanValue dyeWaypointCompass;
private static BooleanValue craftWaypointCompass;
private static BooleanValue copyWaypointCompass;
public static BooleanValue waypointCompassAdvTooltip;
public static BooleanValue waypointCompassCrossDimension;
public static boolean dyeWaypointCompass () {
return dyeWaypointCompass.get() && enableWaypointCompass.get();
}
public static boolean craftWaypointCompass () {
return craftWaypointCompass.get() && enableWaypointCompass.get();
}
public static boolean copyWaypointCompass () {
return copyWaypointCompass.get() && enableWaypointCompass.get();
}
// enchantments
public static BooleanValue moreShieldEnchantments;
private static BooleanValue shieldEnchantmentTable;
public static boolean shieldEnchantmentTable() {
return shieldEnchantmentTable.get() && moreShieldEnchantments.get();
}
public static BooleanValue fixShieldTooltip;
public static BooleanValue axeWeaponEnchants;
public static BooleanValue axeEnchantmentTable;
// tweaks
public static BooleanValue enablePigDesaddle;
public static BooleanValue enableFittedCarpets;
public static BooleanValue coloredEnchantedRibbons;
public static BooleanValue coloredFireworkItems;
public static BooleanValue lilypadBreakFall;
public static BooleanValue betterCauldronItem;
public static BooleanValue unstackableRecipeAlts;
public static BooleanValue dispensersPlaceAnvils;
public static BooleanValue milkCooldown;
public static IntValue milkCooldownTime;
public static BooleanValue customPortalColor;
// heartbeet
public static BooleanValue enableHeartbeet;
private static BooleanValue brewHeartbeet;
public static boolean brewHeartbeet() {
return brewHeartbeet.get() && enableHeartbeet.get();
}
public static IntValue heartbeetChance;
// seeds
public static BooleanValue enableMoreSeeds;
private static BooleanValue addGrassDrops;
private static BooleanValue nerfCarrotPotatoDrops;
public static boolean addGrassDrops() {
return addGrassDrops.get() && enableMoreSeeds.get();
}
public static boolean nerfCarrotPotatoDrops() {
return nerfCarrotPotatoDrops.get() && enableMoreSeeds.get();
}
// bonemeal
public static BooleanValue bonemealMushrooms;
public static BooleanValue bonemealDeadBush;
public static BooleanValue bonemealGrassSpread;
public static BooleanValue bonemealMyceliumSpread;
public static BooleanValue caveSpiderDrops;
public static BooleanValue skeletonSkull;
private static String[] milkContainersDefault = {
"ceramics:clay_bucket",
"minecraft:bowl", // mushroom stew from mooshrooms
"minecraft:bucket",
"simplytea:teapot"
};
public static Set<Item> milkContainers;
static {
BUILDER = new Builder();
BUILDER_OVERRIDE = new Builder();
configure(BUILDER, BUILDER_OVERRIDE);
SPEC = BUILDER.build();
SPEC_OVERRIDE = BUILDER_OVERRIDE.build();
}
private static void configure(Builder builder, Builder builder_override) {
showAllVariants = builder
.comment("Shows all variants for dynamically textured blocks, like bookshelves. If false just the first will be shown")
.define("general.showAllVariants", true);
builder.push("building");
{
// bookshelves
enableBookshelf = builder
.comment("Enables the bookshelf: a decorative block to display books")
.define("bookshelf.enable", true);
enableColoredBooks = builder
.comment("Enables colored books: basically colored versions of the vanilla book to decorate bookshelves")
.define("bookshelf.coloredBooks", true );
bookshelvesBoostEnchanting = builder
.comment( "If true, bookshelves will increase enchanting table power.")
.define("bookshelf.boostEnchanting", true);
defaultEnchantingPower = builder
.comment("Default power for a book for enchanting, can be overridden in the book overrides.")
.defineInRange("bookshelf.defaultEnchanting", 1.5f, 0.0f, 15.0f);
bookKeywords = builder
.comment("List of keywords for valid books, used to determine valid books in the bookshelf. Separate each by commas.")
.define("bookshelf.bookKeywords", bookKeywordsDefault);
// rope
enableRope = builder
.comment("Enables rope: can be climbed like ladders and extended with additional rope")
.worldRestart()
.define("rope", true);
enableRopeLadder = builder
.comment("Enables rope ladders: right click ropes with sticks to extend the hitbox")
.define("ropeLadder", true);
// glass door
enableGlassDoor = builder
.comment("Enables glass doors and trapdoors: basically doors, but made of glass. Not sure what you would expect.")
.worldRestart()
.define("glassDoor", true);
// mulch
enableMulch = builder
.comment("Enables mulch: a craftable falling block which supports plants such as flowers")
.worldRestart()
.define("mulch", true);
// path
enablePath = builder
.comment("Enables stone paths: a carpet like decorative block for making decorative paths")
.worldRestart()
.define("path", true);
// flowers
enableFlowers = builder
.comment("Enables additional flowers from breaking double flowers with shears.")
.worldRestart()
.define("flowers", true);
// enlightenedBush
enableEnlightenedBush = builder
.comment( "Enables enlightened bushes: bushes with lights.")
.worldRestart()
.define("enlightenedBush", true);
}
builder.pop();
builder.push("utility");
{
enableRedstoneBook = builder
.comment("Enables the trapped book: will emit redstone power when placed in a bookshelf. Requires bookshelf.")
.worldRestart()
.define("redstoneBook", true);
// torch lever
enableTorchLever = builder
.comment("Enables the torch lever: basically a lever which looks like a torch")
.worldRestart()
.define("torchLever", true);
// bricks button
enableBricksButton = builder
.comment("Enables button blocks disguised as a full bricks or nether bricks block")
.worldRestart()
.define("bricksButton", true);
// redstone barrel
enableRedstoneBarrel = builder
.comment("Enables the redstone barrel: a block that gives a configurable comparator output and can be pushed by pistons")
.worldRestart()
.define("redstoneBarrel", true);
// redstone torch lever
enableRedstoneTorchLever = builder
.comment("Enables the redstone torch lever: a lever that toggles its state when the block it's on gets powered")
.worldRestart()
.define("redstoneTorchLever", true);
// carpeted trapdoor
enableCarpetedTrapdoor = builder
.comment("Enables carpeted trapdoors: a trapdoor which appears to be a carpet when closed")
.worldRestart()
.define("carpetedTrapdoor", true);
// carpeted pressure plate
enableCarpetedPressurePlate = builder
.comment("Allows placing a carpet on a stone pressure plate to hide it")
.worldRestart()
.define("carpetedPressurePlate", true);
// collector
enableCollector = builder
.comment("Enables the collector: extracts items from inventories or the world similar to a hopper, but can face in all 6 directions and cannot place items in inventories")
.worldRestart()
.define("collector", true);
// pipe
enablePipe = builder
.comment("Enables pipes: a more economical hopper that only outputs items, does not pull from inventories. Both cheaper and better for performance.")
.worldRestart()
.define("pipe.enable", true);
pipeUpwards = builder
.comment("Allows pipes to output upwards. This removes a limitation on not being able to pipe items up without dropper elevators, but should be balanced alongside modded pipes.")
.worldRestart()
.define("pipe.upwards", true);
// dispenser fluid containers
enableDispenserFluidTanks = builder
.comment("Allows dispensers to fill and empty fluid tanks using fluid containers")
.worldRestart()
.define("dispenserFluidTanks", true);
}
builder.pop();
// recipes
builder.push("recipes");
{
// anvil smashing
// configFile.moveProperty("tweaks", "anvilSmashing", "recipes");
enableAnvilSmashing = builder_override
.comment("Anvils break glass blocks and transform blocks into other blocks on landing. Uses a block override, so disable if another mod replaces anvils.")
.worldRestart()
.define("anvilSmashing", true);
// cauldron //
// basic config
spongeEmptyCauldron = builder
.comment("Allows sponges to be used to empty the cauldron of dye, water, or potions. Can be 'disabled', 'full' or 'any'. If set to 'full', requires the cauldron to be full, prevents duplicating water but is less useful for removing unwanted fluids.")
.defineEnum("spongeEmpty", SpongeEmptyCauldron.ANY);
// extended options
replaceCauldron = builder_override
.comment("Replace the cauldron block to allow it to hold other liquids and perform recipes.")
.worldRestart()
.define("cauldron", true);
enableCauldronRecipes = builder
.comment("Allows additional recipes to be performed in the cauldron. If the block replacement is disabled, functionality will be limited to water in cauldrons.")
.define("extendCauldron", true);
builder.push("cauldron");
{
enableBiggerCauldron = builder
.comment("Makes the cauldron hold 4 bottle per bucket instead of 3. Translates better to modded fluids.")
.worldRestart()
.define("bigger", false);
fasterCauldronRain = builder
.comment("Cauldrons fill faster in the rain than vanilla painfully slow rate.")
.define("fasterRain", true);
dropCauldronContents = builder
.comment("Cauldrons will drop their contents when broken.")
.define("dropContents", true);
cauldronObsidian = builder
.comment("Allows making obsidian in a cauldron by using a lava bucket on a water filled cauldron. Supports modded buckets. If cauldron fluids is enabled, you can also use a water bucket on a lava filled cauldron.")
.define("obsidian", true);
// fluids
enableCauldronFluids = builder
.comment("Allows cauldrons to be filled with any fluid and use them in recipes")
.define("fluids.enable", true);
enableMilk = builder
.comment("Registers milk as a fluid so it can be used in cauldron recipes.")
.define("fluids.milk", true);
// dyeing
enableCauldronDyeing = builder
.comment("Allows cauldrons to be filled with dyes and dye items using cauldrons")
.define("dyeing.enable", true);
patchVanillaDyeRecipes = builder
.comment("Makes crafting two dyed water bottles together produce a dyed water bottle. Requires modifying vanilla recipes to prevent a conflict")
.define("dyeing.patchVanillaRecipes", true);
extraBottleRecipes = builder
.comment("Adds extra dyed bottle recipes to craft green and brown")
.define("dyeing.extraBottleRecipes", true);
// potions
enableCauldronPotions = builder
.comment("Allows cauldrons to be filled with potions and support brewing")
.define("potions.enable", true);
enableCauldronBrewing = builder
.comment("Allows cauldrons to perform brewing recipes.")
.define("potions.brewing", true);
expensiveCauldronBrewing = builder
.comment("Caps brewing at 2 potions per ingredient, requiring 2 ingredients for a full cauldron. Makes the brewing stand still useful and balances better against the bigger cauldron.")
.define("potions.brewingExpensive", true);
cauldronTipArrows = builder
.comment("Allows cauldrons to tip arrows with potions.")
.define("potions.tippedArrow", true);
// dispensers
enableCauldronDispenser = builder
.comment("Allows dispensers to perform some recipes in the cauldron. Intended to be used for recipes to fill and empty fluid containers as droppers can already be used for recipes")
.define("dispenser", true);
}
builder.pop();
}
builder.pop();
builder.push("tools");
{
// redstone charge
enableRedstoneCharge = builder
.comment("Enables the redstone charger: a quick pulse created with a flint and steel like item")
.worldRestart()
.define("redstoneCharge", true);
enableChargedArrow = builder
.comment("Enables the charged arrow: places a redstone pulse where it lands")
.worldRestart()
.define("chargedArrow", true);
// lock
enableLock = builder
.comment("Enables locks and keys: an item allowing you to lock a tile entity to only open for a special named item")
.worldRestart()
.define("lock", true);
// harvest hanging vines
harvestHangingVines = builder
.comment("When shearing vines, any supported vines will also be sheared instead of just broken")
.define("shears.harvestHangingVines", true);
// shears reclaim melons
shearsReclaimMelons = builder
.comment("Breaking a melon block with shears will always return 9 slices")
.define("reclaimMelons", true);
// compass
enableNorthCompass = builder
.comment("Enables the north compass: a cheaper compass that always points north. Intended to either allow packs to replace the compass or as an alternative for F3 navigation")
.worldRestart()
.define("northCompass.enable", true);
renameVanillaCompass = builder
.comment("Renames the vanilla compass to 'origin compass' to help clarify the difference between the two compasses.")
.worldRestart()
.define("northCompass.renameVanilla", true);
// barometer
enableBarometer = builder
.comment("Enables the barometer: a tool to measure the player's height in world.")
.worldRestart()
.define("barometer", true);
// photometer
enablePhotometer = builder
.comment("Enables the photometer: a tool to measure light in world. Can be pointed at a block to measure the light level of that block.")
.worldRestart()
.define("photometer", true);
// waypoint compass
enableWaypointCompass = builder
.comment("Enables the waypoint compass: a compass which points towards a full beacon.")
.worldRestart()
.define("waypointCompass.enable", true);
dyeWaypointCompass = builder
.comment("If true, waypoint compasses can be dyed all vanilla colors")
.define("waypointCompass.dye", true);
craftWaypointCompass = builder
.comment("If true, waypoint compasses can be crafted using iron and a blaze rod. If false, they are obtained by using a vanilla compass on a beacon.")
.define("waypointCompass.craft", true);
waypointCompassAdvTooltip = builder
.comment("If true, waypoint compasses show the position target in the advanced item tooltip. Disable for packs that disable coordinates.")
.define("waypointCompass.advTooltip", true);
waypointCompassCrossDimension = builder
.comment("If true, waypoint compasses work across dimensions. The coordinates between the overworld and nether will be adjusted, allowing for portal syncing.")
.define("waypointCompass.crossDimension", true);
copyWaypointCompass = builder
.comment("If true, you can copy the position of one waypoint compass to another in a crafting table, similarly to maps or compasses")
.define("waypointCompass.copy", true);
// enchantments
moreShieldEnchantments = builder_override
.comment("If true, shields can now be enchanted with enchantments such as protection, fire aspect, knockback, and thorns. This requires replacing these enchantments.")
.define("enchantments.moreShield", true);
shieldEnchantmentTable = builder_override
.comment("If true, shields can be enchanted in an enchantment table. Does not support modded shields as it requires a registry substitution")
.define("enchantments.shieldTable", true);
fixShieldTooltip = builder
.comment("If true, fixes the tooltip on shield items so it looks better with both patterns and enchantments")
.define("fixShieldTooltip", true);
axeWeaponEnchants = builder_override
.comment("If true, axes will be able to be enchanted with weapon enchants such as looting, fire aspect, and knockback")
.define("enchantments.axeWeapon", true);
axeEnchantmentTable = builder_override
.comment("If true, axes can receive available weapon enchantments at the enchantment table")
.define("enchantments.axeTable", true);
}
builder.pop();
builder.push("tweaks");
{
// pig desaddle
enablePigDesaddle = builder
.comment("Allows pigs to be desaddled by shift-right click with an empty hand")
.define("desaddlePig", true);
// fitted carpets
enableFittedCarpets = builder_override
.comment("Replace carpet blocks, allowing them to fit to stairs below them.")
.define("fittedCarpets", true);
// bonemeal
builder.push("bonemeal");
bonemealMushrooms = builder
.comment("Bonemeal can be used on mycelium to produce mushrooms")
.define("mushrooms", true);
bonemealDeadBush = builder
.comment("Bonemeal can be used on sand to produce dead bushes")
.define("deadBush", true);
bonemealGrassSpread = builder
.comment("Bonemeal can be used on dirt to produce grass if adjecent to grass")
.define("grassSpread", true);
bonemealMyceliumSpread = builder
.comment("Bonemeal can be used on dirt to produce mycelium if adjecent to mycelium")
.define("myceliumSpread", true);
builder.pop();
// heartroot
enableHeartbeet = builder
.comment("Enables heartbeets: a rare drop from beetroots which can be eaten to restore a bit of health")
.define("heartbeet.enable", true);
brewHeartbeet = builder
.comment("Allows heartbeets to be used as an alternative to ghast tears in making potions of regeneration")
.define("heartbeet.brewRegeneration", true); // && enableHeartbeet;
heartbeetChance = builder
.comment("Chance of a heartbeet to drop instead of a normal drop. Formula is two 1 in [chance] chances for it to drop each harvest")
.defineInRange("heartbeet.chance", 75, 10, 1000);
// dispensers place anvils
dispensersPlaceAnvils = builder
.comment("Dispensers will place anvils instead of dropping them. Plays well with anvil smashing.")
.define("dispensersPlaceAnvils", true);
// better cauldron item
betterCauldronItem = builder
.comment("Replaces the flat cauldron sprite with the 3D cauldron block model")
.define("betterCauldronItemModel", true);
// colored enchanted book ribbons
coloredEnchantedRibbons = builder
.comment("The ribbon on enchanted books colors based on the enchantment rarity")
.worldRestart()
.define("coloredEnchantedRibbons", true);
// colored fireworks
coloredFireworkItems = builder
.comment("Colors the fireworks item based on the colors of the stars")
.define("coloredFireworkItems", true);
// lilypad fall breaking
lilypadBreakFall = builder
.comment("Lily pads prevent fall damage, but break in the process")
.define("lilypadBreakFall", true);
// stackable alternative recipes
unstackableRecipeAlts = builder
.comment("Adds stackable recipes to some vanilla or Inspriations items that require unstackable items to craft")
.define("unstackableRecipeAlts", true);
// seeds
enableMoreSeeds = builder
.comment("Adds seeds for additional vanilla plants, including cactus, sugar cane, carrots, and potatoes.")
.worldRestart()
.define("moreSeeds.enable", true);
addGrassDrops = builder
.comment("Makes carrot and potato seeds drop from grass")
.define("moreSeeds.grassDrops", true);
nerfCarrotPotatoDrops = builder
.comment("Makes carrots and potatoes drop their respective seed if not fully grown")
.define("moreSeeds.nerfCarrotPotatoDrops", true);
// milk cooldown
milkCooldown = builder
.comment("Adds a cooldown to milking cows, prevents practically infinite milk in modded worlds where milk is more useful.")
.define("milkCooldown.enable", false);
milkCooldownTime = builder
.comment("Delay in seconds after milking a cow before it can be milked again.")
.defineInRange("milkCooldown.time", 600, 1, Short.MAX_VALUE);
customPortalColor = builder
.comment( "Allows the portal color to be changed by placing colored blocks under the portal. Any block that tints a beacon beam will work for the color.")
.define("customPortalColor", true);
}
builder.pop();
// milk squids
milkSquids = builder
.comment("Allows milking squids with a glass bottle to get black dyed water.")
.define("tweaks.milkSquids.enable", true);
milkSquidCooldown = builder
.comment("Delay in seconds after milking a squid before it can be milked again.")
.defineInRange("tweaks.milkSquids.cooldown", 300, 1, Short.MAX_VALUE);
// drops
caveSpiderDrops = builder
.comment("If true, cave spiders will rarely drop webs, giving them an advantage to farm over regular spiders")
.define("caveSpiderWeb", true);
skeletonSkull = builder
.comment("If true, skeletons will rarely drop their skull for consistency with wither skeletons. Does not affect creeper or zombie heads.")
.define("skeletonSkull", true);
// building
// Property property = configFile.get("building.bookshelf", "bookOverrides", bookOverrides,
// "List of itemstacks to override book behavior. Format is modid:name[:meta][->enchantingPower].\nUnset meta will default wildcard.\n0 is a valid enchanting power, if unset uses default. Set to 'false' to mark something as not a book.");
// bookOverrides = property.getStringList();
// processBookOverrides(bookOverrides);
// anvil smashing
// skip the helper method so the defaults are not put in the comment
// configFile.moveProperty("tweaks.anvilSmashing", "recipes.anvilSmashing", "smashing");
// anvilSmashing = configFile.get("recipes.anvilSmashing", "smashing", anvilSmashing,
// "List of blocks to add to anvil smashing. Format is modid:input[:meta][->modid:output[:meta]]. If the output is excluded, it will default to air (breaking the block). If the meta is excluded, it will check all states for input and use the default for output").getStringList();
// processAnvilSmashing(anvilSmashing);
// cauldron uses
// configFile.moveProperty("recipes.cauldronRecipes", "recipes", "recipes.cauldron");
// cauldronRecipes = configFile.get("recipes.cauldron", "recipes", cauldronRecipes,
// "List of recipes to add to the cauldron on right click. Format is (modid:input:meta|oreString)->modid:output:meta[->isBoiling]. If isBoiling is excluded, it defaults to false.").getStringList();
// processCauldronRecipes(cauldronRecipes);
}
/**
* Updates a config file from a bunch of colons to the new -> format
* @param line Old line
* @param t True string
* @param f False string
* @return New line
*/
private static String updateConfig(String line, String t, String f) {
String[] parts = line.split(":");
switch(parts.length) {
// 'modid:name' -> 'modid:name->1.5
case 2:
return line + "->" + t;
// 'modid:name:meta' -> 'modid:name:meta->7
case 3:
// if meta -1, remove as wildcard is just none now
if(parts[2].equals("-1")) {
return String.format("%s:%s->%s", parts[0], parts[1], t);
}
return line + "->" + t;
case 4:
// first, determine power
String power = "false".equals(parts[3]) ? f : t;
// if meta -1, remove as wildcard is just none now
if(parts[2].equals("-1")) {
return String.format("%s:%s->%s", parts[0], parts[1], power);
}
return String.format("%s:%s:%s->%s", parts[0], parts[1], parts[2], power);
}
return line;
}
/**
* Parses the book overrides from the string array
* @param overrides Input string array
*/
private static void processBookOverrides(String[] overrides) {
if(!enableBookshelf.get()) {
return;
}
String[] parts;
// simply look through each entry
for(String override : overrides) {
// skip blank lines
if("".equals(override) || override.startsWith("#")) {
continue;
}
parts = override.split("->");
if(parts.length > 2) {
Inspirations.log.error("Invalid book override {}: must be in format modid:name[:meta][->power]. ", override);
continue;
}
// finally, parse the isBook boolean. Pretty lazy here, just check if its not the string false
float power = defaultEnchantingPower.get().floatValue();
if (parts.length > 1) {
try {
power = Float.parseFloat(parts[1]);
} catch(NumberFormatException e) {
if (parts[1].equals("false")) {
power = -1;
} else {
Inspirations.log.error("Invalid book override {}: power must be a number. ", override);
continue;
}
}
}
// normalize not a book
if (power < 0) {
power = -1;
}
final float enchPower = power;
RecipeUtil.forStackInString(parts[0], stack -> InspirationsRegistry.registerBook(stack.getItem(), enchPower));
}
}
/**
* Parses the anvil smashing array into the registry
* @param transformations Input array
*/
private static void processAnvilSmashing(String[] transformations) {
if(!enableAnvilSmashing.get()) {
return;
}
for(String transformation : transformations) {
// skip blank lines
if("".equals(transformation) || transformation.startsWith("#")) {
continue;
}
// first, ensure we have the right number of inputs
// it should be 1 for plain old smashing or two for a transformation
String[] transformParts = transformation.split("->");
if(transformParts.length > 2 || transformParts.length < 1) {
Inspirations.log.error("Invalid anvil smashing {}: must be in the format of modid:input[:meta][->modid:output[:meta]]", transformation);
continue;
}
// if the length is 1, this is block breaking, so use air for the output
BlockState output;
if(transformParts.length == 1) {
output = Blocks.AIR.getDefaultState();
} else {
output = RecipeUtil.getBlockStateFromString(transformParts[1]);
if (output == null) {
Inspirations.log.info("Skipping anvil smashing {}: unable to find output {}", transformation, transformParts[1]);
continue;
}
}
RecipeUtil.forBlockInString(transformParts[0],
state -> InspirationsRegistry.registerAnvilSmashing(state, output),
block -> InspirationsRegistry.registerAnvilSmashing(block, output));
}
}
/**
* Processes the simple cauldron recipes from the config
* @param cauldronRecipes List of recipe strings
*/
private static void processCauldronRecipes(String[] cauldronRecipes) {
if(!enableCauldronRecipes()) {
return;
}
for(String recipe : cauldronRecipes) {
// skip blank lines
if("".equals(recipe) || recipe.startsWith("#")) {
continue;
}
String[] parts = recipe.split("->");
if(parts.length < 2 || parts.length > 3) {
Inspirations.log.error("Invalid cauldron recipe {}: must be in format input->output[->isBoiling]", recipe);
continue;
}
// input
ItemStack input = null;
if(parts[0].contains(":")) {
input = RecipeUtil.getItemStackFromString(parts[0], true);
if(input.isEmpty()) {
continue;
}
}
// output
ItemStack output = RecipeUtil.getItemStackFromString(parts[1], false);
if(output.isEmpty()) {
continue;
}
// add recipe
Boolean boiling = parts.length > 2 ? parts[2].equals("true") : null;
// if the input is empty, we are using an oreString
if(input == null) {
// InspirationsRegistry.addCauldronRecipe(parts[0], output, boiling);
} else {
// InspirationsRegistry.addCauldronRecipe(input, output, boiling);
}
}
}
}