-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
50184f1
commit fb41d42
Showing
5 changed files
with
53 additions
and
50 deletions.
There are no files selected for viewing
4 changes: 3 additions & 1 deletion
4
src/main/java/com/sweetrpg/crafttracker/common/network/PacketHandler.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
40 changes: 40 additions & 0 deletions
40
src/main/java/com/sweetrpg/crafttracker/common/network/packet/AddToQueuePacket.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,40 @@ | ||
package com.sweetrpg.crafttracker.common.network.packet; | ||
|
||
import com.sweetrpg.crafttracker.common.network.IPacket; | ||
import com.sweetrpg.crafttracker.common.network.packet.data.AddToQueueData; | ||
import net.minecraft.network.FriendlyByteBuf; | ||
import net.minecraftforge.network.NetworkEvent.Context; | ||
|
||
import java.util.function.Supplier; | ||
|
||
public class AddToQueuePacket implements IPacket<AddToQueueData> { | ||
|
||
@Override | ||
public void encode(AddToQueueData data, FriendlyByteBuf buf) { | ||
buf.writeUtf(data.itemId); | ||
} | ||
|
||
@Override | ||
public AddToQueueData decode(FriendlyByteBuf buf) { | ||
String itemId = buf.readUtf(); | ||
return new AddToQueueData(itemId); | ||
} | ||
|
||
@Override | ||
public final void handle(AddToQueueData data, Supplier<Context> ctx) { | ||
ctx.get().enqueueWork(() -> { | ||
// Entity target = ctx.get().getSender().level.getEntity(data.entityId); | ||
// | ||
// if (!(target instanceof CatEntity)) { | ||
// return; | ||
// } | ||
// | ||
// this.handleCat((CatEntity) target, data, ctx); | ||
}); | ||
|
||
ctx.get().setPacketHandled(true); | ||
} | ||
|
||
// public abstract void handleCat(CatEntity catIn, T data, Supplier<Context> ctx); | ||
|
||
} |
39 changes: 0 additions & 39 deletions
39
src/main/java/com/sweetrpg/crafttracker/common/network/packet/CatPacket.java
This file was deleted.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
src/main/java/com/sweetrpg/crafttracker/common/network/packet/data/AddToQueueData.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,10 @@ | ||
package com.sweetrpg.crafttracker.common.network.packet.data; | ||
|
||
public class AddToQueueData { | ||
|
||
public String itemId; | ||
|
||
public AddToQueueData(String itemId) { | ||
this.itemId = itemId; | ||
} | ||
} |
10 changes: 0 additions & 10 deletions
10
src/main/java/com/sweetrpg/crafttracker/common/network/packet/data/CatData.java
This file was deleted.
Oops, something went wrong.