From 40991eee8e766a9f02ba4403067137da940d9b07 Mon Sep 17 00:00:00 2001 From: sisby-folk Date: Fri, 26 Jul 2024 16:10:51 +1000 Subject: [PATCH] use instance methods instead of statics --- src/main/java/dev/hephaestus/glowcase/Glowcase.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/dev/hephaestus/glowcase/Glowcase.java b/src/main/java/dev/hephaestus/glowcase/Glowcase.java index 940e26e..da6332e 100644 --- a/src/main/java/dev/hephaestus/glowcase/Glowcase.java +++ b/src/main/java/dev/hephaestus/glowcase/Glowcase.java @@ -38,7 +38,7 @@ public class Glowcase { public static final String MODID = "glowcase"; public Glowcase(IEventBus modBus) { - modBus.addListener(Glowcase::onInitialize); + modBus.addListener(this::onInitialize); BLOCKS.register(modBus); ITEMS.register(modBus); BLOCK_ENTITIES.register(modBus); @@ -86,19 +86,19 @@ public static Identifier id(String... path) { return Identifier.of(MODID, String.join(".", path)); } - public static void onInitialize(FMLCommonSetupEvent event) { + public void onInitialize(FMLCommonSetupEvent event) { GlowcaseCommonNetworking.onInitialize(); CommandRegistrationCallback.EVENT.register((dispatcher, access, environment) -> { dispatcher.register( LiteralArgumentBuilder.literal("mail") .then(CommandManager.argument("pos", new BlockPosArgumentType()) - .then(CommandManager.argument("message", StringArgumentType.greedyString()).executes(Glowcase::sendMessage))) + .then(CommandManager.argument("message", StringArgumentType.greedyString()).executes(this::sendMessage))) ); }); } - private static int sendMessage(CommandContext ctx) { + private int sendMessage(CommandContext ctx) { BlockPos pos = BlockPosArgumentType.getBlockPos(ctx, "pos"); String message = ctx.getArgument("message", String.class); PlayerEntity sender = ctx.getSource().getPlayer();