Skip to content

Commit 781940e

Browse files
authored
Replace Patchouli by GuideME (#1039)
1 parent 8dd5717 commit 781940e

File tree

547 files changed

+7766
-6845
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

547 files changed

+7766
-6845
lines changed

build.gradle

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ repositories {
3838
includeGroup "curse.maven"
3939
}
4040
}
41-
// for Patchouli
42-
maven {
43-
url 'https://maven.blamejared.com'
44-
}
4541
// for AE2 and JEI
4642
maven {
4743
name "Modmaven"
@@ -202,6 +198,10 @@ neoForge {
202198
// You can set various levels here.
203199
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
204200
systemProperty 'forge.logging.console.level', 'debug'
201+
202+
// Allows updates to the guide book to be watched for by GuideME.
203+
systemProperty 'guideme.modern_industrialization.book.sources',
204+
file("src/main/resources/assets/modern_industrialization/mi_guidebook/").absolutePath
205205
}
206206

207207
client {
@@ -251,6 +251,7 @@ configurations {
251251

252252
dependencies {
253253
api jarJar("dev.technici4n:GrandPower:${project.grandpower_version}")
254+
implementation "org.appliedenergistics:guideme:${project.guideme_version}"
254255

255256
compileOnly "mezz.jei:jei-${project.jei_minecraft_version}-neoforge-api:${project.jei_version}"
256257
if (project.runtime_itemlist_mod == "jei") {
@@ -274,10 +275,6 @@ dependencies {
274275
throw new GradleException("Invalid runtime_itemlist_mod value: " + project.runtime_itemlist_mod)
275276
}
276277

277-
compileOnly "vazkii.patchouli:Patchouli:${project.patchouli_version}:api"
278-
localRuntimeOnly "vazkii.patchouli:Patchouli:${project.patchouli_version}"
279-
jarJar "vazkii.patchouli:Patchouli:${project.patchouli_version}"
280-
281278
implementation "me.shedaniel.cloth:cloth-config-neoforge:${project.cloth_config_version}"
282279

283280
localRuntimeOnly compileOnly("curse.maven:jade-324717:${project.jade_file_id}")
@@ -300,6 +297,7 @@ var generateModMetadata = tasks.register("generateModMetadata", ProcessResources
300297
mod_version: version,
301298
cloth_config_version_range: cloth_config_version_range,
302299
grandpower_version_range: grandpower_version_range,
300+
guideme_version_range: guideme_version_range,
303301
ae2_version_range: ae2_version_range,
304302
jei_version_range: jei_version_range,
305303
]
@@ -395,12 +393,12 @@ if (System.getenv("CURSEFORGE_API_KEY") && !version.endsWith("-SNAPSHOT")) {
395393

396394
relations {
397395
requiredDependency "cloth-config"
396+
requiredDependency "guideme"
398397
optionalDependency "wthit"
399398
optionalDependency "emi"
400399
optionalDependency "jei"
401400
optionalDependency "roughly-enough-items"
402401
embeddedLibrary "grandpower"
403-
embeddedLibrary "patchouli"
404402
}
405403
mainArtifact(tasks.named("jar").flatMap { it.archiveFile }) {
406404
displayName = "Modern Industrialization v${version}"
@@ -427,11 +425,11 @@ modrinth {
427425
loaders = ["neoforge"]
428426
dependencies {
429427
required.project "cloth-config"
428+
required.project "guideme"
430429
optional.project "wthit"
431430
optional.project "emi"
432431
optional.project "jei"
433432
optional.project "rei"
434-
embedded.project "patchouli"
435433
}
436434
}
437435
tasks.modrinth.onlyIf {

gradle.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ cloth_config_version=15.0.128
2929
cloth_config_version_range=[15.0.128, 16)
3030
grandpower_version=3.0.0
3131
grandpower_version_range=[3.0.0, 4)
32+
guideme_version=21.1.5
33+
guideme_version_range=[21.1.5, 21.2)
3234

3335
# Optional dependency versions
3436
ae2_version=19.0.12-alpha
@@ -47,6 +49,5 @@ jei_minecraft_version=1.21.1
4749
jei_version=19.20.0.241
4850
jei_version_range=[19.19.0,]
4951
kubejs_version=2100.7.0-build.102
50-
patchouli_version=1.21-87-NEOFORGE-SNAPSHOT
5152
rei_version=16.0.729
5253
rei_annotations_version=12.0.93

src/generated/resources/assets/modern_industrialization/lang/en_us.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,6 @@
447447
"block.modern_industrialization.vacuum_freezer": "Vacuum Freezer",
448448
"block.modern_industrialization.vinyl_chloride": "Vinyl Chloride",
449449
"block.modern_industrialization.yttrium_block": "Block of Yttrium",
450-
"book.modern_industrialization.landing_text": "Welcome to Modern Industrialization! To get started, be sure to collect a lot of Copper Ore and Tin Ore.",
451-
"book.modern_industrialization.subtitle": "Modern Industrialization",
452450
"cable_tier_long.modern_industrialization.ev": "Extreme Voltage",
453451
"cable_tier_long.modern_industrialization.hv": "High Voltage",
454452
"cable_tier_long.modern_industrialization.lv": "Low Voltage",

src/main/java/aztech/modern_industrialization/MI.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
import aztech.modern_industrialization.debug.DebugCommands;
3333
import aztech.modern_industrialization.definition.BlockDefinition;
3434
import aztech.modern_industrialization.definition.ItemDefinition;
35+
import aztech.modern_industrialization.guidebook.GuidebookEvents;
36+
import aztech.modern_industrialization.guidebook.MIGuide;
3537
import aztech.modern_industrialization.items.DynamicToolItem;
3638
import aztech.modern_industrialization.items.SteamDrillHooks;
3739
import aztech.modern_industrialization.items.armor.MIArmorEffects;
@@ -44,7 +46,6 @@
4446
import aztech.modern_industrialization.machines.init.SingleBlockSpecialMachines;
4547
import aztech.modern_industrialization.machines.multiblocks.world.ChunkEventListeners;
4648
import aztech.modern_industrialization.materials.MIMaterials;
47-
import aztech.modern_industrialization.misc.guidebook.GuidebookEvents;
4849
import aztech.modern_industrialization.misc.runtime_datagen.RuntimeDataGen;
4950
import aztech.modern_industrialization.network.MIPackets;
5051
import aztech.modern_industrialization.nuclear.FluidNuclearComponent;
@@ -127,6 +128,7 @@ public MI(IEventBus modBus, Dist dist) {
127128
ChunkEventListeners.init();
128129
DebugCommands.init();
129130
GuidebookEvents.init();
131+
MIGuide.init();
130132
MIArmorEffects.init();
131133

132134
NeoForge.EVENT_BUS.addListener(PlayerEvent.PlayerChangedDimensionEvent.class, event -> MIKeyMap.clear(event.getEntity()));

src/main/java/aztech/modern_industrialization/MIItem.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
import aztech.modern_industrialization.api.energy.EnergyApi;
2929
import aztech.modern_industrialization.definition.ItemDefinition;
30+
import aztech.modern_industrialization.guidebook.GuideBookItem;
3031
import aztech.modern_industrialization.items.*;
3132
import aztech.modern_industrialization.items.armor.GraviChestPlateItem;
3233
import aztech.modern_industrialization.items.armor.JetpackItem;

src/main/java/aztech/modern_industrialization/datagen/translation/TranslationProvider.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,6 @@ public void addTranslation(String key, String englishValue) {
7272

7373
private void addManualEntries() {
7474
addTranslation("block.modern_industrialization.pipe", "Pipe(s)");
75-
addTranslation("book.modern_industrialization.landing_text",
76-
"Welcome to Modern Industrialization! To get started, be sure to collect a lot of Copper Ore and Tin Ore.");
77-
78-
addTranslation("book.modern_industrialization.subtitle",
79-
"Modern Industrialization");
8075

8176
addTranslation("entity.minecraft.villager.modern_industrialization.industrialist", "Industrialist");
8277

src/main/java/aztech/modern_industrialization/items/GuideBookItem.java renamed to src/main/java/aztech/modern_industrialization/guidebook/GuideBookItem.java

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,20 @@
2121
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2222
* SOFTWARE.
2323
*/
24-
package aztech.modern_industrialization.items;
24+
package aztech.modern_industrialization.guidebook;
2525

26-
import aztech.modern_industrialization.MI;
2726
import aztech.modern_industrialization.MIText;
2827
import aztech.modern_industrialization.util.TextHelper;
28+
import guideme.GuidesCommon;
2929
import java.util.List;
3030
import net.minecraft.network.chat.Component;
31-
import net.minecraft.server.level.ServerPlayer;
3231
import net.minecraft.world.InteractionHand;
3332
import net.minecraft.world.InteractionResultHolder;
3433
import net.minecraft.world.entity.player.Player;
3534
import net.minecraft.world.item.Item;
3635
import net.minecraft.world.item.ItemStack;
3736
import net.minecraft.world.item.TooltipFlag;
3837
import net.minecraft.world.level.Level;
39-
import net.neoforged.fml.ModList;
40-
import vazkii.patchouli.api.PatchouliAPI;
4138

4239
public class GuideBookItem extends Item {
4340
public GuideBookItem(Properties settings) {
@@ -46,13 +43,8 @@ public GuideBookItem(Properties settings) {
4643

4744
@Override
4845
public InteractionResultHolder<ItemStack> use(Level world, Player user, InteractionHand hand) {
49-
if (!world.isClientSide && user instanceof ServerPlayer) {
50-
if (ModList.get().isLoaded("patchouli")) { // a bit borderline...
51-
PatchouliAPI.get().openBookGUI((ServerPlayer) user, MI.id("book"));
52-
return InteractionResultHolder.success(user.getItemInHand(hand));
53-
} else {
54-
user.displayClientMessage(Component.literal("Patchouli is not loaded, can't open guide book!"), true);
55-
}
46+
if (world.isClientSide) {
47+
GuidesCommon.openGuide(user, MIGuide.ID);
5648
}
5749
return InteractionResultHolder.consume(user.getItemInHand(hand));
5850
}

src/main/java/aztech/modern_industrialization/misc/guidebook/GuidebookEvents.java renamed to src/main/java/aztech/modern_industrialization/guidebook/GuidebookEvents.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2222
* SOFTWARE.
2323
*/
24-
package aztech.modern_industrialization.misc.guidebook;
24+
package aztech.modern_industrialization.guidebook;
2525

2626
import aztech.modern_industrialization.MIAdvancementTriggers;
2727
import aztech.modern_industrialization.MIConfig;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2222
* SOFTWARE.
2323
*/
24-
package aztech.modern_industrialization.misc.guidebook;
24+
package aztech.modern_industrialization.guidebook;
2525

2626
import aztech.modern_industrialization.util.MISavedData;
2727
import java.util.*;
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* MIT License
3+
*
4+
* Copyright (c) 2020 Azercoco & Technici4n
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in all
14+
* copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
*/
24+
package aztech.modern_industrialization.guidebook;
25+
26+
import aztech.modern_industrialization.MI;
27+
import guideme.Guide;
28+
import net.minecraft.resources.ResourceLocation;
29+
30+
public class MIGuide {
31+
public static final ResourceLocation ID = MI.id("book");
32+
private static Guide guide;
33+
34+
public static void init() {
35+
guide = Guide.builder(ID)
36+
.folder("mi_guidebook")
37+
.build();
38+
}
39+
40+
private MIGuide() {
41+
}
42+
}

0 commit comments

Comments
 (0)