Skip to content

Commit

Permalink
Fix config not being used
Browse files Browse the repository at this point in the history
  • Loading branch information
Meldexun committed Jan 28, 2022
1 parent 306382b commit 760c4d4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/meldexun/reachfix/ReachFix.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import net.minecraftforge.fml.common.LoadController;
import net.minecraftforge.fml.common.ModMetadata;
import net.minecraftforge.fml.common.event.FMLConstructionEvent;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerChangedDimensionEvent;
import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent;
Expand Down Expand Up @@ -54,6 +55,13 @@ public void onFMLConstructionEvent(FMLConstructionEvent event) {
MinecraftForge.EVENT_BUS.register(this);
}

@Subscribe
public void onFMLServerStartingEvent(FMLServerStartingEvent event) {
ReachFixUtil.setEnabled(ReachFixConfig.enabled);
ReachFixUtil.setReach(ReachFixConfig.reach);
ReachFixUtil.setReachCreative(ReachFixConfig.reachCreative);
}

@SubscribeEvent
public void onPlayerLoggedInEvent(PlayerLoggedInEvent event) {
NETWORK.sendTo(new SPacketSyncConfig(ReachFixConfig.enabled, ReachFixConfig.reach, ReachFixConfig.reachCreative), (EntityPlayerMP) event.player);
Expand Down

0 comments on commit 760c4d4

Please sign in to comment.