-
Notifications
You must be signed in to change notification settings - Fork 37
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
Showing
7 changed files
with
118 additions
and
23 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
20 changes: 20 additions & 0 deletions
20
src/main/java/dev/dubhe/anvilcraft/command/AnvilCraftCommand.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,20 @@ | ||
package dev.dubhe.anvilcraft.command; | ||
|
||
import com.mojang.brigadier.CommandDispatcher; | ||
import dev.dubhe.anvilcraft.AnvilCraft; | ||
import net.minecraft.commands.CommandSourceStack; | ||
import net.minecraft.commands.Commands; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class AnvilCraftCommand { | ||
public static void register(@NotNull CommandDispatcher<CommandSourceStack> dispatcher) { | ||
dispatcher.register(Commands.literal("anvilcraft") | ||
.then(Commands.literal("config") | ||
.then(Commands.literal("reload").executes(context -> { | ||
AnvilCraft.loadOrCreateConfig(); | ||
return 0; | ||
})) | ||
) | ||
); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/dev/dubhe/anvilcraft/command/ModCommands.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,13 @@ | ||
package dev.dubhe.anvilcraft.command; | ||
|
||
import com.mojang.brigadier.CommandDispatcher; | ||
import net.minecraft.commands.CommandBuildContext; | ||
import net.minecraft.commands.CommandSourceStack; | ||
import net.minecraft.commands.Commands; | ||
|
||
public class ModCommands { | ||
@SuppressWarnings("unused") | ||
public static void register(CommandDispatcher<CommandSourceStack> dispatcher, CommandBuildContext registryAccess, Commands.CommandSelection environment) { | ||
AnvilCraftCommand.register(dispatcher); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/dev/dubhe/anvilcraft/config/AnvilCraftConfig.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,8 @@ | ||
package dev.dubhe.anvilcraft.config; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
|
||
public class AnvilCraftConfig { | ||
@SerializedName("anvil_efficiency") | ||
public int anvilEfficiency = 64; | ||
} |
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