-
-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathAdvancedPeripherals.java
More file actions
84 lines (71 loc) · 3.11 KB
/
AdvancedPeripherals.java
File metadata and controls
84 lines (71 loc) · 3.11 KB
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
/*
* Copyright 2024 Intelligence Modding @ https://intelligence-modding.de
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.srendi.advancedperipherals;
import de.srendi.advancedperipherals.common.addons.APAddons;
import de.srendi.advancedperipherals.common.configuration.APConfig;
import de.srendi.advancedperipherals.common.network.PacketHandler;
import de.srendi.advancedperipherals.common.setup.APRegistration;
import de.srendi.advancedperipherals.common.village.VillageStructures;
import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.Random;
@Mod(AdvancedPeripherals.MOD_ID)
public class AdvancedPeripherals {
public static final String MOD_ID = "advancedperipherals";
public static final String NAME = "Advanced Peripherals";
public static final Logger LOGGER = LogManager.getLogger(NAME);
public static final Random RANDOM = new Random();
public static final APCreativeTab TAB = new APCreativeTab();
public static final APAddons ADDONS = new APAddons();
public AdvancedPeripherals() {
LOGGER.info("AdvancedPeripherals says hello!");
IEventBus modBus = FMLJavaModLoadingContext.get().getModEventBus();
APConfig.register(ModLoadingContext.get());
modBus.addListener(this::commonSetup);
APRegistration.register();
MinecraftForge.EVENT_BUS.register(this);
}
public static void debug(String message) {
if (APConfig.GENERAL_CONFIG.enableDebugMode.get())
LOGGER.debug("[DEBUG] {}", message);
}
public static void debug(String message, Level level) {
if (APConfig.GENERAL_CONFIG.enableDebugMode.get())
LOGGER.log(level, "[DEBUG] {}", message);
}
public static void exception(String message, Exception exception) {
if (APConfig.GENERAL_CONFIG.enableDebugMode.get()) {
LOGGER.error("[DEBUG]", exception);
}
}
public static ResourceLocation getRL(String resource) {
return new ResourceLocation(MOD_ID, resource);
}
public void commonSetup(FMLCommonSetupEvent event) {
event.enqueueWork(() -> {
PacketHandler.init();
VillageStructures.init();
});
}
}