-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from flinbein/dev
Dev
- Loading branch information
Showing
88 changed files
with
2,713 additions
and
6,436 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package me.dpohvar.powernbt.api; | ||
|
||
public interface NBTBox extends Cloneable { | ||
|
||
/** | ||
* Get original NBT tag. | ||
* @return NBTBase | ||
*/ | ||
public Object getHandle(); | ||
|
||
/** | ||
* Get copy of original nbt box. | ||
* @return NBTTagCompound | ||
*/ | ||
public Object getHandleCopy(); | ||
|
||
/** | ||
* Create clone of this NBT tag | ||
* @return cloned {@link NBTBox} | ||
*/ | ||
public NBTBox clone(); | ||
|
||
public int size(); | ||
|
||
public boolean isEmpty(); | ||
|
||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package me.dpohvar.powernbt.api; | ||
|
||
import org.bukkit.World; | ||
import org.bukkit.block.BlockState; | ||
import org.bukkit.entity.Entity; | ||
import org.bukkit.inventory.ItemStack; | ||
|
||
import java.io.DataInput; | ||
import java.io.DataOutput; | ||
import java.io.IOException; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
abstract class NBTBridge { | ||
|
||
private static NBTBridge instance; | ||
|
||
public static NBTBridge getInstance(){ | ||
if (instance == null) instance = new NBTBridgeSpigot(); | ||
return instance; | ||
} | ||
|
||
abstract Map<String, Object> getNbtInnerMap(Object nbtTagCompound); | ||
|
||
abstract List<Object> getNbtInnerList(Object nbtTagList); | ||
|
||
abstract Object getBlockNBTTag(BlockState state); | ||
|
||
abstract Object getEntityNBTTag(Entity entity); | ||
|
||
abstract Object getItemStackNBTTag(ItemStack itemStack); | ||
|
||
abstract void setBlockNBTTag(BlockState state, Object tag); | ||
|
||
abstract void setEntityNBTTag(Entity entity, Object tag); | ||
|
||
abstract void setItemStackNBTTag(ItemStack itemStack, Object tag); | ||
|
||
abstract ItemStack asCraftCopyItemStack(ItemStack itemStack); | ||
|
||
abstract Object readNBTData(DataInput dataInput) throws IOException; | ||
|
||
abstract void writeNBTData(DataOutput dataInput, Object tag) throws IOException; | ||
|
||
abstract Entity spawnEntity(Object tag, World world); | ||
|
||
abstract byte getTagType(Object tag); | ||
|
||
abstract Object getPrimitiveValue(Object tag); | ||
|
||
abstract Object getTagValueByPrimitive(Object javaPrimitive); | ||
|
||
abstract Object cloneTag(Object tag); | ||
|
||
abstract Object createNBTTagCompound(); | ||
|
||
abstract Object createNBTTagList(); | ||
|
||
abstract byte getNBTTagListType(Object tagList); | ||
|
||
abstract void setNBTTagListType(Object tagList, byte type); | ||
|
||
} |
Oops, something went wrong.