Skip to content

Commit d013732

Browse files
committed
Prevent game crash when patchouli is missing
1 parent af03913 commit d013732

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

  • src/main/java/de/srendi/advancedperipherals/common/events

src/main/java/de/srendi/advancedperipherals/common/events/Events.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
import net.neoforged.neoforge.event.CommandEvent;
1919
import net.neoforged.neoforge.event.ServerChatEvent;
2020
import net.neoforged.neoforge.event.entity.player.PlayerEvent;
21-
import vazkii.patchouli.api.PatchouliAPI;
22-
import vazkii.patchouli.common.base.PatchouliAPIImpl;
2321

2422
import java.util.function.Consumer;
2523

@@ -43,7 +41,7 @@ public static void onWorldJoin(PlayerEvent.PlayerLoggedInEvent event) {
4341
// See https://vazkiimods.github.io/Patchouli/docs/patchouli-basics/giving-new
4442
if (APConfig.WORLD_CONFIG.givePlayerBookOnJoin.get() && APAddon.PATCHOULI.isLoaded()) {
4543
if (!hasPlayedBefore(player)) {
46-
PatchouliAPI.IPatchouliAPI patchouli = new PatchouliAPIImpl();
44+
vazkii.patchouli.api.PatchouliAPI.IPatchouliAPI patchouli = vazkii.patchouli.api.PatchouliAPI.get();
4745
ItemStack book = patchouli.getBookStack(AdvancedPeripherals.getRL("manual"));
4846
player.addItem(book);
4947
}

0 commit comments

Comments
 (0)