mirror of
https://github.com/ViaVersion/ViaNBT.git
synced 2024-09-29 04:07:31 +02:00
Generate source and javadoc jars.
This commit is contained in:
parent
32efcec2f3
commit
c9852292d3
24
pom.xml
24
pom.xml
@ -82,6 +82,30 @@
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.6</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-sources</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-javadocs</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
|
@ -41,6 +41,8 @@ public class ConverterRegistry {
|
||||
/**
|
||||
* Registers a converter.
|
||||
*
|
||||
* @param <T> Tag type to convert from.
|
||||
* @param <V> Value type to convert to.
|
||||
* @param tag Tag type class to register the converter to.
|
||||
* @param type Value type class to register the converter to.
|
||||
* @param converter Converter to register.
|
||||
@ -62,9 +64,11 @@ public class ConverterRegistry {
|
||||
/**
|
||||
* Converts the given tag to a value.
|
||||
*
|
||||
* @param <T> Tag type to convert from.
|
||||
* @param <V> Value type to convert to.
|
||||
* @param tag Tag to convert.
|
||||
* @return The converted value.
|
||||
* @throw ConversionException If a suitable converter could not be found.
|
||||
* @throws ConversionException If a suitable converter could not be found.
|
||||
*/
|
||||
public static <T extends Tag, V> V convertToValue(T tag) throws ConversionException {
|
||||
if(tag == null || tag.getValue() == null) {
|
||||
@ -82,10 +86,12 @@ public class ConverterRegistry {
|
||||
/**
|
||||
* Converts the given value to a tag.
|
||||
*
|
||||
* @param <V> Value type to convert from.
|
||||
* @param <T> Tag type to convert to.
|
||||
* @param name Name of the resulting tag.
|
||||
* @param value Value to convert.
|
||||
* @return The converted tag.
|
||||
* @throw ConversionException If a suitable converter could not be found.
|
||||
* @throws ConversionException If a suitable converter could not be found.
|
||||
*/
|
||||
public static <V, T extends Tag> T convertToTag(String name, V value) throws ConversionException {
|
||||
if(value == null) {
|
||||
|
@ -20,6 +20,7 @@ public interface TagConverter<T extends Tag, V> {
|
||||
/**
|
||||
* Converts a value to a tag.
|
||||
*
|
||||
* @param name Name of the tag.
|
||||
* @param value Value to convert.
|
||||
* @return The converted tag.
|
||||
*/
|
||||
|
@ -39,6 +39,7 @@ public class TagRegistry {
|
||||
/**
|
||||
* Registers a tag class.
|
||||
*
|
||||
* @param id ID of the tag.
|
||||
* @param tag Tag class to register.
|
||||
* @throws TagRegisterException If an error occurs while registering the tag.
|
||||
*/
|
||||
|
@ -71,6 +71,7 @@ public class CompoundTag extends Tag implements Iterable<Tag> {
|
||||
/**
|
||||
* Gets the tag with the specified name.
|
||||
*
|
||||
* @param <T> Type of tag to get.
|
||||
* @param tagName Name of the tag.
|
||||
* @return The tag with the specified name.
|
||||
*/
|
||||
@ -81,6 +82,7 @@ public class CompoundTag extends Tag implements Iterable<Tag> {
|
||||
/**
|
||||
* Puts the tag into this compound tag.
|
||||
*
|
||||
* @param <T> Type of tag to put.
|
||||
* @param tag Tag to put into this compound tag.
|
||||
* @return The previous tag associated with its name, or null if there wasn't one.
|
||||
*/
|
||||
@ -91,6 +93,7 @@ public class CompoundTag extends Tag implements Iterable<Tag> {
|
||||
/**
|
||||
* Removes a tag from this compound tag.
|
||||
*
|
||||
* @param <T> Type of tag to remove.
|
||||
* @param tagName Name of the tag to remove.
|
||||
* @return The removed tag.
|
||||
*/
|
||||
|
@ -120,6 +120,7 @@ public class ListTag extends Tag implements Iterable<Tag> {
|
||||
/**
|
||||
* Gets the tag at the given index of this list tag.
|
||||
*
|
||||
* @param <T> Type of tag to get
|
||||
* @param index Index of the tag.
|
||||
* @return The tag at the given index.
|
||||
*/
|
||||
|
@ -7,7 +7,7 @@ import java.lang.reflect.Array;
|
||||
|
||||
/**
|
||||
* Represents an NBT tag.
|
||||
* <p/>
|
||||
*
|
||||
* All tags must have a constructor with a single string parameter for reading tags (can be any visibility).
|
||||
* Tags should also have setter methods specific to their value types.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user