Archiviert
13
0
Dieses Repository wurde am 2021-01-06 archiviert. Du kannst Dateien ansehen und es klonen, aber nicht pushen oder Issues/Pull-Requests öffnen.
ProtocolLib/Javadoc/com/comphenix/protocol/wrappers/nbt/NbtFactory.html

683 Zeilen
37 KiB
HTML

2013-01-10 00:58:34 +01:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
2013-03-05 17:07:09 +01:00
<!-- Generated by javadoc (version 1.7.0_13) on Tue Mar 05 17:05:45 CET 2013 -->
2013-01-10 00:58:34 +01:00
<title>NbtFactory</title>
2013-03-05 17:07:09 +01:00
<meta name="date" content="2013-03-05">
2013-01-10 00:58:34 +01:00
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="NbtFactory";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="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="class-use/NbtFactory.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtCompound.html" title="interface in com.comphenix.protocol.wrappers.nbt"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtList.html" title="interface in com.comphenix.protocol.wrappers.nbt"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/comphenix/protocol/wrappers/nbt/NbtFactory.html" target="_top">Frames</a></li>
<li><a href="NbtFactory.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></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>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&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><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.comphenix.protocol.wrappers.nbt</div>
<h2 title="Class NbtFactory" class="title">Class NbtFactory</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>com.comphenix.protocol.wrappers.nbt.NbtFactory</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">NbtFactory</span>
extends java.lang.Object</pre>
<div class="block">Factory methods for creating NBT elements, lists and compounds.</div>
<dl><dt><span class="strong">Author:</span></dt>
<dd>Kristian</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtFactory.html#NbtFactory()">NbtFactory</a></strong>()</code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtCompound.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtCompound</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtFactory.html#asCompound(com.comphenix.protocol.wrappers.nbt.NbtBase)">asCompound</a></strong>(<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtBase.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtBase</a>&lt;?&gt;&nbsp;tag)</code>
<div class="block">Attempt to cast this NBT tag as a compund.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtList.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtList</a>&lt;?&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtFactory.html#asList(com.comphenix.protocol.wrappers.nbt.NbtBase)">asList</a></strong>(<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtBase.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtBase</a>&lt;?&gt;&nbsp;tag)</code>
<div class="block">Attempt to cast this NBT tag as a list.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static &lt;T&gt;&nbsp;<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtWrapper.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtWrapper</a>&lt;T&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtFactory.html#fromBase(com.comphenix.protocol.wrappers.nbt.NbtBase)">fromBase</a></strong>(<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtBase.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtBase</a>&lt;T&gt;&nbsp;base)</code>
<div class="block">Get a NBT wrapper from a NBT base.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtWrapper.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtWrapper</a>&lt;?&gt;</code></td>
2013-03-05 17:07:09 +01:00
<td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtFactory.html#fromItemTag(org.bukkit.inventory.ItemStack)">fromItemTag</a></strong>(org.bukkit.inventory.ItemStack&nbsp;stack)</code>
2013-01-10 00:58:34 +01:00
<div class="block">Construct a wrapper for an NBT tag stored (in memory) in an item stack.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static &lt;T&gt;&nbsp;<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtWrapper.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtWrapper</a>&lt;T&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtFactory.html#fromNMS(java.lang.Object)">fromNMS</a></strong>(java.lang.Object&nbsp;handle)</code>
<div class="block">Initialize a NBT wrapper.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtBase.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtBase</a>&lt;java.lang.Byte&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtFactory.html#of(java.lang.String, byte)">of</a></strong>(java.lang.String&nbsp;name,
byte&nbsp;value)</code>
<div class="block">Constructs a NBT tag of type byte.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtBase.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtBase</a>&lt;byte[]&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtFactory.html#of(java.lang.String, byte[])">of</a></strong>(java.lang.String&nbsp;name,
byte[]&nbsp;value)</code>
<div class="block">Constructs a NBT tag of type byte array.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtBase.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtBase</a>&lt;java.lang.Double&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtFactory.html#of(java.lang.String, double)">of</a></strong>(java.lang.String&nbsp;name,
double&nbsp;value)</code>
<div class="block">Constructs a NBT tag of type double.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtBase.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtBase</a>&lt;java.lang.Float&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtFactory.html#of(java.lang.String, float)">of</a></strong>(java.lang.String&nbsp;name,
float&nbsp;value)</code>
<div class="block">Constructs a NBT tag of type float.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtBase.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtBase</a>&lt;java.lang.Integer&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtFactory.html#of(java.lang.String, int)">of</a></strong>(java.lang.String&nbsp;name,
int&nbsp;value)</code>
<div class="block">Constructs a NBT tag of type int.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtBase.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtBase</a>&lt;int[]&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtFactory.html#of(java.lang.String, int[])">of</a></strong>(java.lang.String&nbsp;name,
int[]&nbsp;value)</code>
<div class="block">Constructs a NBT tag of type int array.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtBase.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtBase</a>&lt;java.lang.Long&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtFactory.html#of(java.lang.String, long)">of</a></strong>(java.lang.String&nbsp;name,
long&nbsp;value)</code>
<div class="block">Constructs a NBT tag of type long.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtBase.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtBase</a>&lt;java.lang.Short&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtFactory.html#of(java.lang.String, short)">of</a></strong>(java.lang.String&nbsp;name,
short&nbsp;value)</code>
<div class="block">Constructs a NBT tag of type short.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtBase.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtBase</a>&lt;java.lang.String&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtFactory.html#of(java.lang.String, java.lang.String)">of</a></strong>(java.lang.String&nbsp;name,
java.lang.String&nbsp;value)</code>
<div class="block">Constructs a NBT tag of type string.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtCompound.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtCompound</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtFactory.html#ofCompound(java.lang.String)">ofCompound</a></strong>(java.lang.String&nbsp;name)</code>
<div class="block">Construct a new NBT compound wrapper.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtCompound.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtCompound</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtFactory.html#ofCompound(java.lang.String, java.util.Collection)">ofCompound</a></strong>(java.lang.String&nbsp;name,
java.util.Collection&lt;? extends <a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtBase.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtBase</a>&lt;?&gt;&gt;&nbsp;list)</code>
<div class="block">Construct a new NBT compound initialized with a given list of NBT values.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static &lt;T&gt;&nbsp;<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtList.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtList</a>&lt;T&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtFactory.html#ofList(java.lang.String, java.util.Collection)">ofList</a></strong>(java.lang.String&nbsp;name,
java.util.Collection&lt;? extends T&gt;&nbsp;elements)</code>
<div class="block">Construct a NBT list of out a list of values.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static &lt;T&gt;&nbsp;<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtList.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtList</a>&lt;T&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtFactory.html#ofList(java.lang.String, T...)">ofList</a></strong>(java.lang.String&nbsp;name,
T...&nbsp;elements)</code>
<div class="block">Construct a NBT list of out an array of values.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static &lt;T&gt;&nbsp;<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtWrapper.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtWrapper</a>&lt;T&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtFactory.html#ofWrapper(java.lang.Class, java.lang.String, T)">ofWrapper</a></strong>(java.lang.Class&lt;?&gt;&nbsp;type,
java.lang.String&nbsp;name,
T&nbsp;value)</code>
<div class="block">Create a new NBT wrapper from a given type.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static &lt;T&gt;&nbsp;<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtWrapper.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtWrapper</a>&lt;T&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtFactory.html#ofWrapper(com.comphenix.protocol.wrappers.nbt.NbtType, java.lang.String)">ofWrapper</a></strong>(<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtType.html" title="enum in com.comphenix.protocol.wrappers.nbt">NbtType</a>&nbsp;type,
java.lang.String&nbsp;name)</code>
<div class="block">Create a new NBT wrapper from a given type.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static &lt;T&gt;&nbsp;<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtWrapper.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtWrapper</a>&lt;T&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtFactory.html#ofWrapper(com.comphenix.protocol.wrappers.nbt.NbtType, java.lang.String, T)">ofWrapper</a></strong>(<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtType.html" title="enum in com.comphenix.protocol.wrappers.nbt">NbtType</a>&nbsp;type,
java.lang.String&nbsp;name,
T&nbsp;value)</code>
<div class="block">Create a new NBT wrapper from a given type.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="NbtFactory()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>NbtFactory</h4>
<pre>public&nbsp;NbtFactory()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="asCompound(com.comphenix.protocol.wrappers.nbt.NbtBase)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>asCompound</h4>
<pre>public static&nbsp;<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtCompound.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtCompound</a>&nbsp;asCompound(<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtBase.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtBase</a>&lt;?&gt;&nbsp;tag)</pre>
<div class="block">Attempt to cast this NBT tag as a compund.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>tag</code> - - the NBT tag to cast.</dd>
<dt><span class="strong">Returns:</span></dt><dd>This instance as a compound.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.lang.UnsupportedOperationException</code> - If this is not a compound.</dd></dl>
</li>
</ul>
<a name="asList(com.comphenix.protocol.wrappers.nbt.NbtBase)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>asList</h4>
<pre>public static&nbsp;<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtList.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtList</a>&lt;?&gt;&nbsp;asList(<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtBase.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtBase</a>&lt;?&gt;&nbsp;tag)</pre>
<div class="block">Attempt to cast this NBT tag as a list.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>tag</code> - - the NBT tag to cast.</dd>
<dt><span class="strong">Returns:</span></dt><dd>This instance as a list.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.lang.UnsupportedOperationException</code> - If this is not a list.</dd></dl>
</li>
</ul>
<a name="fromBase(com.comphenix.protocol.wrappers.nbt.NbtBase)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fromBase</h4>
<pre>public static&nbsp;&lt;T&gt;&nbsp;<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtWrapper.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtWrapper</a>&lt;T&gt;&nbsp;fromBase(<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtBase.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtBase</a>&lt;T&gt;&nbsp;base)</pre>
<div class="block">Get a NBT wrapper from a NBT base.
<p>
This may clone the content if the NbtBase is not a NbtWrapper.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>base</code> - - the base class.</dd>
<dt><span class="strong">Returns:</span></dt><dd>A NBT wrapper.</dd></dl>
</li>
</ul>
<a name="fromItemTag(org.bukkit.inventory.ItemStack)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fromItemTag</h4>
2013-03-05 17:07:09 +01:00
<pre>public static&nbsp;<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtWrapper.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtWrapper</a>&lt;?&gt;&nbsp;fromItemTag(org.bukkit.inventory.ItemStack&nbsp;stack)</pre>
2013-01-10 00:58:34 +01:00
<div class="block">Construct a wrapper for an NBT tag stored (in memory) in an item stack. This is where
auxillary data such as enchanting, name and lore is stored. It doesn't include the items
material, damage value or count.
<p>
The item stack must be a wrapper for a CraftItemStack. Use
<a href="../../../../../com/comphenix/protocol/utility/MinecraftReflection.html#getBukkitItemStack(org.bukkit.inventory.ItemStack)"><code>MinecraftReflection.getBukkitItemStack(ItemStack)</code></a> if not.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>stack</code> - - the item stack.</dd>
<dt><span class="strong">Returns:</span></dt><dd>A wrapper for its NBT tag.</dd></dl>
</li>
</ul>
<a name="fromNMS(java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fromNMS</h4>
<pre>public static&nbsp;&lt;T&gt;&nbsp;<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtWrapper.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtWrapper</a>&lt;T&gt;&nbsp;fromNMS(java.lang.Object&nbsp;handle)</pre>
<div class="block">Initialize a NBT wrapper.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>handle</code> - - the underlying net.minecraft.server object to wrap.</dd>
<dt><span class="strong">Returns:</span></dt><dd>A NBT wrapper.</dd></dl>
</li>
</ul>
<a name="of(java.lang.String, java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>of</h4>
<pre>public static&nbsp;<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtBase.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtBase</a>&lt;java.lang.String&gt;&nbsp;of(java.lang.String&nbsp;name,
java.lang.String&nbsp;value)</pre>
<div class="block">Constructs a NBT tag of type string.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - - name of the tag.</dd><dd><code>value</code> - - value of the tag.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The constructed NBT tag.</dd></dl>
</li>
</ul>
<a name="of(java.lang.String, byte)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>of</h4>
<pre>public static&nbsp;<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtBase.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtBase</a>&lt;java.lang.Byte&gt;&nbsp;of(java.lang.String&nbsp;name,
byte&nbsp;value)</pre>
<div class="block">Constructs a NBT tag of type byte.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - - name of the tag.</dd><dd><code>value</code> - - value of the tag.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The constructed NBT tag.</dd></dl>
</li>
</ul>
<a name="of(java.lang.String, short)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>of</h4>
<pre>public static&nbsp;<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtBase.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtBase</a>&lt;java.lang.Short&gt;&nbsp;of(java.lang.String&nbsp;name,
short&nbsp;value)</pre>
<div class="block">Constructs a NBT tag of type short.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - - name of the tag.</dd><dd><code>value</code> - - value of the tag.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The constructed NBT tag.</dd></dl>
</li>
</ul>
<a name="of(java.lang.String, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>of</h4>
<pre>public static&nbsp;<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtBase.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtBase</a>&lt;java.lang.Integer&gt;&nbsp;of(java.lang.String&nbsp;name,
int&nbsp;value)</pre>
<div class="block">Constructs a NBT tag of type int.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - - name of the tag.</dd><dd><code>value</code> - - value of the tag.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The constructed NBT tag.</dd></dl>
</li>
</ul>
<a name="of(java.lang.String, long)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>of</h4>
<pre>public static&nbsp;<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtBase.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtBase</a>&lt;java.lang.Long&gt;&nbsp;of(java.lang.String&nbsp;name,
long&nbsp;value)</pre>
<div class="block">Constructs a NBT tag of type long.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - - name of the tag.</dd><dd><code>value</code> - - value of the tag.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The constructed NBT tag.</dd></dl>
</li>
</ul>
<a name="of(java.lang.String, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>of</h4>
<pre>public static&nbsp;<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtBase.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtBase</a>&lt;java.lang.Float&gt;&nbsp;of(java.lang.String&nbsp;name,
float&nbsp;value)</pre>
<div class="block">Constructs a NBT tag of type float.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - - name of the tag.</dd><dd><code>value</code> - - value of the tag.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The constructed NBT tag.</dd></dl>
</li>
</ul>
<a name="of(java.lang.String, double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>of</h4>
<pre>public static&nbsp;<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtBase.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtBase</a>&lt;java.lang.Double&gt;&nbsp;of(java.lang.String&nbsp;name,
double&nbsp;value)</pre>
<div class="block">Constructs a NBT tag of type double.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - - name of the tag.</dd><dd><code>value</code> - - value of the tag.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The constructed NBT tag.</dd></dl>
</li>
</ul>
<a name="of(java.lang.String, byte[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>of</h4>
<pre>public static&nbsp;<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtBase.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtBase</a>&lt;byte[]&gt;&nbsp;of(java.lang.String&nbsp;name,
byte[]&nbsp;value)</pre>
<div class="block">Constructs a NBT tag of type byte array.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - - name of the tag.</dd><dd><code>value</code> - - value of the tag.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The constructed NBT tag.</dd></dl>
</li>
</ul>
<a name="of(java.lang.String, int[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>of</h4>
<pre>public static&nbsp;<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtBase.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtBase</a>&lt;int[]&gt;&nbsp;of(java.lang.String&nbsp;name,
int[]&nbsp;value)</pre>
<div class="block">Constructs a NBT tag of type int array.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - - name of the tag.</dd><dd><code>value</code> - - value of the tag.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The constructed NBT tag.</dd></dl>
</li>
</ul>
<a name="ofCompound(java.lang.String, java.util.Collection)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ofCompound</h4>
<pre>public static&nbsp;<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtCompound.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtCompound</a>&nbsp;ofCompound(java.lang.String&nbsp;name,
java.util.Collection&lt;? extends <a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtBase.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtBase</a>&lt;?&gt;&gt;&nbsp;list)</pre>
<div class="block">Construct a new NBT compound initialized with a given list of NBT values.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - - the name of the compound wrapper.</dd><dd><code>list</code> - - the list of elements to add.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The new wrapped NBT compound.</dd></dl>
</li>
</ul>
<a name="ofCompound(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ofCompound</h4>
<pre>public static&nbsp;<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtCompound.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtCompound</a>&nbsp;ofCompound(java.lang.String&nbsp;name)</pre>
<div class="block">Construct a new NBT compound wrapper.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - - the name of the compound wrapper.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The new wrapped NBT compound.</dd></dl>
</li>
</ul>
<a name="ofList(java.lang.String,java.lang.Object[])">
<!-- -->
</a><a name="ofList(java.lang.String, T...)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ofList</h4>
<pre>public static&nbsp;&lt;T&gt;&nbsp;<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtList.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtList</a>&lt;T&gt;&nbsp;ofList(java.lang.String&nbsp;name,
T...&nbsp;elements)</pre>
<div class="block">Construct a NBT list of out an array of values.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - - name of this list.</dd><dd><code>elements</code> - - elements to add.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The new filled NBT list.</dd></dl>
</li>
</ul>
<a name="ofList(java.lang.String, java.util.Collection)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ofList</h4>
<pre>public static&nbsp;&lt;T&gt;&nbsp;<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtList.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtList</a>&lt;T&gt;&nbsp;ofList(java.lang.String&nbsp;name,
java.util.Collection&lt;? extends T&gt;&nbsp;elements)</pre>
<div class="block">Construct a NBT list of out a list of values.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - - name of this list.</dd><dd><code>elements</code> - - elements to add.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The new filled NBT list.</dd></dl>
</li>
</ul>
<a name="ofWrapper(com.comphenix.protocol.wrappers.nbt.NbtType, java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ofWrapper</h4>
<pre>public static&nbsp;&lt;T&gt;&nbsp;<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtWrapper.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtWrapper</a>&lt;T&gt;&nbsp;ofWrapper(<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtType.html" title="enum in com.comphenix.protocol.wrappers.nbt">NbtType</a>&nbsp;type,
java.lang.String&nbsp;name)</pre>
<div class="block">Create a new NBT wrapper from a given type.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>type</code> - - the NBT type.</dd><dd><code>name</code> - - the name of the NBT tag.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The new wrapped NBT tag.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></code> - If we're unable to create the underlying tag.</dd></dl>
</li>
</ul>
<a name="ofWrapper(com.comphenix.protocol.wrappers.nbt.NbtType,java.lang.String,java.lang.Object)">
<!-- -->
</a><a name="ofWrapper(com.comphenix.protocol.wrappers.nbt.NbtType, java.lang.String, T)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ofWrapper</h4>
<pre>public static&nbsp;&lt;T&gt;&nbsp;<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtWrapper.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtWrapper</a>&lt;T&gt;&nbsp;ofWrapper(<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtType.html" title="enum in com.comphenix.protocol.wrappers.nbt">NbtType</a>&nbsp;type,
java.lang.String&nbsp;name,
T&nbsp;value)</pre>
<div class="block">Create a new NBT wrapper from a given type.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>type</code> - - the NBT type.</dd><dd><code>name</code> - - the name of the NBT tag.</dd><dd><code>value</code> - - the value of the new tag.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The new wrapped NBT tag.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></code> - If we're unable to create the underlying tag.</dd></dl>
</li>
</ul>
<a name="ofWrapper(java.lang.Class,java.lang.String,java.lang.Object)">
<!-- -->
</a><a name="ofWrapper(java.lang.Class, java.lang.String, T)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>ofWrapper</h4>
<pre>public static&nbsp;&lt;T&gt;&nbsp;<a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtWrapper.html" title="interface in com.comphenix.protocol.wrappers.nbt">NbtWrapper</a>&lt;T&gt;&nbsp;ofWrapper(java.lang.Class&lt;?&gt;&nbsp;type,
java.lang.String&nbsp;name,
T&nbsp;value)</pre>
<div class="block">Create a new NBT wrapper from a given type.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>type</code> - - type of the NBT value.</dd><dd><code>name</code> - - the name of the NBT tag.</dd><dd><code>value</code> - - the value of the new tag.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The new wrapped NBT tag.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../com/comphenix/protocol/reflect/FieldAccessException.html" title="class in com.comphenix.protocol.reflect">FieldAccessException</a></code> - If we're unable to create the underlying tag.</dd>
<dd><code>java.lang.IllegalArgumentException</code> - If the given class type is not valid NBT.</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="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="class-use/NbtFactory.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtCompound.html" title="interface in com.comphenix.protocol.wrappers.nbt"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../com/comphenix/protocol/wrappers/nbt/NbtList.html" title="interface in com.comphenix.protocol.wrappers.nbt"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/comphenix/protocol/wrappers/nbt/NbtFactory.html" target="_top">Frames</a></li>
<li><a href="NbtFactory.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All 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>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&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><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>