generated from neoforged/MDK
-
Notifications
You must be signed in to change notification settings - Fork 19
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
5af1a42
commit d695f8e
Showing
10 changed files
with
80 additions
and
4 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
src/generated/resources/.cache/8202586f691eec5ad0bb88d13a278951d0c130fb
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,2 +1,2 @@ | ||
// 1.21.1 2024-10-08T16:36:37.283985 Languages: en_us for mod: justdirethings | ||
96bc43e5eceb21c7648659daa43d1b5415e229bc assets/justdirethings/lang/en_us.json | ||
// 1.21.1 2024-10-18T20:02:46.3102567 Languages: en_us for mod: justdirethings | ||
c7f1cc2b04789bf34333113ee3c1fcd58eb116b2 assets/justdirethings/lang/en_us.json |
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
22 changes: 22 additions & 0 deletions
22
src/main/java/com/direwolf20/justdirethings/common/network/data/ToolSettingsGUIPayload.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,22 @@ | ||
package com.direwolf20.justdirethings.common.network.data; | ||
|
||
import com.direwolf20.justdirethings.JustDireThings; | ||
import io.netty.buffer.ByteBuf; | ||
import net.minecraft.network.codec.StreamCodec; | ||
import net.minecraft.network.protocol.common.custom.CustomPacketPayload; | ||
import net.minecraft.resources.ResourceLocation; | ||
|
||
public record ToolSettingsGUIPayload( | ||
|
||
) implements CustomPacketPayload { | ||
public static final ToolSettingsGUIPayload INSTANCE = new ToolSettingsGUIPayload(); | ||
public static final Type<ToolSettingsGUIPayload> TYPE = new Type<>(ResourceLocation.fromNamespaceAndPath(JustDireThings.MODID, "tool_settings_gui")); | ||
|
||
@Override | ||
public Type<ToolSettingsGUIPayload> type() { | ||
return TYPE; | ||
} | ||
|
||
public static final StreamCodec<ByteBuf, ToolSettingsGUIPayload> STREAM_CODEC = StreamCodec.unit(INSTANCE); | ||
} | ||
|
25 changes: 25 additions & 0 deletions
25
...main/java/com/direwolf20/justdirethings/common/network/handler/ToolSettingsGUIPacket.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,25 @@ | ||
package com.direwolf20.justdirethings.common.network.handler; | ||
|
||
import com.direwolf20.justdirethings.common.containers.ToolSettingContainer; | ||
import com.direwolf20.justdirethings.common.network.data.ToolSettingsGUIPayload; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.world.SimpleMenuProvider; | ||
import net.minecraft.world.entity.player.Player; | ||
import net.neoforged.neoforge.network.handling.IPayloadContext; | ||
|
||
public class ToolSettingsGUIPacket { | ||
public static final ToolSettingsGUIPacket INSTANCE = new ToolSettingsGUIPacket(); | ||
|
||
public static ToolSettingsGUIPacket get() { | ||
return INSTANCE; | ||
} | ||
|
||
public void handle(final ToolSettingsGUIPayload payload, final IPayloadContext context) { | ||
context.enqueueWork(() -> { | ||
Player sender = context.player(); | ||
sender.openMenu(new SimpleMenuProvider( | ||
(windowId, playerInventory, playerEntity) -> new ToolSettingContainer(windowId, playerInventory, sender), Component.translatable(""))); | ||
|
||
}); | ||
} | ||
} |
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