mirror of
https://github.com/WiIIiam278/HuskSync.git
synced 2025-12-19 23:09:14 +00:00
fix/fabric: slightly adjust item applying
This commit is contained in:
@@ -153,13 +153,13 @@ public abstract class FabricData implements Data {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getSlotCount() {
|
public int getSlotCount() {
|
||||||
return INVENTORY_SLOT_COUNT;
|
return getContents().length;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void apply(@NotNull FabricUser user, @NotNull FabricHuskSync plugin) throws IllegalStateException {
|
public void apply(@NotNull FabricUser user, @NotNull FabricHuskSync plugin) throws IllegalStateException {
|
||||||
final ServerPlayerEntity player = user.getPlayer();
|
final ServerPlayerEntity player = user.getPlayer();
|
||||||
this.clearInventoryCraftingSlots(player);
|
player.playerScreenHandler.clearCraftingSlots();
|
||||||
player.currentScreenHandler.setCursorStack(ItemStack.EMPTY);
|
player.currentScreenHandler.setCursorStack(ItemStack.EMPTY);
|
||||||
final ItemStack[] items = getContents();
|
final ItemStack[] items = getContents();
|
||||||
for (int slot = 0; slot < player.getInventory().size(); slot++) {
|
for (int slot = 0; slot < player.getInventory().size(); slot++) {
|
||||||
@@ -172,10 +172,6 @@ public abstract class FabricData implements Data {
|
|||||||
player.getInventory().updateItems();
|
player.getInventory().updateItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clearInventoryCraftingSlots(@NotNull ServerPlayerEntity player) {
|
|
||||||
player.playerScreenHandler.clearCraftingSlots();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class EnderChest extends FabricData.Items implements Data.Items.EnderChest {
|
public static class EnderChest extends FabricData.Items implements Data.Items.EnderChest {
|
||||||
|
|||||||
Reference in New Issue
Block a user