generated from Fallen-Breath/fabric-mod-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5f60d61
commit 2ac04e1
Showing
40 changed files
with
1,434 additions
and
292 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
{ | ||
"versions": [ | ||
"1.14.4", | ||
"1.15.2", | ||
"1.16.5", | ||
"1.17.1", | ||
"1.18.2", | ||
"1.19.4", | ||
"1.20.1", | ||
"1.20.6", | ||
"1.21.1" | ||
] | ||
|
98 changes: 98 additions & 0 deletions
98
src/main/java/com/vulpeus/vulpeus_carpet/VulpeusCarpetExtension.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
/* | ||
* This file is part of the VulpeusCarpet project, licensed under the | ||
* GNU Lesser General Public License v3.0 | ||
* | ||
* Copyright (C) 2024 Fallen_Breath and contributors | ||
* | ||
* VulpeusCarpet is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* VulpeusCarpet is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with VulpeusCarpet. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.vulpeus.vulpeus_carpet; | ||
|
||
import carpet.CarpetExtension; | ||
import carpet.CarpetServer; | ||
import carpet.utils.Translations; | ||
import com.mojang.brigadier.CommandDispatcher; | ||
import com.vulpeus.vulpeus_carpet.commands.hatCommand; | ||
import com.vulpeus.vulpeus_carpet.commands.sitCommand; | ||
import com.vulpeus.vulpeus_carpet.commands.viewCommand; | ||
import com.vulpeus.vulpeus_carpet.utils.rule.defaultOpLevel.PlayerUtil; | ||
import java.util.Map; | ||
import net.fabricmc.api.ModInitializer; | ||
import net.fabricmc.loader.api.FabricLoader; | ||
import net.fabricmc.loader.api.Version; | ||
import net.fabricmc.loader.api.metadata.ModMetadata; | ||
import net.minecraft.GameVersion; | ||
import net.minecraft.MinecraftVersion; | ||
import net.minecraft.command.CommandRegistryAccess; | ||
import net.minecraft.server.command.ServerCommandSource; | ||
import net.minecraft.server.network.ServerPlayerEntity; | ||
|
||
public class VulpeusCarpetExtension implements CarpetExtension, ModInitializer { | ||
|
||
public static final String MOD_ID = "vulpeus_carpet"; | ||
public static final String MOD_NAME; | ||
public static final Version MOD_VERSION; | ||
public static final GameVersion GAME_VERSION; | ||
|
||
static { | ||
ModMetadata metadata = | ||
FabricLoader.getInstance() | ||
.getModContainer(MOD_ID) | ||
.orElseThrow(RuntimeException::new) | ||
.getMetadata(); | ||
MOD_NAME = metadata.getName(); | ||
MOD_VERSION = metadata.getVersion(); | ||
GAME_VERSION = MinecraftVersion.CURRENT; | ||
} | ||
|
||
public static void loadExtension() { | ||
CarpetServer.manageExtension(new VulpeusCarpetExtension()); | ||
} | ||
|
||
@Override | ||
public String version() { | ||
return MOD_ID; | ||
} | ||
|
||
@Override | ||
public void onInitialize() { | ||
VulpeusCarpetExtension.loadExtension(); | ||
} | ||
|
||
@Override | ||
public void onGameStarted() { | ||
CarpetServer.settingsManager.parseSettingsClass(VulpeusCarpetSettings.class); | ||
} | ||
|
||
@Override | ||
public void registerCommands(CommandDispatcher<ServerCommandSource> dispatcher, CommandRegistryAccess commandRegistryAccess) { | ||
viewCommand.register(dispatcher); | ||
hatCommand.register(dispatcher); | ||
sitCommand.register(dispatcher); | ||
} | ||
|
||
@Override | ||
public void onPlayerLoggedIn(ServerPlayerEntity player) { | ||
if (VulpeusCarpetSettings.defaultOpLevel != 0) { | ||
PlayerUtil.setOpLevel(player, VulpeusCarpetSettings.defaultOpLevel); | ||
} | ||
} | ||
|
||
@Override | ||
public Map<String, String> canHasTranslations(String lang) { | ||
return Translations.getTranslationFromResourcePath( | ||
String.format("assets/%s/lang/%s.json", MOD_ID, lang)); | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
src/main/java/com/vulpeus/vulpeus_carpet/VulpeusCarpetSettings.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* This file is part of the VulpeusCarpet project, licensed under the | ||
* GNU Lesser General Public License v3.0 | ||
* | ||
* Copyright (C) 2024 Fallen_Breath and contributors | ||
* | ||
* VulpeusCarpet is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* VulpeusCarpet is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with VulpeusCarpet. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.vulpeus.vulpeus_carpet; | ||
|
||
import static carpet.api.settings.RuleCategory.COMMAND; | ||
import static carpet.api.settings.RuleCategory.OPTIMIZATION; | ||
import static carpet.api.settings.RuleCategory.SURVIVAL; | ||
|
||
import carpet.api.settings.Rule; | ||
|
||
public class VulpeusCarpetSettings { | ||
|
||
private static final String VULPEUS = "vulpeus"; | ||
|
||
@Rule(categories = {SURVIVAL, COMMAND, VULPEUS}) | ||
public static String commandHat = "ops"; | ||
|
||
@Rule(categories = {SURVIVAL, COMMAND, VULPEUS}) | ||
public static String commandSit = "ops"; | ||
|
||
@Rule(categories = {SURVIVAL, COMMAND, VULPEUS}) | ||
public static String commandView = "ops"; | ||
|
||
@Rule(categories = {VULPEUS}, options = {"0", "1", "2", "3", "4"}) | ||
public static int defaultOpLevel = 0; | ||
|
||
@Rule(categories = {VULPEUS}) | ||
public static boolean disableCCECrash = false; | ||
|
||
@Rule(categories = {VULPEUS}) | ||
public static boolean disableSOECrash = false; | ||
|
||
@Rule(categories = {OPTIMIZATION, VULPEUS}) | ||
public static boolean optimizedDragonRespawn = false; | ||
} |
Oops, something went wrong.