generated from neoforged/MDK
-
Notifications
You must be signed in to change notification settings - Fork 11
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
0c51dae
commit 0b24b8f
Showing
12 changed files
with
151 additions
and
3 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-09-07T23:05:26.591705 Languages: en_us for mod: justdirethings | ||
9d7dc513a32bcfb7d38be2eec9788707e931d062 assets/justdirethings/lang/en_us.json | ||
// 1.21.1 2024-09-07T23:32:11.7388079 Languages: en_us for mod: justdirethings | ||
6df045e49de32b41b0c0ae7b9f14dbd59d6042d3 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
24 changes: 24 additions & 0 deletions
24
...va/com/direwolf20/justdirethings/common/network/data/InventoryHolderMoveItemsPayload.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,24 @@ | ||
package com.direwolf20.justdirethings.common.network.data; | ||
|
||
import com.direwolf20.justdirethings.JustDireThings; | ||
import net.minecraft.network.FriendlyByteBuf; | ||
import net.minecraft.network.codec.ByteBufCodecs; | ||
import net.minecraft.network.codec.StreamCodec; | ||
import net.minecraft.network.protocol.common.custom.CustomPacketPayload; | ||
import net.minecraft.resources.ResourceLocation; | ||
|
||
public record InventoryHolderMoveItemsPayload( | ||
int moveType | ||
) implements CustomPacketPayload { | ||
public static final Type<InventoryHolderMoveItemsPayload> TYPE = new Type<>(ResourceLocation.fromNamespaceAndPath(JustDireThings.MODID, "inventory_holder_move_items")); | ||
|
||
@Override | ||
public Type<InventoryHolderMoveItemsPayload> type() { | ||
return TYPE; | ||
} | ||
|
||
public static final StreamCodec<FriendlyByteBuf, InventoryHolderMoveItemsPayload> STREAM_CODEC = StreamCodec.composite( | ||
ByteBufCodecs.INT, InventoryHolderMoveItemsPayload::moveType, | ||
InventoryHolderMoveItemsPayload::new | ||
); | ||
} |
32 changes: 32 additions & 0 deletions
32
.../com/direwolf20/justdirethings/common/network/handler/InventoryHolderMoveItemsPacket.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,32 @@ | ||
package com.direwolf20.justdirethings.common.network.handler; | ||
|
||
import com.direwolf20.justdirethings.common.containers.InventoryHolderContainer; | ||
import com.direwolf20.justdirethings.common.network.data.InventoryHolderMoveItemsPayload; | ||
import net.minecraft.world.entity.player.Player; | ||
import net.minecraft.world.inventory.AbstractContainerMenu; | ||
import net.neoforged.neoforge.network.handling.IPayloadContext; | ||
|
||
public class InventoryHolderMoveItemsPacket { | ||
public static final InventoryHolderMoveItemsPacket INSTANCE = new InventoryHolderMoveItemsPacket(); | ||
|
||
public static InventoryHolderMoveItemsPacket get() { | ||
return INSTANCE; | ||
} | ||
|
||
public void handle(final InventoryHolderMoveItemsPayload payload, final IPayloadContext context) { | ||
context.enqueueWork(() -> { | ||
Player sender = context.player(); | ||
AbstractContainerMenu container = sender.containerMenu; | ||
|
||
if (container instanceof InventoryHolderContainer inventoryHolderContainer) { | ||
int moveType = payload.moveType(); | ||
if (moveType == 0) | ||
inventoryHolderContainer.sendAllItemsToMachine(); | ||
else if (moveType == 1) | ||
inventoryHolderContainer.sendAllItemsToPlayer(); | ||
else if (moveType == 2) | ||
inventoryHolderContainer.swapItems(); | ||
} | ||
}); | ||
} | ||
} |
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
Binary file added
BIN
+3.22 KB
src/main/resources/assets/justdirethings/textures/gui/buttons/pullitems.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.12 KB
src/main/resources/assets/justdirethings/textures/gui/buttons/senditems.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.23 KB
src/main/resources/assets/justdirethings/textures/gui/buttons/swapitems.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.