Files
StructureLib/feature/doc/javadoc/com/gtnewhorizon/structurelib/structure/IItemSource.html
T

438 lines
22 KiB
HTML

<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>IItemSource (StructureLib 1.2.9-feature-doc.4+6626ed89ae API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../jquery/jquery-ui.min.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../jquery-ui.overrides.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
<script type="text/javascript" src="../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../jquery/jquery-3.6.1.min.js"></script>
<script type="text/javascript" src="../../../../jquery/jquery-ui.min.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="IItemSource (StructureLib 1.2.9-feature-doc.4+6626ed89ae API)";
}
}
catch(err) {
}
//-->
var data = {"i0":1,"i1":1,"i2":6,"i3":18,"i4":18,"i5":18,"i6":18};
var tabs = {65535:["t0","All Methods"],1:["t1","Static 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 = "../../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= 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="../../../../overview-summary.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">
<ul class="navList">
<li><a href="../../../../index.html?com/gtnewhorizon/structurelib/structure/IItemSource.html" target="_top">Frames</a></li>
<li><a href="IItemSource.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<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>
<a id="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">com.gtnewhorizon.structurelib.structure</a></div>
<h2 title="Interface IItemSource" class="title">Interface IItemSource</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<pre>public interface <span class="typeNameLabel">IItemSource</span></pre>
<div class="block">Represent an item source. Take only, cannot be placed back.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<section>
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t5" class="tableTab"><span><a href="javascript:show(16);">Default Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<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>
<tr id="i0" class="altColor">
<td class="colFirst"><code>static <a href="IItemSource.html" title="interface in com.gtnewhorizon.structurelib.structure">IItemSource</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#fromInventory(net.minecraft.inventory.IInventory)">fromInventory</a></span>&#8203;(<a href="https://skmedix.github.io/ForgeJavaDocs/javadoc/forge/1.7.10-10.13.4.1614/net/minecraft/inventory/IInventory.html?is-external=true" title="class or interface in net.minecraft.inventory" class="externalLink">IInventory</a>&nbsp;inv)</code></th>
<td class="colLast">
<div class="block">Construct an IItemSource from given inventory</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>static <a href="IItemSource.html" title="interface in com.gtnewhorizon.structurelib.structure">IItemSource</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#fromPlayer(net.minecraft.entity.player.EntityPlayerMP)">fromPlayer</a></span>&#8203;(<a href="https://skmedix.github.io/ForgeJavaDocs/javadoc/forge/1.7.10-10.13.4.1614/net/minecraft/entity/player/EntityPlayerMP.html?is-external=true" title="class or interface in net.minecraft.entity.player" class="externalLink">EntityPlayerMP</a>&nbsp;player)</code></th>
<td class="colLast">
<div class="block">Construct an IItemSource from inventories associated with given player.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>java.util.Map&lt;<a href="https://skmedix.github.io/ForgeJavaDocs/javadoc/forge/1.7.10-10.13.4.1614/net/minecraft/item/ItemStack.html?is-external=true" title="class or interface in net.minecraft.item" class="externalLink">ItemStack</a>,&#8203;java.lang.Integer&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#take(java.util.function.Predicate,boolean,int)">take</a></span>&#8203;(java.util.function.Predicate&lt;<a href="https://skmedix.github.io/ForgeJavaDocs/javadoc/forge/1.7.10-10.13.4.1614/net/minecraft/item/ItemStack.html?is-external=true" title="class or interface in net.minecraft.item" class="externalLink">ItemStack</a>&gt;&nbsp;predicate,
boolean&nbsp;simulate,
int&nbsp;count)</code></th>
<td class="colLast">
<div class="block">Retrieve some amount of items from this item source matching given filter.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>default boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#takeAll(java.util.function.Predicate,boolean,int)">takeAll</a></span>&#8203;(java.util.function.Predicate&lt;<a href="https://skmedix.github.io/ForgeJavaDocs/javadoc/forge/1.7.10-10.13.4.1614/net/minecraft/item/ItemStack.html?is-external=true" title="class or interface in net.minecraft.item" class="externalLink">ItemStack</a>&gt;&nbsp;predicate,
boolean&nbsp;simulate,
int&nbsp;count)</code></th>
<td class="colLast">
<div class="block">Take exactly count amount of items matching predicate.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>default boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#takeAll(net.minecraft.item.ItemStack,boolean)">takeAll</a></span>&#8203;(<a href="https://skmedix.github.io/ForgeJavaDocs/javadoc/forge/1.7.10-10.13.4.1614/net/minecraft/item/ItemStack.html?is-external=true" title="class or interface in net.minecraft.item" class="externalLink">ItemStack</a>&nbsp;stack,
boolean&nbsp;simulate)</code></th>
<td class="colLast">
<div class="block">Take some item.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>default <a href="https://skmedix.github.io/ForgeJavaDocs/javadoc/forge/1.7.10-10.13.4.1614/net/minecraft/item/ItemStack.html?is-external=true" title="class or interface in net.minecraft.item" class="externalLink">ItemStack</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#takeOne(java.util.function.Predicate,boolean)">takeOne</a></span>&#8203;(java.util.function.Predicate&lt;<a href="https://skmedix.github.io/ForgeJavaDocs/javadoc/forge/1.7.10-10.13.4.1614/net/minecraft/item/ItemStack.html?is-external=true" title="class or interface in net.minecraft.item" class="externalLink">ItemStack</a>&gt;&nbsp;predicate,
boolean&nbsp;simulate)</code></th>
<td class="colLast">
<div class="block">Take exactly one item that matches the predicate.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>default boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#takeOne(net.minecraft.item.ItemStack,boolean)">takeOne</a></span>&#8203;(<a href="https://skmedix.github.io/ForgeJavaDocs/javadoc/forge/1.7.10-10.13.4.1614/net/minecraft/item/ItemStack.html?is-external=true" title="class or interface in net.minecraft.item" class="externalLink">ItemStack</a>&nbsp;stack,
boolean&nbsp;simulate)</code></th>
<td class="colLast">
<div class="block">Take exactly one item.</div>
</td>
</tr>
</table>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<section>
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="take(java.util.function.Predicate,boolean,int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>take</h4>
<pre class="methodSignature">@Nonnull
java.util.Map&lt;<a href="https://skmedix.github.io/ForgeJavaDocs/javadoc/forge/1.7.10-10.13.4.1614/net/minecraft/item/ItemStack.html?is-external=true" title="class or interface in net.minecraft.item" class="externalLink">ItemStack</a>,&#8203;java.lang.Integer&gt;&nbsp;take&#8203;(java.util.function.Predicate&lt;<a href="https://skmedix.github.io/ForgeJavaDocs/javadoc/forge/1.7.10-10.13.4.1614/net/minecraft/item/ItemStack.html?is-external=true" title="class or interface in net.minecraft.item" class="externalLink">ItemStack</a>&gt;&nbsp;predicate,
boolean&nbsp;simulate,
int&nbsp;count)</pre>
<div class="block">Retrieve some amount of items from this item source matching given filter.
<p>
We probably don't need to get a lot of items from this method, so I don't care about the overhead of storing all
fetched items even if downstream code doesn't need it</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>predicate</code> - filtering predicate. should return true for ItemStacks that should be added to result collection</dd>
<dd><code>simulate</code> - whether to actually commit the modification. true for dry run, false otherwise.</dd>
<dd><code>count</code> - how many items to extract.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A nonnull map reflecting the result of extraction. Note this map is NBT and metadata aware.</dd>
</dl>
</li>
</ul>
<a id="takeOne(java.util.function.Predicate,boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>takeOne</h4>
<pre class="methodSignature">default&nbsp;<a href="https://skmedix.github.io/ForgeJavaDocs/javadoc/forge/1.7.10-10.13.4.1614/net/minecraft/item/ItemStack.html?is-external=true" title="class or interface in net.minecraft.item" class="externalLink">ItemStack</a>&nbsp;takeOne&#8203;(java.util.function.Predicate&lt;<a href="https://skmedix.github.io/ForgeJavaDocs/javadoc/forge/1.7.10-10.13.4.1614/net/minecraft/item/ItemStack.html?is-external=true" title="class or interface in net.minecraft.item" class="externalLink">ItemStack</a>&gt;&nbsp;predicate,
boolean&nbsp;simulate)</pre>
<div class="block">Take exactly one item that matches the predicate.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>predicate</code> - filtering predicate. should return true for ItemStacks that should be added to result collection</dd>
<dd><code>simulate</code> - whether to actually commit the modification. true for dry run, false otherwise.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>item stack, or null if none matches</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if given predicate is null.</dd>
</dl>
</li>
</ul>
<a id="takeAll(java.util.function.Predicate,boolean,int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>takeAll</h4>
<pre class="methodSignature">default&nbsp;boolean&nbsp;takeAll&#8203;(java.util.function.Predicate&lt;<a href="https://skmedix.github.io/ForgeJavaDocs/javadoc/forge/1.7.10-10.13.4.1614/net/minecraft/item/ItemStack.html?is-external=true" title="class or interface in net.minecraft.item" class="externalLink">ItemStack</a>&gt;&nbsp;predicate,
boolean&nbsp;simulate,
int&nbsp;count)</pre>
<div class="block">Take exactly count amount of items matching predicate.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>predicate</code> - filtering predicate. should return true for ItemStacks that should be added to result collection</dd>
<dd><code>simulate</code> - whether to actually commit the modification. true for dry run, false otherwise.</dd>
<dd><code>count</code> - how many items to extract.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if at least count amount of items can be/is taken.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if given predicate is null</dd>
</dl>
</li>
</ul>
<a id="takeOne(net.minecraft.item.ItemStack,boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>takeOne</h4>
<pre class="methodSignature">default&nbsp;boolean&nbsp;takeOne&#8203;(<a href="https://skmedix.github.io/ForgeJavaDocs/javadoc/forge/1.7.10-10.13.4.1614/net/minecraft/item/ItemStack.html?is-external=true" title="class or interface in net.minecraft.item" class="externalLink">ItemStack</a>&nbsp;stack,
boolean&nbsp;simulate)</pre>
<div class="block">Take exactly one item. ItemStack given must have a stack size of 1.
<p>
This is meant to be an optimized version of <a href="#takeOne(java.util.function.Predicate,boolean)"><code>takeOne(Predicate, boolean)</code></a>. Implementations that support
item storage indexed by ItemStack can use this to speed up calculation.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>stack</code> - what item to extract. The NBT tag of this ItemStack is siginifcant and will be considered during
matching. must have a stack size of 1.</dd>
<dd><code>simulate</code> - whether to actually commit the modification. true for dry run, false otherwise.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if found. false otherwise</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if given stack is invalid, or has a stack size other than 1.</dd>
</dl>
</li>
</ul>
<a id="takeAll(net.minecraft.item.ItemStack,boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>takeAll</h4>
<pre class="methodSignature">default&nbsp;boolean&nbsp;takeAll&#8203;(<a href="https://skmedix.github.io/ForgeJavaDocs/javadoc/forge/1.7.10-10.13.4.1614/net/minecraft/item/ItemStack.html?is-external=true" title="class or interface in net.minecraft.item" class="externalLink">ItemStack</a>&nbsp;stack,
boolean&nbsp;simulate)</pre>
<div class="block">Take some item. Will not take item if it cannot find enough items to take.
<p>
This is meant to be an optimized version of <a href="#takeOne(java.util.function.Predicate,boolean)"><code>takeOne(Predicate, boolean)</code></a>. Implementations that support
indexing off ItemStack can use this to speed up calculation.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>stack</code> - what item and how many to extract. The NBT tag of this ItemStack is siginifcant and will be
considered during matching</dd>
<dd><code>simulate</code> - whether to actually commit the modification. true for dry run, false otherwise.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if enough item can be/has been extracted. false otherwise</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if given stack is invalid</dd>
</dl>
</li>
</ul>
<a id="fromPlayer(net.minecraft.entity.player.EntityPlayerMP)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fromPlayer</h4>
<pre class="methodSignature">static&nbsp;<a href="IItemSource.html" title="interface in com.gtnewhorizon.structurelib.structure">IItemSource</a>&nbsp;fromPlayer&#8203;(<a href="https://skmedix.github.io/ForgeJavaDocs/javadoc/forge/1.7.10-10.13.4.1614/net/minecraft/entity/player/EntityPlayerMP.html?is-external=true" title="class or interface in net.minecraft.entity.player" class="externalLink">EntityPlayerMP</a>&nbsp;player)</pre>
<div class="block">Construct an IItemSource from inventories associated with given player.
<p>
This will be backed by <a href="../util/InventoryUtility.html" title="class in com.gtnewhorizon.structurelib.util"><code>InventoryUtility</code></a></div>
</li>
</ul>
<a id="fromInventory(net.minecraft.inventory.IInventory)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>fromInventory</h4>
<pre class="methodSignature">static&nbsp;<a href="IItemSource.html" title="interface in com.gtnewhorizon.structurelib.structure">IItemSource</a>&nbsp;fromInventory&#8203;(<a href="https://skmedix.github.io/ForgeJavaDocs/javadoc/forge/1.7.10-10.13.4.1614/net/minecraft/inventory/IInventory.html?is-external=true" title="class or interface in net.minecraft.inventory" class="externalLink">IInventory</a>&nbsp;inv)</pre>
<div class="block">Construct an IItemSource from given inventory
<p>
This will be backed by <a href="../util/InventoryUtility.html" title="class in com.gtnewhorizon.structurelib.util"><code>InventoryUtility</code></a></div>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>
<!-- ========= END OF CLASS DATA ========= -->
<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="../../../../overview-summary.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">
<ul class="navList">
<li><a href="../../../../index.html?com/gtnewhorizon/structurelib/structure/IItemSource.html" target="_top">Frames</a></li>
<li><a href="IItemSource.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<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>
<a id="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
</footer>
</body>
</html>