mirror of
https://code.chipmunk.land/ChomeNS/chipmunkmod.git
synced 2025-12-30 04:56:52 +00:00
fix: invalid slot hacker
This commit is contained in:
parent
c871eebc7b
commit
bf9fd28c1c
1 changed files with 4 additions and 2 deletions
|
|
@ -20,8 +20,6 @@ import net.minecraft.client.network.ClientPlayerEntity;
|
|||
import net.minecraft.client.network.ClientPlayerInteractionManager;
|
||||
import net.minecraft.client.network.PendingUpdateManager;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.command.permission.LeveledPermissionPredicate;
|
||||
import net.minecraft.command.permission.PermissionLevel;
|
||||
import net.minecraft.component.ComponentMap;
|
||||
import net.minecraft.component.DataComponentTypes;
|
||||
import net.minecraft.component.type.NbtComponent;
|
||||
|
|
@ -452,6 +450,10 @@ public class CommandCore implements Listener {
|
|||
final BlockState oldBlockState = pair.getRight();
|
||||
|
||||
final int freeHotBarSlot = player.getInventory().getEmptySlot();
|
||||
if (freeHotBarSlot == -1 || freeHotBarSlot > 8) {
|
||||
if (fallbackToChat) networkHandler.sendChatCommand(command);
|
||||
return null;
|
||||
}
|
||||
final int slot = 36 + freeHotBarSlot;
|
||||
|
||||
final int oldSelectedSlot = player.getInventory().getSelectedSlot();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue