mirror of
https://github.com/xzb23/Minecraft-Command-Permission-Control.git
synced 2026-11-22 08:44:36 +08:00
禁止作弊并广播
This commit is contained in:
4 files changed
+69
-52
No files matched your search
@@ -1,5 +1,6 @@
|
||||
package com.ataku.stopcheat;
|
||||
|
||||
import net.neoforged.fml.loading.FMLEnvironment;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import com.mojang.logging.LogUtils;
|
||||
@@ -66,26 +67,28 @@ public class stopcheat {
|
||||
// The constructor for the mod class is the first code that is run when your mod is loaded.
|
||||
// FML will recognize some parameter types like IEventBus or ModContainer and pass them in automatically.
|
||||
public stopcheat(IEventBus modEventBus, ModContainer modContainer) {
|
||||
// Register the commonSetup method for modloading
|
||||
modEventBus.addListener(this::commonSetup);
|
||||
|
||||
// Register the Deferred Register to the mod event bus so blocks get registered
|
||||
BLOCKS.register(modEventBus);
|
||||
// Register the Deferred Register to the mod event bus so items get registered
|
||||
ITEMS.register(modEventBus);
|
||||
// Register the Deferred Register to the mod event bus so tabs get registered
|
||||
CREATIVE_MODE_TABS.register(modEventBus);
|
||||
|
||||
// Register ourselves for server and other game events we are interested in.
|
||||
// Note that this is necessary if and only if we want *this* class (stopcheat) to respond directly to events.
|
||||
// Do not add this line if there are no @SubscribeEvent-annotated functions in this class, like onServerStarting() below.
|
||||
NeoForge.EVENT_BUS.register(this);
|
||||
|
||||
// Register the item to a creative tab
|
||||
modEventBus.addListener(this::addCreative);
|
||||
|
||||
// Register our mod's ModConfigSpec so that FML can create and load the config file for us
|
||||
modContainer.registerConfig(ModConfig.Type.COMMON, Config.SPEC);
|
||||
// 只在专用服务端执行
|
||||
NeoForge.EVENT_BUS.register(CommandInterceptor.class);
|
||||
// // Register the commonSetup method for modloading
|
||||
// modEventBus.addListener(this::commonSetup);
|
||||
//
|
||||
// // Register the Deferred Register to the mod event bus so blocks get registered
|
||||
// BLOCKS.register(modEventBus);
|
||||
// // Register the Deferred Register to the mod event bus so items get registered
|
||||
// ITEMS.register(modEventBus);
|
||||
// // Register the Deferred Register to the mod event bus so tabs get registered
|
||||
// CREATIVE_MODE_TABS.register(modEventBus);
|
||||
//
|
||||
// // Register ourselves for server and other game events we are interested in.
|
||||
// // Note that this is necessary if and only if we want *this* class (stopcheat) to respond directly to events.
|
||||
// // Do not add this line if there are no @SubscribeEvent-annotated functions in this class, like onServerStarting() below.
|
||||
// NeoForge.EVENT_BUS.register(this);
|
||||
//
|
||||
// // Register the item to a creative tab
|
||||
// modEventBus.addListener(this::addCreative);
|
||||
//
|
||||
// // Register our mod's ModConfigSpec so that FML can create and load the config file for us
|
||||
// modContainer.registerConfig(ModConfig.Type.COMMON, Config.SPEC);
|
||||
}
|
||||
|
||||
private void commonSetup(FMLCommonSetupEvent event) {
|
||||
|
||||
Reference in new issue
Block a user