Minestom/docs/net/minestom/server/inventory/InventoryClickHandler.html
2020-11-15 23:39:49 +01:00

401 lines
20 KiB
HTML

<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>InventoryClickHandler (Minestom 1.0 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="declaration: package: net.minestom.server.inventory, interface: InventoryClickHandler">
<meta name="generator" content="javadoc/ClassWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../script-dir/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
<script type="text/javascript" src="../../../../script-dir/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../script-dir/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../script-dir/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../script-dir/jquery-3.4.1.js"></script>
<script type="text/javascript" src="../../../../script-dir/jquery-ui.js"></script>
</head>
<body class="class-declaration">
<script type="text/javascript">var data = {"i0":18,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],16:["t5","Default Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../../";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flexBox">
<header role="banner" class="flexHeader">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<div class="navListSearch"><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="skipNav"><a id="skip.navbar.top">
<!-- -->
</a></div>
</nav>
</header>
<div class="flexContent">
<main role="main">
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">net.minestom.server.inventory</a></div>
<h1 title="Interface InventoryClickHandler" class="title">Interface InventoryClickHandler</h1>
</div>
<div class="contentContainer">
<section class="description">
<dl>
<dt>All Known Implementing Classes:</dt>
<dd><code><a href="type/AnvilInventory.html" title="class in net.minestom.server.inventory.type">AnvilInventory</a></code>, <code><a href="type/BeaconInventory.html" title="class in net.minestom.server.inventory.type">BeaconInventory</a></code>, <code><a href="type/BrewingStandInventory.html" title="class in net.minestom.server.inventory.type">BrewingStandInventory</a></code>, <code><a href="type/EnchantmentTableInventory.html" title="class in net.minestom.server.inventory.type">EnchantmentTableInventory</a></code>, <code><a href="type/FurnaceInventory.html" title="class in net.minestom.server.inventory.type">FurnaceInventory</a></code>, <code><a href="Inventory.html" title="class in net.minestom.server.inventory">Inventory</a></code>, <code><a href="PlayerInventory.html" title="class in net.minestom.server.inventory">PlayerInventory</a></code>, <code><a href="type/VillagerInventory.html" title="class in net.minestom.server.inventory.type">VillagerInventory</a></code></dd>
</dl>
<hr>
<pre>public interface <span class="typeNameLabel">InventoryClickHandler</span></pre>
<div class="block">Represents an inventory which can receive click input.
All methods returning boolean returns true if the action is successful, false otherwise.
<p>
See https://wiki.vg/Protocol#Click_Window for more information.</div>
</section>
<section class="summary">
<ul class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<li class="blockList">
<section class="methodSummary"><a id="method.summary">
<!-- -->
</a>
<h2>Method Summary</h2>
<div class="memberSummary">
<div role="tablist" aria-orientation="horizontal"><button role="tab" aria-selected="true" aria-controls="memberSummary_tabpanel" tabindex="0" onkeydown="switchTab(event)" id="t0" class="activeTableTab">All Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t2" class="tableTab" onclick="show(2);">Instance Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t3" class="tableTab" onclick="show(4);">Abstract Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t5" class="tableTab" onclick="show(16);">Default Methods</button></div>
<div id="memberSummary_tabpanel" role="tabpanel">
<table aria-labelledby="t0">
<thead>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr class="altColor" id="i0">
<td class="colFirst"><code>default void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#callClickEvent(net.minestom.server.entity.Player,net.minestom.server.inventory.Inventory,int,net.minestom.server.inventory.click.ClickType,net.minestom.server.item.ItemStack,net.minestom.server.item.ItemStack)">callClickEvent</a></span>&#8203;(<a href="../entity/Player.html" title="class in net.minestom.server.entity">Player</a>&nbsp;player,
<a href="Inventory.html" title="class in net.minestom.server.inventory">Inventory</a>&nbsp;inventory,
int&nbsp;slot,
<a href="click/ClickType.html" title="enum in net.minestom.server.inventory.click">ClickType</a>&nbsp;clickType,
<a href="../item/ItemStack.html" title="class in net.minestom.server.item">ItemStack</a>&nbsp;clicked,
<a href="../item/ItemStack.html" title="class in net.minestom.server.item">ItemStack</a>&nbsp;cursor)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor" id="i1">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#changeHeld(net.minestom.server.entity.Player,int,int)">changeHeld</a></span>&#8203;(<a href="../entity/Player.html" title="class in net.minestom.server.entity">Player</a>&nbsp;player,
int&nbsp;slot,
int&nbsp;key)</code></th>
<td class="colLast">
<div class="block">Called when a <a href="../entity/Player.html" title="class in net.minestom.server.entity"><code>Player</code></a> held click in the inventory</div>
</td>
</tr>
<tr class="altColor" id="i2">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#doubleClick(net.minestom.server.entity.Player,int)">doubleClick</a></span>&#8203;(<a href="../entity/Player.html" title="class in net.minestom.server.entity">Player</a>&nbsp;player,
int&nbsp;slot)</code></th>
<td class="colLast">
<div class="block">Called when a <a href="../entity/Player.html" title="class in net.minestom.server.entity"><code>Player</code></a> double click in the inventory</div>
</td>
</tr>
<tr class="rowColor" id="i3">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#dragging(net.minestom.server.entity.Player,int,int)">dragging</a></span>&#8203;(<a href="../entity/Player.html" title="class in net.minestom.server.entity">Player</a>&nbsp;player,
int&nbsp;slot,
int&nbsp;button)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor" id="i4">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#drop(net.minestom.server.entity.Player,int,int,int)">drop</a></span>&#8203;(<a href="../entity/Player.html" title="class in net.minestom.server.entity">Player</a>&nbsp;player,
int&nbsp;mode,
int&nbsp;slot,
int&nbsp;button)</code></th>
<td class="colLast">
<div class="block">Called when a <a href="../entity/Player.html" title="class in net.minestom.server.entity"><code>Player</code></a> press the drop button</div>
</td>
</tr>
<tr class="rowColor" id="i5">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#leftClick(net.minestom.server.entity.Player,int)">leftClick</a></span>&#8203;(<a href="../entity/Player.html" title="class in net.minestom.server.entity">Player</a>&nbsp;player,
int&nbsp;slot)</code></th>
<td class="colLast">
<div class="block">Called when a <a href="../entity/Player.html" title="class in net.minestom.server.entity"><code>Player</code></a> left click in the inventory.</div>
</td>
</tr>
<tr class="altColor" id="i6">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#middleClick(net.minestom.server.entity.Player,int)">middleClick</a></span>&#8203;(<a href="../entity/Player.html" title="class in net.minestom.server.entity">Player</a>&nbsp;player,
int&nbsp;slot)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor" id="i7">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#rightClick(net.minestom.server.entity.Player,int)">rightClick</a></span>&#8203;(<a href="../entity/Player.html" title="class in net.minestom.server.entity">Player</a>&nbsp;player,
int&nbsp;slot)</code></th>
<td class="colLast">
<div class="block">Called when a <a href="../entity/Player.html" title="class in net.minestom.server.entity"><code>Player</code></a> right click in the inventory.</div>
</td>
</tr>
<tr class="altColor" id="i8">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#shiftClick(net.minestom.server.entity.Player,int)">shiftClick</a></span>&#8203;(<a href="../entity/Player.html" title="class in net.minestom.server.entity">Player</a>&nbsp;player,
int&nbsp;slot)</code></th>
<td class="colLast">
<div class="block">Called when a <a href="../entity/Player.html" title="class in net.minestom.server.entity"><code>Player</code></a> shift click in the inventory</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<li class="blockList">
<section class="methodDetails"><a id="method.detail">
<!-- -->
</a>
<h2>Method Details</h2>
<ul class="blockList">
<li class="blockList">
<section class="detail">
<h3><a id="leftClick(net.minestom.server.entity.Player,int)">leftClick</a></h3>
<div class="memberSignature"><span class="returnType">boolean</span>&nbsp;<span class="memberName">leftClick</span>&#8203;(<span class="arguments">@NotNull
<a href="../entity/Player.html" title="class in net.minestom.server.entity">Player</a>&nbsp;player,
int&nbsp;slot)</span></div>
<div class="block">Called when a <a href="../entity/Player.html" title="class in net.minestom.server.entity"><code>Player</code></a> left click in the inventory. Can also be to drop the cursor item</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>player</code> - the player who clicked</dd>
<dd><code>slot</code> - the slot number</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the click hasn't been cancelled, false otherwise</dd>
</dl>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="rightClick(net.minestom.server.entity.Player,int)">rightClick</a></h3>
<div class="memberSignature"><span class="returnType">boolean</span>&nbsp;<span class="memberName">rightClick</span>&#8203;(<span class="arguments">@NotNull
<a href="../entity/Player.html" title="class in net.minestom.server.entity">Player</a>&nbsp;player,
int&nbsp;slot)</span></div>
<div class="block">Called when a <a href="../entity/Player.html" title="class in net.minestom.server.entity"><code>Player</code></a> right click in the inventory. Can also be to drop the cursor item</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>player</code> - the player who clicked</dd>
<dd><code>slot</code> - the slot number</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the click hasn't been cancelled, false otherwise</dd>
</dl>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="shiftClick(net.minestom.server.entity.Player,int)">shiftClick</a></h3>
<div class="memberSignature"><span class="returnType">boolean</span>&nbsp;<span class="memberName">shiftClick</span>&#8203;(<span class="arguments">@NotNull
<a href="../entity/Player.html" title="class in net.minestom.server.entity">Player</a>&nbsp;player,
int&nbsp;slot)</span></div>
<div class="block">Called when a <a href="../entity/Player.html" title="class in net.minestom.server.entity"><code>Player</code></a> shift click in the inventory</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>player</code> - the player who clicked</dd>
<dd><code>slot</code> - the slot number</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the click hasn't been cancelled, false otherwise</dd>
</dl>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="changeHeld(net.minestom.server.entity.Player,int,int)">changeHeld</a></h3>
<div class="memberSignature"><span class="returnType">boolean</span>&nbsp;<span class="memberName">changeHeld</span>&#8203;(<span class="arguments">@NotNull
<a href="../entity/Player.html" title="class in net.minestom.server.entity">Player</a>&nbsp;player,
int&nbsp;slot,
int&nbsp;key)</span></div>
<div class="block">Called when a <a href="../entity/Player.html" title="class in net.minestom.server.entity"><code>Player</code></a> held click in the inventory</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>player</code> - the player who clicked</dd>
<dd><code>slot</code> - the slot number</dd>
<dd><code>key</code> - the held slot (0-8) pressed</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the click hasn't been cancelled, false otherwise</dd>
</dl>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="middleClick(net.minestom.server.entity.Player,int)">middleClick</a></h3>
<div class="memberSignature"><span class="returnType">boolean</span>&nbsp;<span class="memberName">middleClick</span>&#8203;(<span class="arguments">@NotNull
<a href="../entity/Player.html" title="class in net.minestom.server.entity">Player</a>&nbsp;player,
int&nbsp;slot)</span></div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="drop(net.minestom.server.entity.Player,int,int,int)">drop</a></h3>
<div class="memberSignature"><span class="returnType">boolean</span>&nbsp;<span class="memberName">drop</span>&#8203;(<span class="arguments">@NotNull
<a href="../entity/Player.html" title="class in net.minestom.server.entity">Player</a>&nbsp;player,
int&nbsp;mode,
int&nbsp;slot,
int&nbsp;button)</span></div>
<div class="block">Called when a <a href="../entity/Player.html" title="class in net.minestom.server.entity"><code>Player</code></a> press the drop button</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>player</code> - the player who clicked</dd>
<dd><code>mode</code> - </dd>
<dd><code>slot</code> - the slot number</dd>
<dd><code>button</code> - -999 if clicking outside, normal if he is not</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the drop hasn't been cancelled, false otherwise</dd>
</dl>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="dragging(net.minestom.server.entity.Player,int,int)">dragging</a></h3>
<div class="memberSignature"><span class="returnType">boolean</span>&nbsp;<span class="memberName">dragging</span>&#8203;(<span class="arguments">@NotNull
<a href="../entity/Player.html" title="class in net.minestom.server.entity">Player</a>&nbsp;player,
int&nbsp;slot,
int&nbsp;button)</span></div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="doubleClick(net.minestom.server.entity.Player,int)">doubleClick</a></h3>
<div class="memberSignature"><span class="returnType">boolean</span>&nbsp;<span class="memberName">doubleClick</span>&#8203;(<span class="arguments">@NotNull
<a href="../entity/Player.html" title="class in net.minestom.server.entity">Player</a>&nbsp;player,
int&nbsp;slot)</span></div>
<div class="block">Called when a <a href="../entity/Player.html" title="class in net.minestom.server.entity"><code>Player</code></a> double click in the inventory</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>player</code> - the player who clicked</dd>
<dd><code>slot</code> - the slot number</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the click hasn't been cancelled, false otherwise</dd>
</dl>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="callClickEvent(net.minestom.server.entity.Player,net.minestom.server.inventory.Inventory,int,net.minestom.server.inventory.click.ClickType,net.minestom.server.item.ItemStack,net.minestom.server.item.ItemStack)">callClickEvent</a></h3>
<div class="memberSignature"><span class="modifiers">default</span>&nbsp;<span class="returnType">void</span>&nbsp;<span class="memberName">callClickEvent</span>&#8203;(<span class="arguments">@NotNull
<a href="../entity/Player.html" title="class in net.minestom.server.entity">Player</a>&nbsp;player,
<a href="Inventory.html" title="class in net.minestom.server.inventory">Inventory</a>&nbsp;inventory,
int&nbsp;slot,
@NotNull
<a href="click/ClickType.html" title="enum in net.minestom.server.inventory.click">ClickType</a>&nbsp;clickType,
@NotNull
<a href="../item/ItemStack.html" title="class in net.minestom.server.item">ItemStack</a>&nbsp;clicked,
@NotNull
<a href="../item/ItemStack.html" title="class in net.minestom.server.item">ItemStack</a>&nbsp;cursor)</span></div>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
</div>
<!-- ========= END OF CLASS DATA ========= -->
</main>
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
</div>
<a id="skip.navbar.bottom">
<!-- -->
</a>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
</footer>
</div>
</div>
</body>
</html>