public class GearStorage implements IStorage<IGear> {
@Override
public NBTBase writeNBT(Capability<IGear> capability, IGear instance, EnumFacing side) {
return new NBTTagByte((byte)(instance.havePermission()) ? 1 : 0);
}
@Override
public void readNBT(Capability<IGear> capability, IHandcuffValue instance, EnumFacing side, NBTBase nbt) {
instance.setPermission((NBTPrimitive) nbt).getByte() == 1);
}
}