diff options
Diffstat (limited to 'forge/src/serverComponent/java/me/shedaniel/rei')
| -rw-r--r-- | forge/src/serverComponent/java/me/shedaniel/rei/forge/RoughlyEnoughItemsForgeServerComponent.java | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/forge/src/serverComponent/java/me/shedaniel/rei/forge/RoughlyEnoughItemsForgeServerComponent.java b/forge/src/serverComponent/java/me/shedaniel/rei/forge/RoughlyEnoughItemsForgeServerComponent.java new file mode 100644 index 000000000..91becf2f8 --- /dev/null +++ b/forge/src/serverComponent/java/me/shedaniel/rei/forge/RoughlyEnoughItemsForgeServerComponent.java @@ -0,0 +1,52 @@ +/* + * This file is licensed under the MIT License, part of Roughly Enough Items. + * Copyright (c) 2018, 2019, 2020, 2021, 2022 shedaniel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package me.shedaniel.rei.forge; + +import me.shedaniel.rei.RoughlyEnoughItemsInitializer; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.fml.DatagenModLoader; +import net.minecraftforge.fml.ModList; +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.loading.FMLEnvironment; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@Mod("roughlyenoughitems_servercomponent") +public class RoughlyEnoughItemsForgeServerComponent { + public RoughlyEnoughItemsForgeServerComponent() { + Logger logger = LogManager.getLogger(RoughlyEnoughItemsForgeServerComponent.class); + if (!DatagenModLoader.isRunningDataGen()) { + if (FMLEnvironment.dist == Dist.CLIENT) { + logger.error("Roughly Enough Items Server Component is not compatible with the client!"); + System.exit(1); + } else if (ModList.get().isLoaded("roughlyenoughitems")) { + logger.error("Roughly Enough Items is already loaded! The server component is only used alongside Just Enough Items, " + + "to allow clients to use REI without switching to JEI completely on the server!"); + System.exit(1); + } else { + RoughlyEnoughItemsInitializer.onInitialize(); + } + } + } +} |
