-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
27 changed files
with
631 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,24 @@ | ||
# Enchant Menu | ||
|
||
WIP enchantment menu mod for Minecraft Fabric | ||
Enchant Menu adds a simple menu for modifying item enchantments. | ||
|
||
## Current Features | ||
- Select enchantments from the list of possible enchantments | ||
- Select the level of enchantment from 1 to 10 | ||
- Supports custom enchantments | ||
|
||
## Planned Features | ||
- Toggle to surpass vanilla level limits | ||
- Toggle to allow incompatible enchantments | ||
- Toggle to allow treasure-only enchantments | ||
- Configuration of menu features | ||
|
||
## Gallery | ||
|
||
![Item with enchantments](./assets/screenshots/item-with-enchantment.png) | ||
![Custom enchantments](./assets/screenshots/custom-enchantments.png) | ||
|
||
## Credit | ||
|
||
This mod is based on the enchanting tool included in NEI from the days of Tekkit Classic - Thanks to the original | ||
creator for the inspiration! |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,22 +1,18 @@ | ||
kotlin.code.style = official | ||
org.gradle.jvmargs = -Xmx1G | ||
org.gradle.warning.mode = all | ||
|
||
kotlin.code.style=official | ||
org.gradle.jvmargs=-Xmx1G | ||
org.gradle.warning.mode=all | ||
# Fabric Properties - https://fabricmc.net/develop/ | ||
minecraftVersion = 1.19 | ||
yarnMappings = 1.19+build.4 | ||
loaderVersion = 0.14.8 | ||
|
||
minecraftVersion=1.19 | ||
yarnMappings=1.19+build.4 | ||
loaderVersion=0.14.8 | ||
# Fabric API | ||
fabricVersion = 0.57.0+1.19 | ||
loomVersion = 0.12-SNAPSHOT | ||
|
||
fabricVersion=0.57.0+1.19 | ||
loomVersion=0.12-SNAPSHOT | ||
# Kotlin | ||
systemProp.kotlinVersion = 1.7.0 | ||
fabricKotlinVersion = 1.8.1+kotlin.1.7.0 | ||
|
||
systemProp.kotlinVersion=1.7.0 | ||
fabricKotlinVersion=1.8.1+kotlin.1.7.0 | ||
# Mod Properties | ||
modVersion = 0.1.0-alpha+1.19 | ||
mavenGroup = com.github.eth0net | ||
archivesBaseName = enchant-menu | ||
modReleaseType = alpha | ||
mavenGroup=com.github.eth0net | ||
modId=enchant-menu | ||
modVersion=1.0.0-beta+fabric-1.19 | ||
modVersionType=beta |
31 changes: 28 additions & 3 deletions
31
src/main/kotlin/com/github/eth0net/enchantmenu/EnchantMenu.kt
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,36 @@ | ||
package com.github.eth0net.enchantmenu | ||
|
||
import com.github.eth0net.enchantmenu.network.channel.DecrementChannel | ||
import com.github.eth0net.enchantmenu.network.channel.IncrementChannel | ||
import com.github.eth0net.enchantmenu.network.channel.MenuChannel | ||
import com.github.eth0net.enchantmenu.screen.EnchantMenuScreenHandler | ||
import com.github.eth0net.enchantmenu.screen.EnchantMenuScreenHandlerFactory | ||
import com.github.eth0net.enchantmenu.util.Identifier | ||
import com.github.eth0net.enchantmenu.util.Logger | ||
import net.fabricmc.api.ModInitializer | ||
import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking | ||
import net.minecraft.screen.ScreenHandlerType | ||
import net.minecraft.util.registry.Registry | ||
|
||
@Suppress("UNUSED") | ||
object EnchantMenu: ModInitializer { | ||
private const val MOD_ID = "enchant-menu" | ||
object EnchantMenu : ModInitializer { | ||
internal val SCREEN_HANDLER = Registry.register( | ||
Registry.SCREEN_HANDLER, Identifier("enchant_menu"), ScreenHandlerType(::EnchantMenuScreenHandler) | ||
) | ||
|
||
override fun onInitialize() { | ||
println("Enchant menu mod has been initialized.") | ||
Logger.info("EnchantMenu initializing...") | ||
|
||
ServerPlayNetworking.registerGlobalReceiver(MenuChannel) { _, player, _, _, _ -> | ||
player.openHandledScreen(EnchantMenuScreenHandlerFactory) | ||
} | ||
ServerPlayNetworking.registerGlobalReceiver(IncrementChannel) { _, player, _, _, _ -> | ||
(player.currentScreenHandler as? EnchantMenuScreenHandler)?.incrementLevel() | ||
} | ||
ServerPlayNetworking.registerGlobalReceiver(DecrementChannel) { _, player, _, _, _ -> | ||
(player.currentScreenHandler as? EnchantMenuScreenHandler)?.decrementLevel() | ||
} | ||
|
||
Logger.info("EnchantMenu initialized.") | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/kotlin/com/github/eth0net/enchantmenu/client/EnchantMenuClient.kt
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,27 @@ | ||
package com.github.eth0net.enchantmenu.client | ||
|
||
import com.github.eth0net.enchantmenu.EnchantMenu | ||
import com.github.eth0net.enchantmenu.client.gui.screen.EnchantMenuScreen | ||
import com.github.eth0net.enchantmenu.client.keybinding.MenuKeyBinding | ||
import com.github.eth0net.enchantmenu.network.channel.MenuChannel | ||
import com.github.eth0net.enchantmenu.util.Logger | ||
import net.fabricmc.api.ClientModInitializer | ||
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents | ||
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking | ||
import net.fabricmc.fabric.api.networking.v1.PacketByteBufs | ||
import net.minecraft.client.gui.screen.ingame.HandledScreens | ||
|
||
@Suppress("UNUSED") | ||
object EnchantMenuClient : ClientModInitializer { | ||
override fun onInitializeClient() { | ||
Logger.info("EnchantMenuClient initializing...") | ||
|
||
HandledScreens.register(EnchantMenu.SCREEN_HANDLER, ::EnchantMenuScreen) | ||
|
||
ClientTickEvents.END_CLIENT_TICK.register { | ||
while (MenuKeyBinding.wasPressed()) ClientPlayNetworking.send(MenuChannel, PacketByteBufs.empty()) | ||
} | ||
|
||
Logger.info("EnchantMenuClient initialized.") | ||
} | ||
} |
Oops, something went wrong.