|
| 1 | +/** |
| 2 | + * @author lishid |
| 3 | + * @author Aleksey Terzi |
| 4 | + * |
| 5 | + */ |
| 6 | + |
| 7 | +package com.lishid.orebfuscator.nms.v1_12_R1; |
| 8 | + |
| 9 | +import java.io.DataInput; |
| 10 | +import java.io.DataInputStream; |
| 11 | +import java.io.DataOutput; |
| 12 | +import java.io.IOException; |
| 13 | + |
| 14 | +import net.minecraft.server.v1_12_R1.NBTCompressedStreamTools; |
| 15 | +import net.minecraft.server.v1_12_R1.NBTTagCompound; |
| 16 | + |
| 17 | +import com.lishid.orebfuscator.nms.INBT; |
| 18 | + |
| 19 | +public class NBT implements INBT { |
| 20 | + NBTTagCompound nbt = new NBTTagCompound(); |
| 21 | + |
| 22 | + public void reset() { |
| 23 | + nbt = new NBTTagCompound(); |
| 24 | + } |
| 25 | + |
| 26 | + public void setInt(String tag, int value) { |
| 27 | + nbt.setInt(tag, value); |
| 28 | + } |
| 29 | + |
| 30 | + public void setLong(String tag, long value) { |
| 31 | + nbt.setLong(tag, value); |
| 32 | + } |
| 33 | + |
| 34 | + public void setBoolean(String tag, boolean value) { |
| 35 | + nbt.setBoolean(tag, value); |
| 36 | + } |
| 37 | + |
| 38 | + public void setByteArray(String tag, byte[] value) { |
| 39 | + nbt.setByteArray(tag, value); |
| 40 | + } |
| 41 | + |
| 42 | + public void setIntArray(String tag, int[] value) { |
| 43 | + nbt.setIntArray(tag, value); |
| 44 | + } |
| 45 | + |
| 46 | + public int getInt(String tag) { |
| 47 | + return nbt.getInt(tag); |
| 48 | + } |
| 49 | + |
| 50 | + public long getLong(String tag) { |
| 51 | + return nbt.getLong(tag); |
| 52 | + } |
| 53 | + |
| 54 | + public boolean getBoolean(String tag) { |
| 55 | + return nbt.getBoolean(tag); |
| 56 | + } |
| 57 | + |
| 58 | + public byte[] getByteArray(String tag) { |
| 59 | + return nbt.getByteArray(tag); |
| 60 | + } |
| 61 | + |
| 62 | + public int[] getIntArray(String tag) { |
| 63 | + return nbt.getIntArray(tag); |
| 64 | + } |
| 65 | + |
| 66 | + public void Read(DataInput stream) throws IOException { |
| 67 | + nbt = NBTCompressedStreamTools.a((DataInputStream) stream); |
| 68 | + } |
| 69 | + |
| 70 | + public void Write(DataOutput stream) throws IOException { |
| 71 | + NBTCompressedStreamTools.a(nbt, stream); |
| 72 | + } |
| 73 | +} |
0 commit comments