添加MCR的灵魂
This commit is contained in:
parent
7e22bab186
commit
dbd96a7ee6
2 changed files with 43 additions and 0 deletions
|
@ -15,6 +15,8 @@ import net.minecraftforge.network.NetworkDirection;
|
||||||
import net.minecraftforge.network.NetworkEvent;
|
import net.minecraftforge.network.NetworkEvent;
|
||||||
import net.minecraftforge.network.NetworkRegistry;
|
import net.minecraftforge.network.NetworkRegistry;
|
||||||
import net.minecraftforge.network.simple.SimpleChannel;
|
import net.minecraftforge.network.simple.SimpleChannel;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||||
|
@ -27,6 +29,8 @@ public class TargetMod {
|
||||||
public static final String MODID = "target";
|
public static final String MODID = "target";
|
||||||
public static final String ATTRIBUTE_MODIFIER = "target_attribute_modifier";
|
public static final String ATTRIBUTE_MODIFIER = "target_attribute_modifier";
|
||||||
|
|
||||||
|
public static final Logger LOGGER = LogManager.getLogger(TargetMod.class);
|
||||||
|
|
||||||
public TargetMod() {
|
public TargetMod() {
|
||||||
IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus();
|
IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus();
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
package net.mcreator.target.procedures;
|
||||||
|
|
||||||
|
import net.mcreator.target.TargetMod;
|
||||||
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
|
import net.minecraftforge.fml.InterModComms;
|
||||||
|
import net.minecraftforge.fml.common.Mod;
|
||||||
|
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
|
||||||
|
public class WelcomeProcedure {
|
||||||
|
@SubscribeEvent
|
||||||
|
public static void onFMLCommonSetup(FMLCommonSetupEvent event) {
|
||||||
|
if (event != null) {
|
||||||
|
execute(event, event.getIMCStream());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void execute(Stream<InterModComms.IMCMessage> stream) {
|
||||||
|
execute(null, stream);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void execute(@Nullable Event event, Stream<InterModComms.IMCMessage> stream) {
|
||||||
|
if (event == null)
|
||||||
|
return;
|
||||||
|
Logger logger = null;
|
||||||
|
if ((logger == null ? logger = TargetMod.LOGGER : LogManager.getLogger(TargetMod.class)) instanceof Logger) {
|
||||||
|
{
|
||||||
|
Logger _lgr = (Logger) logger;
|
||||||
|
_lgr.info("This Mod is made by MCreator!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue