Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added a keybind to use a transmitter in your inventory
- Loading branch information
Showing
11 changed files
with
72 additions
and
23 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
src/generated/resources/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8
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.20.1 2024-03-28T17:28:00.8019855 Languages: en_us | ||
8bbd719a8776bc2ca9edc129a308156fee4253cb assets/deeperdarker/lang/en_us.json | ||
// 1.20.1 2024-03-30T12:59:03.813707 Languages: en_us | ||
e1ddfa4d3b64479bb8dcb4dc8c5927e6fa309ace assets/deeperdarker/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
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
35 changes: 35 additions & 0 deletions
35
src/main/java/com/kyanite/deeperdarker/network/UseTransmitterPacket.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,35 @@ | ||
package com.kyanite.deeperdarker.network; | ||
|
||
import com.kyanite.deeperdarker.content.DDItems; | ||
import com.kyanite.deeperdarker.content.items.SculkTransmitterItem; | ||
import io.netty.buffer.ByteBuf; | ||
import net.minecraft.server.level.ServerPlayer; | ||
import net.minecraft.world.item.ItemStack; | ||
import net.minecraftforge.network.NetworkEvent; | ||
|
||
import java.util.function.Supplier; | ||
|
||
public class UseTransmitterPacket { | ||
public UseTransmitterPacket() { | ||
} | ||
|
||
public UseTransmitterPacket(ByteBuf buf) { | ||
} | ||
|
||
public void toBytes(ByteBuf buf) { | ||
} | ||
|
||
public void handle(Supplier<NetworkEvent.Context> context) { | ||
context.get().enqueueWork(() -> { | ||
ServerPlayer player = context.get().getSender(); | ||
for(ItemStack stack : player.getInventory().items) { | ||
if(stack.is(DDItems.SCULK_TRANSMITTER.get()) && SculkTransmitterItem.isLinked(stack)) { | ||
SculkTransmitterItem.transmit(player.level(), player, stack, null); | ||
break; | ||
} | ||
} | ||
}); | ||
|
||
context.get().setPacketHandled(true); | ||
} | ||
} |