mirror of
https://github.com/RustyRaptor/InvTweaksRenewed.git
synced 2026-12-04 07:35:23 -07:00
Initial commit
This commit is contained in:
commit
ebc2546d07
18 files changed
+931
No files matched your search
@@ -0,0 +1,24 @@
|
||||
package invtweaks.packets;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.*;
|
||||
|
||||
import net.minecraft.entity.player.*;
|
||||
import net.minecraft.network.*;
|
||||
import net.minecraftforge.fml.network.*;
|
||||
|
||||
public class PacketSortPlayerInv {
|
||||
public PacketSortPlayerInv() {}
|
||||
public PacketSortPlayerInv(PacketBuffer buf) {}
|
||||
|
||||
public void handle(Supplier<NetworkEvent.Context> ctx) {
|
||||
ctx.get().enqueueWork(() -> {
|
||||
//System.out.println("Teehee!");
|
||||
PlayerInventory inv = ctx.get().getSender().inventory;
|
||||
inv.mainInventory.subList(PlayerInventory.getHotbarSize(), inv.mainInventory.size())
|
||||
.sort(Comparator.comparing(is -> is.getTranslationKey())); // TODO change comparator
|
||||
});
|
||||
}
|
||||
|
||||
public void encode(PacketBuffer buf) {}
|
||||
}
|
||||
Reference in new issue
Block a user