mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 01:27:27 +00:00
Added ScriptBlock and ScriptNbt support to scripting API
This commit is contained in:
1 parent
6752f8baec
commit
699182f4c0
9 files changed
+339
-4
No files matched your search
@@ -9,6 +9,7 @@ import java.util.Map;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -109,4 +110,10 @@ public class ScriptBlock implements IBlock {
|
||||
public TileEntity getMCTileEntity() {
|
||||
return this.tile;
|
||||
}
|
||||
|
||||
public INbt getTileEntityNBT() {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
this.tile.writeToNBT(compound);
|
||||
return NpcAPI.Instance().getINbt(compound);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user