Skip to content

Commit

Permalink
Merge pull request #7 from PssbleTrngle/develop
Browse files Browse the repository at this point in the history
Fix EventBus crash
  • Loading branch information
PssbleTrngle authored Aug 16, 2020
2 parents a10df36 + cc4dfc5 commit d8b8f09
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ forge_version=32.0.88
mapping_version=20200514-1.16
mapping_channel=snapshot
mc_version=1.16.1
mod_version=1.0.0
mod_version=1.0.2
mod_id=brazier
mod_name=Brazier
1 change: 0 additions & 1 deletion src/main/java/com/possible_triangle/brazier/Brazier.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public Brazier() {
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff);

MinecraftForge.EVENT_BUS.register(this);
MinecraftForge.EVENT_BUS.register(ModConfig.class);

ModLoadingContext.get().registerConfig(ModConfig.Type.CLIENT, BrazierConfig.CLIENT_SPEC);
ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, BrazierConfig.SERVER_SPEC);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ public static void configReload(ModConfig.Reloading event) {
}
}

@SubscribeEvent
public static void playerJoined(PlayerEvent.PlayerLoggedInEvent event) {
syncServerConfigs(event.getPlayer());
}

public static void syncServerConfigs(PlayerEntity player) {
final Path config = FMLPaths.CONFIGDIR.get().resolve(Brazier.MODID + "-common.toml").toAbsolutePath();
try {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.possible_triangle.brazier.config;

import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;

@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.FORGE)
public class LoginHandler {

@SubscribeEvent
public static void playerJoined(PlayerEvent.PlayerLoggedInEvent event) {
BrazierConfig.syncServerConfigs(event.getPlayer());
}

}

0 comments on commit d8b8f09

Please sign in to comment.