-
-
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
1 parent
21c7dbb
commit 0bfb59e
Showing
6 changed files
with
81 additions
and
0 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
48 changes: 48 additions & 0 deletions
48
...rg/cyclops/integratedscripting/network/packet/TerminalScriptingCreateNewScriptPacket.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,48 @@ | ||
package org.cyclops.integratedscripting.network.packet; | ||
|
||
import net.minecraft.server.level.ServerPlayer; | ||
import net.minecraft.world.entity.player.Player; | ||
import net.minecraft.world.level.Level; | ||
import net.minecraftforge.api.distmarker.Dist; | ||
import net.minecraftforge.api.distmarker.OnlyIn; | ||
import org.cyclops.cyclopscore.network.CodecField; | ||
import org.cyclops.cyclopscore.network.PacketCodec; | ||
import org.cyclops.integratedscripting.inventory.container.ContainerTerminalScripting; | ||
|
||
|
||
/** | ||
* Packet for letting a client trigger the creation of a new script by sending to the server. | ||
* @author rubensworks | ||
* | ||
*/ | ||
public class TerminalScriptingCreateNewScriptPacket extends PacketCodec { | ||
|
||
@CodecField | ||
private int disk; | ||
|
||
public TerminalScriptingCreateNewScriptPacket() { | ||
|
||
} | ||
|
||
public TerminalScriptingCreateNewScriptPacket(int disk) { | ||
this.disk = disk; | ||
} | ||
|
||
@Override | ||
public boolean isAsync() { | ||
return false; | ||
} | ||
|
||
@Override | ||
@OnlyIn(Dist.CLIENT) | ||
public void actionClient(Level world, Player player) { | ||
|
||
} | ||
|
||
@Override | ||
public void actionServer(Level world, ServerPlayer player) { | ||
if(player.containerMenu instanceof ContainerTerminalScripting container) { | ||
container.createNewServerScript(disk); | ||
} | ||
} | ||
} |
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