Skip to content

Commit

Permalink
use instance methods instead of statics
Browse files Browse the repository at this point in the history
  • Loading branch information
sisby-folk committed Jul 26, 2024
1 parent 642c29d commit 40991ee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/dev/hephaestus/glowcase/Glowcase.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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.<ServerCommandSource>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<ServerCommandSource> ctx) {
private int sendMessage(CommandContext<ServerCommandSource> ctx) {
BlockPos pos = BlockPosArgumentType.getBlockPos(ctx, "pos");
String message = ctx.getArgument("message", String.class);
PlayerEntity sender = ctx.getSource().getPlayer();
Expand Down

0 comments on commit 40991ee

Please sign in to comment.