禁止作弊并广播

This commit is contained in:
xzb23 committed 2026-08-14 18:33:00 +08:00
1 parent 891f574221
commit 95a59befa6
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) {