Initial commit

This commit is contained in:
Thanh-Phuong committed 2019-12-29 12:15:02 -05:00
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) {}
}