Skip to content

Commit

Permalink
Fix ckit command as well. Closes #693
Browse files Browse the repository at this point in the history
  • Loading branch information
Earthcomputer committed Dec 9, 2024
1 parent b9ad1a6 commit 6879f63
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static void register(CommandDispatcher<FabricClientCommandSource> dispatc

private static int give(FabricClientCommandSource source, ItemInput itemInput, int count) throws CommandSyntaxException {
LocalPlayer player = source.getPlayer();
if (!player.getAbilities().instabuild) {
if (!player.isCreative()) {
throw NOT_CREATIVE_EXCEPTION.create();
}
MultiPlayerGameMode interactionManager = source.getClient().gameMode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ private static int edit(FabricClientCommandSource source, String name) throws Co
}

private static int load(FabricClientCommandSource source, String name, boolean override) throws CommandSyntaxException {
if (!source.getPlayer().getAbilities().instabuild) {
if (!source.getPlayer().isCreative()) {
throw NOT_CREATIVE_EXCEPTION.create();
}

Expand All @@ -137,6 +137,7 @@ private static int load(FabricClientCommandSource source, String name, boolean o
if (slots.get(i).container == source.getPlayer().getInventory()) {
ItemStack itemStack = tempInv.getItem(slots.get(i).getContainerSlot());
if (!itemStack.isEmpty() || override) {
source.getPlayer().getInventory().setItem(i, itemStack);
source.getClient().gameMode.handleCreativeModeItemAdd(itemStack, i);
}
}
Expand Down

0 comments on commit 6879f63

Please sign in to comment.