Merge branch 'master' into 1.17
This commit is contained in:
commit
b2bde4b836
3 files changed
+38
-34
No files matched your search
@@ -58,6 +58,9 @@ public class PlayerCommand
|
||||
.then(makeActionCommand("dropStack", EntityPlayerActionPack.ActionType.DROP_STACK))
|
||||
.then(makeDropCommand("dropStack", true))
|
||||
.then(makeActionCommand("swapHands", EntityPlayerActionPack.ActionType.SWAP_HANDS))
|
||||
.then(literal("hotbar")
|
||||
.then(argument("slot", IntegerArgumentType.integer(1, 9))
|
||||
.executes(c -> manipulate(c, ap -> ap.setSlot(IntegerArgumentType.getInteger(c, "slot"))))))
|
||||
.then(literal("kill").executes(PlayerCommand::kill))
|
||||
.then(literal("shadow"). executes(PlayerCommand::shadow))
|
||||
.then(literal("mount").executes(manipulation(ap -> ap.mount(true)))
|
||||
|
||||
@@ -10,6 +10,7 @@ import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.entity.vehicle.BoatEntity;
|
||||
import net.minecraft.entity.vehicle.MinecartEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.packet.s2c.play.HeldItemChangeS2CPacket;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
@@ -276,6 +277,12 @@ public class EntityPlayerActionPack
|
||||
}
|
||||
}
|
||||
|
||||
public void setSlot(int slot)
|
||||
{
|
||||
player.inventory.selectedSlot = slot-1;
|
||||
player.networkHandler.sendPacket(new HeldItemChangeS2CPacket(slot-1));
|
||||
}
|
||||
|
||||
public enum ActionType
|
||||
{
|
||||
USE(true)
|
||||
|
||||
Reference in new issue
Block a user