<commit_before>package com.mcjty.rftools;

import com.mcjty.rftools.dimension.RfToolsDimensionManager;
import com.mcjty.rftools.items.dimlets.KnownDimletConfiguration;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.client.Minecraft;
import net.minecraft.server.MinecraftServer;
import net.minecraftforge.event.world.WorldEvent;

public class WorldLoadEvent {

//    @SubscribeEvent
//    public void loadEvent(WorldEvent.Load evt) {
//        System.out.println("######### loadEvent: evt.world.isRemote = " + evt.world.isRemote);
//        System.out.println("evt.world.provider.dimensionId = " + evt.world.provider.dimensionId);
//
//        if (evt.world.isRemote) {
//            return;
//        }
//        int d = evt.world.provider.dimensionId;
//        if (d == 0) {
//            TeleportDestinations.clearInstance();
//            RfToolsDimensionManager.clearInstance();
//            DimensionStorage.clearInstance();
//        }
//    }

    @SubscribeEvent
    public void loadEvent(WorldEvent.Load evt) {
        System.out.println("################################################ WorldLoadEvent.loadEvent:" + evt.world.isRemote);
        if (evt.world.provider.dimensionId != 0) {
            return;
        }
        if (evt.world.isRemote) {
//            if (Minecraft.getMinecraft().isSingleplayer()) {
                // If we are single player then we register our dimlet stuff here.
                System.out.println("SINGLE PLAYER");
            KnownDimletConfiguration.init();
            KnownDimletConfiguration.initCrafting();
//            }
        } else if (MinecraftServer.getServer().isDedicatedServer()) {
            System.out.println("SERVER START");
            KnownDimletConfiguration.init();
            KnownDimletConfiguration.initCrafting();
        }
    }

    @SubscribeEvent
    public void unloadEvent(WorldEvent.Unload evt) {
        if (evt.world.isRemote) {
            return;
        }
        int d = evt.world.provider.dimensionId;
        if (d == 0) {
            RfToolsDimensionManager.unregisterDimensions();
        }
    }
}<commit_msg>Fixed the bug where on server the sync of the dimlet ids would fail if you started in the wrong dimension<commit_after>package com.mcjty.rftools;

import com.mcjty.rftools.dimension.RfToolsDimensionManager;
import com.mcjty.rftools.items.dimlets.KnownDimletConfiguration;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.client.Minecraft;
import net.minecraft.server.MinecraftServer;
import net.minecraftforge.event.world.WorldEvent;

public class WorldLoadEvent {

//    @SubscribeEvent
//    public void loadEvent(WorldEvent.Load evt) {
//        System.out.println("######### loadEvent: evt.world.isRemote = " + evt.world.isRemote);
//        System.out.println("evt.world.provider.dimensionId = " + evt.world.provider.dimensionId);
//
//        if (evt.world.isRemote) {
//            return;
//        }
//        int d = evt.world.provider.dimensionId;
//        if (d == 0) {
//            TeleportDestinations.clearInstance();
//            RfToolsDimensionManager.clearInstance();
//            DimensionStorage.clearInstance();
//        }
//    }

    @SubscribeEvent
    public void loadEvent(WorldEvent.Load evt) {
        System.out.println("################################################ WorldLoadEvent.loadEvent:" + evt.world.isRemote + ", dim: " + evt.world.provider.dimensionId);
        if (evt.world.isRemote) {
            System.out.println("SINGLE PLAYER");
            KnownDimletConfiguration.init();
            KnownDimletConfiguration.initCrafting();
        } else if (MinecraftServer.getServer().isDedicatedServer()) {
            if (evt.world.provider.dimensionId == 0) {
                System.out.println("SERVER START");
                KnownDimletConfiguration.init();
                KnownDimletConfiguration.initCrafting();
            }
        }
    }

    @SubscribeEvent
    public void unloadEvent(WorldEvent.Unload evt) {
        if (evt.world.isRemote) {
            return;
        }
        int d = evt.world.provider.dimensionId;
        if (d == 0) {
            RfToolsDimensionManager.unregisterDimensions();
        }
    }
}
{'fraction_non_alphanumeric': 0.14353052085788356, 'fraction_numerical': 0.0014140938015555031, 'mean_word_length': 2.447603574329813, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3626680', 'n_tokens_mistral': 1226, 'n_tokens_neox': 1221, 'n_words': 195}